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 1SAjoO-0004TR-0z for garchives@archives.gentoo.org; Thu, 22 Mar 2012 15:20:24 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 49432E072C; Thu, 22 Mar 2012 15:20:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 182E6E072C for ; Thu, 22 Mar 2012 15:20:04 +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 787131B400C for ; Thu, 22 Mar 2012 15:20:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 2D0FCE542C for ; Thu, 22 Mar 2012 15:20:02 +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: <1332429351.7ee9306c7d68bd8b54219788b61558abc8732e9e.sping@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: ChangeLog gen_initramfs.sh X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 7ee9306c7d68bd8b54219788b61558abc8732e9e X-VCS-Branch: master Date: Thu, 22 Mar 2012 15:20:02 +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: 2636d281-7a91-4851-a6e3-d633b639ebf2 X-Archives-Hash: e4eef3774ca9ba0e40c6b107168b0649 commit: 7ee9306c7d68bd8b54219788b61558abc8732e9e Author: Sebastian Pipping pipping org> AuthorDate: Thu Mar 22 15:07:23 2012 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Thu Mar 22 15:15:51 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/genkernel.git= ;a=3Dcommit;h=3D7ee9306c Fail hard on LUKS inclusion error (bug #409277), advise about sys-fs/cryp= tsetup[static], drop support for cryptsetup binary from /bin/ --- ChangeLog | 4 ++++ gen_initramfs.sh | 27 +++++++++++++-------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2529bf..b6319e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,10 @@ # Distributed under the GPL v2 # $Id$ =20 + 22 Mar 2012; Sebastian Pipping gen_initramfs.sh: + Fail hard on LUKS inclusion error (bug #409277), advise about + sys-fs/cryptsetup[static], drop support for cryptsetup binary from /bi= n/ + 22 Mar 2012; Sebastian Pipping gen_funcs.sh, gen_initramfs.sh: Make errors stand out more diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 9a17b3a..419d557 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -391,6 +391,10 @@ append_overlay(){ } =20 append_luks() { + local _luks_error_format=3D"LUKS support cannot be included: %s. Pleas= e emerge sys-fs/cryptsetup[static]." + local _luks_source=3D/sbin/cryptsetup + local _luks_dest=3D/sbin/cryptsetup + if [ -d "${TEMP}/initramfs-luks-temp" ] then rm -r "${TEMP}/initramfs-luks-temp/" @@ -402,20 +406,15 @@ append_luks() { =20 if isTrue ${LUKS} then - if is_static /bin/cryptsetup - then - print_info 1 "Including LUKS support" - cp /bin/cryptsetup ${TEMP}/initramfs-luks-temp/sbin/cryptsetup - chmod +x "${TEMP}/initramfs-luks-temp/sbin/cryptsetup" - elif is_static /sbin/cryptsetup - then - print_info 1 "Including LUKS support" - cp /sbin/cryptsetup ${TEMP}/initramfs-luks-temp/sbin/cryptsetup - chmod +x "${TEMP}/initramfs-luks-temp/sbin/cryptsetup" - else - print_info 1 "LUKS support requires static cryptsetup at /bin/cryptse= tup or /sbin/cryptsetup" - print_info 1 "Not including LUKS support" - fi + [ -x "${_luks_source}" ] \ + || gen_die "$(printf "${_luks_error_format}" "no file ${_luks_source= }")" + + is_static "${_luks_source}" \ + || gen_die "$(printf "${_luks_error_format}" "${_luks_source} not a = static binary")" + + print_info 1 "Including LUKS support" + cp "${_luks_source}" ${TEMP}/initramfs-luks-temp${_luks_dest} + chmod +x "${TEMP}/initramfs-luks-temp${_luks_dest}" fi =20 find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \