Editing Kernel command-line arguments inside Kernel

那年仲夏 提交于 2020-07-15 06:18:19

问题


U-boot passes kernel command-line parameters. In my requirement I want to edit these parameters in the kernel source tree and don't want to change U-boot code. I am using 2.6.35 kernel.

So please guide me which part of the kernel source I have to check for this.


回答1:


Follow this procedure:

  • Enter the kernel config by typing make menuconfig
  • Enter the menu Processor type and features
  • Enable Built-in kernel command line
  • Specify your command line by clicking on Built-in kernel command string
  • Select Built-in command line overrides boot loader arguments if you want bootargs to be ignored



回答2:


You can change if from kernel config:-

+CONFIG_CMDLINE="foo=1"
+CONFIG_CMDLINE_EXTEND=y

Check runtime:-
$cat /proc/cmdline


来源:https://stackoverflow.com/questions/34307977/editing-kernel-command-line-arguments-inside-kernel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!