]>
git.proxmox.com Git - mirror_zfs.git/blob - contrib/dracut/90zfs/mount-zfs.sh.in
3 .
/lib
/dracut-zfs-lib.sh
13 # If sysroot.mount exists, the initial RAM disk configured
14 # it to mount ZFS on root. In that case, we bail early.
15 loadstate
="$(systemctl --system --show -p LoadState sysroot.mount || true)"
16 if [ "${loadstate}" = "LoadState=not-found" -o "${loadstate}" = "" ] ; then
17 info
"ZFS: sysroot.mount absent, mounting root with mount-zfs.sh"
19 info
"ZFS: sysroot.mount present, delegating root mount to it"
23 # Delay until all required block devices are present.
26 if [ "${root}" = "zfs:AUTO" ] ; then
27 ZFS_DATASET
="$(find_bootfs)"
28 if [ $?
-ne 0 ] ; then
29 zpool import
-N -a ${ZPOOL_IMPORT_OPTS}
30 ZFS_DATASET
="$(find_bootfs)"
31 if [ $?
-ne 0 ] ; then
32 warn
"ZFS: No bootfs attribute found in importable pools."
33 export_all || export_all
"-f"
39 info
"ZFS: Using ${ZFS_DATASET} as root."
42 ZFS_DATASET
="${ZFS_DATASET:-${root#zfs:}}"
43 ZFS_POOL
="${ZFS_DATASET%%/*}"
45 if import_pool
"${ZFS_POOL}" ; then
46 info
"ZFS: Mounting dataset ${ZFS_DATASET}..."
47 if mount_dataset
"${ZFS_DATASET}" ; then