fix: use mkinitrd for opensuse 12 and older
This commit is contained in:
parent
338e184424
commit
77201baa63
@ -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)
|
||||||
|
}
|
||||||
|
|
||||||
|
modules := "ata_piix libata e1000 ext4 sd_mod rfkill af_packet"
|
||||||
|
|
||||||
|
if !strings.HasPrefix(suse.release, "12") &&
|
||||||
|
!strings.HasPrefix(suse.release, "11") {
|
||||||
|
|
||||||
cmdf("dracut "+
|
cmdf("dracut "+
|
||||||
"-a workaround "+
|
"-a workaround "+
|
||||||
"--add-drivers 'ata_piix libata' " +
|
"--force-drivers '%s' "+
|
||||||
"--force-drivers 'e1000 ext4 sd_mod rfkill af_packet' " +
|
"-f /boot/initrd-$(ls /lib/modules) $(ls /lib/modules)",
|
||||||
"-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/")
|
||||||
|
Loading…
Reference in New Issue
Block a user