]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
make udevdir systemdutildir systemdsystemunitdir global vars
authorHarald Hoyer <harald@redhat.com>
Wed, 6 Jun 2012 13:12:59 +0000 (15:12 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 6 Jun 2012 13:16:00 +0000 (15:16 +0200)
your distribution should ship those settings in
/etc/dracut.conf.d/01-distro.conf

see dracut.conf.d/fedora.conf.example

dracut-functions.sh
dracut.conf.d/fedora.conf.example
dracut.sh
modules.d/95udev-rules/module-setup.sh
modules.d/98systemd/module-setup.sh

index 4180f03a428a8606b00b5f40224f7028270e3988..8aba88dea473ca172cdf0c4599377fe7c44914cf 100755 (executable)
@@ -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
index e362e733722bb8cb643b3a1ae011b1bf06058fae..f3f57f1345761a4f596da7e7188ac24366b91544 100644 (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
index 65398a8cd6f6fb1770d58e94169a1dc1047fe904..49ea5032088c1ded81fb7095a62d872510f61956 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -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}"
index ff4702105ed709792e25c069f7c930c96c0e0bbb..a48b0cb10098992f35f51ec90761e92d9f291616 100755 (executable)
@@ -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
index 1d8aefc06b13bf9d8661c34fc7f55d1594475d45..4fda2a2a779467fd3fd543548190c65131e7410d 100755 (executable)
@@ -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 \