2 # The "intel_iommu=on iommu=pt" kernel command line is necessary
4 # TODO Add check for existence of QAT hardware?
6 grub_file=${1:-"/etc/default/grub"}
7 kernel_parameters="intel_iommu=on iommu=pt"
8 sed -i~ "/^GRUB_CMDLINE_LINUX=/{h;s/\(=\".*\)\"/\1 ${kernel_parameters}\"/};\${x;/^$/{s//GRUB_CMDLINE_LINUX=\"${kernel_parameters}\"/;H};x}" "$grub_file"