mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-25 16:31:13 +00:00
88389bfe41
U-Boot provides standard variables for load addresses, and filesystem-agnostic load-commands. Furthermore thanks to distro-boot, the device and partition from which the system boots is known. The new boot-script makes use of all this information. Tested on the only board that uses this boot-script: Clearfog Pro Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
23 lines
840 B
Plaintext
23 lines
840 B
Plaintext
# 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.
|
|
|
|
# generate bootargs for rootfs on MMC
|
|
if test "${devtype}" = "mmc"; then
|
|
setexpr lede_rootpart ${distro_bootpart} + 1
|
|
setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${lede_rootpart} rootfstype=auto rootwait
|
|
fi
|
|
|
|
# here one could add logic for other rootfs device types such as scsi and usb
|
|
|
|
# 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} ${fdtfile}
|
|
load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} zImage
|
|
bootz ${kernel_addr_r} - ${fdt_addr_r}
|