diff --git a/ChangeLog b/ChangeLog index 6ed045a..761a724 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ # Distributed under the GPL v2 # $Id$ + 18 Apr 2012; Robin H. Johnson gen_initramfs.sh: + lddtree call must be outside the for loop. + 16 Apr 2012; Robin H. Johnson gen_initramfs.sh: Use CC0 instead of public domain for copy_binaries to cover French jurisdiction concerns. diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 7db1c95..3739fe6 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -31,15 +31,15 @@ copy_binaries() { if LC_ALL=C lddtree "${binary}" 2>&1 | fgrep -q 'not found'; then gen_die "Binary ${binary} is linked to missing libraries and may need to be re-built" fi - - lddtree "${binary}" \ - | 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" done + # This must be OUTSIDE the for loop, we only want to run lddtree etc ONCE. + 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" } append_base_layout() {