Which way is better, customizing base.txz or using local.post-configure?

I'm trying to make my own FreeBSD iso which installs kde automatically, and I found two ways.

First is extract base.txz, install all packages I need with help of chroot, repackage base.txz and put it into iso file.

Second is add a script /usr/libexec/bsdinstall/local.post-configure to install packages after system is installed.

Which is thought to be the better way? Or is there a even better one?

BTY I don't use /etc/installerconfig because I may use the iso file in different environments and I want a normal installation procedure. I think /etc/installerconfig can't do that. (I may be wrong with this.)

Thanks!
 
First is extract base.txz, install all packages I need with help of chroot, repackage base.txz and put it into iso file.
base.txz is expected to only contain the base OS, you should not add packages to that. It's also quite labor intensive every time you want to update/upgrade the OS or the packages. Also keep in mind that registration of packages is stored in /var/db/pkg/local.sqlite, which is not contained within base.txz, so your new installed system won't know what's installed.

Second is add a script /usr/libexec/bsdinstall/local.post-configure to install packages after system is installed.
This is probably a much cleaner solution. You don't have to touch base.txz and just need to add the packages in the correct directory. Much easier to maintain.

Which is thought to be the better way? Or is there a even better one?
Depends on how you plan to use this, but there is also sysutils/firstboot-pkgs. Or leverage Ansible to set up a newly spun up system.
 
Back
Top