]>
git.siccegge.de Git - forks/vmdebootstrap.git/blob - examples/wandboard-uboot.sh
d6e8b7c2a842911e06ae97f7c87a1487e5ad7764
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}"
23 if [ -z "${tarball}" ]; then
24 echo "Tarball not specified"
28 if [ ! -f '/usr/lib/u-boot/wandboard_quad/u-boot.imx' ]; then
29 echo "Unable to find wandboard u-boot file"
33 # u-boot needs to be dd'd to the device, not a partition
34 # but kpartx does not setup the device, just the partitions
36 sudo
dd if=/dev
/zero of
=${device} bs
=1M count
=10
37 sudo
dd if=/usr
/lib
/u-boot
/wandboard_quad
/u-boot.imx of
=${device} seek
=1 conv
=fsync bs
=1k
38 sudo sfdisk
--in-order --Linux --unit M
${device} <<-__EOF__
41 sudo mkfs.ext4
${device}p1
-L rootfs
44 sudo mount
${Ddevice}p1
${dir}
45 sudo
tar -xzf ${tarball} -C ${dir}
47 # assumes a single partition deployment to SD card
49 ver
=$
(basename `find $rootdir/lib/modules/ -maxdepth 1 -mindepth 1 -type d`)
50 sudo
touch ${dir}/uEnv.txt
51 sudo
chmod 666 ${dir}/uEnv.txt
52 echo fdt_file
=/boot
/dtbs
/imx6q-wandboard.dtb
> ${dir}/uEnv.txt
53 echo image
=/boot
/vmlinuz-
${ver} >> ${dir}/uEnv.txt
54 echo mmcroot
=/dev
/mmcblk0p1 rootwait rw
>> ${dir}/uEnv.txt
55 echo loadaddr
='0x11000000' >> ${dir}/uEnv.txt
56 echo initrd_addr_r
='0x13000000' >> ${dir}/uEnv.txt
57 echo fdt_addr
='0x12000000' >> ${dir}/uEnv.txt
58 echo initrd_high
='0xffffffff' >> ${dir}/uEnv.txt
59 echo fdt_high
='0xffffffff' >> ${dir}/uEnv.txt
60 echo console
=ttymxc0
,115200 >> ${dir}/uEnv.txt
61 echo loadinitrd
=load mmc
${mmcdev}:${mmcpart} ${initrd_addr_r} /boot/initrd.img-${ver}.uboot; setenv initrd_size ${filesize} >> ${dir}/uEnv.txt
62 echo bootargs
=console
=${console},${baudrate} root=${mmcroot} >> ${dir}/uEnv.txt
63 echo bootcmd
=run loadfdt
; run loadimage
; run loadinitrd
; bootz
${loadaddr} ${ramdisk_addr_r}:${filesize} ${fdt_addr} >> ${dir}/uEnv.txt
64 sudo
chmod 644 ${dir}/uEnv.txt