40-boot 970 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/bin/sh -efu

mkdir -p /boot

vmlinuz="$(find /boot -type f -name 'vmlinuz-*')"
kversion="${vmlinuz##/boot/vmlinuz-}"

DTB_NAME=
# grep 'load-.*0xffffffff' arch/mips/baikal/Platform
KERNEL_LOAD_ADDR=
case "$kversion" in
	3.19*)
		DTB_NAME=tplatforms_mitx2
		KERNEL_LOAD_ADDR=0x80004000
		;;
16 17 18 19
	4.4*)
		DTB_NAME=tplatforms_mitx
		KERNEL_LOAD_ADDR=0x80100000
		;;
20
	*)
21
	        # 4.9 and other experimential stuff
22 23 24 25 26 27 28 29 30 31 32 33 34
		DTB_NAME=baikal_mitx
		KERNEL_LOAD_ADDR=0x80100000
		;;
esac

[ -n "$DTB_NAME" ]
[ -n "$KERNEL_LOAD_ADDR" ]

cp /lib/devicetree/"$kversion/$DTB_NAME".dtb /boot/"$DTB_NAME"-"$kversion".dtb
ln -s "$DTB_NAME"-"$kversion".dtb /boot/$DTB_NAME.dtb

cat > /boot/bootconf << EOF
default: bootconf0
35
bootconf0 vmlinuz $KERNEL_LOAD_ADDR $KERNEL_LOAD_ADDR $DTB_NAME.dtb initrd.img root=/dev/sda6 rw rootwait earlyprintk=uart8520,mmio32,0x1f04a000,115200 maxcpus=2 consoleblank=0 console=tty1 video=sm750fb:1920x1080-32@60 nohtw nocoherentio ieee754=relaxed
36 37 38
EOF

exit 0