ni / u-boot

5 stars 9 forks source link

How to modify "Kernel Command line" #2

Closed hizlbuzz closed 3 years ago

hizlbuzz commented 3 years ago

Hi, Im trying to modify the Kernel command line parameter. (to run a memory test)

So in U-Boot, I set the variable "memtest=17" in bootargs

U-Boot> printenv set_args 
set_args=setenv bootargs memtest=17 ${consoleparam} $mtdparts ubi.mtd=boot-config ubi.mtd=root root=ubi1:rootfs rw rootfstype=ubifs threadsirqs=1 kthreadd_pri=25 ksoftirqd_pri=8 irqthread_pri=15 ${usb_gadget_args} $othbootargs

But when booting up it looks like, there is no memtest set

[    0.000000] Kernel command line: console=ttyS0,115200 mtdparts=xilinx_nand:128k(fsbl)ro,11M(u-boot)ro,70M(boot-config),-(root) ubi.mtd=boot-config ubi.mtd=root root=ubi1:rootfs rw rootfstype=ubifs kthreadd_pri=25 ksoftirqd_pri=8 irqthread_pri=15 g_ether.idVendor=0x3923 g_ether.idProduct=0x770D g_ether.iProduct="NI sbRIO-9651 [NI-sbRIO-9651-03071797]" g_ether.iSerialNumber=03071797 g_ether.dev_addr=00:80:2f:19:4f:23 g_ether.bcdDevice=0x775E

Is there something wrong with setting? Is the NI software overwriting something?

Thanks

gratian commented 3 years ago

You can use the othbootargs variable for this. It gets appended to the bootargs and it's intended for this purpose.

Also make sure you save the changes with saveenv. On some targets you might need to call saveenv twice in a row so both the primary and backup environment partitions get updated.

hizlbuzz commented 3 years ago

cool using othbootargs does the trick! Thank you for the quick help!