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 :)

Share:
5,246

Related videos on Youtube

thopiekar
Author by

thopiekar

Updated on September 18, 2022

Comments

  • thopiekar
    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 before 10_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
      bain almost 10 years
      It 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 run grub-mkconfig and then modify the output.
    • Eliah Kagan
      Eliah Kagan almost 10 years
      @bain I'd suggest posting that (or something like it) as an answer.
    • thopiekar
      thopiekar almost 10 years
      Well, 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
    muru over 9 years
    How new? Which Ubuntu version started supporting this?
  • thopiekar
    thopiekar over 9 years
    Don't know. Just found it after installing linux-crashdump to debug a kernel module. kexec is using to to pass parameters to grub.