1
0

fix: avoid fail on non-existing dracut module

This commit is contained in:
dump_stack() 2023-06-17 15:25:12 +00:00
parent 77201baa63
commit 2a55d611d1
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -215,11 +215,14 @@ func (suse OpenSUSE) Install(version string, headers bool) (err error) {
if !strings.HasPrefix(suse.release, "12") && if !strings.HasPrefix(suse.release, "12") &&
!strings.HasPrefix(suse.release, "11") { !strings.HasPrefix(suse.release, "11") {
cmdf("dracut "+ format := "dracut "
"-a workaround "+ if strings.HasPrefix(suse.release, "13") {
"--force-drivers '%s' "+ format += "-a workaround "
"-f /boot/initrd-$(ls /lib/modules) $(ls /lib/modules)", }
modules) format += "--force-drivers '%s' "
format += "-f /boot/initrd-$(ls /lib/modules) $(ls /lib/modules)"
cmdf(format, modules)
} else { } else {
cmdf("touch /etc/fstab") cmdf("touch /etc/fstab")
cmdf("mkinitrd -m '%s'", modules) cmdf("mkinitrd -m '%s'", modules)