diff -Naur genkernel-4.2.1.orig/defaults/initrd.scripts genkernel-4.2.1/defaults/initrd.scripts --- genkernel-4.2.1.orig/defaults/initrd.scripts 2021-03-27 22:09:40.000000000 +0900 +++ genkernel-4.2.1/defaults/initrd.scripts 2021-04-01 10:57:35.991418836 +0900 @@ -1843,6 +1843,12 @@ exit 1 fi + if [ $2 -gt 0 ] + then + eval local LUKS_NAME="$1_$2" + eval local OPENED_LOCKFILE='"${CRYPT_'${TYPE}'_OPENED_LOCKFILE}_$2"' + fi + while true do local gpg_cmd="" @@ -2344,7 +2350,11 @@ if [ -n "${CRYPT_ROOT}" ] then - openLUKS "root" + local crypt_index=0 + for CRYPT_ROOT in ${CRYPT_ROOTS}; do + openLUKS "root" ${crypt_index} + let crypt_index=${crypt_index}+1 + done if [ -n "${REAL_ROOT}" ] then # Rescan volumes @@ -2394,6 +2404,7 @@ write_env_file \ "${CRYPT_ENV_FILE}" \ CRYPT_ROOT \ + CRYPT_ROOTS \ CRYPT_ROOT_OPTIONS \ CRYPT_SILENT \ CRYPT_SWAP \ diff -Naur genkernel-4.2.1.orig/defaults/linuxrc genkernel-4.2.1/defaults/linuxrc --- genkernel-4.2.1.orig/defaults/linuxrc 2021-03-27 22:09:40.000000000 +0900 +++ genkernel-4.2.1/defaults/linuxrc 2021-04-01 10:57:00.067418026 +0900 @@ -214,8 +214,9 @@ ISCSI_NOIBFT=1 ;; # Crypto - crypt_root=*) - CRYPT_ROOT=${x#*=} + crypt_root=*|crypt_roots=*) + CRYPT_ROOT=${CRYPT_ROOT:=${x#*=}} + CRYPT_ROOTS="${CRYPT_ROOTS} ${x#*=}" USE_CRYPTSETUP=1 ;; crypt_root_options=*)