u-boot/arch
Simon Glass 51bb33846a bootm: Support string substitution in bootargs
In some cases it is necessary to pass parameters to Linux so that it will
boot correctly. For example, the rootdev parameter is often used to
specify the root device. However the root device may change depending on
whence U-Boot loads the kernel. At present it is necessary to build up
the command line by adding device strings to it one by one.

It is often more convenient to provide a template for bootargs, with
U-Boot doing the substitution from other environment variables.

Add a way to substitute strings in the bootargs variable. This allows
things like "rootdev=${rootdev}" to be used in bootargs, with the
${rootdev} substitution providing the UUID of the root device.

For example, to substitute the GUID of the kernel partition:

  setenv bootargs "console=/dev/ttyS0 rootdev=${uuid}/PARTNROFF=1
		kern_guid=${uuid}"
  part uuid mmc 2:2 uuid
  bootm

This is particularly useful when the command line from another place. For
example, Chrome OS stores the command line next to the kernel itself. It
depends on the kernel version being used as well as the hardware features,
so it is extremely difficult to devise a U-Boot script that works on all
boards and kernel versions. With this feature, the command line can be
read from disk and used directly, with a few substitutions set up.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-12-04 19:48:29 -05:00
..
arc board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo 2020-08-06 14:26:35 -04:00
arm board: sl28: add OP-TEE Trusted OS support (bl32) 2020-12-04 16:09:06 -05:00
m68k arch: Move NEEDS_MANUAL_RELOC symbol to Kconfig 2020-11-04 10:13:44 -05:00
microblaze microblaze: Enable GCC garbage collector for full U-Boot 2020-11-20 10:42:53 +01:00
mips mips: octeon: Add bootoctlinux command 2020-10-07 20:25:58 +02:00
nds32 treewide: convert bd_t to struct bd_info by coccinelle 2020-07-17 09:30:13 -04:00
nios2 cpu: Convert the methods to use a const udevice * 2020-07-25 14:46:57 -06:00
powerpc board: Rename uclass to sysinfo 2020-11-06 10:18:20 +08:00
riscv riscv: sifive/fu540: kconfig: Enable support for Opencores I2C controller 2020-11-28 08:30:41 +01:00
sandbox patman status subcommand to collect tags from Patchwork 2020-11-06 11:27:14 -05:00
sh sh: r2dplus: Add SCIF1 to the basic DT 2020-08-02 19:58:27 +02:00
x86 x86: zimage: Add silent-console processing 2020-12-04 16:10:00 -05:00
xtensa xtensa: Remove arch_setup_bdinfo() 2020-08-26 09:19:40 +02:00
.gitignore
Kconfig bootm: Support string substitution in bootargs 2020-12-04 19:48:29 -05:00
u-boot-elf.lds arch: Add explicit linker script for u-boot-elf 2020-04-03 11:52:55 -04:00