Example Analysis of Linux Kernel Boot parameters
This article mainly shows you the "sample analysis of Linux kernel startup parameters", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "sample analysis of Linux kernel startup parameters".
1. Environment:
Ubuntu 16.04
Linux linuxidc 4.4.0-89-generic # 112-Ubuntu SMP Mon Jul 31 19:38:41 UTC 2017 x86 "64 GNU/Linux
two。 Check the startup parameters of the current linux kernel:
Cat / proc/cmdline
The author's output is as follows:
BOOT_IMAGE=/boot/vmlinuz-4.4.0-89-generic root=UUID=bef418fa-4202-4513-b39b-cde6a5d9753f ro quiet splash vt.handoff=7
3. Start parsing
Root=UUID=bef418fa-4202-4513-b39b-cde6a5d9753f: this string can be replaced with root=/dev/sda1 (if the root file system is in the first partition), but not root= (hd0,msdos1)
Ro: Mount the root file system read-only at startup
Quiet: there is no output of print information, so removing this item will lead to a lot of print information.
Splash: show boot animation
Vt.handoff=7: tty7 is used in the graphical interface to prevent splash from occupying tty7, so this item is invalid if the splash parameter is removed.
4. Add new startup parameters
Vi / boot/grub/grub.cfg
The output from step 2 will be included in this file, and parameters can be appended to it, for example:
The author's grub.cfg file looks like the following line: (is it similar to the information output in step 2)
Linux / boot/vmlinuz-4.4.0-89-generic root=UUID=bef418fa-4202-4513-b39b-cde6a5d9753f ro quiet splash $vt_handoff
Suppose the author wants to add the parameter dwc_otg.speed=1, then the modified parameter is as follows:
Linux / boot/vmlinuz-4.4.0-89-generic root=UUID=bef418fa-4202-4513-b39b-cde6a5d9753f ro quiet splash $vt_handoff dwc_otg.speed=1
Save this file and restart to make this parameter effective.
5. Why not use update-grub to update the grub.cfg file?
The update-grub command does not meet the more detailed kernel parameter modification requirements.
The above is all the contents of the article "sample Analysis of Linux Kernel Startup parameters". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!