aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2022-05-24 13:34:54 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2022-05-24 13:34:54 -0700
commitedefa80c999972b0dffdc5c9cf9d880156e6e0db (patch)
tree895cb2bb1364702ce171dce6e032d8d8f2cffdd5 /gen_initramfs.sh
parentarch: Copy s390 config to s390x (it's 64bit anyway!) (diff)
parentgenkernel: add keyctl support for loading LUKS passphrase into a keyring (diff)
downloadgenkernel-edefa80c999972b0dffdc5c9cf9d880156e6e0db.tar.gz
genkernel-edefa80c999972b0dffdc5c9cf9d880156e6e0db.tar.bz2
genkernel-edefa80c999972b0dffdc5c9cf9d880156e6e0db.zip
add keyctl support for loading LUKS passphrase into a keyring
Merges: https://github.com/gentoo/genkernel/pull/10 Closes: https://github.com/gentoo/genkernel/pull/10 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'gen_initramfs.sh')
-rwxr-xr-xgen_initramfs.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 0b74f4c..227badd 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -484,6 +484,7 @@ append_base_layout() {
isTrue "${ZFS}" && build_parameters+=( --zfs ) || build_parameters+=( --no-zfs )
isTrue "${SPLASH}" && build_parameters+=( --splash ) || build_parameters+=( --no-splash )
isTrue "${STRACE}" && build_parameters+=( --strace ) || build_parameters+=( --no-strace )
+ isTrue "${KEYCTL}" && build_parameters+=( --keyctl ) || build_parameters+=( --no-keyctl )
isTrue "${GPG}" && build_parameters+=( --gpg ) || build_parameters+=( --no-gpg )
isTrue "${LUKS}" && build_parameters+=( --luks ) || build_parameters+=( --no-luks )
isTrue "${FIRMWARE}" && build_parameters+=( --firmware ) || build_parameters+=( --no-firmware )
@@ -901,6 +902,33 @@ append_iscsi() {
fi
}
+append_keyutils() {
+ local PN=keyutils
+ local TDIR="${TEMP}/initramfs-${PN}-temp"
+ if [ -d "${TDIR}" ]
+ then
+ rm -r "${TDIR}" || gen_die "Failed to clean out existing '${TDIR}'!"
+ fi
+
+ populate_binpkg ${PN}
+
+ mkdir "${TDIR}" || gen_die "Failed to create '${TDIR}'!"
+
+ unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}"
+
+ cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!"
+
+ log_future_cpio_content
+ find . -print0 | "${CPIO_COMMAND}" ${CPIO_ARGS} --append -F "${CPIO_ARCHIVE}" \
+ || gen_die "Failed to append ${PN} to cpio!"
+
+ cd "${TEMP}" || die "Failed to chdir to '${TEMP}'!"
+ if isTrue "${CLEANUP}"
+ then
+ rm -rf "${TDIR}"
+ fi
+}
+
append_lvm() {
local PN=lvm
local TDIR="${TEMP}/initramfs-${PN}-temp"
@@ -2050,6 +2078,7 @@ create_initramfs() {
append_data 'e2fsprogs' "${E2FSPROGS}"
append_data 'gpg' "${GPG}"
append_data 'iscsi' "${ISCSI}"
+ append_data 'keyutils' "${KEYCTL}"
append_data 'luks' "${LUKS}"
append_data 'lvm' "${LVM}"
append_data 'bcache' "${BCACHE}"