commit
3bf8857c65
13 changed files with 40 additions and 23 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function make_BACKUP () {
|
function make_BACKUP () {
|
||||||
local BACKUPDIR
|
local BACKUPDIR
|
||||||
|
@ -127,7 +128,7 @@ unless a backup already exist.
|
||||||
Then the files above will be copied to your system followed by running followed by updating your
|
Then the files above will be copied to your system followed by running followed by updating your
|
||||||
initramfs and then attempt adding new kernel arguments to your bootloader."
|
initramfs and then attempt adding new kernel arguments to your bootloader."
|
||||||
|
|
||||||
read -p "Do you want to proceed with the installation of the files? (no=quit) [Y/n]: " YESNO
|
read -r -p "Do you want to proceed with the installation of the files? (no=quit) [Y/n]: " YESNO
|
||||||
|
|
||||||
case "${YESNO}" in
|
case "${YESNO}" in
|
||||||
[Nn]*)
|
[Nn]*)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function get_GPU_GROUP () {
|
function get_GPU_GROUP () {
|
||||||
clear
|
clear
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091,SC2024
|
||||||
|
|
||||||
function get_GPU_ROM () {
|
function get_GPU_ROM () {
|
||||||
clear
|
clear
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function get_USB_CTL_GROUP () {
|
function get_USB_CTL_GROUP () {
|
||||||
clear
|
clear
|
||||||
|
@ -26,7 +27,7 @@ To return to the previous page just press ENTER.
|
||||||
[Yy]*)
|
[Yy]*)
|
||||||
# Get the PCI ids
|
# Get the PCI ids
|
||||||
local PCI_ID
|
local PCI_ID
|
||||||
PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/([0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//")
|
PCI_ID=$("$SCRIPTDIR/utils/ls-iommu" | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/([0-9a-f]{2}:[0-9a-f]{2}.[0-9a-f]{1})\n/\"\1\" /" | perl -pe "s/\s$//")
|
||||||
|
|
||||||
# Replace the blank USB_CTL_ID with the PCI_ID for the usb controller the user wants to pass through
|
# Replace the blank USB_CTL_ID with the PCI_ID for the usb controller the user wants to pass through
|
||||||
perl -pi -e "s/USB_CTL_ID=\(\)/USB_CTL_ID=\($PCI_ID\)/" "$SCRIPTDIR/$QUICKEMU/qemu-vfio_vars.conf"
|
perl -pi -e "s/USB_CTL_ID=\(\)/USB_CTL_ID=\($PCI_ID\)/" "$SCRIPTDIR/$QUICKEMU/qemu-vfio_vars.conf"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2034
|
||||||
MODPROBE="config/etc/modprobe.d"
|
MODPROBE="config/etc/modprobe.d"
|
||||||
INITRAMFS="config/etc/initramfs-tools"
|
INITRAMFS="config/etc/initramfs-tools"
|
||||||
ETCMODULES="config/etc/modules"
|
ETCMODULES="config/etc/modules"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
# Function to configure systemd-boot using kernelstub
|
# Function to configure systemd-boot using kernelstub
|
||||||
function set_KERNELSTUB () {
|
function set_KERNELSTUB () {
|
||||||
|
@ -51,13 +52,13 @@ function set_GRUB () {
|
||||||
if grep -q "GRUB_CMDLINE_LINUX_DEFAULT=" "$SCRIPTDIR/$DEFAULT/grub" ;
|
if grep -q "GRUB_CMDLINE_LINUX_DEFAULT=" "$SCRIPTDIR/$DEFAULT/grub" ;
|
||||||
then
|
then
|
||||||
# Update the GRUB_CMDLINE_LINUX_DEFAULT line
|
# Update the GRUB_CMDLINE_LINUX_DEFAULT line
|
||||||
GRUB_CMDLINE=$(cat "/etc/default/grub" | grep -P "^GRUB_CMDLINE_LINUX_DEFAULT" | perl -pe "s/GRUB_CMDLINE_LINUX_DEFAULT=\"(.+)\"/\1/" | perl -pe "s/iommu=(pt|on)|amd_iommu=on|vfio_pci.ids=.+|vfio_pci.disable_vga=\d{1}//g" | perl -pe "s/(^\s+|\s+$)//g")
|
GRUB_CMDLINE=$(grep -P "^GRUB_CMDLINE_LINUX_DEFAULT" "/etc/default/grub" | perl -pe "s/GRUB_CMDLINE_LINUX_DEFAULT=\"(.+)\"/\1/" | perl -pe "s/iommu=(pt|on)|amd_iommu=on|vfio_pci.ids=.+|vfio_pci.disable_vga=\d{1}//g" | perl -pe "s/(^\s+|\s+$)//g")
|
||||||
GRUB_CMDLINE_LINUX=$(cat "/etc/default/grub" | grep -P "^GRUB_CMDLINE_LINUX_DEFAULT")
|
GRUB_CMDLINE_LINUX=$(grep -P "^GRUB_CMDLINE_LINUX_DEFAULT" "/etc/default/grub")
|
||||||
perl -pi -e "s/${GRUB_CMDLINE_LINUX}/GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE} ${CMDLINE}\"/" "${SCRIPTDIR}/$DEFAULT/grub"
|
perl -pi -e "s/${GRUB_CMDLINE_LINUX}/GRUB_CMDLINE_LINUX_DEFAULT=\"${GRUB_CMDLINE} ${CMDLINE}\"/" "${SCRIPTDIR}/$DEFAULT/grub"
|
||||||
else
|
else
|
||||||
# Update the GRUB_CMDLINE_LINUX line
|
# Update the GRUB_CMDLINE_LINUX line
|
||||||
GRUB_CMDLINE=$(cat "/etc/default/grub" | grep -P "^GRUB_CMDLINE_LINUX" | perl -pe "s/GRUB_CMDLINE_LINUX=\"(.+)\"/\1/" | perl -pe "s/iommu=(pt|on)|amd_iommu=on|vfio_pci.ids=.+|vfio_pci.disable_vga=\d{1}//g" | perl -pe "s/(^\s+|\s+$)//g")
|
GRUB_CMDLINE=$(grep -P "^GRUB_CMDLINE_LINUX" "/etc/default/grub" | perl -pe "s/GRUB_CMDLINE_LINUX=\"(.+)\"/\1/" | perl -pe "s/iommu=(pt|on)|amd_iommu=on|vfio_pci.ids=.+|vfio_pci.disable_vga=\d{1}//g" | perl -pe "s/(^\s+|\s+$)//g")
|
||||||
GRUB_CMDLINE_LINUX=$(cat "/etc/default/grub" | grep -P "^GRUB_CMDLINE_LINUX")
|
GRUB_CMDLINE_LINUX=$(grep -P "^GRUB_CMDLINE_LINUX" "/etc/default/grub")
|
||||||
perl -pi -e "s/${GRUB_CMDLINE_LINUX}/GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE} ${CMDLINE}\"/" "${SCRIPTDIR}/$DEFAULT/grub"
|
perl -pi -e "s/${GRUB_CMDLINE_LINUX}/GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE} ${CMDLINE}\"/" "${SCRIPTDIR}/$DEFAULT/grub"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -80,7 +81,7 @@ $SCRIPTDIR/backup/etc/default/grub
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
read -r -p "Please verify there was no errors generating the grub.cfg file, then press ENTER"
|
read -r -p "Please verify there were no errors generating the grub.cfg file, then press ENTER"
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_FINISH () {
|
function show_FINISH () {
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function set_DRACUT () {
|
function set_DRACUT () {
|
||||||
# Get the config paths
|
# Get the config paths
|
||||||
source "$SCRIPTDIR/lib/paths.sh"
|
source "$SCRIPTDIR/lib/paths.sh"
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function insert_INITRAMFSTOOLS() {
|
function insert_INITRAMFSTOOLS() {
|
||||||
# Get the header and enabled modules separately from the /etc/modules file
|
# Get the header and enabled modules separately from the /etc/modules file
|
||||||
local MODULES_HEADER
|
local MODULES_HEADER
|
||||||
local MODULES_ENABLED
|
local MODULES_ENABLED
|
||||||
local VENDOR_RESET
|
local VENDOR_RESET
|
||||||
MODULES_HEADER=$(head -n $1 "$2" | grep -P "^#" | grep -v "# Added by quickpassthrough")
|
MODULES_HEADER=$(head -n "$1" "$2" | grep -P "^#" | grep -v "# Added by quickpassthrough")
|
||||||
MODULES_ENABLED=$(cat "$2" | grep -vP "^#" | grep -v "vendor-reset")
|
MODULES_ENABLED=$(grep -vP "^#" "$2" | grep -v "vendor-reset" | perl -pe "s/^\n//")
|
||||||
VENDOR_RESET=0
|
VENDOR_RESET=0
|
||||||
|
|
||||||
# If vendor-reset is present
|
# If vendor-reset is present
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function set_MKINITCPIO () {
|
function set_MKINITCPIO () {
|
||||||
# Get the config paths
|
# Get the config paths
|
||||||
source "$SCRIPTDIR/lib/paths.sh"
|
source "$SCRIPTDIR/lib/paths.sh"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function set_MODPROBE () {
|
function set_MODPROBE () {
|
||||||
# Get the config paths
|
# Get the config paths
|
||||||
source "$SCRIPTDIR/lib/paths.sh"
|
source "$SCRIPTDIR/lib/paths.sh"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
function set_VFIO () {
|
function set_VFIO () {
|
||||||
# Get the config paths
|
# Get the config paths
|
||||||
source "$SCRIPTDIR/lib/paths.sh"
|
source "$SCRIPTDIR/lib/paths.sh"
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
|
||||||
# Get the scripts directory
|
# Get the scripts directory
|
||||||
SCRIPTDIR=$(dirname "$(realpath "$0")")
|
SCRIPTDIR=$(dirname "$(realpath "$0")")
|
||||||
cd "$SCRIPTDIR"
|
cd "$SCRIPTDIR" || exit
|
||||||
|
|
||||||
# Get the config paths
|
# Get the config paths
|
||||||
source "$SCRIPTDIR/lib/paths.sh"
|
source "$SCRIPTDIR/lib/paths.sh"
|
||||||
|
|
||||||
# Get the CPU Vendor
|
# Get the CPU Vendor
|
||||||
CPU_VENDOR=$(cat /proc/cpuinfo | grep vendor | head -1 | cut -f 2 | cut -d " " -f 2)
|
CPU_VENDOR=$(grep "vendor_id" /proc/cpuinfo | head -1 | cut -f 2 | cut -d " " -f 2)
|
||||||
CMDLINE="iommu=pt"
|
CMDLINE="iommu=pt"
|
||||||
|
|
||||||
# Adjust our kernel_args based on cpu vendor
|
# Adjust our kernel_args based on cpu vendor
|
||||||
|
@ -63,7 +64,7 @@ This is a list of prerequisites you will be needing before starting with VFIO:
|
||||||
if both cards share the same device id (ex: both are identified as 1022:145c), then passthrough will
|
if both cards share the same device id (ex: both are identified as 1022:145c), then passthrough will
|
||||||
not be possible unless you swap out one of the cards.
|
not be possible unless you swap out one of the cards.
|
||||||
* A \"ghost display\" dummy plug for your second graphic card (or having it hooked to a separate input on your monitor).
|
* A \"ghost display\" dummy plug for your second graphic card (or having it hooked to a separate input on your monitor).
|
||||||
* If you are planning to use the inegrated GPU on your CPU, make sure your monitor is connected to it and working/enabled before continuing.
|
* If you are planning to use the integrated GPU on your CPU, make sure your monitor is connected to it and working/enabled before continuing.
|
||||||
* Preferably a motherboard verified to work with IOMMU and with good IOMMU groups.
|
* Preferably a motherboard verified to work with IOMMU and with good IOMMU groups.
|
||||||
https://reddit.com/r/vfio is a good resource for this info.
|
https://reddit.com/r/vfio is a good resource for this info.
|
||||||
(If you are unsure, you will find out while using this script)
|
(If you are unsure, you will find out while using this script)
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# shellcheck disable=SC2002,SC2164
|
||||||
|
|
||||||
# Get the scripts directory
|
# Get the scripts directory
|
||||||
SCRIPTDIR=$(dirname "$(which $0)")
|
SCRIPTDIR=$(dirname "$(which "$0")")
|
||||||
cd "$SCRIPTDIR"
|
cd "$SCRIPTDIR"
|
||||||
|
|
||||||
# If there is a config generated, then $SCRIPTDIR/config/kernel_args
|
# If there is a config generated, then $SCRIPTDIR/config/kernel_args
|
||||||
# should exist, which contains all the info we need
|
# should exist, which contains all the info we need
|
||||||
if [ -f $SCRIPTDIR/config/kernel_args ];
|
if [ -f "$SCRIPTDIR/config/kernel_args" ];
|
||||||
then
|
then
|
||||||
# Fetch part of the device id we need
|
# Fetch part of the device id we need
|
||||||
DEVID=$(cat $SCRIPTDIR/config/kernel_args | cut -d " " -f 3 | cut -d "=" -f 2 | perl -pe "s/^([0-9a-f]{4}:).*/\1/")
|
DEVID=$(cat "$SCRIPTDIR/config/kernel_args" | cut -d " " -f 3 | cut -d "=" -f 2 | perl -pe "s/^([0-9a-f]{4}:).*/\1/")
|
||||||
echo "#------------------------------------------#"
|
echo "#------------------------------------------#"
|
||||||
# List info about the vfio gpu and what kernel driver is being used
|
# List info about the vfio gpu and what kernel driver is being used
|
||||||
lspci -d $DEVID -v | grep -iP "kernel driver|amd|radeon|nvidia|nouveau" | grep -vi "kernel modules"
|
lspci -d "$DEVID" -v | grep -iP "kernel driver|amd|radeon|nvidia|nouveau" | grep -vi "kernel modules"
|
||||||
echo "#------------------------------------------#"
|
echo "#------------------------------------------#"
|
||||||
|
|
||||||
printf "
|
printf "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue