11.9. 引导加载程序
grubby 的行为与其文档有区别
当您使用 grubby 工具添加了一个新内核而不指定任何参数时,grubby 会将默认参数传递给新条目。即使不传递 --copy-default 参数,也会发生此行为。使用 --args 和 --copy-default 选项确保这些参数附加到默认参数中,如 grubby 文档中所述。
但是,当添加额外的参数(如 $tuned_params )时,grubby 工具不会传递这些参数,除非调用了 --copy-default 选项。
在这种情况下,有两个临时解决方案:
设置
root=参数,并保留--args为空:grubby --add-kernel /boot/my_kernel --initrd /boot/my_initrd --args "root=/dev/mapper/rhel-root" --title "entry_with_root_set"
# grubby --add-kernel /boot/my_kernel --initrd /boot/my_initrd --args "root=/dev/mapper/rhel-root" --title "entry_with_root_set"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 或者设置
root=参数和指定的参数,但不是默认的参数:grubby --add-kernel /boot/my_kernel --initrd /boot/my_initrd --args "root=/dev/mapper/rhel-root some_args and_some_more" --title "entry_with_root_set_and_other_args_too"
# grubby --add-kernel /boot/my_kernel --initrd /boot/my_initrd --args "root=/dev/mapper/rhel-root some_args and_some_more" --title "entry_with_root_set_and_other_args_too"Copy to Clipboard Copied! Toggle word wrap Toggle overflow