History log of /freebsd-current/tools/build/beinstall.sh
Revision Date Author Comments
# b07689d1 08-Sep-2023 Ed Maste <emaste@FreeBSD.org>

beinstall: retire mergemaster support

Mergemaster has been deprecated for some time, and will be retired.

Reviewed by: kevans
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41799


# d0b2dbfa 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line sh pattern

Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/


# a0c50eda 18-Dec-2022 Joseph Mingrone <jrm@FreeBSD.org>

beinstall.sh: Check correct exit status

When retrieving the timestamp of the last commit using git-show(1), do
not pipe the output to head(1), otherwise the return value in $? will be
for head(1) and not git-show(1).

Approved by: bapt
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37742


# eb7f380f 30-Oct-2020 Mateusz Piotrowski <0mp@FreeBSD.org>

beinstall.sh: Use bectl instead of beadm by default

This patch also introduces an environment variable BE_UTILITY,
which can be used to specify the utility to use for managing
ZFS boot environments (which can be either bectl or beadm).

While here, fix some typos in the manual page and
remove beadm from section "SEE ALSO".

Reviewed by: bcr, kevans, rpokala
Approved by: will
Differential Revision: https://reviews.freebsd.org/D21111


# 1655b231 27-Oct-2020 Mateusz Piotrowski <0mp@FreeBSD.org>

Mount devfs inside a beinstall(8) chroot

It turns out that without /dev/null beinstall is not able to complete and
instead exits with messages similar to these:

--------------------------------------------------------------
>>> Installing kernel GENERIC completed on Sun Oct 25 17:47:37 CET 2020
--------------------------------------------------------------
/tmp/beinstall.JleGoP/mnt: Inspecting dirs /usr/src /usr/obj/usr/src/amd64.amd64
--- installworld ---
make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: Using cached toolchain metadata from build at t480 on Sun Oct 25 15:53:28 CET 2020
make[2]: "/dev/null" line 2: Need an operator
make[2]: Fatal errors encountered -- cannot continuemake[1]: "/usr/src/Makefile.inc1" line 593: CPUTYPE global should be set with ?=.
Cleaning up ...
umount -f /tmp/beinstall.JleGoP/mnt/usr/src /tmp/beinstall.JleGoP/mnt/usr/obj/usr/src/amd64.amd64 /tmp/beinstall.JleGoP/mnt
Destroyed successfully
error: Installworld failed!

Upon a bit of debugging, it turns out that /dev/null inside the chroot
environment is full random bytes, which cause "make -f /dev/null" to
misbehave. Mounting a proper devfs inside the chroot seems to be the most
appropriate way to fix it.

will@ also noted that this change requires that whatever is needed in devfs
must exist in the old kernel.

Approved by: will
MFC after: 2 week
Differential Revision: https://reviews.freebsd.org/D26944


# 1935b8f9 18-May-2019 Brad Davis <brd@FreeBSD.org>

Update beinstall to use the mergemaster/etcupdate from the source tree instead
of the installed one.

Approved by: will (mentor)
Differential Revision: https://reviews.freebsd.org/D20291


# 2728d630 27-Dec-2018 Will Andrews <will@FreeBSD.org>

beinstall: try to save progress from pkg updates.

This is primarily aimed at failed updates due to package conflicts, and
affects treatment of failed updates. Whereas before potentially a large
number of packages would need to be synced for each attempt, they can now
be persisted. Requires rsync. There may be better ways to implement this,
e.g. using secondary cache path that is only used on followup attempts and
then wiped on success, which avoids polluting current cache.


# 16702050 28-Jul-2018 Will Andrews <will@FreeBSD.org>

beinstall: perform pre-installworld steps.

Since all post-installkernel steps are assumed to operate in the updated
installation, it's necessary to chroot all of the followup steps in the new
boot environment. Set up and mount the source and object directories at the
same paths inside the BE root, and clean up to the extent changes were made.
This commit fixes upgrading using beinstall past the new ntpd user change.

Improve testability of changes to this script while I'm here.

Reported by: rpokala (earlier patch)


# fc3bfe91 27-Jul-2018 Eitan Adler <eadler@FreeBSD.org>

tools/build/beinstall.sh: Use some slightly better shell syntax; reduce duplication

This is is a first pass at improving the be installer.

Reviewed By: will
Differential Revision: https://reviews.freebsd.org/D16081


# 7d4a3185 30-Jun-2018 Will Andrews <will@FreeBSD.org>

beinstall: enable use with git worktrees.


# 1ff30c6a 18-Oct-2017 Brad Davis <brd@FreeBSD.org>

Teach beinstall to use and prefer svnlite, with a fallback to svn.

Approved by: will


# 462819bb 17-Jul-2016 Will Andrews <will@FreeBSD.org>

Add my beinstall script.

This is meant to install a new BE (boot environment) given a fully built
world/kernel. In addition to installing world and kernel in the new BE,
it also automatically performs /etc updates (using etcupdate or mergemaster)
and package updates (using pkg).

Because this process is performed in a new BE, it reduces the need for a
second reboot. It also means a reboot into a partially updated system (due
to install or hardware failure) can't happen.

Inspired by and similar in function to Solaris/illumos-style upgrades.