done
}
-
if ! [[ $DRACUT_INSTALL ]]; then
DRACUT_INSTALL=$(find_binary dracut-install)
fi
_ret=$?
return $_ret
}
+
+check_kernel_config()
+{
+ local _config_opt="$1"
+ local _config_file
+ [[ -f /boot/config-$kernel ]] \
+ && _config_file="/boot/config-$kernel"
+ [[ -f /lib/modules/$kernel/config ]] \
+ && _config_file="/lib/modules/$kernel/config"
+
+ # no kernel config file, so return true
+ [[ $_config_file ]] || return 0
+
+ grep -q -F "${_config_opt}=" "$_config_file" && return 0
+ return 1
+}
+
+
# get_cpu_vendor
# Only two values are returned: AMD or Intel
get_cpu_vendor ()
fi
fi
+if [[ $acpi_override = yes ]] && ! check_kernel_config CONFIG_ACPI_INITRD_TABLE_OVERRIDE; then
+ dwarn "Disabling ACPI override, because kernel does not support it. CONFIG_ACPI_INITRD_TABLE_OVERRIDE!=y"
+ unset acpi_override
+fi
+
+if [[ $early_microcode = yes ]]; then
+ if [[ $hostonly ]]; then
+ [[ $(get_cpu_vendor) == "AMD" ]] \
+ && ! check_kernel_config CONFIG_MICROCODE_AMD_EARLY \
+ && unset early_microcode
+ [[ $(get_cpu_vendor) == "Intel" ]] \
+ && ! check_kernel_config CONFIG_MICROCODE_INTEL_EARLY \
+ && unset early_microcode
+ else
+ ! check_kernel_config CONFIG_MICROCODE_AMD_EARLY \
+ && ! check_kernel_config CONFIG_MICROCODE_INTEL_EARLY \
+ && unset early_microcode
+ fi
+ [[ $early_microcode != yes ]] \
+ && dwarn "Disabling early microcode, because kernel does not support it. CONFIG_MICROCODE_[AMD|INTEL]_EARLY!=y"
+fi
+
# Need to be able to have non-root users read stuff (rpcbind etc)
chmod 755 "$initdir"