Date: Mon, 24 Jan 2022 21:39:57 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 261446] freebsd-update should not create boot environment when it's not making changes to the boot environment Message-ID: <bug-261446-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D261446 Bug ID: 261446 Summary: freebsd-update should not create boot environment when it's not making changes to the boot environment Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: delphij@FreeBSD.org I have noticed that f28f138905416c45ebaa6429f44a0b88a72f54b1 have implement= ed a feature that would create a new boot environment upon installation. While the feature itself is very useful, there are some scenarios that we d= on't want a new boot environment to be created unconditionally. One of these scenarios would be poudriere, which runs freebsd-update without jailing into the jails. I think the behavior should be disabled when -b is specified AND when it's = not /, because the boot environment is not going to be changed. I'd like to make the following feature requests: 1) Make the creation of boot environment to be named after both freebsd-ver= sion -k and freebsd-version -u results, in other words: diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh index 1776115d0776..a6f758813cd8 100644 --- a/usr.sbin/freebsd-update/freebsd-update.sh +++ b/usr.sbin/freebsd-update/freebsd-update.sh @@ -911,7 +911,7 @@ install_create_be () { esac if [ ${CREATEBE} =3D yes ]; then echo -n "Creating snapshot of existing boot environment... " - VERSION=3D`freebsd-version -k` + VERSION=3D`freebsd-version -ku | sort -V | tail -n = 1` TIMESTAMP=3D`date +"%Y-%m-%d_%H%M%S"` bectl create ${VERSION}_${TIMESTAMP} if [ $? -eq 0 ]; then 2) Make freebsd-update to not create boot environment when -b is specified = and the base directory is / 3) It's probably reasonable to have a RC script or periodic script to do something like: (bectl list -H | awk '{print $1;}' | grep -q $(freebsd-version -k) ) || bec= tl create $(freebsd-version -k)_$(date +%Y-%m-%d_%H%M%S) 4) There should be some way to clean up the automatically created boot environments. It makes sense to keep them around for e.g. a few weeks, but running out of disk space on / is not really fun. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-261446-227>