initramfs: fix import of additional zpools on boot

Currently all zpools defined in ZFS_INITRD_ADDITIONAL_DATASETS
aren't imported correctly if they are on an other zpool than
the root-pool. The mount fails hence the zpool is not known.
Initramfs asks know for the second decryption-key on boot for
second zpool.

Signed-off-by: theQuestionmark <17354322+theQuestionmark@users.noreply.github.com>
This commit is contained in:
theQuestionmark 2022-06-09 16:59:04 +02:00
parent f371cc18f8
commit 9c52dadbdd
1 changed files with 9 additions and 0 deletions

View File

@ -897,6 +897,15 @@ mountroot()
ZFS_RPOOL="${pool}"
fi
# We need to import additional zpools which aren't under root zpool, before mount_fs()
for add_zpool in $ZFS_INITRD_ADDITIONAL_DATASETS; do
add_zpool_base="${add_zpool%%/*}"
if [ "$add_zpool_base" != "$ZFS_RPOOL" ]
then
import_pool "${add_zpool_base}"
fi
done
# ----------------------------------------------------------------
# P R E P A R E R O O T F I L E S Y S T E M