linux icon indicating copy to clipboard operation
linux copied to clipboard

kernel cmdline override by bootloader

Open ya-mouse opened this issue 8 years ago • 1 comments

I'm trying to override kernel's cmdline within u-boot but with default config I fail. If I make unset for the following configs:

CONFIG_ARM_APPENDED_DTB=y
CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y

then I'll be able to overwrite cmdline. I've put DTB on separate partition on mtd and pass it's address to bootm. Also, I've tried to combine while keep ARM_APPENDED_DTB config:

CONFIG_ATAGS=y
CONFIG_DEPRECATED_PARAM_STRUCT=y
CONFIG_CMDLINE="console=ttyS4,115200" # just non-empty string
CONFIG_CMDLINE_FROM_BOOTLOADER=y

but no luck. Kernel's cmdline is set only within embedded/loaded DTB's cmdline.

Tried with qemu and real HW:

./arm-softmmu/qemu-system-arm -machine palmetto-bmc -nographic \
    -kernel ../openbmc/build/tmp/deploy/images/cb/image-kernel \
    -dtb ../openbmc/build/tmp/deploy/images/cb/aspeed-bmc-opp-palmetto.dts \
    -initrd ../openbmc/build/tmp/deploy/images/cb/core-image-minimal-initramfs-cb.cpio.lzma \
    -append 'console=ttyS4 earlyprintk panic=10 root=/dev/mtdblock4' \
    -m 256 -mtdblock ../openbmc/build/tmp/deploy/images/cb/flash-cb

ya-mouse avatar Nov 11 '16 11:11 ya-mouse

This sounds like a u-boot configuration issue. The arm boot wrapper and kernel both use the same register to receive both atags and dtb from the boot loader. If passed atags and append dtb is set it will extract the dtb and patch it with the command line from atags. If passing a dtb the command line must be embedded in the dtb.

mdmillerii avatar May 18 '17 17:05 mdmillerii