From fb005d688ea2955df89279d75499fca26e2f6f00 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Sat, 11 May 2019 19:37:30 +0200 Subject: mvebu: image: introduce BOOT_SCRIPT variable All of U-Boot scripts repeat the same pattern with only Device Tree blob name changing for respective device. Therefore create generic scripts which will be altered on demad by image build process, and create BOOT_SCRIPT variable which can be added to device recipe and will allow referencing the same script by many device recipes. This will allow to slim down the ammount of files in buildroot tree and avoid needlessly incrementing amount of boot scripts if new devices will be added. Signed-off-by: Tomasz Maciej Nowak --- target/linux/mvebu/image/clearfog.bootscript | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 target/linux/mvebu/image/clearfog.bootscript (limited to 'target/linux/mvebu/image/clearfog.bootscript') diff --git a/target/linux/mvebu/image/clearfog.bootscript b/target/linux/mvebu/image/clearfog.bootscript new file mode 100644 index 0000000000..20ba76f0da --- /dev/null +++ b/target/linux/mvebu/image/clearfog.bootscript @@ -0,0 +1,23 @@ +# Standard Boot-Script +# use only well-known variable names provided by U-Boot Distro boot +# This script assumes that there is a boot partition, +# and that the root partition is always the next one. + +# rootfs is always on the next partition +setexpr openwrt_rootpart ${distro_bootpart} + 1 + +# figure out partition uuid to pass to the kernel as root= +part uuid ${devtype} ${devnum}:${openwrt_rootpart} uuid + +# generate bootargs (rootfs) +setenv bootargs ${bootargs} root=PARTUUID=${uuid} rootfstype=auto rootwait + +# add console= option to bootargs, if any +if test -n "${console}"; then + setenv bootargs ${bootargs} console=${console} +fi + +echo "Booting Linux with ${bootargs}" +load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} @DTB@.dtb +load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage +bootz ${kernel_addr_r} - ${fdt_addr_r} -- cgit v1.2.3