Notes:
- the routine is personalised – things such as SDDM and graphics/drm-devel-kmod in the mix, and the longhand helps me to not make mistakes after being distracted (or falling asleep at the keyboard, or whatever)
/bin/csh
for all commands below, some no longer require root since I changed ownership of/usr/doc
,/usr/obj
,/usr/ports
, and/usr/src
.
Routine
- glance at https://cgit.freebsd.org/src/log/, https://cgit.freebsd.org/src/tree/UPDATING#n29, and https://cgit.freebsd.org/ports/tree/UPDATING#n5 to estimate whether it's a good time to update
su -
pkg lock -l
pkg unlock emulators/virtualbox-ose-kmod graphics/drm-510-kmod graphics/drm-515-kmod
chown -vR grahamperrin /usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG/usr/ports/
exit
git -C /usr/ports branch && git -C /usr/src branch
git -C /usr/ports pull --ff-only freebsd main && git -C /usr/src pull --ff-only freebsd main
- repeat step 8 until no changes are found
echo "" ; date ; uname -sr ; echo "shell: $SHELL" ; echo "" ; set freebsdmaingitcommitcount="`git -C /usr/src rev-list --first-parent --count HEAD`" && echo "freebsd/main (FreeBSD-CURRENT) Git commit count: $freebsdmaingitcommitcount" && set freebsdmaingithash="`git -C /usr/src rev-list --max-count=1 HEAD`" && echo "freebsd/main Git hash: $freebsdmaingithash" && echo "<https://cgit.freebsd.org/src/commit/?id=$freebsdmaingithash>" && echo "– in context: <https://cgit.freebsd.org/src/log/?qt=range&q=$freebsdmaingithash>"
cd /usr/src && time make -j4 buildworld > & buildworld.log && time make DISABLE_VULNERABILITIES=yes -j2 buildkernel > & buildkernel.log && tail buildworld.log && tail buildkernel.log
- continue using the desktop environment until completion of the builds
- check the tails of the first and second logs for sanity
sudo bectl create n"$freebsdmaingitcommitcount"-"$freebsdmaingithash"-a && sudo bectl activate n"$freebsdmaingitcommitcount"-"$freebsdmaingithash"-a && sudo bectl mount n"$freebsdmaingitcommitcount"-"$freebsdmaingithash"-a /tmp/up
sudo sysrc -R /tmp/up sddm_enable="NO"
sudo bectl umount n"$freebsdmaingitcommitcount"-"$freebsdmaingithash"-a && bectl list -c creation
- use bectl(8) to shorten the name of the boot environment – remove twenty-eight characters from the tail of the git hash, leave twelve
- restart the computer
- key Alt-F2 for ttyv1
- login
nextboot -o "-s"
cd /usr/src && time make installkernel > & installkernel.log && history -S && shutdown -r now
/bin/csh
mount -uw /
zfs mount -a
kldload radeonkms
setenv EDITOR /usr/local/bin/nano
tail /usr/src/installkernel.log
- check the tail of the third log for sanity
etcupdate -p
cd /usr/src && time make installworld > & installworld.log && etcupdate -B
tail -n 100 /usr/src/installworld.log
- check the tail of the fourth log for sanity
make -DBATCH_DELETE_OLD_FILES delete-old && exit
pkg search drm-510-kmod ; pkg search drm-515-kmod
pkg lock -l
pkg lock emulators/virtualbox-ose-kmod drm-510-kmod graphics/drm-515-kmod
pkg upgrade --yes && pkg clean -a && pkg autoremove
sysrc sddm_enable="YES" && history -S && reboot -r
- sign in to the desktop environment.
Additionally
For an existing poudriere jail named main with method src=/usr/src
to gain an update equal to its host:
sudo poudriere jail -u -j main
Then, have readily-available packages of ports that are special to you. For example:
sudo poudriere ports -u && sudo poudriere bulk -j main -b latest -Ct emulators/virtualbox-ose-kmod drm-510-kmod graphics/drm-515-kmod graphics/gpu-firmware-radeon-kmod@btc graphics/gpu-firmware-radeon-kmod@sumo graphics/gpu-firmware-radeon-kmod@turks
Retrospective
Originally
git -C /usr clone -o freebsd -b main --depth 1 https://git.freebsd.org/src.git src
One-off, 2021-03-02
git -C /usr/src pull --ff-only --unshallow
– https://lists.freebsd.org/pipermail/freebsd-current/2021-March/078985.html
One-off, 2021-03-10
After removing all source files:
git -C /usr clone -o freebsd -b main https://git.freebsd.org/src.git src