commit:     0bb250ff921c5789e395e491530c23156a01fc3b
Author:     Hank Leininger <hlein <AT> korelogic <DOT> com>
AuthorDate: Fri Mar  4 03:20:22 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Mar 11 08:31:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0bb250ff

sys-fs/loop-aes: Version bump to 3.7w, minor Gentoo compat fixes

Upstream version bump added 5.16 support. Also, updates to the bundled
build-initrd.sh script to be compatible with Gentoo's install ISO kernel
(see bug).

Signed-off-by: Hank Leininger <hlein <AT> korelogic.com>
Closes: https://bugs.gentoo.org/834546
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Closes: https://github.com/gentoo/gentoo/pull/24399
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 sys-fs/loop-aes/Manifest                           |  1 +
 .../files/build-initrd_explicit-losetup.patch      | 28 +++++++++
 sys-fs/loop-aes/loop-aes-3.7w.ebuild               | 69 ++++++++++++++++++++++
 3 files changed, 98 insertions(+)

diff --git a/sys-fs/loop-aes/Manifest b/sys-fs/loop-aes/Manifest
index 25aeb63a47a7..529b8e4b6fbb 100644
--- a/sys-fs/loop-aes/Manifest
+++ b/sys-fs/loop-aes/Manifest
@@ -1 +1,2 @@
 DIST loop-AES-v3.7v.tar.bz2 378465 BLAKE2B 
01d9c3719242846696c1e199a02a42254c06472abce6cee7ccc3882e456921176f7469e9c61331193dd86ee2fcf0d24972f9012026eadad150a8e6116dd4e275
 SHA512 
62c0bafd97bc07d78d128ba3bbcf471bf16bd979264ad9180132b83f01a1e8d4f6d9aa874c602a00bc85360abfefe16f72b28b2c73cc2ad863ea2d36eb7bc478
+DIST loop-AES-v3.7w.tar.bz2 379844 BLAKE2B 
00877a1711afa0a232f6cf0d568fd667fe891393c4cf4602666c68169c71b4a1308806e37ce48f7e5372d5e2416be2f5f1a680302d6ccc795057ccc1d3716f4b
 SHA512 
882653341edba90a4717624382826296d490cd71d4e8843c9f44f606eda0d30a9e685a5310ed3b996b04ab9095d7be6adccff2a16f1c68a2349c052a69fd0a15

diff --git a/sys-fs/loop-aes/files/build-initrd_explicit-losetup.patch 
b/sys-fs/loop-aes/files/build-initrd_explicit-losetup.patch
new file mode 100644
index 000000000000..2cf2976b71fe
--- /dev/null
+++ b/sys-fs/loop-aes/files/build-initrd_explicit-losetup.patch
@@ -0,0 +1,28 @@
+--- loop-AES-v3.7v.orig/build-initrd.sh        2012-11-12 09:42:58.000000000 
-0700
++++ loop-AES-v3.7v/build-initrd.sh     2022-01-05 18:27:49.410016729 -0700
+@@ -884,7 +884,8 @@
+ 
+     dd if=/dev/zero of=tmp-i-$$ bs=1024 count=${y}
+     /sbin/mkfs -t minix -i 32 tmp-i-$$ ${y}
+-    mount -t minix tmp-i-$$ tmp-d-$$ -o 
loop=/dev/loop${DEVFSSLASH2}${TEMPLOOPINDEX}
++    losetup /dev/loop${DEVFSSLASH2}${TEMPLOOPINDEX} tmp-i-$$
++    mount -t minix /dev/loop${DEVFSSLASH2}${TEMPLOOPINDEX} tmp-d-$$
+ fi
+ cd tmp-d-$$
+ 
+@@ -978,6 +979,7 @@
+         if [ ${USEPIVOT} != 2 ] ; then
+             umount tmp-d-$$
+             rmdir tmp-d-$$
++            losetup -d /dev/loop${DEVFSSLASH2}${TEMPLOOPINDEX}
+             rm tmp-i-$$
+         else
+             rm -rf tmp-d-$$
+@@ -1002,6 +1004,7 @@
+     cd ..
+     df tmp-d-$$
+     umount tmp-d-$$
++    losetup -d /dev/loop${DEVFSSLASH2}${TEMPLOOPINDEX}
+     rmdir tmp-d-$$
+     sync ; sync ; sync
+     gzip -9 tmp-i-$$

diff --git a/sys-fs/loop-aes/loop-aes-3.7w.ebuild 
b/sys-fs/loop-aes/loop-aes-3.7w.ebuild
new file mode 100644
index 000000000000..c8931191f0a0
--- /dev/null
+++ b/sys-fs/loop-aes/loop-aes-3.7w.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-mod
+
+MY_P="${PN/aes/AES}-v${PV}"
+
+DESCRIPTION="Linux kernel module to encrypt disk partitions with AES cipher"
+HOMEPAGE="http://loop-aes.sourceforge.net/loop-AES.README";
+SRC_URI="http://loop-aes.sourceforge.net/loop-AES/${MY_P}.tar.bz2";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~sparc ~x86"
+IUSE="cpu_flags_x86_aes extra-ciphers keyscrub cpu_flags_x86_padlock"
+
+DEPEND="app-crypt/loop-aes-losetup"
+
+PATCHES=( "${FILESDIR}"/build-initrd_explicit-losetup.patch )
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+       linux-mod_pkg_setup
+
+       CONFIG_CHECK="!BLK_DEV_LOOP"
+       MODULE_NAMES="loop(block::tmp-d-kbuild)"
+       BUILD_TARGETS="all"
+
+       BUILD_PARAMS=" \
+               V=1 \
+               LINUX_SOURCE=\"${KERNEL_DIR}\" \
+               KBUILD_OUTPUT=\"${KBUILD_OUTPUT}\" \
+               USE_KBUILD=y MODINST=n RUNDM=n"
+       use cpu_flags_x86_aes && BUILD_PARAMS+=" INTELAES=y"
+       use keyscrub && BUILD_PARAMS+=" KEYSCRUB=y"
+       use cpu_flags_x86_padlock && BUILD_PARAMS+=" PADLOCK=y"
+
+       if use extra-ciphers; then
+               MODULE_NAMES="${MODULE_NAMES}
+                       loop_blowfish(block::tmp-d-kbuild)
+                       loop_serpent(block::tmp-d-kbuild)
+                       loop_twofish(block::tmp-d-kbuild)"
+               BUILD_PARAMS+=" EXTRA_CIPHERS=y"
+       fi
+}
+
+src_install() {
+       linux-mod_src_install
+
+       dodoc README
+       dodoc ChangeLog
+       dobin loop-aes-keygen
+       doman loop-aes-keygen.1
+
+       into /
+       dosbin build-initrd.sh
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+
+       einfo
+       einfo "For more instructions take a look at examples in README at:"
+       einfo "'${EPREFIX}/usr/share/doc/${PF}'"
+       einfo
+}

Reply via email to