Re: Good practices with bectl

2022-09-24 Thread Graham Perrin

On 24/09/2022 18:08, Nuno Teixeira wrote:


And src/tools/build/beinstall.sh too!

…






OpenPGP_signature
Description: OpenPGP digital signature


Re: Good practices with bectl

2022-09-24 Thread Graham Perrin

On 24/09/2022 14:47, Daniel Tameling wrote:

… Would it be possible to add this to the handbook? …


FreeBSD bug 263331 – Explain use of bectl (if using ZFS) in the updating 
FreeBSD section of the FreeBSD Handbook





OpenPGP_signature
Description: OpenPGP digital signature


Re: Good practices with bectl

2022-09-24 Thread Nuno Teixeira
And src/tools/build/beinstall.sh too!

beinstall.sh is just great:
`bectl list`:
---
 BE   Active Mountpoint Space Created
 14.0-CURRENT-20220924.142841 NR /  110G  2022-09-24 17:48
 default  -  -  2.41G 2021-07-06 11:03
---

Cheers

Daniel Tameling  escreveu no dia sábado,
24/09/2022 à(s) 14:47:

> On Wed, Sep 21, 2022 at 12:08:38PM +0100, Nuno Teixeira wrote:
> > Summary: Using bectl for upgrades
> >
> > RELEASE=Whatever
> > > bectl create ${RELEASE}
> > > bectl mount ${RELEASE}
> > BASEDIR=/tmp/be_mount. # Use mount point returned by bectl mount
> >
> > [freebsd-update method]
> > > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update \
> > upgrade -r ${RELEASE}
> > > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > # Ignore admonitions to reboot, since we're using a boot environment
> > > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > > bectl activate ${RELEASE}
> > #> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far
> away
> > to simply walk over and
> > switch to the old BE):
> > > reboot
> >
> > [upgrade from source method]
> > > make DESTDIR=${BASEDIR} installkernel
> > > etcupdate -p -D $BASEDIR
> > > make DESTDIR=${BASEDIR} installworld
> > > etcupdate -D $BASEDIR
> > > make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old
> > delete-old-libs
> > > bectl activate ${RELEASE}
> > #> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far
> away
> > to simply walk over and
> > switch to the old BE):
> > > reboot
> >
>
> Would it be possible to add this to the handbook? I know that I will be
> looking for it when I upgrade next time.
>
> Best regards,
> Daniel
>
>

-- 
Nuno Teixeira
FreeBSD Committer (ports)


Re: Good practices with bectl

2022-09-24 Thread Daniel Tameling
On Wed, Sep 21, 2022 at 12:08:38PM +0100, Nuno Teixeira wrote:
> Summary: Using bectl for upgrades
> 
> RELEASE=Whatever
> > bectl create ${RELEASE}
> > bectl mount ${RELEASE}
> BASEDIR=/tmp/be_mount. # Use mount point returned by bectl mount
> 
> [freebsd-update method]
> > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update \
> upgrade -r ${RELEASE}
> > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
> # Ignore admonitions to reboot, since we're using a boot environment
> > freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
> > bectl activate ${RELEASE}
> #> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far away
> to simply walk over and
> switch to the old BE):
> > reboot
> 
> [upgrade from source method]
> > make DESTDIR=${BASEDIR} installkernel
> > etcupdate -p -D $BASEDIR
> > make DESTDIR=${BASEDIR} installworld
> > etcupdate -D $BASEDIR
> > make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old
> delete-old-libs
> > bectl activate ${RELEASE}
> #> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far away
> to simply walk over and
> switch to the old BE):
> > reboot
> 

Would it be possible to add this to the handbook? I know that I will be looking 
for it when I upgrade next time.

Best regards,
Daniel



Re: Good practices with bectl

2022-09-21 Thread Nuno Teixeira
Summary: Using bectl for upgrades

RELEASE=Whatever
> bectl create ${RELEASE}
> bectl mount ${RELEASE}
BASEDIR=/tmp/be_mount. # Use mount point returned by bectl mount

[freebsd-update method]
> freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update \
upgrade -r ${RELEASE}
> freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
# Ignore admonitions to reboot, since we're using a boot environment
> freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
> bectl activate ${RELEASE}
#> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far away
to simply walk over and
switch to the old BE):
> reboot

[upgrade from source method]
> make DESTDIR=${BASEDIR} installkernel
> etcupdate -p -D $BASEDIR
> make DESTDIR=${BASEDIR} installworld
> etcupdate -D $BASEDIR
> make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old
delete-old-libs
> bectl activate ${RELEASE}
#> bectl activate -t ${RELEASE} # Failsafe (if the machine is too far away
to simply walk over and
switch to the old BE):
> reboot

Alexander Leidinger  escreveu no dia quarta,
21/09/2022 à(s) 11:45:

> Quoting David Wolfskill  (from Wed, 21 Sep 2022
> 03:25:52 -0700):
>
> > On Wed, Sep 21, 2022 at 11:27:06AM +0200, Alexander Leidinger wrote:
> >>   ...
> >> make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old
> delete-old-libs
> >>
> >> Usually I replace the delete-old-libs with check-old, as I don't want
> >> to blindly delete them (some ports may depend on them... at least for
> >> the few libs which don't have symbol versioning).
> >> 
> >
> > A way to address that issue that may work for you is to install
> > appropriate misc/compat* ports/packages.
>
> I'm running exclusively on -current. In the cases where this happens,
> there are no compat packages yet. And I rather update the ports than
> to install a compat package. It doesn't hurt me to keep the libs
> during the pkg rebuild.
>
> In the generic case I prefer to stay safe and keep the libs until I
> validated that nothing uses them anymore. That's the reason why I made
> the delete-old-libs functionality separate from delete-old already in
> the initial implementation.
>
> Bye,
> Alexander.
> --
> http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
> http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF
>


-- 
Nuno Teixeira
FreeBSD Committer (ports)


Re: Good practices with bectl

2022-09-21 Thread Renato Botelho

On 20/09/22 19:19, Alan Somers wrote:

On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira  wrote:


Hello to all,

I will use becl for the first time for current upgrades.
Just to check that I'm thinking correctly:

Create a test environment for upgrade:

bectl create -r test (should I use '-r'?)

Activate test:

bectl activate test
reboot

...

upgrade OS on test
reboot

...
if a problem happens, reboot default from BE loader
---
if everything fine destroy default and rename test to default

bectl destroy -o default
bectl rename test default

repeat on next upgrade

Don't know if a faster way exists with chroot or bectl jail...

Any hints appreciated.

Thanks,
--
Nuno Teixeira
FreeBSD Committer (ports)


I don't think you need to use "-r".  Also, you're forgetting one of
the best things about boot environments: you can upgrade them even
when not booted into them.  That's faster than upgrading the running
BE.  Here is the procedure I use:

RELEASE=Whatever
sudo bectl create ${RELEASE}
sudo bectl mount ${RELEASE}
BASEDIR=/tmp/be_mount.# Use mount point returned by bectl mount
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
upgrade -r ${RELEASE}
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
# Ignore admonitions to reboot, since we're using a boot environment
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
sudo bectl activate ${RELEASE}


I like to use `sudo bectl activate -t ${RELEASE}`, it activates new 
partition to be ROOT only for the next boot.  If something goes wrong, 
you just need to power cycle the machine and it will boot on previous 
partition.


After a success boot you must run `sudo bectl activate RELEASE` again to 
make it permanent.



sudo reboot

This general procedure works just as well if you're upgrading from source, too.

sudo make DESTDIR=${BASEDIR} installworld
sudo mergemaster -m $PWD -D $BASEDIR -U

-Alan







Re: Good practices with bectl

2022-09-21 Thread Alexander Leidinger
Quoting David Wolfskill  (from Wed, 21 Sep 2022  
03:25:52 -0700):



On Wed, Sep 21, 2022 at 11:27:06AM +0200, Alexander Leidinger wrote:

  ...
make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old delete-old-libs

Usually I replace the delete-old-libs with check-old, as I don't want
to blindly delete them (some ports may depend on them... at least for
the few libs which don't have symbol versioning).



A way to address that issue that may work for you is to install
appropriate misc/compat* ports/packages.


I'm running exclusively on -current. In the cases where this happens,  
there are no compat packages yet. And I rather update the ports than  
to install a compat package. It doesn't hurt me to keep the libs  
during the pkg rebuild.


In the generic case I prefer to stay safe and keep the libs until I  
validated that nothing uses them anymore. That's the reason why I made  
the delete-old-libs functionality separate from delete-old already in  
the initial implementation.


Bye,
Alexander.
--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


pgpNgN_xBrE1T.pgp
Description: Digitale PGP-Signatur


Re: Good practices with bectl

2022-09-21 Thread David Wolfskill
On Wed, Sep 21, 2022 at 11:27:06AM +0200, Alexander Leidinger wrote:
>   ...
> make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old delete-old-libs
> 
> Usually I replace the delete-old-libs with check-old, as I don't want  
> to blindly delete them (some ports may depend on them... at least for  
> the few libs which don't have symbol versioning).
> 

A way to address that issue that may work for you is to install
appropriate misc/compat* ports/packages.

Peace,
david
-- 
David H. Wolfskill  da...@catwhisker.org
In 2022, the governors of Texas and Florida resurrect the racist
ploys of the "White Citizens’ Council" of 1962 -- at taxpayers' expense.

See https://www.catwhisker.org/~david/publickey.gpg for my public key.


signature.asc
Description: PGP signature


Re: Good practices with bectl

2022-09-21 Thread Alexander Leidinger
Quoting Alan Somers  (from Tue, 20 Sep 2022  
16:19:49 -0600):



sudo bectl activate ${RELEASE}


Failsafe (if the machine is too far away to simply walk over and  
switch to the old BE):

bectl activate -t ${RELEASE}

Needs an activate without -t later.

Bye,
Alexander.

--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


pgpXQ2xA9dSvy.pgp
Description: Digitale PGP-Signatur


Re: Good practices with bectl

2022-09-21 Thread Alexander Leidinger
 Quoting Nuno Teixeira  (from Wed, 21 Sep 2022  
00:11:41 +0100):



(...)
   maybe:
   > yes | make DESTDIR=${BASEDIR} delete-old delete-old-libs


make DESTDIR=${BASEDIR} -DBATCH_DELETE_OLD_FILES delete-old delete-old-libs

Usually I replace the delete-old-libs with check-old, as I don't want  
to blindly delete them (some ports may depend on them... at least for  
the few libs which don't have symbol versioning).


Bye,
Alexander.
--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


pgpXRih39w_V7.pgp
Description: Digitale PGP-Signatur


Re: Good practices with bectl

2022-09-21 Thread Felix Palmen
* Nuno Teixeira  [20220921 00:11]:
> (...)
> maybe:
> > yes | make DESTDIR=${BASEDIR} delete-old delete-old-libs

Exactly, DESTDIR is used by all the targets.

BTW, you can just set BATCH_DELETE_OLD_FILES=yes (either on the
command-line or in make.conf) instead of using "yes" here.

-- 
 Felix Palmen  {private}   fe...@palmen-it.de
 -- ports committer (mentee) --{web}  http://palmen-it.de
 {pgp public key}  http://palmen-it.de/pub.txt
 {pgp fingerprint} 6936 13D5 5BBF 4837 B212  3ACC 54AD E006 9879 F231


signature.asc
Description: PGP signature


Re: Good practices with bectl

2022-09-20 Thread Graham Perrin

On 21/09/2022 01:47, Graham Perrin wrote:


On 20/09/2022 23:14, Nuno Teixeira wrote:


Hello to all,

I will use becl for the first time for current upgrades.
Just to check that I'm thinking correctly:

Create a test environment for upgrade:
> bectl create -r test (should I use '-r'?)
Activate test:
> bectl activate test
> reboot
...
> upgrade OS on test
…
If using freebsd-update(8) to perform the upgrade: please be aware 
that, with recent releases of the OS, there's automated creation of a 
snapshot of a boot environment.


, 
CreateBootEnv


Omitted from release notes; sorry.

True: no freebsd-update for CURRENT, however I'm raising awareness of 
the automation. (My own experience: a habit adopted with CURRENT might 
be accidentally repeated with RELEASE.)


For updates/upgrades to CURRENT: I do prefer to create, activate then 
boot an environment before installing.




With the alternative (a snapshot that's not active), and a Default boot 
environment, things can become confusing when the preferred environment 
is no longer Default, especially if (in rare situations) Default becomes 
no longer bootable. Need to think _very_ carefully about names and the 
appropriateness of renaming.




OpenPGP_signature
Description: OpenPGP digital signature


Re: Good practices with bectl

2022-09-20 Thread Graham Perrin

On 20/09/2022 23:14, Nuno Teixeira wrote:


Hello to all,

I will use becl for the first time for current upgrades.
Just to check that I'm thinking correctly:

Create a test environment for upgrade:
> bectl create -r test (should I use '-r'?)
Activate test:
> bectl activate test
> reboot
...
> upgrade OS on test
…
If using freebsd-update(8) to perform the upgrade: please be aware that, 
with recent releases of the OS, there's automated creation of a snapshot 
of a boot environment.


, 
CreateBootEnv


Omitted from release notes; sorry.



OpenPGP_signature
Description: OpenPGP digital signature


beinstall(8) (was: Good practices with bectl)

2022-09-20 Thread Graham Perrin

On 21/09/2022 00:17, Paul Mather wrote:

… a handy tool in /usr/src/tools/build that can be used as a wrapper 
to install a SRC build into a new boot environment. It's 
/usr/src/tools/build/beinstall.sh (see man beinstall(8) for details). …


Thanks. FYI:

beinstall.sh(8) should be in the FreeBSD Handbook


beinstall.sh with a port: installkernel failed, chrooted make in 
/tmp/beinstall.⋯/mnt failed





OpenPGP_signature
Description: OpenPGP digital signature


Re: Good practices with bectl

2022-09-20 Thread Nuno Teixeira
Hi Paul,

Really nice! I will test it soon.

Cheers

Paul Mather  escreveu no dia quarta, 21/09/2022
à(s) 00:17:

> On Sep 20, 2022, at 6:19 PM, Alan Somers  wrote:
>
> > On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira 
> wrote:
> >>
> >> Hello to all,
> >>
> >> I will use becl for the first time for current upgrades.
> >> Just to check that I'm thinking correctly:
> >>
> >> Create a test environment for upgrade:
> >>> bectl create -r test (should I use '-r'?)
> >> Activate test:
> >>> bectl activate test
> >>> reboot
> >> ...
> >>> upgrade OS on test
> >>> reboot
> >> ...
> >> if a problem happens, reboot default from BE loader
> >> ---
> >> if everything fine destroy default and rename test to default
> >>> bectl destroy -o default
> >>> bectl rename test default
> >> repeat on next upgrade
> >>
> >> Don't know if a faster way exists with chroot or bectl jail...
> >>
> >> Any hints appreciated.
> >>
> >> Thanks,
> >> --
> >> Nuno Teixeira
> >> FreeBSD Committer (ports)
> >
> > I don't think you need to use "-r".  Also, you're forgetting one of
> > the best things about boot environments: you can upgrade them even
> > when not booted into them.  That's faster than upgrading the running
> > BE.  Here is the procedure I use:
> >
> > RELEASE=Whatever
> > sudo bectl create ${RELEASE}
> > sudo bectl mount ${RELEASE}
> > BASEDIR=/tmp/be_mount.# Use mount point returned by bectl mount
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> > upgrade -r ${RELEASE}
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > # Ignore admonitions to reboot, since we're using a boot environment
> > sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> install
> > sudo bectl activate ${RELEASE}
> > sudo reboot
> >
> > This general procedure works just as well if you're upgrading from
> source, too.
> >
> > sudo make DESTDIR=${BASEDIR} installworld
> > sudo mergemaster -m $PWD -D $BASEDIR -U
>
>
> There's even a handy tool in /usr/src/tools/build that can be used as a
> wrapper to install a SRC build into a new boot environment.  It's
> /usr/src/tools/build/beinstall.sh (see man beinstall(8) for details).  It
> will create a new boot environment from a source build, run etcupdate and
> so forth, and even mark the new boot environment as the one to be active on
> reboot.  All you need to do is reboot.  I've been using it for source
> upgrades for a while now without problems.  The best thing, for me, is it
> cuts out all that time doing "make installworld" and etcupdate in single
> user mode, thus minimising downtime.
>
> Cheers,
>
> Paul.
>
>
>

-- 
Nuno Teixeira
FreeBSD Committer (ports)


Re: Good practices with bectl

2022-09-20 Thread Paul Mather
On Sep 20, 2022, at 6:19 PM, Alan Somers  wrote:

> On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira  wrote:
>> 
>> Hello to all,
>> 
>> I will use becl for the first time for current upgrades.
>> Just to check that I'm thinking correctly:
>> 
>> Create a test environment for upgrade:
>>> bectl create -r test (should I use '-r'?)
>> Activate test:
>>> bectl activate test
>>> reboot
>> ...
>>> upgrade OS on test
>>> reboot
>> ...
>> if a problem happens, reboot default from BE loader
>> ---
>> if everything fine destroy default and rename test to default
>>> bectl destroy -o default
>>> bectl rename test default
>> repeat on next upgrade
>> 
>> Don't know if a faster way exists with chroot or bectl jail...
>> 
>> Any hints appreciated.
>> 
>> Thanks,
>> --
>> Nuno Teixeira
>> FreeBSD Committer (ports)
> 
> I don't think you need to use "-r".  Also, you're forgetting one of
> the best things about boot environments: you can upgrade them even
> when not booted into them.  That's faster than upgrading the running
> BE.  Here is the procedure I use:
> 
> RELEASE=Whatever
> sudo bectl create ${RELEASE}
> sudo bectl mount ${RELEASE}
> BASEDIR=/tmp/be_mount.# Use mount point returned by bectl mount
> sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
> upgrade -r ${RELEASE}
> sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
> # Ignore admonitions to reboot, since we're using a boot environment
> sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
> sudo bectl activate ${RELEASE}
> sudo reboot
> 
> This general procedure works just as well if you're upgrading from source, 
> too.
> 
> sudo make DESTDIR=${BASEDIR} installworld
> sudo mergemaster -m $PWD -D $BASEDIR -U


There's even a handy tool in /usr/src/tools/build that can be used as a wrapper 
to install a SRC build into a new boot environment.  It's 
/usr/src/tools/build/beinstall.sh (see man beinstall(8) for details).  It will 
create a new boot environment from a source build, run etcupdate and so forth, 
and even mark the new boot environment as the one to be active on reboot.  All 
you need to do is reboot.  I've been using it for source upgrades for a while 
now without problems.  The best thing, for me, is it cuts out all that time 
doing "make installworld" and etcupdate in single user mode, thus minimising 
downtime.

Cheers,

Paul.




Re: Good practices with bectl

2022-09-20 Thread Nuno Teixeira
(...)
maybe:
> yes | make DESTDIR=${BASEDIR} delete-old delete-old-libs

Nuno Teixeira  escreveu no dia quarta, 21/09/2022 à(s)
00:09:

> Hi Alan,
>
> This general procedure works just as well if you're upgrading from source,
>> too.
>>
>> sudo make DESTDIR=${BASEDIR} installworld
>> sudo mergemaster -m $PWD -D $BASEDIR -U
>>
>
> (mergemaster -m  -D )
>
> using etcupdate:
> (etcupdate -s  -D ), source defaults to /usr/src
>
> > etcupdate -D $BASEDIR
>
> Need to find how to execute:
> `make delete-old delete-old-libs` since $BASEDIR don't have /usr/src
>
> Thanks
> --
> Nuno Teixeira
> FreeBSD Committer (ports)
>


-- 
Nuno Teixeira
FreeBSD Committer (ports)


Re: Good practices with bectl

2022-09-20 Thread Nuno Teixeira
Hi Alan,

This general procedure works just as well if you're upgrading from source,
> too.
>
> sudo make DESTDIR=${BASEDIR} installworld
> sudo mergemaster -m $PWD -D $BASEDIR -U
>

(mergemaster -m  -D )

using etcupdate:
(etcupdate -s  -D ), source defaults to /usr/src

> etcupdate -D $BASEDIR

Need to find how to execute:
`make delete-old delete-old-libs` since $BASEDIR don't have /usr/src

Thanks
-- 
Nuno Teixeira
FreeBSD Committer (ports)


Re: Good practices with bectl

2022-09-20 Thread Alan Somers
On Tue, Sep 20, 2022 at 4:14 PM Nuno Teixeira  wrote:
>
> Hello to all,
>
> I will use becl for the first time for current upgrades.
> Just to check that I'm thinking correctly:
>
> Create a test environment for upgrade:
> > bectl create -r test (should I use '-r'?)
> Activate test:
> > bectl activate test
> > reboot
> ...
> > upgrade OS on test
> > reboot
> ...
> if a problem happens, reboot default from BE loader
> ---
> if everything fine destroy default and rename test to default
> > bectl destroy -o default
> > bectl rename test default
> repeat on next upgrade
>
> Don't know if a faster way exists with chroot or bectl jail...
>
> Any hints appreciated.
>
> Thanks,
> --
> Nuno Teixeira
> FreeBSD Committer (ports)

I don't think you need to use "-r".  Also, you're forgetting one of
the best things about boot environments: you can upgrade them even
when not booted into them.  That's faster than upgrading the running
BE.  Here is the procedure I use:

RELEASE=Whatever
sudo bectl create ${RELEASE}
sudo bectl mount ${RELEASE}
BASEDIR=/tmp/be_mount.# Use mount point returned by bectl mount
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update
upgrade -r ${RELEASE}
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
# Ignore admonitions to reboot, since we're using a boot environment
sudo freebsd-update -b ${BASEDIR} -d ${BASEDIR}/var/db/freebsd-update install
sudo bectl activate ${RELEASE}
sudo reboot

This general procedure works just as well if you're upgrading from source, too.

sudo make DESTDIR=${BASEDIR} installworld
sudo mergemaster -m $PWD -D $BASEDIR -U

-Alan



Good practices with bectl

2022-09-20 Thread Nuno Teixeira
Hello to all,

I will use becl for the first time for current upgrades.
Just to check that I'm thinking correctly:

Create a test environment for upgrade:
> bectl create -r test (should I use '-r'?)
Activate test:
> bectl activate test
> reboot
...
> upgrade OS on test
> reboot
...
if a problem happens, reboot default from BE loader
---
if everything fine destroy default and rename test to default
> bectl destroy -o default
> bectl rename test default
repeat on next upgrade

Don't know if a faster way exists with chroot or bectl jail...

Any hints appreciated.

Thanks,
-- 
Nuno Teixeira
FreeBSD Committer (ports)