@@ -, +, @@ --- gen_initramfs.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/gen_initramfs.sh +++ a/gen_initramfs.sh @@ -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() { --