mvebu: clearfog: use partition uuid for root= bootarg

U-Boot already knows where it found the boot.scr, and
figuring out the partition UUID becomes trivial at this point.
This change allows booting OpenWrt from whatever storage it has been
flashed to: SD card, eMMC, USB disk or SATA disk.

Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
[replace lede with openwrt, redact commit message]
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
master
Josua Mayer 7 years ago committed by Hauke Mehrtens
parent 98aa44ce79
commit 9a82076592
  1. 13
      target/linux/mvebu/image/cfbase-boot.script
  2. 13
      target/linux/mvebu/image/cfpro-boot.script

@ -7,13 +7,14 @@
# removed once U-Boot is able to detect the board variant. # removed once U-Boot is able to detect the board variant.
setenv fdtfile armada-388-clearfog-base.dtb setenv fdtfile armada-388-clearfog-base.dtb
# generate bootargs for rootfs on MMC # rootfs is always on the next partition
if test "${devtype}" = "mmc"; then setexpr openwrt_rootpart ${distro_bootpart} + 1
setexpr openwrt_rootpart ${distro_bootpart} + 1
setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait # figure out partition uuid to pass to the kernel as root=
fi part uuid ${devtype} ${devnum}:${openwrt_rootpart} uuid
# here one could add logic for other rootfs device types such as scsi and usb # generate bootargs (rootfs)
setenv bootargs ${bootargs} root=PARTUUID=${uuid} rootfstype=auto rootwait
# add console= option to bootargs, if any # add console= option to bootargs, if any
if test -n "${console}"; then if test -n "${console}"; then

@ -3,13 +3,14 @@
# This script assumes that there is a boot partition, # This script assumes that there is a boot partition,
# and that the root partition is always the next one. # and that the root partition is always the next one.
# generate bootargs for rootfs on MMC # rootfs is always on the next partition
if test "${devtype}" = "mmc"; then setexpr openwrt_rootpart ${distro_bootpart} + 1
setexpr openwrt_rootpart ${distro_bootpart} + 1
setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait # figure out partition uuid to pass to the kernel as root=
fi part uuid ${devtype} ${devnum}:${openwrt_rootpart} uuid
# here one could add logic for other rootfs device types such as scsi and usb # generate bootargs (rootfs)
setenv bootargs ${bootargs} root=PARTUUID=${uuid} rootfstype=auto rootwait
# add console= option to bootargs, if any # add console= option to bootargs, if any
if test -n "${console}"; then if test -n "${console}"; then

Loading…
Cancel
Save