]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut: lib and usr/lib dirs detection
authorAmadeusz Żołnowski <aidecoe@aidecoe.name>
Wed, 18 Aug 2010 18:06:44 +0000 (20:06 +0200)
committerHarald Hoyer <harald@redhat.com>
Mon, 23 Aug 2010 09:54:09 +0000 (11:54 +0200)
First we check if $libdir and $usrlibdir vars are already set in config
file. If not we perform simple detect. Vars are exported - to be useful
in module/check scripts.

dracut

diff --git a/dracut b/dracut
index 4cf2ca3d25ccd0a21fb972278494c558d0cda17d..3b0848ff1d9ecf4a902e5cd535d43d8875acc51e 100755 (executable)
--- a/dracut
+++ b/dracut
@@ -223,6 +223,17 @@ fi
 dracutfunctions=$dracutbasedir/dracut-functions
 export dracutfunctions
 
+# Detect lib paths
+[[ $libdir ]] || for libdir in /lib64 /lib; do
+    [[ -d $libdir ]] && break
+done || {
+    derror 'No lib directory?!!!'
+    exit 1
+}
+[[ $usrlibdir ]] || for usrlibdir in /usr/lib64 /usr/lib; do
+    [[ -d $usrlibdir ]] && break
+done || dwarning 'No usr/lib directory!'
+
 # This is kinda legacy -- eventually it should go away.
 case $dracutmodules in
     ""|auto) dracutmodules="all" ;;
@@ -273,7 +284,7 @@ chmod 755 "$initdir"
 export initdir hookdirs dracutbasedir dracutmodules drivers \
     fw_dir drivers_dir debug beverbose no_kernel kernel_only \
     add_drivers mdadmconf lvmconf filesystems ignore_kmodules \
-    use_fstab
+    use_fstab libdir usrlibdir
 
 if [[ $kernel_only != yes ]]; then
     # Create some directory structure first