fix: correctly handle empty MODULES=() in mkinitcpio

This commit is contained in:
HikariKnight 2024-03-14 15:30:26 +01:00
parent 3fceb14f0b
commit 46376435ef

View file

@ -26,7 +26,7 @@ func Set_Mkinitcpio() {
// Make a regex to find the modules line // Make a regex to find the modules line
module_line_re := regexp.MustCompile(`^MODULES=`) module_line_re := regexp.MustCompile(`^MODULES=`)
modules_re := regexp.MustCompile(`MODULES=\((.+?)\)`) modules_re := regexp.MustCompile(`MODULES=\((.*)\)`)
vfio_modules_re := regexp.MustCompile(`(vfio_iommu_type1|vfio_pci|vfio_virqfd|vfio|vendor-reset)`) vfio_modules_re := regexp.MustCompile(`(vfio_iommu_type1|vfio_pci|vfio_virqfd|vfio|vendor-reset)`)
// Read the mkinitcpio file // Read the mkinitcpio file