Skip to content

RFC: base-uboot: remove single quote for baseargs.

Rémi Duraffort requested to merge baseargs_fix into master

I'm working on a scenario which will set extra_kernel_args: fsck.mode=skip ${mcore_clk}, then lava will send next command to uboot:

setenv bootargs 'console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200n8 root=/dev/nfs rw nfsroot=192.168.100.102:/rootfs/LF_730_202301121728/imx84_rootfs_r,tcp,hard,v3 fsck.mode=skip ${mcore_clk} ip=dhcp'

Unfortunately, single quote here makes ${mcore_clk} never expand to its real value which already defined in uboot.

This patch remove that single quote in base-uboot.jinja2, then lava send next command to uboot which prove can get mcore_clk expanded.

setenv bootargs console=ttymxc1,115200 earlycon=ec_imx6q,0x30890000,115200n8 root=/dev/nfs rw nfsroot=192.168.100.102:/rootfs/LF_730_202301121728/imx84_rootfs_r,tcp,hard,v3 fsck.mode=skip ${mcore_clk} ip=dhcp


In fact,

  1. What I usually used for single quote in uboot is as next, it could delay the expansion of net_boot here, so it possible expand only when we call run net_boot. But, I think the baseargs in lava is not the same scenario.
u-boot=> setenv net_boot setenv bootargs console ${parameter}
u-boot=> setenv parameter me
u-boot=> run net_boot
u-boot=> print bootargs
bootargs=console
u-boot=> setenv net_boot 'setenv bootargs console ${parameter}'
u-boot=> setenv parameter me
u-boot=> run net_boot
u-boot=> print bootargs
bootargs=console me
  1. Double quote in "setenv bootargs xxx" already makes it a valid string, so yaml won't treat it as a map even it find any colon+space there in xxx.

  2. What you already did for x86.jinja2 is same as what this patch did already, no single quote there:

- "set extraargs root=/dev/nfs rw {{ base_nfsroot_args }} {{ base_kernel_args }} {{ base_ip_args }}"
  1. I don't know what nbd is, but next define which has ${extraargs} in it should already broken as it will never expand ${extraargs}, do you have environment to verify it?
- "setenv bootargs '{{ console_device }}{{ baud_rate }} rw {{ base_nbdroot_args }} {{ base_kernel_args }} {{ base_ip_args }} verbose earlyprintk systemd.log_color=false ${extraargs} rw'"

As this patch looks not break anything of mine, I wonder if I miss any other scenario which you add single quote on purpose?

Merge request reports