get current modules and modules from our config folder

This commit is contained in:
HikariKnight 2022-03-12 18:37:06 +01:00
parent 9870b51c26
commit b4a45b4228
No known key found for this signature in database
GPG key ID: E8B239063B022F5A

View file

@ -4,8 +4,8 @@ function set_MKINITCPIO () {
source "$SCRIPTDIR/lib/paths.sh" source "$SCRIPTDIR/lib/paths.sh"
# Grab the current modules but exclude vfio and vendor-reset # Grab the current modules but exclude vfio and vendor-reset
CURRENTMODULES=$(grep -P "^MODULES" /etc/mkinitcpio.conf | perl -pe "s/MODULES=\((.+)\)/\1/") CURRENTMODULES=$(grep -P "^MODULES" "$SCRIPTDIR/$MKINITCPIO" | perl -pe "s/MODULES=\((.+)\)/\1/")
MODULES="$(grep -P "^MODULES" /etc/mkinitcpio.conf | perl -pe "s/MODULES=\((.+)\)/\1/" | perl -pe "s/\s?(vfio_iommu_type1|vfio_pci|vfio_virqfd|vfio|vendor-reset)\s?//g")" MODULES="$(grep -P "^MODULES" "$SCRIPTDIR/$MKINITCPIO" | perl -pe "s/MODULES=\((.+)\)/\1/" | perl -pe "s/\s?(vfio_iommu_type1|vfio_pci|vfio_virqfd|vfio|vendor-reset)\s?//g")"
if [[ $CURRENTMODULES =~ "vendor-reset" ]]; if [[ $CURRENTMODULES =~ "vendor-reset" ]];
then then