From nobody Tue Sep 20 22:19:49 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MXGFH3Gx3z4cR17 for ; Tue, 20 Sep 2022 22:20:03 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MXGFG4RPqz3Vlx; Tue, 20 Sep 2022 22:20:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id k3-20020a05600c1c8300b003b4fa1a85f8so107411wms.3; Tue, 20 Sep 2022 15:20:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=ONwegdLwly6e4zwA94wpT+sQIcHQBGhkR3fAbOblw3w=; b=ctfgU+uN9rnBjy+J6sd6aCHEf0mRvNg5G74k41i7NypLh367XUOO/f6XXyDPkFZqvB 06LbdRopysB5qU5Nm50oGJZd8b/foRwNQkLVvqMx5LNSVqp1Ba42hxakee5gRvy2d7wg XxeP8h1dQ5n9F+J/5QGosP9vb6u0blEKTLfdQzj52k9euFEj+vRq01q7AcZwzSSucaV8 XBgLP+E6SepaYucrjaTpmcNOalYrs8mJJoDGyksJSjFXPdK2L1/NSAQyS0qdn4ZUNDda wthItLcQggO7/g8LOrXMG3Jc/K/GPnTOZnOlM+NwUGEV+FXLunRl0so4vqvu20Fh/UI+ PrKA== X-Gm-Message-State: ACrzQf23/2IpBmtD2BymdjjqfRF6iJpk8pykVRV7pN31hnZOa+q+P4YR fwn1HoUkuysy4NoHuyBIbJ08yazubYwTGwoa5A7S6E4+zsU= X-Google-Smtp-Source: AMsMyM4TJe6NO3eSFWNjip4exfCYPIdIMy3HIwGoCzbKWwpSARAFDXSrAOtY2bLLDxLbxyKMzmYttctMq0CX6DSinNI= X-Received: by 2002:a7b:ca49:0:b0:3b4:7555:4dac with SMTP id m9-20020a7bca49000000b003b475554dacmr3833993wml.130.1663712400619; Tue, 20 Sep 2022 15:20:00 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Tue, 20 Sep 2022 16:19:49 -0600 Message-ID: Subject: Re: Good practices with bectl To: Nuno Teixeira Cc: FreeBSD CURRENT Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4MXGFG4RPqz3Vlx X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-2.65 / 15.00]; NEURAL_HAM_SHORT(-0.99)[-0.992]; NEURAL_HAM_LONG(-0.90)[-0.903]; NEURAL_HAM_MEDIUM(-0.75)[-0.753]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.43:from]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.43:from]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FROM_HAS_DN(0.00)[]; FREEFALL_USER(0.00)[asomers]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DMARC_NA(0.00)[freebsd.org]; RCVD_TLS_LAST(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N 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.XXXX # 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