问题
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