From a10096a71a4444412b92400fada7360e6333cbc9 Mon Sep 17 00:00:00 2001 From: Francesco Dolcini Date: Tue, 16 Apr 2024 18:47:12 +0200 Subject: u-boot-distro-boot: set kernel cmdline using APPEND variable 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 --- recipes-bsp/u-boot/u-boot-distro-boot.bb | 4 +++- recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in | 9 +++------ 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 -- cgit v1.2.3