Preparation for other initramfs systems

This commit is contained in:
HikariKnight 2022-03-12 11:05:37 +01:00
parent 4954917ab2
commit 5b9c7a1326
No known key found for this signature in database
GPG key ID: E8B239063B022F5A
4 changed files with 8 additions and 8 deletions

View file

@ -32,7 +32,7 @@ backup skipped."
function copy_FILES () { function copy_FILES () {
echo "Starting copying files to the system!" echo "Starting copying files to the system!"
sudo cp -v "$SCRIPTDIR/$MODULES" "/etc/modules" sudo cp -v "$SCRIPTDIR/$ETCMODULES" "/etc/modules"
sudo cp -v "$SCRIPTDIR/$INITRAMFS/modules" "/etc/initramfs-tools/modules" sudo cp -v "$SCRIPTDIR/$INITRAMFS/modules" "/etc/initramfs-tools/modules"
sudo cp -v "$SCRIPTDIR/$MODPROBE/vfio.conf" "/etc/modprobe.d/vfio.conf" sudo cp -v "$SCRIPTDIR/$MODPROBE/vfio.conf" "/etc/modprobe.d/vfio.conf"
@ -47,7 +47,7 @@ function apply_CHANGES () {
source "$SCRIPTDIR/lib/paths.sh" source "$SCRIPTDIR/lib/paths.sh"
echo "Configuration is now complete and these files have been generated for your system: echo "Configuration is now complete and these files have been generated for your system:
$SCRIPTDIR/$MODULES $SCRIPTDIR/$ETCMODULES
$SCRIPTDIR/$INITRAMFS/modules $SCRIPTDIR/$INITRAMFS/modules
$SCRIPTDIR/$MODPROBE/vfio.conf $SCRIPTDIR/$MODPROBE/vfio.conf

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
MODPROBE="config/etc/modprobe.d" MODPROBE="config/etc/modprobe.d"
INITRAMFS="config/etc/initramfs-tools" INITRAMFS="config/etc/initramfs-tools"
MODULES="config/etc/modules" ETCMODULES="config/etc/modules"
DEFAULT="config/etc/default" DEFAULT="config/etc/default"
QUICKEMU="config/quickemu" QUICKEMU="config/quickemu"

View file

@ -16,7 +16,7 @@ function insert_MODULES() {
fi fi
# Write header # Write header
echo "$MODULES_HEADER" > "$2" echo "$ETCMODULES_HEADER" > "$2"
# If vendor-reset existed from before # If vendor-reset existed from before
if [ $VENDOR_RESET == 1 ]; if [ $VENDOR_RESET == 1 ];
@ -36,7 +36,7 @@ vfio_virqfd
" >> "$2" " >> "$2"
# Write the previously enabled modules under vfio in the load order # Write the previously enabled modules under vfio in the load order
echo "$MODULES_ENABLED" >> "$2" echo "$ETCMODULES_ENABLED" >> "$2"
} }
function set_MODULES () { function set_MODULES () {
@ -45,7 +45,7 @@ function set_MODULES () {
# Insert modules in the correct locations as early as possible without # Insert modules in the correct locations as early as possible without
# conflicting with vendor-reset module if it is enabled # conflicting with vendor-reset module if it is enabled
insert_MODULES 4 "$SCRIPTDIR/$MODULES" insert_MODULES 4 "$SCRIPTDIR/$ETCMODULES"
insert_MODULES 11 "$SCRIPTDIR/$INITRAMFS/modules" insert_MODULES 11 "$SCRIPTDIR/$INITRAMFS/modules"
# Assign the GPU device ids to a variable # Assign the GPU device ids to a variable

View file

@ -103,9 +103,9 @@ echo "$CMDLINE" > "$SCRIPTDIR/config/kernel_args"
if [ -f "/etc/modules" ]; if [ -f "/etc/modules" ];
then then
# This copies /etc/modules without the vfio module lines # This copies /etc/modules without the vfio module lines
grep -v "vfio" "/etc/modules" > "$SCRIPTDIR/$MODULES" grep -v "vfio" "/etc/modules" > "$SCRIPTDIR/$ETCMODULES"
else else
touch "$SCRIPTDIR/$MODULES" touch "$SCRIPTDIR/$ETCMODULES"
fi fi
if [ -f "/etc/default/grub" ]; if [ -f "/etc/default/grub" ];