From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SJbq7-0006Bl-4x for garchives@archives.gentoo.org; Mon, 16 Apr 2012 02:38:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43311E0E7A; Mon, 16 Apr 2012 02:38:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 1049AE0E7A for ; Mon, 16 Apr 2012 02:38:28 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 75E141B4063 for ; Mon, 16 Apr 2012 02:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3C6B4E5403 for ; Mon, 16 Apr 2012 02:38:26 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1334541481.9e947f441600d0d22cdf31337514c163ac4a3a05.sping@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 9e947f441600d0d22cdf31337514c163ac4a3a05 X-VCS-Branch: master Date: Mon, 16 Apr 2012 02:38:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 2acb2a0a-337f-486d-a46b-9302b1119af9 X-Archives-Hash: 305eb162683a99816a2d43cd5202fd7d commit: 9e947f441600d0d22cdf31337514c163ac4a3a05 Author: Sebastian Pipping pipping org> AuthorDate: Mon Apr 16 01:18:48 2012 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Mon Apr 16 01:58:01 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3D9e947f44 Add error detection to copy_binaries --- gen_initramfs.sh | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gen_initramfs.sh b/gen_initramfs.sh index f3c14c2..61ebce1 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -6,13 +6,23 @@ CPIO_ARGS=3D"--quiet -o -H newc" copy_binaries() { local destdir=3D$1 shift - lddtree "$@" \ - | tr ')(' '\n' \ - | awk '/=3D>/{ if($3 ~ /^\//){print $3}}' \ - | sort \ - | uniq \ - | cpio -p --make-directories --dereference --quiet $destdir =20 + for binary in "$@"; do + [[ -e "${binary}" ]] \ + || gen_die "Binary ${binary} could not be found" + + if LC_ALL=3DC 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 '/=3D>/{ if($3 ~ /^\//){print $3}}' \ + | sort \ + | uniq \ + | cpio -p --make-directories --dereference --quiet "${destdir}" \ + || gen_die "Binary ${f} or some of its library dependencies could no= t be copied" + done } =20 append_base_layout() {