Split up scripts to reuse parts for other initramfs systems
This commit is contained in:
parent
9ab572032d
commit
898e1f7347
4 changed files with 103 additions and 52 deletions
27
vfio-setup
27
vfio-setup
|
@ -91,35 +91,46 @@ fi
|
|||
|
||||
# Make the directories
|
||||
mkdir -p "$SCRIPTDIR/$MODPROBE"
|
||||
mkdir -p "$SCRIPTDIR/$DEFAULT"
|
||||
mkdir -p "$SCRIPTDIR/$INITRAMFS"
|
||||
mkdir -p "$SCRIPTDIR/$QUICKEMU"
|
||||
|
||||
# Write the cmdline file
|
||||
echo "$CMDLINE" > "$SCRIPTDIR/config/kernel_args"
|
||||
|
||||
# Copy system configs into our config folder so we can safely edit them
|
||||
|
||||
# Copy system configs that exists into our config folder so we can safely edit them
|
||||
if [ -f "/etc/modules" ];
|
||||
then
|
||||
# This copies /etc/modules without the vfio module lines
|
||||
grep -v "vfio" "/etc/modules" > "$SCRIPTDIR/$ETCMODULES"
|
||||
else
|
||||
touch "$SCRIPTDIR/$ETCMODULES"
|
||||
fi
|
||||
|
||||
if [ -f "/etc/default/grub" ];
|
||||
then
|
||||
# Create the default folder
|
||||
mkdir -p "$SCRIPTDIR/$DEFAULT"
|
||||
|
||||
# Copy grub config
|
||||
cp "/etc/default/grub" "$SCRIPTDIR/$DEFAULT/grub"
|
||||
fi
|
||||
|
||||
if [ -f "/etc/initramfs-tools/modules" ];
|
||||
then
|
||||
# Create the initramfs folder
|
||||
mkdir -p "$SCRIPTDIR/$INITRAMFS"
|
||||
|
||||
# This copies /etc/initramfs-tools/modules without the vfio modules
|
||||
grep -v "vfio" "/etc/initramfs-tools/modules" > "$SCRIPTDIR/$INITRAMFS/modules"
|
||||
else
|
||||
touch "$SCRIPTDIR/$INITRAMFS"
|
||||
fi
|
||||
|
||||
if [ -f "/etc/mkinitcpio.conf" ];
|
||||
then
|
||||
# Copy mkinitcpio.conf to our config folder
|
||||
cp "/etc/mkinitcpio.conf" "$SCRIPTDIR/$MKINITCPIO"
|
||||
fi
|
||||
|
||||
if [ -f "/etc/dracut.conf" ];
|
||||
then
|
||||
# Create a dracut.conf.d file
|
||||
touch "$SCRIPTDIR/$DRACUT"
|
||||
fi
|
||||
|
||||
# Run ls-iommu so we can verify that IOMMU properly working
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue