From 41ebf61957c1c3d168b5e048e465c6a7b0b57a1c Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Tue, 23 Dec 2014 16:15:20 +0000 Subject: Allow space for a bootloader installed with dd Implement bootoffset to explcitly allow space for a bootloader to be installed in front of the first partition. Add support for cubietruck in the example to dd the Debian uboot image by adding a parameter to the customise script call. Increase size of boot partition to make upgrades easier. Allow the partition type to be specified. Use mib units as these are converted to 1024 instead of 1000. --- examples/beagleboneblack.sh | 2 +- examples/cubietruck-customise.sh | 18 +++++++++++++++--- examples/cubietruck.sh | 4 ++-- 3 files changed, 18 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/beagleboneblack.sh b/examples/beagleboneblack.sh index 3923949..30d0c4a 100755 --- a/examples/beagleboneblack.sh +++ b/examples/beagleboneblack.sh @@ -17,5 +17,5 @@ sudo vmdebootstrap \ --distribution sid \ --serial-console-command "'/sbin/getty -L ttyO0 115200 vt100'" \ --customize "beagleboneblack-customise.sh" \ - --bootsize 50m --boottype vfat \ + --bootsize 100mib --boottype vfat \ "$@" diff --git a/examples/cubietruck-customise.sh b/examples/cubietruck-customise.sh index 74a0d5b..4d436ae 100755 --- a/examples/cubietruck-customise.sh +++ b/examples/cubietruck-customise.sh @@ -3,10 +3,22 @@ set -e rootdir=$1 +image=$2 -# u-boot needs to be dd'd to the partition -#cp /usr/lib/u-boot/Cubietruck/uboot.elf /boot/ -#cp /usr/lib/u-boot/Cubietruck/u-boot-sunxi-with-spl.bin /boot/ +if [ -z "${image}" ]; then + echo "Image not specified" + exit +fi + +if [ ! -f '/usr/lib/u-boot/Cubietruck/u-boot-sunxi-with-spl.bin' ]; then + echo "Unable to find cubietruck 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/Cubietruck/u-boot-sunxi-with-spl.bin of=${image} bs=1k seek=8 mkdir -p $rootdir/boot/dtbs cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs diff --git a/examples/cubietruck.sh b/examples/cubietruck.sh index 2da46af..a904e07 100755 --- a/examples/cubietruck.sh +++ b/examples/cubietruck.sh @@ -18,6 +18,6 @@ sudo vmdebootstrap \ --distribution sid \ --serial-console-command "/sbin/getty -L ttyS0 115200 vt100" \ --customize "cubietruck-customise.sh" \ - --serial-console-command \ - --bootsize 50m --boottype vfat \ + --bootoffset=2mib \ + --bootsize 100mib --boottype vfat \ "$@" -- cgit v1.2.1