Make copy_binaries compatible with lddtree from pax-utils-0.6
authorPeter Hjalmarsson <xake@rymdraket.net>
Thu, 7 Feb 2013 12:31:14 +0000 (13:31 +0100)
committerPeter Hjalmarsson <xake@rymdraket.net>
Sat, 9 Feb 2013 21:47:01 +0000 (22:47 +0100)
On some system the output from the new lddtree does not match with what
genkernel expects, however lddtree have insted gained a new option that
essentially gives what we want with less code.

Signed-off-by: Peter Hjalmarsson <xake@rymdraket.net>
gen_initramfs.sh

index 99bd3f37523a2cfd7f35392f6a2c103255ac37eb..3ae9d7a9e5962dd65ada3df454c46acfa10e60cd 100755 (executable)
@@ -33,13 +33,22 @@ copy_binaries() {
                fi
        done
        # This must be OUTSIDE the for loop, we only want to run lddtree etc ONCE.
-       lddtree "$@" \
+       # lddtree does not have the -V (version) nor the -l (list) options prior to version 1.18
+       if lddtree -V > /dev/null 2>&1 ; then
+               lddtree -l "$@" \
+                       | sort \
+                       | uniq \
+                       | cpio -p --make-directories --dereference --quiet "${destdir}" \
+                       || gen_die "Binary ${f} or some of its library dependencies could not be copied"
+       else
+               lddtree "$@" \
                        | tr ')(' '\n' \
                        | awk  '/=>/{ if($3 ~ /^\//){print $3}}' \
                        | sort \
                        | uniq \
                        | cpio -p --make-directories --dereference --quiet "${destdir}" \
                        || gen_die "Binary ${f} or some of its library dependencies could not be copied"
+       fi
 }
 
 log_future_cpio_content() {