Add more comments and convert some variables to local variables
This commit is contained in:
parent
7f04af90d9
commit
2b52c744fe
5 changed files with 8 additions and 5 deletions
|
@ -33,7 +33,7 @@ then
|
|||
# Get the PCI ids
|
||||
local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4 | perl -pe "s/\n/ /" | perl -pe "s/\s$//")
|
||||
|
||||
# Write the currently unused vfio config for quickemu
|
||||
# Write the GPU_PCI_IDs to the config that quickemu might make use of in the future
|
||||
printf "GPU_PCI_ID=($PCI_ID)
|
||||
USB_CTL_ID=\"\"
|
||||
" > "$SCRIPTDIR/$QUICKEMU/qemu-vfio_vars.conf"
|
||||
|
|
|
@ -23,9 +23,9 @@ echo 0 | sudo tee $VBIOS_PATH
|
|||
echo 1 | sudo tee $VBIOS_PATH
|
||||
sudo cat $VBIOS_PATH > "$SCRIPTDIR/$QUICKEMU/vfio_card.rom"
|
||||
sudo md5sum $VBIOS_PATH | cut -d " " -f 1 > "$SCRIPTDIR/$QUICKEMU/vfio_card.rom.md5"
|
||||
ROM_MD5=$(sudo md5sum $VBIOS_PATH | cut -d " " -f 1)
|
||||
local ROM_MD5=$(sudo md5sum $VBIOS_PATH | cut -d " " -f 1)
|
||||
echo 0 | sudo tee $VBIOS_PATH
|
||||
ROMFILE_MD5=$(md5sum "$SCRIPTDIR/$QUICKEMU/vfio_card.rom" | cut -d " " -f 1)
|
||||
local ROMFILE_MD5=$(md5sum "$SCRIPTDIR/$QUICKEMU/vfio_card.rom" | cut -d " " -f 1)
|
||||
|
||||
if [ -f $SCRIPTDIR/$QUICKEMU/vfio_card.rom ];
|
||||
then
|
||||
|
|
|
@ -24,8 +24,9 @@ read -p "Enter the id for the device you want to passthrough: " USB_CTL_DEVID
|
|||
if [[ $USB_CTL_DEVID =~ : ]];
|
||||
then
|
||||
# Get the PCI ids
|
||||
PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4)
|
||||
local PCI_ID=$($SCRIPTDIR/utils/ls-iommu | grep -i "group $1" | cut -d " " -f 4)
|
||||
|
||||
# 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"
|
||||
exec "$SCRIPTDIR/lib/set_CMDLINE.sh"
|
||||
else
|
||||
|
|
|
@ -5,7 +5,7 @@ function set_CMDLINE () {
|
|||
# Get the config paths
|
||||
source "$SCRIPTDIR/lib/paths.sh"
|
||||
|
||||
CMDLINE=$(cat "$SCRIPTDIR/config/kernel_args")
|
||||
local CMDLINE=$(cat "$SCRIPTDIR/config/kernel_args")
|
||||
|
||||
printf "Configuration is now complete, however no changes have been done to your system.
|
||||
The files needed have just been written to $SCRIPTDIR/config/etc
|
||||
|
|
|
@ -63,9 +63,11 @@ then
|
|||
rm -r "$SCRIPTDIR/config"
|
||||
fi
|
||||
|
||||
# Get the CPU Vendor
|
||||
CPU_VENDOR=$(cat /proc/cpuinfo | grep vendor | head -1 | cut -f 2 | cut -d " " -f 2)
|
||||
CMDLINE="iommu=pt"
|
||||
|
||||
# Adjust our kernel_args based on cpu vendor
|
||||
if [ "$CPU_VENDOR" == "GenuineIntel" ];
|
||||
then
|
||||
CMDLINE="$CMDLINE intel_iommu=on"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue