Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #49 from jcajka/fwcfg
Browse files Browse the repository at this point in the history
module-setup.sh: Simplify the qemu_fw_cfg kernel module check
  • Loading branch information
dustymabe committed Mar 4, 2019
2 parents ca593a1 + 819e0da commit e3bd9c9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions dracut/30ignition/module-setup.sh
Expand Up @@ -45,15 +45,15 @@ install() {
"$systemdutildir/system/ignition-remount-sysroot.service"
}

has_builtin_fw_cfg() {
# this is like check_kernel_config() but it specifically checks for `y` and
has_fw_cfg_module() {
# this is like check_kernel_config() but it specifically checks for `m` and
# also checks the OSTree-specific kernel location
for path in /boot/config-$kernel \
/usr/lib/modules/$kernel/config \
/usr/lib/ostree-boot/config-$kernel; do
if test -f $path; then
rc=0
grep -q CONFIG_FW_CFG_SYSFS=y $path || rc=$?
grep -q CONFIG_FW_CFG_SYSFS=m $path || rc=$?
return $rc
fi
done
Expand All @@ -62,7 +62,8 @@ has_builtin_fw_cfg() {

installkernel() {
# We definitely need this one in the initrd to support Ignition cfgs on qemu
if ! has_builtin_fw_cfg; then
# if available
if has_fw_cfg_module; then
instmods -c qemu_fw_cfg
fi
}

0 comments on commit e3bd9c9

Please sign in to comment.