Starting with commit
24a38bc1cbe461c344ce61c7e10b6d51d5689c93 dracut
uses udev builtins but still depends on >=udev-166 in dracut.spec. This
patch makes dracut work with older udev again.
All credits go to Alexander Tsoy <alexander@tsoy.me>; see
https://bugs.gentoo.org/show_bug.cgi?id=437700
# Also don't process disks that are slated to be a multipath device
ENV{DM_MULTIPATH_DEVICE_PATH}=="?*", GOTO="ps_end"
-KERNEL=="cciss[0-9]*", IMPORT{builtin}="blkid"
-KERNEL=="nbd[0-9]*", IMPORT{builtin}="blkid"
+KERNEL=="cciss[0-9]*", IMPORT BLKID
+KERNEL=="nbd[0-9]*", IMPORT BLKID
KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end"
LABEL="md_ignore_state"
IMPORT{program}="/sbin/mdadm --detail --export $tempnode"
-IMPORT{builtin}="blkid"
+IMPORT BLKID
OPTIONS+="link_priority=100"
OPTIONS+="watch"
LABEL="md_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="ps_end"
ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="ps_end"
ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="ps_end"
-IMPORT{builtin}="blkid"
+IMPORT BLKID
LABEL="ps_end"
LABEL="do_pss"
# by-path (parent device path)
-ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT PATH_ID
ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
inst_script "$moddir/load-modules.sh" /lib/udev/load-modules.sh
inst_libdir_file "libnss_files*"
+
+ inst_hook pre-udev 10 "$moddir/udev-rules-prepare.sh"
}
--- /dev/null
+#!/bin/sh
+# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
+# ex: ts=8 sw=4 sts=4 et filetype=sh
+
+for f in /etc/udev/rules.d/*-persistent-storage.rules; do
+ [ -e "$f" ] || continue
+ while read line; do
+ if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
+ if [ $UDEVVERSION -ge 174 ]; then
+ printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
+ else
+ printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}"
+ fi
+ elif [ "${line%%IMPORT BLKID}" != "$line" ]; then
+ if [ $UDEVVERSION -ge 176 ]; then
+ printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}"
+ else
+ printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}"
+ fi
+ else
+ echo "$line"
+ fi
+ done < "${f}" > "${f}.new"
+ mv "${f}.new" "$f"
+done
[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
-UDEVVERSION=$(udevadm --version)
+export UDEVVERSION=$(udevadm --version)
if [ $UDEVVERSION -gt 166 ]; then
# newer versions of udev use /run/udev/rules.d
export UDEVRULESD=/run/udev/rules.d