summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNeil Williams <codehelp@debian.org>2014-12-30 21:34:05 +0000
committerNeil Williams <codehelp@debian.org>2015-01-04 14:34:15 +0000
commitacfffcd24d9a51f16a3e35e9a0554c8ef780a2c6 (patch)
tree8a77d9f97a0c0e3a1b21d791630644bdc7ac181f /examples
parent1f3bab3a66538d5cf3ca13ed76bcf015955302b3 (diff)
downloadvmdebootstrap-acfffcd24d9a51f16a3e35e9a0554c8ef780a2c6.tar.gz
Improve wandboard support
Diffstat (limited to 'examples')
-rwxr-xr-x[-rw-r--r--]examples/wandboard-customise.sh16
-rwxr-xr-xexamples/wandboard-uboot.sh66
-rwxr-xr-x[-rw-r--r--]examples/wandboard6q.sh17
3 files changed, 77 insertions, 22 deletions
diff --git a/examples/wandboard-customise.sh b/examples/wandboard-customise.sh
index f16cff0..070637a 100644..100755
--- a/examples/wandboard-customise.sh
+++ b/examples/wandboard-customise.sh
@@ -3,22 +3,6 @@
set -e
rootdir=$1
-image=$2
-
-if [ -z "${image}" ]; then
- echo "Image not specified"
- exit
-fi
-
-if [ ! -f '/usr/lib/u-boot/wandboard_quad/u-boot.imx' ]; then
- echo "Unable to find wandboard u-boot file"
- exit
-fi
-
-# u-boot needs to be dd'd to the device, not a partition
-# but kpartx does not setup the device, just the partitions
-
-dd if=/usr/lib/u-boot/wandboard_quad/u-boot.imx of=${image} seek=1 conv=fsync bs=1k
mkdir -p $rootdir/boot/dtbs
cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs
diff --git a/examples/wandboard-uboot.sh b/examples/wandboard-uboot.sh
new file mode 100755
index 0000000..d6e8b7c
--- /dev/null
+++ b/examples/wandboard-uboot.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+
+set -e
+
+# This script is experimental and incomplete.
+
+# Expects a tarball rootfs which includes a kernel, e.g.
+# wandboard6q.sh --tarball wandboard.tgz
+# wandboard-uboot.sh /dev/mmcblk0 wandboard.tgz
+
+device=$1
+tarball=$2
+
+if [ -z "${device}" ]; then
+ echo "Block device not specified"
+ exit
+fi
+
+if [ ! -f "${device}" ]; then
+ echo "Specified device does not exist: ${device}"
+ exit
+
+if [ -z "${tarball}" ]; then
+ echo "Tarball not specified"
+ exit
+fi
+
+if [ ! -f '/usr/lib/u-boot/wandboard_quad/u-boot.imx' ]; then
+ echo "Unable to find wandboard u-boot file"
+ exit
+fi
+
+# u-boot needs to be dd'd to the device, not a partition
+# but kpartx does not setup the device, just the partitions
+
+sudo dd if=/dev/zero of=${device} bs=1M count=10
+sudo dd if=/usr/lib/u-boot/wandboard_quad/u-boot.imx of=${device} seek=1 conv=fsync bs=1k
+sudo sfdisk --in-order --Linux --unit M ${device} <<-__EOF__
+1,,0x83,-
+__EOF__
+sudo mkfs.ext4 ${device}p1 -L rootfs
+
+dir=`mktemp -d`
+sudo mount ${Ddevice}p1 ${dir}
+sudo tar -xzf ${tarball} -C ${dir}
+
+# assumes a single partition deployment to SD card
+
+ver=$(basename `find $rootdir/lib/modules/ -maxdepth 1 -mindepth 1 -type d`)
+sudo touch ${dir}/uEnv.txt
+sudo chmod 666 ${dir}/uEnv.txt
+echo fdt_file=/boot/dtbs/imx6q-wandboard.dtb > ${dir}/uEnv.txt
+echo image=/boot/vmlinuz-${ver} >> ${dir}/uEnv.txt
+echo mmcroot=/dev/mmcblk0p1 rootwait rw >> ${dir}/uEnv.txt
+echo loadaddr='0x11000000' >> ${dir}/uEnv.txt
+echo initrd_addr_r='0x13000000' >> ${dir}/uEnv.txt
+echo fdt_addr='0x12000000' >> ${dir}/uEnv.txt
+echo initrd_high='0xffffffff' >> ${dir}/uEnv.txt
+echo fdt_high='0xffffffff' >> ${dir}/uEnv.txt
+echo console=ttymxc0,115200 >> ${dir}/uEnv.txt
+echo loadinitrd=load mmc ${mmcdev}:${mmcpart} ${initrd_addr_r} /boot/initrd.img-${ver}.uboot; setenv initrd_size ${filesize} >> ${dir}/uEnv.txt
+echo bootargs=console=${console},${baudrate} root=${mmcroot} >> ${dir}/uEnv.txt
+echo bootcmd=run loadfdt; run loadimage; run loadinitrd; bootz ${loadaddr} ${ramdisk_addr_r}:${filesize} ${fdt_addr} >> ${dir}/uEnv.txt
+sudo chmod 644 ${dir}/uEnv.txt
+sudo umount ${dir}
+sudo rm -rf ${dir}
diff --git a/examples/wandboard6q.sh b/examples/wandboard6q.sh
index 0113bef..38c05a7 100644..100755
--- a/examples/wandboard6q.sh
+++ b/examples/wandboard6q.sh
@@ -2,8 +2,14 @@
set -e
-sudo vmdebootstrap \
- --owner $(whoami) --verbose \
+# Important: this example is to create a VM image for wandboard
+# To boot the device itself, u-boot support will need to be added
+# to a real block device.
+
+user=`whoami`
+
+sudo ./vmdebootstrap \
+ --owner ${user} --verbose \
--size 3G \
--mirror http://http.debian.net/debian \
--log wandboard.log --log-level debug \
@@ -12,12 +18,11 @@ sudo vmdebootstrap \
--enable-dhcp \
--configure-apt \
--no-extlinux \
+ --grub \
--no-kernel \
- --package u-boot \
--package linux-image-armmp \
--distribution sid \
--serial-console-command "/sbin/getty -L ttymxc0 115200 vt100" \
- --customize "wandboard-customise.sh" \
- --bootoffset=2mib \
- --bootsize 100mib --boottype vfat \
+ --customize "./examples/wandboard-customise.sh" \
"$@"
+