dracut: Do not fail if Xen components are built into the kernel

Prior to this commit, if the Linux kernel's Xen-related components were
built into the kernel (as opposed to the use of kernel modules), then
the dracut module initialization would fail during the generation of the
initial ramdisk image.

This commit corrects this issue by using an if/then block.

Signed-off-by: M. Vefa Bicakci <m.v.b@runbox.com>
pull/19/head mm_e6e2404d
M. Vefa Bicakci 7 years ago
parent eb12a8cfc6
commit e6e2404d24
No known key found for this signature in database
GPG Key ID: 1DF87CE3B3A5DFAF

@ -1,3 +1,7 @@
#!/bin/bash
modinfo -k $kernel pciback > /dev/null 2>&1 && instmods pciback
modinfo -k $kernel xen-pciback > /dev/null 2>&1 && instmods xen-pciback
for mod in pciback xen-pciback; do
if modinfo -k "${kernel}" "${mod}" >/dev/null 2>&1; then
instmods "${mod}"
fi
done

@ -8,6 +8,11 @@ install() {
}
installkernel() {
modinfo -k $kernel pciback > /dev/null 2>&1 && hostonly='' instmods pciback
modinfo -k $kernel xen-pciback > /dev/null 2>&1 && hostonly='' instmods xen-pciback
local mod=
for mod in pciback xen-pciback; do
if modinfo -k "${kernel}" "${mod}" >/dev/null 2>&1; then
hostonly='' instmods "${mod}"
fi
done
}

Loading…
Cancel
Save