make udevdir systemdutildir systemdsystemunitdir global vars

your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf

see dracut.conf.d/fedora.conf.example
master
Harald Hoyer 2012-06-06 15:12:59 +02:00
parent 2cf4f4fb74
commit d161561290
5 changed files with 22 additions and 30 deletions

View File

@ -531,12 +531,6 @@ inst_symlink() {
ln -sfn $(convert_abs_rel "${_target}" "${_realsrc}") "$initdir/$_target"
}

udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
[[ -d /lib/udev ]] && udevdir=/lib/udev
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
fi

# attempt to install any programs specified in a udev rule
inst_rule_programs() {
local _prog _bin

View File

@ -8,3 +8,6 @@ stdloglvl=3
realinitpath="/usr/lib/systemd/systemd"
install_items+=" vi /etc/virc ps grep cat rm "
prefix="/"
systemdutildir=/usr/lib/systemd
systemdsystemunitdir=/usr/lib/systemd/system
udevdir=/usr/lib/udev

View File

@ -650,13 +650,31 @@ for dev in "${host_devs[@]}"; do
done
done

[[ -d $udevdir ]] \
|| udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
[[ -d /lib/udev ]] && udevdir=/lib/udev
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
fi

[[ -d $systemdutildir ]] \
|| systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
[[ -d $systemdsystemunitdir ]] \
|| systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null)

if ! [[ -d "$systemdutildir" ]]; then
[[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
fi
[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system

export initdir dracutbasedir dracutmodules drivers \
fw_dir drivers_dir debug no_kernel kernel_only \
add_drivers omit_drivers mdadmconf lvmconf filesystems \
use_fstab fstab_lines libdirs fscks nofscks \
stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
debug host_fs_types host_devs sshkey add_fstab \
DRACUT_VERSION
DRACUT_VERSION udevdir systemdutildir systemdsystemunitdir

# Create some directory structure first
[[ $prefix ]] && mkdir -m 0755 -p "${initdir}${prefix}"

View File

@ -5,18 +5,6 @@
install() {
local _i

systemdutildir=$(pkg-config systemd --variable=systemdutildir 2>/dev/null)
if ! [[ -d "$systemdutildir" ]]; then
[[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
fi

udevdir=$(pkg-config udev --variable=udevdir 2>/dev/null)
if ! [[ -d "$udevdir" ]]; then
[[ -d /lib/udev ]] && udevdir=/lib/udev
[[ -d /usr/lib/udev ]] && udevdir=/usr/lib/udev
fi

# Fixme: would be nice if we didn't have to know which rules to grab....
# ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies
# of the rules we want so that we just copy those in would be best

View File

@ -16,17 +16,6 @@ depends() {
}

install() {
local systemdutildir systemdsystemunitdir

systemdutildir=$(pkg-config systemd --variable=systemdutildir)
systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir)

if ! [[ -d "$systemdutildir" ]]; then
[[ -d /lib/systemd ]] && systemdutildir=/lib/systemd
[[ -d /usr/lib/systemd ]] && systemdutildir=/usr/lib/systemd
fi
[[ -d "$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system

dracut_install -o "$i" \
$systemdutildir/systemd \
$systemdutildir/systemd-cgroups-agent \