]> git.siccegge.de Git - forks/vmdebootstrap.git/blob - examples/beagleboneblack-customise.sh
Improve wandboard support
[forks/vmdebootstrap.git] / examples / beagleboneblack-customise.sh
1 #!/bin/sh
2
3 set -e
4
5 rootdir=$1
6
7 # copy u-boot to the boot partition
8 cp $rootdir/usr/lib/u-boot/am335x_boneblack/MLO $rootdir/boot/MLO
9 cp $rootdir/usr/lib/u-boot/am335x_boneblack/u-boot.img $rootdir/boot/u-boot.img
10
11 # Setup uEnv.txt
12 kernelVersion=$(basename `dirname $rootdir/usr/lib/*/am335x-boneblack.dtb`)
13 version=$(echo $kernelVersion | sed 's/linux-image-\(.*\)/\1/')
14 initRd=initrd.img-$version
15 vmlinuz=vmlinuz-$version
16
17 # uEnv.txt for Beaglebone
18 # based on https://github.com/beagleboard/image-builder/blob/master/target/boot/beagleboard.org.txt
19 cat >> $rootdir/boot/uEnv.txt <<EOF
20 mmcroot=/dev/mmcblk0p2 ro
21 mmcrootfstype=ext4 rootwait fixrtc
22
23 console=ttyO0,115200n8
24
25 kernel_file=$vmlinuz
26 initrd_file=$initRd
27
28 loadaddr=0x80200000
29 initrd_addr=0x81000000
30 fdtaddr=0x80F80000
31
32 initrd_high=0xffffffff
33 fdt_high=0xffffffff
34
35 loadkernel=load mmc \${mmcdev}:\${mmcpart} \${loadaddr} \${kernel_file}
36 loadinitrd=load mmc \${mmcdev}:\${mmcpart} \${initrd_addr} \${initrd_file}; setenv initrd_size \${filesize}
37 loadfdt=load mmc \${mmcdev}:\${mmcpart} \${fdtaddr} /dtbs/\${fdtfile}
38
39 loadfiles=run loadkernel; run loadinitrd; run loadfdt
40 mmcargs=setenv bootargs console=tty0 console=\${console} root=\${mmcroot} rootfstype=\${mmcrootfstype}
41
42 uenvcmd=run loadfiles; run mmcargs; bootz \${loadaddr} \${initrd_addr}:\${initrd_size} \${fdtaddr}
43 EOF
44
45 mkdir -p $rootdir/boot/dtbs
46 cp $rootdir/usr/lib/linux-image-*-armmp/* $rootdir/boot/dtbs