Change /etc/modprobe.d path to /run/modprobe.d in hooks.
/etc might be mounted as read-only.
_parse-insmodpost.sh_:
----
for p in $(getargs rd.driver.post=); do
- echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf
+ echo "blacklist $p" >> /run/modprobe.d/initramfsblacklist.conf
_do_insmodpost=1
done
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
- rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
+ :
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif getarg boot= > /dev/null; then
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
- rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
+ :
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
else
type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh
if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
- rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
+ :
elif [ -z "$fipsmode" ]; then
die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif ! [ -f /tmp/fipsdone ]; then
read -d '' -r FIPSMODULES < /etc/fipsmodules
fips_info "Loading and integrity checking all crypto modules"
- mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
for _module in $FIPSMODULES; do
if [ "$_module" != "tcrypt" ]; then
if ! nonfatal_modprobe "${_module}" 2> /tmp/fips.modprobe_err; then
fi
fi
done
- mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf
+ if [ -f /etc/fips.conf ]; then
+ mkdir -p /run/modprobe.d
+ cp /etc/fips.conf /run/modprobe.d/fips.conf
+ fi
fips_info "Self testing crypto algorithms"
modprobe tcrypt || return 1
_fipsmodules+="aead cryptomgr tcrypt crypto_user "
fi
- # shellcheck disable=SC2174
- mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
-
for _mod in $_fipsmodules; do
if hostonly='' instmods -c -s "$_mod"; then
echo "$_mod" >> "${initdir}/etc/fipsmodules"
- echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
+ echo "blacklist $_mod" >> "${initdir}/etc/fips.conf"
fi
done
#!/bin/sh
-_modprobe_d=/etc/modprobe.d
-if [ -d /usr/lib/modprobe.d ]; then
- _modprobe_d=/usr/lib/modprobe.d
-elif [ -d /lib/modprobe.d ]; then
- _modprobe_d=/lib/modprobe.d
-elif [ ! -d $_modprobe_d ]; then
+_modprobe_d=/run/modprobe.d
+if [ ! -d $_modprobe_d ]; then
mkdir -p $_modprobe_d
fi
)
done
-[ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d
-
for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
IFS=,
IFS="$OLDIFS"
if [ -d /sys/module/scsi_mod ]; then
printf "manual" > /sys/module/scsi_mod/parameters/scan
- elif [ ! -f /etc/modprobe.d/95lunmask.conf ]; then
- echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf
+ elif [ ! -f /run/modprobe.d/95lunmask.conf ]; then
+ mkdir -p /run/modprobe.d
+ echo "options scsi_mod scan=manual" > /run/modprobe.d/95lunmask.conf
fi
create_udev_rule "$1" "$2" "$3"
)
getargs 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev"
source_hook pre-udev
-_modprobe_d=/etc/modprobe.d
-if [ -d /usr/lib/modprobe.d ]; then
- _modprobe_d=/usr/lib/modprobe.d
-elif [ -d /lib/modprobe.d ]; then
- _modprobe_d=/lib/modprobe.d
-elif [ ! -d $_modprobe_d ]; then
+_modprobe_d=/run/modprobe.d
+if [ ! -d $_modprobe_d ]; then
mkdir -p $_modprobe_d
fi
)
done
-[ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d
-
for i in $(getargs rd.driver.blacklist -d rdblacklist=); do
(
IFS=,