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>
This commit is contained in:
M. Vefa Bicakci 2017-03-14 17:16:27 +03:00
parent eb12a8cfc6
commit e6e2404d24
No known key found for this signature in database
GPG Key ID: 1DF87CE3B3A5DFAF
2 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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
}