]> git.siccegge.de Git - forks/vmdebootstrap.git/blob - examples/cubietruck-customise.sh
1a66bf92e6452f45c9b8889e070b4d9bc16d3209
[forks/vmdebootstrap.git] / examples / cubietruck-customise.sh
1 #!/bin/sh
2
3 set -e
4
5 rootdir=$1
6 image=$2
7
8 if [ -z "${image}" ]; then
9 echo "Image not specified"
10 exit
11 fi
12
13 if [ ! -f '/usr/lib/u-boot/Cubietruck/u-boot-sunxi-with-spl.bin' ]; then
14 echo "Unable to find cubietruck u-boot file"
15 exit
16 fi
17
18 # u-boot needs to be dd'd to the device, not a partition
19 # but kpartx does not setup the device, just the partitions
20
21 dd if=/usr/lib/u-boot/Cubietruck/u-boot-sunxi-with-spl.bin of=${image} bs=1k seek=8
22
23 mkdir -p $rootdir/boot/dtbs
24 cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs
25
26 for module in phy-sun4i-usb ohci-platform; do
27 echo ${module} >> ${rootdir}/etc/initramfs-tools/modules
28 done