dracut-functions.sh: avoid tokenizing ldconfig output with 'read'
The space does not separate the elements reliably, spaces can be embedded in parenthesized expressions too: libgmpxx.so.4 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmpxx.so.4 libgmp.so.10 (libc6, hwcap: 0x0000000004000000) => /lib/sse2/libgmp.so.10 This results in dracut creating '0x0000000004000000' and '=>' directories in the initramfs image.master
parent
1dc360790d
commit
c59779cf93
|
@ -104,17 +104,7 @@ fi
|
||||||
|
|
||||||
ldconfig_paths()
|
ldconfig_paths()
|
||||||
{
|
{
|
||||||
local a i
|
ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq
|
||||||
declare -A a
|
|
||||||
for i in $(
|
|
||||||
ldconfig -pN 2>/dev/null | grep -F '=>' | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | while read a b c d; do
|
|
||||||
d=${d%/*}
|
|
||||||
printf "%s\n" "$d";
|
|
||||||
done
|
|
||||||
); do
|
|
||||||
a["$i"]=1;
|
|
||||||
done;
|
|
||||||
printf "%s\n" ${!a[@]}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Detect lib paths
|
# Detect lib paths
|
||||||
|
|
Loading…
Reference in New Issue