Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Sep 2024 09:55:16 +0100
From:      Sad Clouds <cryintothebluesky@gmail.com>
To:        "Edward Sanford Sutton, III" <mirror176@hotmail.com>
Cc:        questions@freebsd.org
Subject:   Re: How to upgrade custom release
Message-ID:  <20240906095516.568f43f9c00561ff934363eb@gmail.com>
In-Reply-To: <CO1PR11MB4770F0627BFA5D495795B895E69D2@CO1PR11MB4770.namprd11.prod.outlook.com>
References:  <20240905190801.990f63880ba706a56a065a34@gmail.com> <CO1PR11MB4770F0627BFA5D495795B895E69D2@CO1PR11MB4770.namprd11.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 5 Sep 2024 13:43:50 -0700
"Edward Sanford Sutton, III" <mirror176@hotmail.com> wrote:

>    3. Share resulting tgz installer packages that you built. `man 
> release` to learn to begin such build steps. Cleaning out old files and 
> merging changes is not part of the toolset as these are used for 
> new+fresh installations by the installer and no notes are created about 
> what was installed or where; this is why this would be the least 
> desirable and trying to create fixes for this scenario is what leads to 
> pkgbase as an effort. I believe it is planned to have the installer use 
> pkgbase from the start of a system being installed. A workaround to do 
> it cleanly would be using boot environments to make clean 
> partition(s)/dataset(s) to extract them to and copy/edit your 
> configuration into the new system.

Hi, thanks for the suggestions. I think both, NetBSD and FreeBSD had
something like pkgbase projects for quite some time, however they are
still in the experimental stage and not quite ready for production use.
I was looking for something stable and reliable that I could use right
now.

NetBSD has a concept of "sets", where different components are split
into different tarballs and can be installed individually, thus
simulating coarse base OS packages. You can extract all sets into /
when performing a pristine install, or exclude etc.tar.xz and
xetc.tar.xz when performing a later upgrade. The actual upgrade steps
on NetBSD are very simple and work identically with the official and
custom builds.

I'm not that familiar with FreeBSD, but the issues I notice:

1) FreeBSD bundles everything into a single base.txz tarball which
makes it harder to upgrade, since extracting it into / will overwrite
existing /etc and /var files.

2) FreeBSD etcupdate does not seem to perform post-install fixes with
regard to obsolete files and shared libraries. I've not been able to
find a tool like NetBSD postinstall(8) to take care of this problem.
Copying build tree to various machines and running "make delete-old"
is far from ideal.

As a comparison, below are 5 simple steps I did recently to upgrade
NetBSD VM. No need for update servers or make files. If anyone found
a way to do something similar with FreeBSD, then please let me know.



1) Download NetBSD-9.4 binary sets. Also works with local custom
built binary sets, as they are simple tarballs.

# ftp -a ftp.netbsd.org << 'EOF'
cd pub/NetBSD/NetBSD-9.4/amd64/binary/sets/
prompt
mget *
EOF

# ls -1 *.tar.xz
base.tar.xz
comp.tar.xz
debug.tar.xz
etc.tar.xz
games.tar.xz
kern-GENERIC.tar.xz
kern-GENERIC_KASLR.tar.xz
kern-XEN3_DOM0.tar.xz
kern-XEN3_DOMU.tar.xz
man.tar.xz
misc.tar.xz
modules.tar.xz
rescue.tar.xz
tests.tar.xz
text.tar.xz
xbase.tar.xz
xcomp.tar.xz
xdebug.tar.xz
xetc.tar.xz
xfont.tar.xz
xserver.tar.xz

2) Extract new kernel and reboot

# tar -C / -xpf kern-GENERIC.tar.xz
# reboot

3) Extract required base system packages, excluding etc and xetc

# for i in base comp games man misc modules rescue tests text xcomp xfont xserver
do
  tar -C / -xpf ./${i}.tar.xz || break
done

4) Update files in /etc and /var

# etcupdate -al -s ./etc.tar.xz ./xetc.tar.xz
...
postinstall checks passed: bluetooth ddbonpanic defaults dhcpcd dhcpcdrundir envsys fontconfig gid gpio hosts iscsi makedev motd mtree named pam periodic pf pwd_mkdb rc ssh wscons x11 xkb uid varrwho tcpdumpchroot atf catpages manconf ptyfsoldnodes varshm
postinstall checks failed: obsolete
To fix, run:
    sh /usr/sbin/postinstall -s ./etc.tar.xz -d / fix obsolete
Note that this may overwrite local changes.
*** All done

5) Run postinstall to remove obsolete file

# sh /usr/sbin/postinstall -s ./etc.tar.xz -d / fix obsolete
Note: Creating temporary directory /tmp/_postinstall.9791.0/etc.tgz
Note: Extracting files from ./etc.tar.xz
Source directory: /tmp/_postinstall.9791.0/etc.tgz
 (extracted from: ./etc.tar.xz)
Target directory: /
obsolete fix:
        Removed obsolete file /usr/share/man/man8/nsec3hash.8
        Removed obsolete file /usr/share/man/man8/named-journalprint.8
        Removed obsolete file /usr/share/man/man8/named-compilezone.8
        Removed obsolete file /usr/share/man/man8/named-checkzone.8
        Removed obsolete file /usr/share/man/man8/named-checkconf.8
        Removed obsolete file /usr/share/man/man8/dnssec-verify.8
        Removed obsolete file /usr/share/man/man8/dnssec-signzone.8
        Removed obsolete file /usr/share/man/man8/dnssec-settime.8
        Removed obsolete file /usr/share/man/man8/dnssec-revoke.8
        Removed obsolete file /usr/share/man/man8/dnssec-keygen.8
        Removed obsolete file /usr/share/man/man8/dnssec-keyfromlabel.8
        Removed obsolete file /usr/share/man/man8/dnssec-importkey.8
        Removed obsolete file /usr/share/man/man8/dnssec-dsfromkey.8
        Removed obsolete file /usr/share/man/html8/nsec3hash.html
        Removed obsolete file /usr/share/man/html8/named-journalprint.html
        Removed obsolete file /usr/share/man/html8/named-compilezone.html
        Removed obsolete file /usr/share/man/html8/named-checkzone.html
        Removed obsolete file /usr/share/man/html8/named-checkconf.html
        Removed obsolete file /usr/share/man/html8/dnssec-verify.html
        Removed obsolete file /usr/share/man/html8/dnssec-signzone.html
        Removed obsolete file /usr/share/man/html8/dnssec-settime.html
        Removed obsolete file /usr/share/man/html8/dnssec-revoke.html
        Removed obsolete file /usr/share/man/html8/dnssec-keygen.html
        Removed obsolete file /usr/share/man/html8/dnssec-keyfromlabel.html
        Removed obsolete file /usr/share/man/html8/dnssec-importkey.html
        Removed obsolete file /usr/share/man/html8/dnssec-dsfromkey.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch09.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch08.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch07.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch06.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch05.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch04.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch03.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch02.html
        Removed obsolete file /usr/share/doc/reference/ref8/bind9/arm/Bv9ARM.ch01.html
        Removed obsolete file /lib/libcrypto.so.14.0
        Removed obsolete link /usr/lib/libcrypto.so.14.0
        Removed obsolete file /usr/lib/i386/libcrypto.so.14.0
postinstall fixes passed: obsolete
postinstall fixes failed:






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20240906095516.568f43f9c00561ff934363eb>