Blame 0001-get-rid-of-libdir-and-usrlibdir.patch

Harald Hoyer 18c19d
From d77540c8e4caf557d472786711ef17838a4a24f1 Mon Sep 17 00:00:00 2001
Harald Hoyer 18c19d
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 18c19d
Date: Mon, 4 Jun 2012 15:23:15 +0200
Harald Hoyer 18c19d
Subject: [PATCH] get rid of libdir and usrlibdir
Harald Hoyer 18c19d
Harald Hoyer 18c19d
---
Harald Hoyer 18c19d
 dracut.sh                                        |   23 ++++++++--------------
Harald Hoyer 18c19d
 modules.d/01fips/module-setup.sh                 |    2 +-
Harald Hoyer 18c19d
 modules.d/50plymouth/plymouth-populate-initrd.sh |   12 ++++-------
Harald Hoyer 18c19d
 modules.d/95nfs/module-setup.sh                  |    8 +++-----
Harald Hoyer 18c19d
 4 files changed, 16 insertions(+), 29 deletions(-)
Harald Hoyer 18c19d
Harald Hoyer 18c19d
diff --git a/dracut.sh b/dracut.sh
Harald Hoyer 18c19d
index c9e412e..65398a8 100755
Harald Hoyer 18c19d
--- a/dracut.sh
Harald Hoyer 18c19d
+++ b/dracut.sh
Harald Hoyer 18c19d
@@ -527,22 +527,15 @@ ddebug "Executing $0 $dracut_args"
Harald Hoyer 18c19d
 }
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 # Detect lib paths
Harald Hoyer 18c19d
-if ! [[ $libdir ]] || ! [[ $usrlibdir ]] ; then
Harald Hoyer 18c19d
+if ! [[ $libdirs ]] ; then
Harald Hoyer 18c19d
     if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
Harald Hoyer 18c19d
         && [[ -d /lib64 ]]; then
Harald Hoyer 18c19d
-        libdir=/lib64
Harald Hoyer 18c19d
-        usrlibdir=/usr/lib64
Harald Hoyer 18c19d
+        libdirs+=" /lib64"
Harald Hoyer 18c19d
+        [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
Harald Hoyer 18c19d
     else
Harald Hoyer 18c19d
-        libdir=/lib
Harald Hoyer 18c19d
-        usrlibdir=/usr/lib
Harald Hoyer 18c19d
+        libdirs+=" /lib"
Harald Hoyer 18c19d
+        [[ -d /usr/lib ]] && libdirs+=" /usr/lib"
Harald Hoyer 18c19d
     fi
Harald Hoyer 18c19d
-    for i in $libdir $usrlibdir; do
Harald Hoyer 18c19d
-        if [[ -d $i ]]; then
Harald Hoyer 18c19d
-            libdirs+=" $i"
Harald Hoyer 18c19d
-        else
Harald Hoyer 18c19d
-            dwarn 'No $i directory??!!'
Harald Hoyer 18c19d
-        fi
Harald Hoyer 18c19d
-    done
Harald Hoyer 18c19d
 fi
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 # This is kinda legacy -- eventually it should go away.
Harald Hoyer 18c19d
@@ -660,7 +653,7 @@ done
Harald Hoyer 18c19d
 export initdir dracutbasedir dracutmodules drivers \
Harald Hoyer 18c19d
     fw_dir drivers_dir debug no_kernel kernel_only \
Harald Hoyer 18c19d
     add_drivers omit_drivers mdadmconf lvmconf filesystems \
Harald Hoyer 18c19d
-    use_fstab fstab_lines libdir usrlibdir fscks nofscks \
Harald Hoyer 18c19d
+    use_fstab fstab_lines libdirs fscks nofscks \
Harald Hoyer 18c19d
     stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \
Harald Hoyer 18c19d
     debug host_fs_types host_devs sshkey add_fstab \
Harald Hoyer 18c19d
     DRACUT_VERSION
Harald Hoyer 18c19d
@@ -672,13 +665,13 @@ export initdir dracutbasedir dracutmodules drivers \
Harald Hoyer 18c19d
 [[ $prefix ]] && ln -sfn "${prefix#/}/lib" "$initdir/lib"
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 if [[ $prefix ]]; then
Harald Hoyer 18c19d
-    for d in bin etc lib "$libdir" sbin tmp usr var; do
Harald Hoyer 18c19d
+    for d in bin etc lib $libdirs sbin tmp usr var; do
Harald Hoyer 18c19d
         ln -sfn "${prefix#/}/${d#/}" "$initdir/$d"
Harald Hoyer 18c19d
     done
Harald Hoyer 18c19d
 fi
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 if [[ $kernel_only != yes ]]; then
Harald Hoyer 18c19d
-    for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log var/run var/lock; do
Harald Hoyer 18c19d
+    for d in usr/bin usr/sbin bin etc lib $libdirs sbin tmp usr var var/log var/run var/lock; do
Harald Hoyer 18c19d
         [[ -e "${initdir}${prefix}/$d" ]] && continue
Harald Hoyer 18c19d
         if [ -L "/$d" ]; then
Harald Hoyer 18c19d
             inst_symlink "/$d" "${prefix}/$d"
Harald Hoyer 18c19d
diff --git a/modules.d/01fips/module-setup.sh b/modules.d/01fips/module-setup.sh
Harald Hoyer 18c19d
index 075fc24..a576a4a 100755
Harald Hoyer 18c19d
--- a/modules.d/01fips/module-setup.sh
Harald Hoyer 18c19d
+++ b/modules.d/01fips/module-setup.sh
Harald Hoyer 18c19d
@@ -41,7 +41,7 @@ install() {
Harald Hoyer 18c19d
     inst_libdir_file libfreebl3.so
Harald Hoyer 18c19d
     inst_libdir_file libfreebl3.chk
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
-    dracut_install $usrlibdir/hmaccalc/sha512hmac.hmac
Harald Hoyer 18c19d
+    inst_libdir_file 'hmaccalc/sha512hmac.hmac'
Harald Hoyer 18c19d
     if command -v prelink >/dev/null; then
Harald Hoyer 18c19d
         dracut_install prelink
Harald Hoyer 18c19d
     fi
Harald Hoyer 18c19d
diff --git a/modules.d/50plymouth/plymouth-populate-initrd.sh b/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer 18c19d
index 25657ae..7ab1a5d 100755
Harald Hoyer 18c19d
--- a/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer 18c19d
+++ b/modules.d/50plymouth/plymouth-populate-initrd.sh
Harald Hoyer 18c19d
@@ -12,8 +12,8 @@ dracut_install /bin/plymouth \
Harald Hoyer 18c19d
 mkdir -m 0755 -p "${initdir}/usr/share/plymouth"
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
 if [[ $hostonly ]]; then
Harald Hoyer 18c19d
-    dracut_install "${usrlibdir}/plymouth/text.so" \
Harald Hoyer 18c19d
-        "${usrlibdir}/plymouth/details.so" \
Harald Hoyer 18c19d
+    inst_libdir_file "plymouth/text.so" "plymouth/details.so"
Harald Hoyer 18c19d
+    dracut_install \
Harald Hoyer 18c19d
         "/usr/share/plymouth/themes/details/details.plymouth" \
Harald Hoyer 18c19d
         "/usr/share/plymouth/themes/text/text.plymouth" \
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
@@ -28,7 +28,7 @@ if [[ $hostonly ]]; then
Harald Hoyer 18c19d
         inst /usr/share/plymouth/themes/default.plymouth
Harald Hoyer 18c19d
         # Install plugin for this theme
Harald Hoyer 18c19d
         PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c; do echo $b; done;)
Harald Hoyer 18c19d
-        inst "${usrlibdir}/plymouth/${PLYMOUTH_PLUGIN}.so"
Harald Hoyer 18c19d
+        inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so"
Harald Hoyer 18c19d
     fi
Harald Hoyer 18c19d
 else
Harald Hoyer 18c19d
     for x in /usr/share/plymouth/themes/{text,details}/* ; do
Harald Hoyer 18c19d
@@ -37,11 +37,7 @@ else
Harald Hoyer 18c19d
         mkdir -m 0755 -p "${initdir}/$THEME_DIR"
Harald Hoyer 18c19d
         dracut_install "$x"
Harald Hoyer 18c19d
     done
Harald Hoyer 18c19d
-    for x in "${usrlibdir}"/plymouth/{text,details}.so ; do
Harald Hoyer 18c19d
-        [[ -f "$x" ]] || continue
Harald Hoyer 18c19d
-        [[ "$x" != "${x%%/label.so}" ]] && continue
Harald Hoyer 18c19d
-        dracut_install "$x"
Harald Hoyer 18c19d
-    done
Harald Hoyer 18c19d
+    inst_libdir_file "/plymouth/{text,details}.so"
Harald Hoyer 18c19d
     (
Harald Hoyer 18c19d
         cd ${initdir}/usr/share/plymouth/themes;
Harald Hoyer 18c19d
         ln -s text/text.plymouth default.plymouth 2>&1;
Harald Hoyer 18c19d
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
Harald Hoyer 18c19d
index 1d62e95..bf87762 100755
Harald Hoyer 18c19d
--- a/modules.d/95nfs/module-setup.sh
Harald Hoyer 18c19d
+++ b/modules.d/95nfs/module-setup.sh
Harald Hoyer 18c19d
@@ -43,11 +43,9 @@ install() {
Harald Hoyer 18c19d
     dracut_install rpc.idmapd
Harald Hoyer 18c19d
     dracut_install sed
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
-    for _i in {"$libdir","$usrlibdir"}/libnfsidmap_nsswitch.so* \
Harald Hoyer 18c19d
-        {"$libdir","$usrlibdir"}/libnfsidmap/*.so \
Harald Hoyer 18c19d
-        {"$libdir","$usrlibdir"}/libnfsidmap*.so*; do
Harald Hoyer 18c19d
-        [ -e "$_i" ] && dracut_install "$_i"
Harald Hoyer 18c19d
-    done
Harald Hoyer 18c19d
+    inst_libdir_file 'libnfsidmap_nsswitch.so*'
Harald Hoyer 18c19d
+    inst_libdir_file 'libnfsidmap/*.so'
Harald Hoyer 18c19d
+    inst_libdir_file 'libnfsidmap*.so*'
Harald Hoyer 18c19d
 
Harald Hoyer 18c19d
     _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \
Harald Hoyer 18c19d
         |  tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|')