]>
Commit | Line | Data |
---|---|---|
464ad04e AM |
1 | diff --git a/functions b/functions |
2 | index a3f6b19..f4d9acb 100644 | |
3 | --- a/functions | |
4 | +++ b/functions | |
5 | @@ -291,3 +291,9 @@ find_modules_by_class_mit() { | |
6 | ' | |
7 | } | |
b66ea229 | 8 | |
464ad04e AM |
9 | +# get possible paths for specifed patter containing LIBDIR |
10 | +get_libdir() { | |
11 | + for dir in lib lib64 libx32; do | |
12 | + echo -n "${1/LIBDIR/$dir} " | |
13 | + done | |
14 | +} | |
15 | diff --git a/geninitrd b/geninitrd | |
16 | index 2c435f8..6ad6820 100755 | |
17 | --- a/geninitrd | |
18 | +++ b/geninitrd | |
19 | @@ -553,17 +553,20 @@ inst_exec() { | |
20 | ||
21 | # hack for uclibc linked binaries requiring this fixed path | |
22 | # XXX: shouldn't rpath be used here instead so th | |
23 | - if [ -f $DESTDIR/$_lib/libc.so.0 ]; then | |
24 | - lib=$DESTDIR/$_lib/libc.so.0 | |
25 | - lib=$(ldd "$lib" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u) | |
26 | - libdir=$(cd $(dirname "$lib"); pwd) | |
27 | - if [ ! -e $DESTDIR$libdir ]; then | |
28 | - libdir=$(dirname "$libdir") | |
29 | - inst_d $libdir | |
30 | - verbose "+ ln -s /$_lib $DESTDIR$libdir" | |
31 | - ln -s /$_lib $DESTDIR$libdir | |
32 | + for _lib in $(get_libdir LIBDIR); do | |
33 | + if [ -f $DESTDIR/$_lib/libc.so.0 ]; then | |
34 | + lib=$DESTDIR/$_lib/libc.so.0 | |
35 | + lib=$(ldd "$lib" | awk '/statically|linux-(gate|vdso)\.so/{next} NF == 2 {print $1} /=/{print $3}' | sort -u) | |
36 | + libdir=$(cd $(dirname "$lib"); pwd) | |
37 | + if [ ! -e $DESTDIR$libdir ]; then | |
38 | + libdir=$(dirname "$libdir") | |
39 | + inst_d $libdir | |
40 | + verbose "+ ln -s /$_lib $DESTDIR$libdir" | |
41 | + ln -s /$_lib $DESTDIR$libdir | |
42 | + break | |
43 | + fi | |
44 | fi | |
45 | - fi | |
46 | + done | |
47 | } | |
48 | ||
49 | # output modules.conf / modprobe.conf | |
50 | @@ -1363,19 +1366,10 @@ for dir in libx32 lib64 lib; do | |
51 | fi | |
52 | done | |
53 | ||
54 | -if [ -d /libx32 -a -d /usr/libx32 ]; then | |
55 | - _lib=libx32 | |
56 | -elif [ -d /lib64 -a -d /usr/lib64 ]; then | |
57 | - _lib=lib64 | |
58 | -else | |
59 | - _lib=lib | |
60 | -fi | |
61 | - | |
62 | kernel_version=$(echo "$kernel" | awk -F. '{gsub(/[_-].*/, "", $0); print sprintf("%03d%03d",$1,$2)}') | |
63 | kernel_version_long=$(echo "$kernel" | awk -F. '{gsub(/[_-].*/, "", $0); print sprintf("%03d%03d%03d",$1,$2,$3)}') | |
64 | ||
65 | verbose "# geninitrd $VERSION" | |
66 | -debug "Using _lib: $_lib" | |
67 | debug "Using initrd_dir: $initrd_dir" | |
68 | ||
69 | busybox=$(find_tool $initrd_dir/busybox $initrd_dir/initrd-busybox /bin/initrd-busybox) || die "Couldn't find busybox suitable for initrd" | |
70 | diff --git a/mod-multipath.sh b/mod-multipath.sh | |
71 | index f918dd5..559eb55 100644 | |
72 | --- a/mod-multipath.sh | |
73 | +++ b/mod-multipath.sh | |
74 | @@ -112,13 +112,19 @@ initrd_gen_multipath() { | |
75 | inst_exec /sbin/multipath /sbin | |
76 | ||
77 | # for udev callouts | |
78 | - local scsi_id=$(find_tool /$_lib/udev/scsi_id /lib/udev/scsi_id /sbin/scsi_id) | |
79 | + local scsi_id=$(find_tool $(get_libdir /LIBDIR/udev/scsi_id) /lib/udev/scsi_id /sbin/scsi_id) | |
80 | inst_exec $scsi_id /lib/udev | |
81 | ||
82 | - if [ -d /$_lib/multipath ]; then | |
83 | - inst_d /$_lib/multipath | |
84 | - inst_exec /$_lib/multipath/* /$_lib/multipath | |
85 | - else | |
86 | + local installed=0 | |
87 | + for _lib in $(get_libdir LIBDIR); do | |
88 | + if [ -d /$_lib/multipath ]; then | |
89 | + inst_d /$_lib/multipath | |
90 | + inst_exec /$_lib/multipath/* /$_lib/multipath | |
91 | + installed=1 | |
92 | + break | |
93 | + fi | |
94 | + done | |
95 | + if [ "$installed" -eq 0 ]; then | |
96 | inst_exec /sbin/mpath* /sbin | |
97 | fi | |
98 | ||
99 | diff --git a/mod-suspend.sh b/mod-suspend.sh | |
100 | index 48efd57..c984e77 100644 | |
101 | --- a/mod-suspend.sh | |
102 | +++ b/mod-suspend.sh | |
103 | @@ -13,7 +13,7 @@ setup_mod_suspend() { | |
104 | warn "Tuxonice and mainline suspend are exclusive!" | |
105 | fi | |
106 | ||
107 | - resume=$(find_tool $initrd_dir/resume /usr/${_lib}/suspend/resume /usr/sbin/resume) | |
108 | + resume=$(find_tool $(get_libdir /usr/LIBDIR/suspend/resume) $initrd_dir/resume /usr/sbin/resume) | |
109 | ||
110 | if [ ! -x "$resume" ] || [ ! -f /etc/suspend.conf ]; then | |
111 | USE_SUSPEND=no | |
112 | @@ -58,11 +58,7 @@ initrd_gen_suspend() { | |
113 | inst $resume_dev $resume_dev | |
114 | ||
115 | inst /etc/suspend.conf /etc/suspend.conf | |
116 | - if [ -x /usr/${_lib}/suspend/resume ]; then | |
117 | - inst_exec /usr/${_lib}/suspend/resume /bin/resume | |
118 | - else | |
119 | - inst_exec /usr/sbin/resume /bin/resume | |
120 | - fi | |
121 | + inst_exec $resume /bin/resume | |
122 | ||
123 | add_linuxrc <<-'EOF' | |
124 | resume=no |