dracut.sh: improve udevdir and systemdutildir fallback logic
Check for a common binary in systemdutildir. This resolves an issue on split-usr systems, where it is common to have both /lib/systemd[/system] and /usr/lib/systemd[/user] present. Check for systemd-udevd specifically, since some distros (Gentoo) allow udev to be installed without the rest of the systemd stack. Similar logic is applied to udevdir simply for consistency.master
parent
e3fb645821
commit
9d1b81c0d1
|
|
@ -1314,16 +1314,16 @@ done
|
||||||
[[ -d $udevdir ]] \
|
[[ -d $udevdir ]] \
|
||||||
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
|
|| udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)"
|
||||||
if ! [[ -d "$udevdir" ]]; then
|
if ! [[ -d "$udevdir" ]]; then
|
||||||
[[ ! -h /lib ]] && [[ -d /lib/udev ]] && udevdir=/lib/udev
|
[[ -e /lib/udev/collect ]] && udevdir=/lib/udev
|
||||||
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
|
[[ -e /usr/lib/udev/collect ]] && udevdir=/usr/lib/udev
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -d $systemdutildir ]] \
|
[[ -d $systemdutildir ]] \
|
||||||
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
|
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
|
||||||
|
|
||||||
if ! [[ -d "$systemdutildir" ]]; then
|
if ! [[ -d "$systemdutildir" ]]; then
|
||||||
[[ ! -h /lib ]] && [[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
|
[[ -e /lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd
|
||||||
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
|
[[ -e /usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -d $systemdsystemunitdir ]] \
|
[[ -d $systemdsystemunitdir ]] \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue