mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
ae26d0465a
To simplify the process of using zfs as your root filesystem a zfs-drucat sub-package has been added. This sub-package adds a zfs dracut module which allows your initramfs to be rebuilt with zfs support. The process for doing this is still complicated but there is clearly interest from the community about getting this working well and documented. This should help lay some of the groundwork. Longer term these changes should be pushed in the upstream dracut package. Once that occurs this subpackage will no longer be required for new systems, however we may want to conditionally build this package in the future for systems running older dracut versions. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
24 lines
519 B
Bash
Executable File
24 lines
519 B
Bash
Executable File
case "$root" in
|
|
zfs:FILESYSTEM=*|FILESYSTEM=*)
|
|
root="${root#zfs:}"
|
|
root="zfs:${root#FILESYSTEM=}"
|
|
rootfs="zfs"
|
|
rootok=1 ;;
|
|
zfs:ZFS=*|ZFS=*)
|
|
root="${root#zfs:}"
|
|
root="zfs:${root#ZFS=}"
|
|
rootfs="zfs"
|
|
rootok=1 ;;
|
|
esac
|
|
|
|
if [ "$rootok" != "1" ] ; then
|
|
zpool import -aN
|
|
zfsbootfs=`zpool list -H -o bootfs | grep -v ^-$ -m 1`
|
|
if [ -n "$zfsbootfs" ] ; then
|
|
root="zfs:$zfsbootfs"
|
|
rootfs="zfs"
|
|
rootok=1
|
|
fi
|
|
zpool list -H | while read fs rest ; do zpool export "$fs" ; done
|
|
fi
|