Build 22.7.11 from source fails, proper parameters?

Started by Knogle, September 06, 2023, 08:29:01 PM

Previous topic - Next topic
Hello everyone! I hope you're all doing well. I've been using OPNsense for a while now and have several systems set up in my home environment. To conduct some further testing, I decided to build the 22.7.11 release from scratch on a FreeBSD 13.1 machine. I followed these steps to clone the git repository and initiate the build process:

    git clone --depth 1 --branch 22.7.11 https://github.com/opnsense/tools
    env ROOTDIR=/tmp/opnsense TOOLSBRANCH=22.7.11 OS=13.1 make update
    env ROOTDIR=/tmp/opnsense TOOLSBRANCH=22.7.11 OS=13.1 make dvd


However, I encountered an issue during the build process, which led to a failure after approximately 12 hours of building. The error message I received is as follows:

    Number of packages to be removed: 11
    The operation will free 109 MiB.
   
    [1/11] Deinstalling squid-5.9...
    [1/11] Deleting files for squid-5.9: 100%
    ==> You should manually remove the "squid" user.
    ==> You should manually remove the "squid" group
    [2/11] Deinstalling krb5-1.21.2...
    [2/11] Deleting files for krb5-1.21.2: 100%
    [3/11] Deinstalling openldap24-client-2.4.59_4...
    [3/11] Deleting files for openldap24-client-2.4.59_4: 100%
    [4/11] Deinstalling cyrus-sasl-2.1.28...
    [4/11] Deleting files for cyrus-sasl-2.1.28: 100%
    To delete Cyrus user permanently, use 'pw userdel cyrus'
    To delete Cyrus group permanently, use 'pw groupdel cyrus'
    [5/11] Deinstalling gmake-4.3_2...
    [5/11] Deleting files for gmake-4.3_2: 100%
    [6/11] Deinstalling readline-8.2.1...
    [6/11] Deleting files for readline-8.2.1: 100%
    [7/11] Deinstalling gettext-runtime-0.22_1...
    [7/11] Deleting files for gettext-runtime-0.22_1: 100%
    [8/11] Deinstalling pkg-1.19.2...
    [8/11] Deleting files for pkg-1.19.2: 100%
    [9/11] Deinstalling indexinfo-0.3.1...
    [9/11] Deleting files for indexinfo-0.3.1: 100%
    [10/11] Deinstalling openssl-1.1.1v,1...
    [10/11] Deleting files for openssl-1.1.1v,1: 100%
    [11/11] Deinstalling perl5-5.32.1_4...
    [11/11] Deleting files for perl5-5.32.1_4: 100%
    Creating repository in /usr/obj/tmp/opnsense/tools/config/22.7/OpenSSL:amd64/.pkg-new/: 100%
    Packing files for repository: 100%
    >>> Removing packages set
    >>> Creating package mirror set for 23.7.3_60-OpenSSL-amd64... done
    -rw-r--r--  1 root  wheel   858M Sep  6 12:32 packages-23.7.3_60-OpenSSL-amd64.tar
    >>> ERROR: The build encountered fatal issues!
    >>> Aborted version 1.12a for sysutils/cciss_vol_status
    >>> Aborted version 7.26.0 for sysutils/puppet7
    *** Error code 1
   
    Stop.
    make: stopped in /tmp/opnsense/tools


I'm wondering what might be causing this issue, and if there are any specific commands or additional parameters I need to provide in order to successfully build a DVD image for the 22.7.11 release. Thank you in advance for your assistance!
Somehow 23.7.x packages are in between, something seems to be mixed.

While you did change the tools.git to the correct branch/tag you haven't done the same for src.git, ports.git, plugins.git and core.git as far as I can see. The historic command to be used was:

# make rewind VERSION=22.7.11

But I think that this might scrub manual changes from tools.git and may not even build anymore given the outdated ports information contained in that ports stable branch.


Cheers,
Franco

If your goal is to simply acquire a vanilla 22.7.11 iso, there's a faster way. From my cookbook:


cd /usr
git clone https://github.com/opnsense/tools
cd tools
make update OS=13.1 SRCBRANCH=stable/22.7 PLUGINSBRANCH=stable/22.7 COREBRANCH=stable/22.7 VERSION=22.7.11
make prefetch-base,kernel VERSION=22.7.9
rsync -vaz rsync://mirror.ams1.nl.leaseweb.net/opnsense/FreeBSD:13:amd64/22.7/MINT/22.7.11/OpenSSL /tmp/opnsense
tar -C /tmp/opnsense/OpenSSL -cf /usr/local/opnsense/build/22.7/amd64/sets/packages-22.7.11-OpenSSL-amd64.tar .
make dvd


Shouldn't take too long.

Cheers
Maurice
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Reusing the published sets and packages is a quick solution, but hard to document (which kernel has which version?) and also hard to add customizations. Inconsistencies can creep into each step, but for educational purposes that is fine.


Cheers,
Franco

You're right, not great for customizing code. Better build from source then. But if the goal merely is an unmodified image which isn't officially available (e. g. intermediate versions or VM images), I don't think there's anything wrong with this method. That's how I build all my vm-amd64 images.

Quote from: franco on September 07, 2023, 11:22:10 AM
which kernel has which version?

Kernel and base version is the same as packages version. If not available, the closest below. No?
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

> Kernel and base version is the same as packages version. If not available, the closest below. No?

Yes but if you never knew? :)

One more thing to note is that published images are rigorously vetted for consistency and operability. It usually takes 1-2 days to do that here. Later versions could have unintended artefacts during installation or boot behaviour.

Yet as I said there is nothing against that. I just want to share process details in the open source spirit.


Cheers,
Franco


Quote from: Maurice on September 07, 2023, 01:04:27 AM
If your goal is to simply acquire a vanilla 22.7.11 iso, there's a faster way. From my cookbook:


cd /usr
git clone https://github.com/opnsense/tools
cd tools
make update OS=13.1 SRCBRANCH=stable/22.7 PLUGINSBRANCH=stable/22.7 COREBRANCH=stable/22.7 VERSION=22.7.11
make prefetch-base,kernel VERSION=22.7.9
rsync -vaz rsync://mirror.ams1.nl.leaseweb.net/opnsense/FreeBSD:13:amd64/22.7/MINT/22.7.11/OpenSSL /tmp/opnsense
tar -C /tmp/opnsense/OpenSSL -cf /usr/local/opnsense/build/22.7/amd64/sets/packages-22.7.11-OpenSSL-amd64.tar .
make dvd


Shouldn't take too long.

Cheers
Maurice

Thanks a lot!
Yes that's what i wanted to achive, i'd like to build a simple Vanilla image for VMs as well as ARM.
One more question, which system did you use to build? I've used FreeBSD 13.1 now, but unfortunately the proper 'pkg' version is not available anymore for 13.1, so the one for 13.2 is being installed instead which leads to the following error.
Asked in the FreeBSD IRC for help, but they simply said 'FreeBSD 13.1 is EOL, don't use it'
Thanks in advance!

>>> Running build step: ports
>>> Passing arguments: (none)
Installed pkg version '1.19' does not match required version '1.18'
*** Error code 1

Stop.
make: stopped in /usr/tools

You can build the right package manager version from our ports tree from the stable/22.7 branch:

# cd /tmp/opnsense/ports/ports-mgmt/pkg
# make package
# make reinstall

There have been many incompatibilities between newer pkg versions vs the ones that we use for a release for stability's sake.


Cheers,
Franco

Ah yes, the pesky pkg version mismatch. I forgot about this, sorry. You can build the correct version like Franco explained. Or go my preferred lazy & quick way: Install the pkg you downloaded anyway.

pkg install /tmp/opnsense/OpenSSL/All/pkg-1.18.4.pkg
OPNsense virtual machine images
OPNsense aarch64 firmware repository

Commercial support & engineering available. PM for details (en / de).

Thanks a lot already!

One more question :) Are there any log files or anything else generated by the build process?
Unfortunately the build fails with error 1.

-rw-r--r--  1 root  wheel   805M Sep  8 03:07 packages-22.7.11-OpenSSL-amd64.tar
>>> WARNING: The build provided additional info.
>>> Package list inconsistency for emulators/qemu-guest-agent
>>> Package list inconsistency for net/librdkafka
>>> Package list inconsistency for www/squid
>>> ERROR: The build encountered fatal issues!
>>> Aborted version 1.12.4_4 for sysutils/consul
*** Error code 1

Stop.
make: stopped in /usr/tools

Logs are not stored... only for nightly target. But in this case just drop "sysutils/consul" from config/22.7/ports.conf

A number of ports are not needed for core/plugins and that's one of them.


Cheers,
Franco

Thank you so much!


Now i have a working build  ;D Thanks!

1+0 records out
4096 bytes transferred in 0.000126 secs (32562207 bytes/sec)
Creating `/usr/obj/usr/tools/config/22.7/OpenSSL:amd64/efiboot.img'
/usr/obj/usr/tools/config/22.7/OpenSSL:amd64/efiboot.img: 4039 sectors in 4039 FAT12 clusters (512 bytes/cluster)
BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=4096 Media=0xf0 FATsecs=12 SecPerTrack=63 Heads=255 HiddenSecs=0
Populating `/usr/obj/usr/tools/config/22.7/OpenSSL:amd64/efiboot.img'
Image `/usr/obj/usr/tools/config/22.7/OpenSSL:amd64/efiboot.img' complete
>>> Building dvd image... -- 0:make -- time-stamp -- Sep/08/23 13:09:44 --
-- 0:make -- time-stamp -- Sep/08/23 13:09:47 --
done