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

image: Option to set compatibility property for zpool #1099

Open
1 task done
einsibjarni opened this issue Dec 13, 2023 · 3 comments
Open
1 task done

image: Option to set compatibility property for zpool #1099

einsibjarni opened this issue Dec 13, 2023 · 3 comments

Comments

@einsibjarni
Copy link

Prerequisites

  • Have you checked for an existing issue describing your idea?

What is your proposal?

Add an option to set the compatibility property of zpool that poudriere image creates, i.e. compatibility="openzfs-2.1-freebsd"

What is the existing behavior, if any?

When running on FreeBSD 14+, if you try to create a FreeBSD 13.2-RELEASE image with zfs+gpt, it's unbootable since it enables features that the 13.2 bootloader doesn't support and no way to configure the features that are enabled (that I know of)

What is the motivation / use case for the change?

To create bootable zfs+gpt images for FreeBSD 13.2 on 14+

It's likely this problem will pop up again when new features are added to OpenZFS and merged in new major versions of FreeBSD

@jlduran
Copy link
Contributor

jlduran commented Jan 2, 2024

One possibility is to adapt the current script to use makefs -t zfs:

makefs -t zfs -s ${IMAGESIZE} \
    -o poolname="$ZFSPOOLNAME" -o bootfs=${zroot}/${ZFS_BEROOT_NAME}/${ZFS_BOOTFS_NAME} -o rootpath=/ \
    -o fs=${zroot}\;mountpoint=none \
    -o fs=${zroot}/${ZFS_BEROOT_NAME}\;mountpoint=none \
    -o fs=${zroot}/${ZFS_BEROOT_NAME}/${ZFS_BOOTFS_NAME}\;mountpoint=/ \
    -o fs=${zroot}/home\;mountpoint=/home \
    -o fs=${zroot}/tmp\;mountpoint=/tmp\;exec=on\;setuid=off \
    -o fs=${zroot}/usr\;mountpoint=/usr\;canmount=off \
    -o fs=${zroot}/usr/ports\;setuid=off \
    -o fs=${zroot}/usr/src \
    -o fs=${zroot}/usr/obj \
    -o fs=${zroot}/var\;mountpoint=/var\;canmount=off \
    -o fs=${zroot}/var/audit\;setuid=off\;exec=off \
    -o fs=${zroot}/var/crash\;setuid=off\;exec=off \
    -o fs=${zroot}/var/log\;setuid=off\;exec=off \
    -o fs=${zroot}/var/mail\;atime=on \
    -o fs=${zroot}/var/tmp\;setuid=off \
    ${WRKDIR}/raw.img ${WRKDIR}/world # XXX adapt

@einsibjarni
Copy link
Author

One possibility is to adapt the current script to use makefs -t zfs:

Would that work, even if poudriere runs 14.0, but the image created is 13.2? Is -o bootfs=${zroot}/${ZFS_BEROOT_NAME}/${ZFS_BOOTFS_NAME} the secret sauce?

@jlduran
Copy link
Contributor

jlduran commented Jan 5, 2024

We'll see... makefs has a few drawbacks:

  • Support for some characters in the pool name (I may have a fix for this one)
  • Need to run service zpoolreguid onestart to reguid the pool
  • Need to run service zpoolupgrade onestart to upgrade the pool features

The last two can also be seen as a feature.
In the meantime, I would prefer to keep using a custom pre-script that passes the compatibility option when creating the zpool (I think this is what you have been doing).
I would argue against adding too many options to the vanilla poudriere-image. Although, in this is case it is a valid argument, chances are, if you are going to do something more advanced with poudriere-image, you'll likely need a custom pre-script (-B flag) anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants