Notes:
- the routine is personalised – things such as SDDM and graphics/x11/nvidia-driver-470 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
.
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/ ; chown -vR grahamperrin /usr/obj/usr/src/amd64.amd64/sys/GENERIC/usr/ports/
exit
git -C /usr/doc branch -vv | grep \* && git -C /usr/ports branch -vv | grep \* && git -C /usr/src branch -vv | grep \*
- if necessary, switch
/usr/ports
and/usr/src/
tomain
git -C /usr/src reset --hard HEAD
git -C /usr/ports pull --ff-only freebsd main && git -C /usr/src pull --ff-only freebsd main
- repeat step 9 until no changes are found
- 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
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>"
git -C /usr/src stash apply 0
cd /usr/src && time make -j 16 buildworld | tee /var/log/buildworld.log > /dev/null && time make DISABLE_VULNERABILITIES=yes -j 16 buildkernel | tee /var/log/buildkernel.log > /dev/null && grep -C 2 completed\ on /var/log/buildworld.log && grep -C 2 completed\ on /var/log/buildkernel.log
- continue using the desktop environment until completion of the builds
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 -j 200 installkernel | tee /var/log/installkernel.log > /dev/null && history -S && shutdown -r now
/bin/csh
mount -uw /
zfs mount -a
kldload nvidia-modeset
setenv EDITOR /usr/local/bin/nano
grep -C 1 completed\ on /var/log/installkernel.log
etcupdate -p
cd /usr/src && time make -j 200 installworld | tee /var/log/installworld.log > /dev/null && etcupdate -B
grep -C 2 everything\ completed\ on /var/log/installworld.log
make -DBATCH_DELETE_OLD_FILES delete-old && exit
pkg search nvidia-driver-470 ; pkg search drm-510-kmod ; pkg search drm-515-kmod
pkg lock -l
pkg lock emulators/virtualbox-ose-kmod x11/nvidia-driver-470
pkg upgrade --yes && pkg clean -a && pkg autoremove
sysrc sddm_enable="YES" && history -S && reboot -r
- sign in to the desktop environment.
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 x11/nvidia-driver-470 sysutils/sysctlinfo-kmod sysutils/sysctlbyname-improved-kmod emulators/virtualbox-ose-kmod graphics/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
git -C /usr clone -o freebsd -b main --depth 1 https://git.freebsd.org/src.git src
git -C /usr/src pull --ff-only --unshallow
– https://lists.freebsd.org/pipermail/freebsd-current/2021-March/078985.html
After removing all source files:
git -C /usr clone -o freebsd -b main https://git.freebsd.org/src.git src