Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs-initramfs: Support GRUB's native root=ZFS= #140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
zfs-initramfs: Support GRUB's native root=ZFS=
Upstream GRUB sets root=ZFS=rpool/path/to/rootfs by default.  By
supporting that syntax (while retaining the existing support for
backwards compatibility), we can work out-of-the-box.
  • Loading branch information
rlaager committed Feb 22, 2015
commit d3cab97ca061fac828a59cf5c3dda42c570fb454
@@ -0,0 +1,8 @@
for x in $(cat /proc/cmdline)
do
case $x in
root=ZFS=*)
BOOT=zfs
;;
esac
done
Expand Up @@ -75,6 +75,12 @@ mountroot()
ZFS_RPOOL=$(echo "$ZFS_RPOOL" | sed -e 's,/.*,,')
fi

if [ -z "$ZFS_RPOOL" ]
then
ZFS_BOOTFS=${ROOT#ZFS=}
ZFS_RPOOL=$(echo "$ZFS_BOOTFS" | sed -e 's,/.*,,')
fi

# Use "rpool" as the default, like on most Solaris systems.
[ -z "$ZFS_RPOOL" ] && ZFS_RPOOL='rpool'

Expand Down