Skip to content

Conversation

@vozhyk-
Copy link
Contributor

@vozhyk- vozhyk- commented Jan 19, 2021

genkernel is often used to generate the initramfs on Gentoo.
An initramfs generated by genkernel accepts a ZFS root option
in the form of root=ZFS=<dataset>,
but does not accept root=zfs:<dataset>,
which is the default format for passing the root dataset
to the BE initramfs in zfsbootmenu.

For Gentoo BEs, make the default root prefix root=ZFS=,
which is accepted by both genkernel- and dracut-generated initramfs.

Users can still set the org.zfsbootmenu:rootprefix property
on <pool>/ROOT or the BE datasets to override the default.

Fixes: #136.

@vozhyk- vozhyk- marked this pull request as draft January 19, 2021 17:47
@vozhyk-
Copy link
Contributor Author

vozhyk- commented Jan 19, 2021

I have tested this manually on my Gentoo system by booting BEs with both genkernel and dracut initramfs. The root prefix property is not set, but the kernel/initramfs gets the root dataset in the expected (new default) format:

# zfs list -r -d 1 -o org.zfsbootmenu:rootprefix,org.zfsbootmenu:commandline xa/ROOT | uniq
ORG.ZFSBOOTMENU:ROOTPREFIX  ORG.ZFSBOOTMENU:COMMANDLINE
-                           dozfs=cache mem_sleep_default=deep
# cat /proc/cmdline
root=ZFS=xa/ROOT/gentoo-zfsbootmenu-test2 dozfs=cache mem_sleep_default=deep
# mount | grep ' / '
xa/ROOT/gentoo-zfsbootmenu-test2 on / type zfs (rw,relatime,xattr,noacl)

@vozhyk- vozhyk- marked this pull request as ready for review January 19, 2021 18:10
Copy link
Member

@zdykstra zdykstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indenting to be consistent with the rest of zfsbootmenu-lib.sh and then this is good to go. Thank you!

genkernel is often used to generate the initramfs on Gentoo.
An initramfs generated by genkernel accepts a ZFS root option
in the form of "root=ZFS=<dataset>",
but does not accept "root=zfs:<dataset>",
which is the default format for passing the root dataset
to the BE initramfs in zfsbootmenu.

For Gentoo BEs, make the default root prefix "root=ZFS=",
which is accepted by both genkernel- and dracut-generated initramfs.

Users can still set the "org.zfsbootmenu:rootprefix" property
on "<pool>/ROOT" or the BE datasets to override the default.

Fixes: zbm-dev#136.
@vozhyk- vozhyk- force-pushed the 136-use-genkernel-root-prefix-on-gentoo branch from b29cfac to d0cc1ff Compare January 19, 2021 18:21
@zdykstra zdykstra merged commit 6cf753f into zbm-dev:master Jan 19, 2021
@zdykstra
Copy link
Member

Your help getting this up-to-snuff for Gentoo is greatly appreciated!

@vozhyk-
Copy link
Contributor Author

vozhyk- commented Jan 19, 2021

Thank you too for the prompt replies and suggestions on solving problems!

@vozhyk- vozhyk- deleted the 136-use-genkernel-root-prefix-on-gentoo branch January 19, 2021 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pass root=ZFS= to the BE kernel on Gentoo

2 participants