summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-12 23:36:42 +0000
committerMike Frysinger <vapier@gentoo.org>2011-01-12 23:36:42 +0000
commit4dc5f20975ec79734f2d67bf4015c89075ab2e2c (patch)
treefb6bd22f8ce74ff0163bb32f4b1a3b6fa8b23e4f /sys-fs/cryptsetup
parentInitial commit, ebuild by Leo, Jean-Baptiste Rouault and Vadim Fint, bug 159684 (diff)
downloadgentoo-2-4dc5f20975ec79734f2d67bf4015c89075ab2e2c.tar.gz
gentoo-2-4dc5f20975ec79734f2d67bf4015c89075ab2e2c.tar.bz2
gentoo-2-4dc5f20975ec79734f2d67bf4015c89075ab2e2c.zip
Push out updated addon to fix baselayout-2 support #350399 by Martin Kolleck.
(Portage version: 2.2.0_alpha13/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'sys-fs/cryptsetup')
-rw-r--r--sys-fs/cryptsetup/ChangeLog10
-rw-r--r--sys-fs/cryptsetup/cryptsetup-1.1.3-r3.ebuild91
-rw-r--r--sys-fs/cryptsetup/files/1.1.3-dm-crypt-start.sh41
-rw-r--r--sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh20
4 files changed, 134 insertions, 28 deletions
diff --git a/sys-fs/cryptsetup/ChangeLog b/sys-fs/cryptsetup/ChangeLog
index e267545dd7cf..4586ee0e10d8 100644
--- a/sys-fs/cryptsetup/ChangeLog
+++ b/sys-fs/cryptsetup/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-fs/cryptsetup
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup/ChangeLog,v 1.107 2011/01/08 21:31:55 maekke Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup/ChangeLog,v 1.108 2011/01/12 23:36:42 vapier Exp $
+
+*cryptsetup-1.1.3-r3 (12 Jan 2011)
+
+ 12 Jan 2011; Mike Frysinger <vapier@gentoo.org>
+ files/1.1.3-dm-crypt-start.sh, +cryptsetup-1.1.3-r3.ebuild,
+ files/1.1.3-dm-crypt-stop.sh:
+ Push out updated addon to fix baselayout-2 support #350399 by Martin
+ Kolleck.
08 Jan 2011; Markus Meier <maekke@gentoo.org> cryptsetup-1.1.3-r2.ebuild:
arm stable, bug #350044
diff --git a/sys-fs/cryptsetup/cryptsetup-1.1.3-r3.ebuild b/sys-fs/cryptsetup/cryptsetup-1.1.3-r3.ebuild
new file mode 100644
index 000000000000..c74f8132407a
--- /dev/null
+++ b/sys-fs/cryptsetup/cryptsetup-1.1.3-r3.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/cryptsetup/cryptsetup-1.1.3-r3.ebuild,v 1.1 2011/01/12 23:36:42 vapier Exp $
+
+EAPI="2"
+
+inherit linux-info eutils multilib libtool
+
+MY_P=${P/_rc/-rc}
+DESCRIPTION="Tool to setup encrypted devices with dm-crypt"
+HOMEPAGE="http://code.google.com/p/cryptsetup/"
+SRC_URI="http://cryptsetup.googlecode.com/files/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~mips ppc ~ppc64 ~s390 ~sh ~sparc x86"
+IUSE="dynamic nls selinux"
+
+S=${WORKDIR}/${MY_P}
+
+DEPEND=">=sys-fs/lvm2-2.02.64
+ >=dev-libs/libgcrypt-1.1.42
+ >=dev-libs/libgpg-error-1.0-r1
+ >=dev-libs/popt-1.7
+ >=sys-fs/udev-124
+ || ( >=sys-libs/e2fsprogs-libs-1.41 <sys-fs/e2fsprogs-1.41 )
+ selinux? ( sys-libs/libselinux )
+ !sys-fs/cryptsetup-luks"
+
+pkg_setup() {
+ local CONFIG_CHECK="~DM_CRYPT ~CRYPTO ~CRYPTO_CBC"
+ local WARNING_DM_CRYPT="CONFIG_DM_CRYPT:\tis not set (required for cryptsetup)\n"
+ local WARNING_CRYPTO_CBC="CONFIG_CRYPTO_CBC:\tis not set (required for kernel 2.6.19)\n"
+ local WARNING_CRYPTO="CONFIG_CRYPTO:\tis not set (required for cryptsetup)\n"
+ check_extra_config
+
+ if use dynamic ; then
+ ewarn "If you need cryptsetup for an initrd or initramfs then you"
+ ewarn "should NOT use the dynamic USE flag"
+ epause 5
+ fi
+}
+
+src_prepare() {
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ --sbindir=/sbin \
+ --enable-shared \
+ $(use_enable !dynamic static) \
+ --libdir=/usr/$(get_libdir) \
+ $(use_enable nls) \
+ $(use_enable selinux)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc TODO ChangeLog # README NEWS # last ones are empty
+
+ insinto /$(get_libdir)/rcscripts/addons
+ newins "${FILESDIR}"/1.1.3-dm-crypt-start.sh dm-crypt-start.sh || die
+ newins "${FILESDIR}"/1.1.3-dm-crypt-stop.sh dm-crypt-stop.sh || die
+ newconfd "${FILESDIR}"/1.0.6-dmcrypt.confd dmcrypt || die
+ newinitd "${FILESDIR}"/1.0.5-dmcrypt.rc dmcrypt || die
+}
+
+pkg_postinst() {
+ ewarn "This ebuild introduces a new set of scripts and configuration"
+ ewarn "than the last version. If you are currently using /etc/conf.d/cryptfs"
+ ewarn "then you *MUST* copy your old file to:"
+ ewarn "/etc/conf.d/dmcrypt"
+ ewarn "Or your encrypted partitions will *NOT* work."
+ elog "Please see the example for configuring a LUKS mountpoint"
+ elog "in /etc/conf.d/dmcrypt"
+ elog
+ elog "If you are using baselayout-2 then please do:"
+ elog "rc-update add dmcrypt boot"
+ elog "This version introduces a command line arguement 'key_timeout'."
+ elog "If you want the search for the removable key device to timeout"
+ elog "after 10 seconds add the following to your bootloader config:"
+ elog "key_timeout=10"
+ elog "A timeout of 0 will mean it will wait indefinitely."
+ elog
+ elog "Users using cryptsetup-1.0.x (dm-crypt plain) volumes must use"
+ elog "a compatibility mode when using cryptsetup-1.1.x. This can be"
+ elog "done by specifying the cipher (-c), key size (-s) and hash (-h)."
+ elog "For more info, see http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions#6._Issues_with_Specific_Versions_of_cryptsetup"
+
+}
diff --git a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-start.sh b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-start.sh
index 536f3dfaa944..c78f0bcaedaf 100644
--- a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-start.sh
+++ b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-start.sh
@@ -1,20 +1,19 @@
# /lib/rcscripts/addons/dm-crypt-start.sh
-# For backwards compatability with baselayout < 1.13.0 #174256
-if [[ -z ${SVCNAME} ]] ; then
- case ${myservice} in
- ""|checkfs|localmount) SVCNAME=dmcrypt ;;
- *) SVCNAME=${myservice} ;;
- esac
-fi
-
-dm_crypt_execute_checkfs() {
- dm_crypt_execute_dmcrypt
-}
-
-dm_crypt_execute_volumes() {
- dm_crypt_execute_dmcrypt
-}
+# For backwards compatibility with baselayout < 1.13.0 #174256
+: ${SVCNAME:=${myservice}}
+
+# We might be hooked into init.d scripts (ala baselayout-1), or we might
+# be a standalone dmcrypt script. We support multiple dmcrypt instances,
+# but they must start with "dmcrypt." to be detected that way. It keeps
+# our lives much simpler with this multiplexed arrangement.
+execute_hook="dm_crypt_execute_dmcrypt"
+conf_file="dmcrypt"
+case ${SVCNAME} in
+ localmount) execute_hook="dm_crypt_execute_localmount" ;;
+ dmcrypt.*) conf_file="${SVCNAME}" ;;
+esac
+conf_file="/etc/conf.d/${conf_file}"
# Setup mappings for an individual target/swap
# Note: This relies on variables localized in the main body below.
@@ -260,7 +259,7 @@ do
esac
done
-if [[ -f /etc/conf.d/${SVCNAME} ]] && [[ -x /sbin/cryptsetup ]] ; then
+if [[ -f ${conf_file} ]] && [[ -x /sbin/cryptsetup ]] ; then
ebegin "Setting up dm-crypt mappings"
while read -u 3 targetline ; do
@@ -271,7 +270,7 @@ if [[ -f /etc/conf.d/${SVCNAME} ]] && [[ -x /sbin/cryptsetup ]] ; then
case ${targetline} in
target=*|swap=*)
# If we have a target queued up, then execute it
- dm_crypt_execute_${SVCNAME%.*}
+ ${execute_hook}
# Prepare for the next target/swap by resetting variables
unset gpg_options key loop_file target options pre_mount post_mount source swap remdev
@@ -290,16 +289,16 @@ if [[ -f /etc/conf.d/${SVCNAME} ]] && [[ -x /sbin/cryptsetup ]] ; then
;;
*)
- ewarn "Skipping invalid line in /etc/conf.d/${SVCNAME}: ${targetline}"
+ ewarn "Skipping invalid line in ${conf_file}: ${targetline}"
;;
esac
- # Queue this setting for the next call to dm_crypt_execute_${SVCNAME%.*}
+ # Queue this setting for the next call to dm_crypt_execute_xxx
eval "${targetline}"
- done 3< /etc/conf.d/${SVCNAME}
+ done 3< ${conf_file}
# If we have a target queued up, then execute it
- dm_crypt_execute_${SVCNAME%.*}
+ ${execute_hook}
ewend ${cryptfs_status} "Failed to setup dm-crypt devices"
fi
diff --git a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
index 138688bced2e..548269c0ae3b 100644
--- a/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
+++ b/sys-fs/cryptsetup/files/1.1.3-dm-crypt-stop.sh
@@ -1,15 +1,23 @@
# /lib/rcscripts/addons/dm-crypt-stop.sh
-# Fix for baselayout-1.12.10 (bug 174256)
+# For backwards compatibility with baselayout < 1.13.0 #174256
: ${SVCNAME:=${myservice}}
+# See notes in dm-crypt-start.sh
+execute_hook="dm_crypt_execute_dmcrypt"
+conf_file="dmcrypt"
+case ${SVCNAME} in
+ dmcrypt.*) conf_file="${SVCNAME}" ;;
+esac
+conf_file="/etc/conf.d/${conf_file}"
+
# Try to remove any dm-crypt mappings
csetup=/sbin/cryptsetup
-if [ -f /etc/conf.d/${SVCNAME} ] && [ -x "$csetup" ]
+if [ -f ${conf_file} ] && [ -x "$csetup" ]
then
einfo "Removing dm-crypt mappings"
- /bin/egrep "^(target|swap)" /etc/conf.d/${SVCNAME} | \
+ /bin/egrep "^(target|swap)" ${conf_file} | \
while read targetline
do
target=
@@ -18,16 +26,16 @@ then
eval ${targetline}
[ -n "${swap}" ] && target=${swap}
- [ -z "${target}" ] && ewarn "Invalid line in /etc/conf.d/${SVCNAME}: ${targetline}"
+ [ -z "${target}" ] && ewarn "Invalid line in ${conf_file}: ${targetline}"
ebegin "Removing dm-crypt mapping for: ${target}"
${csetup} remove ${target}
eend $? "Failed to remove dm-crypt mapping for: ${target}"
done
- if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" /etc/conf.d/${SVCNAME}) ]] ; then
+ if [[ -n $(/bin/egrep -e "^(source=)./dev/loop*" ${conf_file}) ]] ; then
einfo "Taking down any dm-crypt loop devices"
- /bin/egrep -e "^(source)" /etc/conf.d/${SVCNAME} | while read sourceline
+ /bin/egrep -e "^(source)" ${conf_file} | while read sourceline
do
source=
eval ${sourceline}