pkgbase and automatic ZFS snapshots on upgrade

Hello,

I've been reading a bit on the new pkgbase system lately, and couldn't find an answer to the following: will there still be a mechanism that automatically creates a bootable ZFS snapshot whenever the base system is upgraded?

This a highly convenient feature of FreeBSD and I hope it will stay despite the deprecation of freebsd-update.
 
You do know that you can very easily create one by using bectl or vermaden's beadm, right? I realize that if you're used to it being automatic, it can seem a nuisance, but for me I find it relatively easy to remember to type
Code:
sudo bectl working-$(date +%F)
before upgrading.
Sorry, I realize this doesn't answer your question (as I don't know the answer), but there is that alternative (that is, manually creating the backup quickly before updating)
 
will there still be a mechanism that automatically creates a bootable ZFS snapshot whenever the base system is upgraded?
PKGBASE updates/upgrades are processed by ports-mgmt/pkg, at the moment there is no logic in pkg to create automatic ZFS boot environments as it is in /usr/sbin/freebsd-update [1]. I don't know if something similar is planed, perhaps ask on freebsd-pkgbase@ mailing list, or open an issue on https://github.com/freebsd/pkg.

[1]
Code:
    898         # Create a boot environment if enabled
    899         if [ ${BOOTENV} = yes ]; then
    900                 bectl check 2>/dev/null
    901                 case $? in
    902                         0)
    903                                 # Boot environment are supported
    904                                 CREATEBE=yes
    905                                 ;;
    906                         255)
    907                                 # Boot environments are not supported
    908                                 CREATEBE=no
    909                                 ;;
    910                         *)
    911                                 # If bectl returns an unexpected exit code, don't create a BE
    912                                 CREATEBE=no
    913                                 ;;
    914                 esac
    915                 if [ ${CREATEBE} = yes ]; then
    916                         echo -n "Creating snapshot of existing boot environment... "
    917                         VERSION=`freebsd-version -ku | sort -V | tail -n 1`
    918                         TIMESTAMP=`date +"%Y-%m-%d_%H%M%S"`
    919                         bectl create -r ${VERSION}_${TIMESTAMP}
    920                         if [ $? -eq 0 ]; then
    921                                 echo "done.";
    922                         else
    923                                 echo "failed."
    924                                 exit 1
    925                         fi
    926                 fi
    927         fi
 
Back
Top