aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/freebsd-update/freebsd-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/freebsd-update/freebsd-update.sh')
-rw-r--r--usr.sbin/freebsd-update/freebsd-update.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/freebsd-update/freebsd-update.sh b/usr.sbin/freebsd-update/freebsd-update.sh
index 1776115d0776..9743cd652d16 100644
--- a/usr.sbin/freebsd-update/freebsd-update.sh
+++ b/usr.sbin/freebsd-update/freebsd-update.sh
@@ -890,7 +890,12 @@ install_check_params () {
install_create_be () {
# Figure out if we're running in a jail and return if we are
if [ `sysctl -n security.jail.jailed` = 1 ]; then
- return 1
+ return 1
+ fi
+ # Operating on roots that aren't located at / will, more often than not,
+ # not touch the boot environment.
+ if [ "$BASEDIR" != "/" ]; then
+ return 1
fi
# Create a boot environment if enabled
if [ ${BOOTENV} = yes ]; then
@@ -911,7 +916,7 @@ install_create_be () {
esac
if [ ${CREATEBE} = yes ]; then
echo -n "Creating snapshot of existing boot environment... "
- VERSION=`freebsd-version -k`
+ VERSION=`freebsd-version -ku | sort -V | tail -n 1`
TIMESTAMP=`date +"%Y-%m-%d_%H%M%S"`
bectl create ${VERSION}_${TIMESTAMP}
if [ $? -eq 0 ]; then