Re: How to upgrade custom release
- In reply to: Sad Clouds : "Re: How to upgrade custom release"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 07 Sep 2024 13:44:19 UTC
OK, I managed to create a set of scripts to perform the updates the way I'm used to, i.e. extract base and kernel archives and then update etc files. Simple and unobtrusive. This seems to work for standalone jails, so will try it on real hardware soon with UFS snapshots as described in the previous email. # Build or download FreeBSD release archives cd FreeBSD-14.1-arm64-aarch64 && ls -1 base.txz kernel.txz lib32.txz # Root mount point at which update should happen UPDATE_ROOT="/jails/test_update" # Paths that need to be removed and then updated with new binaries UPDATE_PATHS=" bin boot lib libexec rescue sbin usr/sbin usr/bin usr/include usr/lib usr/lib32 usr/libdata usr/libexec usr/share usr/tests " # Remove paths with old binaries for i in ${UPDATE_PATHS:?} do chflags -R 0 ${UPDATE_ROOT:?}/${i:?} rm -rf ${UPDATE_ROOT:?}/${i:?} done # Extract new updates from base.txz for i in ${UPDATE_PATHS:?} do tar -C ${UPDATE_ROOT:?} --clear-nochange-fflags -xpf base.txz ./${i:?} done # Extract kernel updates (not required for jails) tar -C ${UPDATE_ROOT:?} --clear-nochange-fflags -xpf kernel.txz # View previous etc changes prior to update etcupdate diff -D ${UPDATE_ROOT:?} -d ${UPDATE_ROOT:?}/var/db/etcupdate # Update etc files # 1) Extract etcupdate current tree from the base archive tar -xpf base.txz ./var/db/etcupdate/current # 2) Create etcupdate.tar.bz2 archive tar -C ./var/db/etcupdate/current -jcf etcupdate.tar.bz2 ./ && rm -rf ./var # 3) Run etcupdate merging new changes in etcupdate.tar.bz2 into /etc etcupdate -D ${UPDATE_ROOT:?} -d ${UPDATE_ROOT:?}/var/db/etcupdate -F -t etcupdate.tar.bz2