From: Jóhann B. Guðmundsson Date: Sun, 17 Jan 2021 22:44:17 +0000 (+0000) Subject: feat: add addional global variables X-Git-Tag: 052~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1acf52b60e59a6b5c5647cc01302da7ad9942eb6;p=thirdparty%2Fdracut.git feat: add addional global variables --- diff --git a/dracut.conf.d/fedora.conf.example b/dracut.conf.d/fedora.conf.example index b32abb096..475da95cb 100644 --- a/dracut.conf.d/fedora.conf.example +++ b/dracut.conf.d/fedora.conf.example @@ -10,9 +10,22 @@ stdloglvl=3 sysloglvl=5 install_optional_items+=" vi /etc/virc ps grep cat rm " prefix="/" +environment=/usr/lib/environment.d +dbus=/usr/share/dbus-1 +dbusinterfaces=/usr/share/dbus-1/interfaces +dbusservices=/usr/share/dbus-1/services +dbussession=/usr/share/dbus-1/session.d +dbussystem=/usr/share/dbus-1/system.d +dbussystemservices=/usr/share/dbus-1/system-services +sysctld=/usr/lib/sysctl.d systemdutildir=/usr/lib/systemd +systemdcatalog=/usr/lib/systemd/catalog +systemdntpunits=/usr/lib/systemd/ntp-units.d +systemdportable=/usr/lib/systemd/portable systemdsystemunitdir=/usr/lib/systemd/system systemdsystemconfdir=/etc/systemd/system +systemduser=/usr/lib/systemd/user +sysusers=/usr/lib/sysusers.d udevdir=/usr/lib/udev hostonly="yes" hostonly_cmdline="no" diff --git a/dracut.sh b/dracut.sh index e59e76ea4..4b35b92e9 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1427,6 +1427,36 @@ for dev in "${!host_fs_types[@]}"; do fi done +[[ -d $dracutsysrootdir$dbus ]] \ + || dbus=$(pkg-config dbus --variable=dbus 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbus" ]] || dbus=/usr/share/dbus-1 + +[[ -d $dracutsysrootdir$dbusinterfaces ]] \ + || dbusinterfaces=$(pkg-config dbus --variable=dbusinterfaces 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbusinterfaces" ]] || dbusinterfaces=${dbus}/interfaces + +[[ -d $dracutsysrootdir$dbusservices ]] \ + || dbusservices=$(pkg-config dbus --variable=dbusservices 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbusservices" ]] || dbusservices=${dbus}/services + +[[ -d $dracutsysrootdir$dbussession ]] \ + || dbussession=$(pkg-config dbus --variable=dbussession 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbussession" ]] || dbussession=${dbus}/session.d + +[[ -d $dracutsysrootdir$dbussystem ]] \ + || dbussystem=$(pkg-config dbus --variable=dbussystem 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbussystem" ]] || dbussystem=${dbus}/system.d + +[[ -d $dracutsysrootdir$dbussystemservices ]] \ + || dbussystemservices=$(pkg-config dbus --variable=dbussystemservices 2>/dev/null) + +[[ -d "$dracutsysrootdir$dbussystemservices" ]] || dbussystemservices=${dbus}/system-services + [[ -d $dracutsysrootdir$udevdir ]] \ || udevdir="$(pkg-config udev --variable=udevdir 2>/dev/null)" if ! [[ -d "$dracutsysrootdir$udevdir" ]]; then @@ -1434,16 +1464,56 @@ if ! [[ -d "$dracutsysrootdir$udevdir" ]]; then [[ -e $dracutsysrootdir/usr/lib/udev/ata_id ]] && udevdir=/usr/lib/udev fi +[[ -d $dracutsysrootdir$sysctl ]] \ + || sysctl=$(pkg-config systemd --variable=sysctl 2>/dev/null) + +[[ -d "$dracutsysrootdir$sysctl" ]] || sysusers=/usr/lib/sysctl.d + +[[ -d $dracutsysrootdir$environment ]] \ + || environment=$(pkg-config systemd --variable=environment 2>/dev/null) + +[[ -d "$dracutsysrootdir$environment" ]] || environment=/usr/lib/environment.d + +[[ -d $dracutsysrootdir$systemdcatalog ]] \ + || systemdcatalog=$(pkg-config systemd --variable=systemdcatalog 2>/dev/null) + +[[ -d "$dracutsysrootdir$systemdcatalog" ]] || systemdcatalog=${systemdutildir}/catalog + +[[ -d $dracutsysrootdir$systemdnetwork ]] \ + || systemdnetwork=$(pkg-config systemd --variable=systemdnetwork 2>/dev/null) + +[[ -d "$dracutsysrootdir$systemdnetwork" ]] || systemdnetwork=${systemdutildir}/network + +[[ -d $dracutsysrootdir$systemdntpunits ]] \ + || systemdntpunits=$(pkg-config systemd --variable=systemdntpunits 2>/dev/null) + +[[ -d "$dracutsysrootdir$systemdntpunits" ]] || systemdntpunits=${systemdutildir}/ntp-units.d + +[[ -d $dracutsysrootdir$systemdportable ]] \ + || systemdportable=$(pkg-config systemd --variable=systemdportable 2>/dev/null) + +[[ -d "$dracutsysrootdir$systemdportable" ]] || systemdportable=${systemdutildir}/portable + [[ -d $dracutsysrootdir$systemdsystemunitdir ]] \ || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2>/dev/null) [[ -d "$dracutsysrootdir$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system +[[ -d $dracutsysrootdir$systemduser ]] \ + || systemduser=$(pkg-config systemd --variable=systemduser 2>/dev/null) + +[[ -d "$dracutsysrootdir$systemduser" ]] || systemduser=${systemdutildir}/user + [[ -d $dracutsysrootdir$systemdsystemconfdir ]] \ || systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2>/dev/null) [[ -d "$dracutsysrootdir$systemdsystemconfdir" ]] || systemdsystemconfdir=/etc/systemd/system +[[ -d $dracutsysrootdir$sysusers ]] \ + || sysusers=$(pkg-config systemd --variable=sysusers 2>/dev/null) + +[[ -d "$dracutsysrootdir$sysusers" ]] || sysusers=/usr/lib/sysusers.d + [[ -d $dracutsysrootdir$tmpfilesdir ]] \ || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2>/dev/null) @@ -1461,7 +1531,10 @@ export initdir dracutbasedir \ stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ debug host_fs_types host_devs swap_devs sshkey add_fstab \ DRACUT_VERSION udevdir prefix filesystems drivers \ - systemdutildir systemdsystemunitdir systemdsystemconfdir \ + dbus dbusinterfaces dbusservices dbussession dbussystem \ + dbussystemservices environment sysctl \ + systemdutildir systemdcatalog systemdntpunits \ + systemdsystemunitdir systemdsystemconfdir \ hostonly_cmdline loginstall \ tmpfilesdir