Commit 4fd412c9 authored by Rasmus Thomsen's avatar Rasmus Thomsen

initramfs-init: fix importing the root pool

We accidentally used $_root_vol instead of $_root_pol for force importing.
Also import (but without -f) if we don't force import as this is required
on some setups. Add -d /dev as this is required for zpool to find the
pool if you have defined some subvolume as partition (e.g. for VMs)
parent 59204d36
......@@ -284,11 +284,15 @@ prepare_zfs_root() {
local _root_vol=${KOPT_root#ZFS=}
local _root_pool=${_rool_vol%%/*}
# Force import if this has been imported on a different system previously
# Force import if this has been imported on a different system previously.
# Import normally otherwise
if [ "$KOPT_zfs_force" = 1 ]; then
zpool import -N -f $_root_vol
zpool import -N -d /dev -f $_root_pool
else
zpool import -N -d /dev $_root_pool
fi
# Ask for encryption password
if [ $(zpool list -H -o feature@encryption $_root_pool) = "active" ]; then
local _encryption_root=$(zfs get -H -o value encryptionroot $_root_vol)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment