1
0

fix: use mkinitrd for opensuse 12 and older

This commit is contained in:
dump_stack() 2023-06-17 14:44:51 +00:00
parent 338e184424
commit 77201baa63
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -193,6 +193,7 @@ func (suse OpenSUSE) Install(version string, headers bool) (err error) {
cmdf("%s kernel-default-devel=%s", installcmd, version) cmdf("%s kernel-default-devel=%s", installcmd, version)
} }
if strings.HasPrefix(suse.release, "13") {
cmdf("mkdir /usr/lib/dracut/modules.d/42workaround") cmdf("mkdir /usr/lib/dracut/modules.d/42workaround")
wsetuppath := "/usr/lib/dracut/modules.d/42workaround/module-setup.sh" wsetuppath := "/usr/lib/dracut/modules.d/42workaround/module-setup.sh"
@ -207,12 +208,22 @@ func (suse OpenSUSE) Install(version string, headers bool) (err error) {
cmdf("echo '#!/bin/sh' >> %s", wpath) cmdf("echo '#!/bin/sh' >> %s", wpath)
cmdf("echo 'modprobe af_packet' >> %s", wpath) cmdf("echo 'modprobe af_packet' >> %s", wpath)
}
cmdf("dracut " + modules := "ata_piix libata e1000 ext4 sd_mod rfkill af_packet"
"-a workaround " +
"--add-drivers 'ata_piix libata' " + if !strings.HasPrefix(suse.release, "12") &&
"--force-drivers 'e1000 ext4 sd_mod rfkill af_packet' " + !strings.HasPrefix(suse.release, "11") {
"-f /boot/initrd-$(ls /lib/modules) $(ls /lib/modules)")
cmdf("dracut "+
"-a workaround "+
"--force-drivers '%s' "+
"-f /boot/initrd-$(ls /lib/modules) $(ls /lib/modules)",
modules)
} else {
cmdf("touch /etc/fstab")
cmdf("mkinitrd -m '%s'", modules)
}
cmdf("cp -r /boot /target/") cmdf("cp -r /boot /target/")
cmdf("cp -r /lib/modules /target/lib/") cmdf("cp -r /lib/modules /target/lib/")