How do I change redhat kernel command line parameters for a specific kernel version?



  • Also see: grubby(8) - command line tool used to configure bootloader menu entries...

    List your kernel files. The example shows two kernels with their associated rescue files.

    # ls /boot/vmlinuz*
    /boot/vmlinuz-0-rescue-a1f64654d787441991547c9458034686
    /boot/vmlinuz-0-rescue-c74bc11fb3d6436bb2716196dd0e7a47
    /boot/vmlinuz-4.18.0-147.5.1.el8_1.x86_64
    /boot/vmlinuz-4.18.0-80.4.2.el8_0.x86_64
    

    The kernel version you are currently running can be seen using uname

    $ uname -a
    Linux ip-172-31-26-43.eu-west-2.compute.internal 4.18.0-80.4.2.el8_0.x86_64...
    ...
    ...
    ...
    

    The changes are going to be made to the /boot/vmlinuz-4.18.0-80.4.2.el8_0.x86_64 kernel to change the console boot output to be minimum; by using the kernel parameter "quiet"

    Note: It is important to understand you are overriding the default kernel parameter setting, by individually editing a single kernel boot entry.

           --update-kernel=kernel-path
                  Update the entries for kernels matching  kernel-path.  Currently
                  the  only  item that can be updated is the kernel argument list,
                  which is modified via the --args and --remove-args options.
    
           --args=kernel-args
                  When a new kernel is added,  this  specifies  the  command  line
                  arguments  which should be passed to the kernel by default (note
                  they are merged with the arguments from the template if  --copy-
                  default  is used).  When --update-kernel is used, this specifies
                  new arguments to add to the argument list. Multiple, space sepa‐
                  rated  arguments  may be used. If an argument already exists the
                  new value replaces the old values.  The  root=  kernel  argument
                  gets special handling if the configuration file has special han‐
                  dling for specifying the root filesystem (like lilo.conf does).
    

    This will change the boot entry configuration file for this version of the kernel only.

    $ sudo grubby --update-kernel=/boot/vmlinuz-$(uname -r) --args="quiet"
    

Log in to reply
 

© Lightnetics 2024