Append options to GRUB_CMDLINE_LINUX_DEFAULT without modification on files
5,246
Newer grub packages now provide to add files with own modifications at /etc/default/grub.d/ . In my case I was able to modify grub with my packaging by:
thopiekar@t91:~$ cat /etc/default/grub.d/emgd.cfg
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT vmalloc=256MB selinux=0 vga=current"
Thank you all anyway :)
Related videos on Youtube
Author by
thopiekar
Updated on September 18, 2022Comments
-
thopiekar over 1 year
I want to add an option to
GRUB_CMDLINE_LINUX_DEFAULT
without modifying any files on the system. The reason is that I want to apply it by installing a driver package, but currently I haven't found any way to do that without touching/etc/default/grub
or/etc/grub/10_linux
. I tried to add it with the script below which should be executed before10_linux
but it has no effect:$ cat /etc/grub.d/09_linux_vmalloc #!/bin/sh set -e export GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT vmalloc=256MB"
-
bain almost 10 yearsIt is not really clear what exactly you are trying to do, or why, but you can edit
/boot/grub/grub.cfg
directly without editing /etc files, or you can rungrub-mkconfig
and then modify the output. -
Eliah Kagan almost 10 years@bain I'd suggest posting that (or something like it) as an answer.
-
thopiekar almost 10 yearsWell, that'S not what I want to do. I just want to provide a file (placed somewhere) to make update-grub append my needed option without changing any (upstream) files. I already done that years before using a script, but it broke (somehow) others /etc/default/grub . Just want to avoid that...
-
-
muru over 9 yearsHow new? Which Ubuntu version started supporting this?
-
thopiekar over 9 yearsDon't know. Just found it after installing linux-crashdump to debug a kernel module. kexec is using to to pass parameters to grub.