Add a grub entry with other kernel parameters

Hello,

I would like to passtrough a GPU but I sometimes still need it on the host. How can I add a grub entry with the vfio-pci kernel parameter? So the goal is to have in the grub menu : Advanced options for Manjaro > Linux54, Linux54-fallback and Linux54-GPU-passtrough.

Thanks for your help, cheers :slight_smile:

Can you post your /etc/default/grub?

Sure

/etc/default/grub

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=menu
GRUB_DISTRIBUTOR='Manjaro'
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 lsm=yama,apparmor resume=UUID=7f0696c8-a732-4471-935d-6d154ab355cf noacpi mitigations=off intel_iommu=on"
GRUB_CMDLINE_LINUX=""

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"
GRUB_THEME="/usr/share/grub/themes/manjaro/theme.txt"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

#Disable submenu
#GRUB_DISABLE_SUBMENU=y

Change into:

#GRUB_DISABLE_RECOVERY=true

Change into:

#Disable submenu
GRUB_DISABLE_SUBMENU=n

After saving, run

sudo update-grub

and reboot.

I’ve made the required changes to /etc/default/grub et ran update-grub but I don’t see how it solves my problem.

My question is : how to add an entry with different kernel parameters?

Thanks for your help :slight_smile:

1 Like

For those wondering I fixed it by adding
export GRUB_CMDLINE_LINUX_DEFAULT_1="quiet apparmor=1 i915.enable_gvt=1 kvm.ignore_msrs=1 intel_iommu=on vfio-pci.ids=8086:1901,10de:1c8d,10de:0fb9"
or whetever kernel parameters you need, in /etc/default/grub.

Then in /etc/grub.d/linux.10
linux_entry β€œ${OS} (vfio)” β€œ${version}” simple\
β€œ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT_1}”

Under another linux_entry.
You’ll have to that on nearly every system updates.
Cheers

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.