]>
git.siccegge.de Git - forks/vmdebootstrap.git/blob - examples/wandboard-uboot.sh
5 # This script is experimental and incomplete.
7 # Expects a tarball rootfs which includes a kernel, e.g.
8 # wandboard6q.sh --tarball wandboard.tgz
9 # wandboard-uboot.sh /dev/mmcblk0 wandboard.tgz
14 if [ -z "${device}" ]; then
15 echo "Block device not specified"
19 if [ ! -f "${device}" ]; then
20 echo "Specified device does not exist: ${device}"
24 if [ -z "${tarball}" ]; then
25 echo "Tarball not specified"
29 if [ ! -f '/usr/lib/u-boot/wandboard_quad/u-boot.imx' ]; then
30 echo "Unable to find wandboard u-boot file"
34 # u-boot needs to be dd'd to the device, not a partition
35 # but kpartx does not setup the device, just the partitions
37 sudo
dd if=/dev
/zero of
=${device} bs
=1M count
=10
38 sudo
dd if=/usr
/lib
/u-boot
/wandboard_quad
/u-boot.imx of
=${device} seek
=1 conv
=fsync bs
=1k
39 sudo sfdisk
--in-order --Linux --unit M
${device} <<-__EOF__
42 sudo mkfs.ext4
${device}p1
-L rootfs
45 sudo mount
${Ddevice}p1
${dir}
46 sudo
tar -xzf ${tarball} -C ${dir}
48 # assumes a single partition deployment to SD card
50 ver
=$
(basename `find $rootdir/lib/modules/ -maxdepth 1 -mindepth 1 -type d`)
51 sudo
touch ${dir}/uEnv.txt
52 sudo
chmod 666 ${dir}/uEnv.txt
53 echo fdt_file
=/boot
/dtbs
/imx6q-wandboard.dtb
> ${dir}/uEnv.txt
54 echo image
=/boot
/vmlinuz-
${ver} >> ${dir}/uEnv.txt
55 echo mmcroot
=/dev
/mmcblk0p1 rootwait rw
>> ${dir}/uEnv.txt
56 echo loadaddr
='0x11000000' >> ${dir}/uEnv.txt
57 echo initrd_addr_r
='0x13000000' >> ${dir}/uEnv.txt
58 echo fdt_addr
='0x12000000' >> ${dir}/uEnv.txt
59 echo initrd_high
='0xffffffff' >> ${dir}/uEnv.txt
60 echo fdt_high
='0xffffffff' >> ${dir}/uEnv.txt
61 echo console
=ttymxc0
,115200 >> ${dir}/uEnv.txt
62 echo loadinitrd
=load mmc
${mmcdev}:${mmcpart} ${initrd_addr_r} /boot/initrd.img-${ver}.uboot; setenv initrd_size ${filesize} >> ${dir}/uEnv.txt
63 echo bootargs
=console
=${console},${baudrate} root=${mmcroot} >> ${dir}/uEnv.txt
64 echo bootcmd
=run loadfdt
; run loadimage
; run loadinitrd
; bootz
${loadaddr} ${ramdisk_addr_r}:${filesize} ${fdt_addr} >> ${dir}/uEnv.txt
65 sudo
chmod 644 ${dir}/uEnv.txt