aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2019-03-09 21:47:00 +0100
committerThomas Deutschmann <whissi@gentoo.org>2019-03-09 21:50:00 +0100
commitf63dd6233d70692d56146a982b6a9dbd84012ff0 (patch)
tree01028e1ca96b62a5bbac480b478d063475f7367e
parentMisc improvements for FIRMWARE* handling (diff)
downloadgenkernel-f63dd623.tar.gz
genkernel-f63dd623.tar.bz2
genkernel-f63dd623.zip
Add LUKS2 support
LUKS2 requires libgcc_s.so.1 because libargon2 uses pthread_cancel. Re-use code from append_zfs instead of duplicating code. Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
-rwxr-xr-xgen_initramfs.sh51
1 files changed, 38 insertions, 13 deletions
diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 9b8f76c8..420e9fe3 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -507,19 +507,7 @@ append_zfs(){
fi
done
- # Copy binaries
- # Include libgcc_s.so.1 to workaround zfsonlinux/zfs#4749
- local libgccpath
- if type gcc-config 2>&1 1>/dev/null; then
- libgccpath="/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
- fi
- if [[ ! -f ${libgccpath} ]]; then
- libgccpath="/usr/lib/gcc/*/*/libgcc_s.so.1"
- fi
-
- copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zdb,zfs,zpool} ${libgccpath}
- cd "${TEMP}/initramfs-zfs-temp/lib64"
- ln -s "..${libgccpath}"
+ copy_binaries "${TEMP}/initramfs-zfs-temp" /sbin/{mount.zfs,zdb,zfs,zpool}
cd "${TEMP}/initramfs-zfs-temp/"
log_future_cpio_content
@@ -548,6 +536,38 @@ append_btrfs() {
rm -rf "${TEMP}/initramfs-btrfs-temp" > /dev/null
}
+append_libgcc_s() {
+ if [ -d "${TEMP}/initramfs-libgcc_s-temp" ]
+ then
+ rm -r "${TEMP}/initramfs-libgcc_s-temp"
+ fi
+
+ mkdir -p "${TEMP}/initramfs-libgcc_s-temp"
+
+ # Include libgcc_s.so.1:
+ # - workaround for zfsonlinux/zfs#4749
+ # - required for LUKS2 (libargon2 uses pthread_cancel)
+ local libgccpath
+ if type gcc-config 2>&1 1>/dev/null; then
+ libgccpath="/usr/lib/gcc/$(s=$(gcc-config -c); echo ${s%-*}/${s##*-})/libgcc_s.so.1"
+ fi
+ if [[ ! -f ${libgccpath} ]]; then
+ libgccpath="/usr/lib/gcc/*/*/libgcc_s.so.1"
+ fi
+
+ # Copy binaries
+ copy_binaries "${TEMP}/initramfs-libgcc_s-temp" ${libgccpath}
+ cd "${TEMP}/initramfs-libgcc_s-temp/lib64"
+ ln -s "..${libgccpath}"
+
+ cd "${TEMP}/initramfs-libgcc_s-temp/"
+ log_future_cpio_content
+ find . -print | cpio ${CPIO_ARGS} --append -F "${CPIO}" \
+ || gen_die "compressing libgcc_s cpio"
+ cd "${TEMP}"
+ rm -rf "${TEMP}/initramfs-libgcc_s-temp" > /dev/null
+}
+
append_linker() {
if [ -d "${TEMP}/initramfs-linker-temp" ]
then
@@ -990,6 +1010,11 @@ create_initramfs() {
append_data 'modprobed'
+ if isTrue "${ZFS}" || isTrue "${LUKS}"
+ then
+ append_data 'libgcc_s'
+ fi
+
if isTrue "${FIRMWARE}" && [ -n "${FIRMWARE_DIR}" ]
then
append_data 'firmware'