summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancesco Dolcini <francesco.dolcini@toradex.com>2024-04-16 18:47:12 +0200
committerFrancesco Dolcini <francesco.dolcini@toradex.com>2024-04-18 09:36:05 +0200
commita10096a71a4444412b92400fada7360e6333cbc9 (patch)
tree033c58db799a4c16deaec56142c53340162b436a
parent101bb917159e3c1fb15e3f18e45dc449f78a3e31 (diff)
u-boot-distro-boot: set kernel cmdline using APPEND variableHEADmaster
Do not depend on U-Boot environment for setting the Linux kernel command line from the boot script. Use standard APPEND variable to specify the kernel command line, stop using ${defargs}, ${setup} and ${vidargs} from U-Boot environment. APPEND is the standard OE variable to set the kernel command line, it is for example used in OE-core rootfs-postcommands.bbclass to add "ro" to the command line and part of the official documentation. U-Boot ${tdxargs} is still supported and its content is added to the command line. Remove consoleblank=0 since this is already the kernel default. Link: https://docs.yoctoproject.org/dev/kernel-dev/faq.html#how-do-i-change-the-linux-kernel-command-line Related-to: ELB-5619 Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
-rw-r--r--recipes-bsp/u-boot/u-boot-distro-boot.bb4
-rw-r--r--recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in9
2 files changed, 6 insertions, 7 deletions
diff --git a/recipes-bsp/u-boot/u-boot-distro-boot.bb b/recipes-bsp/u-boot/u-boot-distro-boot.bb
index 4aa80fa..5f696df 100644
--- a/recipes-bsp/u-boot/u-boot-distro-boot.bb
+++ b/recipes-bsp/u-boot/u-boot-distro-boot.bb
@@ -9,6 +9,8 @@ SRC_URI = " \
file://boot.cmd.in \
"
+APPEND ?= ""
+
KERNEL_BOOTCMD ??= "bootz"
KERNEL_BOOTCMD:aarch64 ?= "booti"
@@ -17,7 +19,7 @@ DTB_PREFIX ??= "${@d.getVar('KERNEL_DTB_PREFIX').replace("/", "_") if d.getVar('
inherit deploy
do_deploy() {
- sed -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/;s/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/;s/@@KERNEL_DTB_PREFIX@@/${DTB_PREFIX}/' \
+ sed -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/;s/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/;s/@@KERNEL_DTB_PREFIX@@/${DTB_PREFIX}/;s/@@APPEND@@/${APPEND}/' \
"${WORKDIR}/boot.cmd.in" > boot.cmd
mkimage -T script -C none -n "Distro boot script" -d boot.cmd boot.scr
diff --git a/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in b/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in
index 6969a55..9760ccc 100644
--- a/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in
+++ b/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in
@@ -67,11 +67,8 @@ if test "${root_devtype}" = ""; then
fi
fi
-if test -n ${setup}; then
- run setup
-else
- env set setupargs console=tty1 console=${console},${baudrate} consoleblank=0
-fi
+env set appendargs @@APPEND@@
+env set setupargs console=tty1 console=${console},${baudrate}
if test ${kernel_image} = "fitImage"; then
env set kernel_addr_load ${ramdisk_addr_r}
@@ -121,7 +118,7 @@ else
fi
fi
-env set bootcmd_args 'run rootfsargs_set && env set bootargs ${defargs} ${rootfsargs} ${setupargs} ${vidargs} ${tdxargs}'
+env set bootcmd_args 'run rootfsargs_set && env set bootargs ${rootfsargs} ${setupargs} ${appendargs} ${tdxargs}'
if test ${skip_fdt_overlays} != 1; then
env set bootcmd_overlays 'run load_overlays_file && run fdt_resize && run apply_overlays'
else