Take into account lib64 dirs when detecting version, modules and params

master
Amadeusz Żołnowski 2015-03-24 14:13:14 +01:00 committed by Harald Hoyer
parent 2bc5054a64
commit d3be9275c7
1 changed files with 12 additions and 3 deletions

View File

@ -108,6 +108,12 @@ if ! [[ -f "$image" ]]; then
exit 1 exit 1
fi fi


dracutlibdirs() {
for d in lib64/dracut lib/dracut usr/lib64/dracut usr/lib/dracut; do
echo "$d/$1"
done
}

extract_files() extract_files()
{ {
(( ${#filenames[@]} == 1 )) && nofileinfo=1 (( ${#filenames[@]} == 1 )) && nofileinfo=1
@ -124,7 +130,8 @@ extract_files()
list_modules() list_modules()
{ {
echo "dracut modules:" echo "dracut modules:"
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/modules.txt' 'usr/lib/dracut/modules.txt' 2>/dev/null $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs modules.txt) 2>/dev/null
((ret+=$?)) ((ret+=$?))
} }


@ -217,7 +224,8 @@ ret=0
if (( ${#filenames[@]} > 0 )); then if (( ${#filenames[@]} > 0 )); then
extract_files extract_files
else else
version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/dracut-*' 'usr/lib/dracut/dracut-*' 2>/dev/null) version=$($CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs 'dracut-*') 2>/dev/null)
((ret+=$?)) ((ret+=$?))
echo "Version: $version" echo "Version: $version"
echo echo
@ -226,7 +234,8 @@ else
echo "========================================================================" echo "========================================================================"
else else
echo -n "Arguments: " echo -n "Arguments: "
$CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- 'lib/dracut/build-parameter.txt' 'usr/lib/dracut/build-parameter.txt' 2>/dev/null $CAT "$image" | cpio --extract --verbose --quiet --to-stdout -- \
$(dracutlibdirs build-parameter.txt) 2>/dev/null
echo echo
list_modules list_modules
list_files list_files