Commit Graph

10 Commits

Author SHA1 Message Date
Joseph Mingrone
a0c50eda29
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
2023-01-03 10:27:53 -04:00
Mateusz Piotrowski
eb7f380f12 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
2020-10-30 09:40:55 +00:00
Mateusz Piotrowski
1655b2314e 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
2020-10-27 09:32:06 +00:00
Brad Davis
1935b8f92e 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
2019-05-18 17:13:08 +00:00
Will Andrews
2728d6307d 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.
2018-12-27 23:27:48 +00:00
Will Andrews
16702050ac 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)
2018-07-29 01:44:26 +00:00
Eitan Adler
fc3bfe916e 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
2018-07-28 00:33:40 +00:00
Will Andrews
7d4a3185c9 beinstall: enable use with git worktrees. 2018-07-01 01:09:52 +00:00
Brad Davis
1ff30c6af0 Teach beinstall to use and prefer svnlite, with a fallback to svn.
Approved by:	will
2017-10-18 15:48:26 +00:00
Will Andrews
462819bb16 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.
2016-07-18 02:13:57 +00:00