OpnSense 25.1 building from scratch fails

Started by cbr84, July 08, 2025, 12:34:03 PM

Previous topic - Next topic
July 08, 2025, 12:34:03 PM Last Edit: July 08, 2025, 01:07:57 PM by cbr84
Dear OpnSense Team,

first of all I would like to thank you as a user for your great work, you provide an incredible environment and I really appreciate it.
In order to familiarize myself further with the system, I wanted to compile and use OpnSense from Scratch. To do this I followed the guidelines: https://github.com/opnsense/tools#setting-up-a-build-system

- FreeBSD 14.2-RELEASE amd64 (16 GB Ram, 120 GB SSD, 2 CPU in VirtualBox,...)
- Git repo is located in /home/opnsense (cd /home/opnsense; git clone https://github.com/opnsense/tools;)
- Then "cd tools"
- All commands are executed with "env ROOTDIR=/home/opnsense/"
   - "env ROOTDIR=/home/opnsense make update"
   - At "env ROOTDIR=/home/opnsense make dvd" fails:
   [...]
   >>> WARNING: The build provided additional info.
   >>> Unresolvable conflict with package awscli-1.20.61
   >>> Unresolvable conflict with package zabbix6-agent-6.0.40_1
   >>> Unresolvable conflict with package zabbix-proxy-6.0.40
   >>> Unresolvable conflict with package py311-yaml-6.0.1
   >>> ERROR: The build encountered fatal issues!
   >>> Aborted version 3.2.1402000_2 for net/ndproxy (ndproxy)
   >>> Aborted version 1.12a_1 for sysutils/cciss_vol_status (cciss_vol_status)
   *** Error code 1
   Stop.

I don't know what I'm doing wrong and why this is happening. I would be grateful for any advice.

Quote from: cbr84 on July 08, 2025, 12:34:03 PMBei "env ROOTDIR=/tmp/opnsense make dvd" schlägt fehl:
Copy-Paste Fehler? ROOTDIR sollte natürlich nicht /tmp/opnsense sein, sondern /home/opnsense.
Deciso DEC740

Yes, it really was a copy & paste error in the description.
I paid attention to it on the build system.

Sorry, not sure why I answered in German.

Was it a fresh installation of FreeBSD 14.2? I'll started a compile a few minutes ago with in /home/opnsense and still runs.
Did you create a user called 'opnsense' and run the commands with that user or with root?
Deciso DEC740

July 08, 2025, 01:21:34 PM #4 Last Edit: July 08, 2025, 04:14:48 PM by cbr84
No worries, I speak the language, but maybe it's worth reading for other users too.

1) Yes, FreeBSD 14.2 is fresh installed.
2) Yes, the process is running ("env ROOTDIR=/home/opnsense make dvd"), but it is not completed. The process runs on the error listed above.
3) No, a user "opnsense" does not exist. This is only a folder for compiling. It was separated created.
4) The building procress is executed under "root".

Now I really don't know what to do. I get the same error on "... make ports" and  "... make plugins". It stops always with the same message:
   >>> ERROR: The build encountered fatal issues!
   >>> Aborted version 3.2.1402000_2 for net/ndproxy (ndproxy)
   >>> Aborted version 1.12a_1 for sysutils/cciss_vol_status (cciss_vol_status)
   *** Error code 1
   Stop.

Is it possible that the error is due to these packages?

Not sure, right now download takes forever and I can't test it, not sure if my Hetzner instance got blocked/hit a rate limit.

Are there not error before these once?
Deciso DEC740

Now I've used a ssh-login, so I can use Copy and Paste. So here it is, hope it helps:

===>   ndproxy-3.2.1402000_2 depends on file: /usr/local/sbin/pkg - not found
===>   Installing existing package /.pkg-cache/All/pkg-1.19.2_5.pkg
Installing pkg-1.19.2_5...
Extracting pkg-1.19.2_5: 100%
===>   ndproxy-3.2.1402000_2 depends on file: /usr/local/sbin/pkg - found
===>   Returning to build of ndproxy-3.2.1402000_2
[20250708194736] => AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz doesn't seem to exist in /home/opnsense/ports/distfiles/.
[20250708194736] => Attempting to fetch https://codeload.github.com/AlexandreFenyo/ndproxy/tar.gz/v3.2?dummy=/AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz
fetch: https://codeload.github.com/AlexandreFenyo/ndproxy/tar.gz/v3.2?dummy=/AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz: size unknown
fetch: https://codeload.github.com/AlexandreFenyo/ndproxy/tar.gz/v3.2?dummy=/AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz: size of remote file is not known
AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz                9934 kB   10 MBps    01s
[20250708194738] ===> Fetching all distfiles required by ndproxy-3.2.1402000_2 for building
[20250708194738] ===> Extracting for ndproxy-3.2.1402000_2
[20250708194738] => SHA256 Checksum OK for AlexandreFenyo-ndproxy-v3.2_GH0.tar.gz.
[20250708194738] ===> Patching for ndproxy-3.2.1402000_2
[20250708194738] ===> Applying FreeBSD patches for ndproxy-3.2.1402000_2 from /home/opnsense/ports/net/ndproxy/files
[20250708194738] ===> Configuring for ndproxy-3.2.1402000_2
[20250708194738] ===> Building for ndproxy-3.2.1402000_2
(cd /usr/obj/home/opnsense/ports/net/ndproxy/work/ndproxy-3.2; make depend)
make[1]: "/usr/share/mk/bsd.sysdir.mk" line 16: Unable to locate the kernel source tree. Set SYSDIR to override.

make[1]: stopped in /usr/obj/home/opnsense/ports/net/ndproxy/work/ndproxy-3.2
*** Error code 1

Stop.
make: stopped in /home/opnsense/ports/net/ndproxy
[20250708194739] ===> Cleaning for ndproxy-3.2.1402000_2
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages:

Installed packages to be REMOVED:
pkg: 1.19.2_5

Number of packages to be removed: 1

The operation will free 16 MiB.
[1/1] Deinstalling pkg-1.19.2_5...
[1/1] Deleting files for pkg-1.19.2_5: 100%
[20250708194748] ===> License GPLv2 accepted by the user
===>   cciss_vol_status-1.12a_1 depends on file: /usr/local/sbin/pkg - not found
===>   Installing existing package /.pkg-cache/All/pkg-1.19.2_5.pkg
Installing pkg-1.19.2_5...
Extracting pkg-1.19.2_5: 100%
===>   cciss_vol_status-1.12a_1 depends on file: /usr/local/sbin/pkg - found
===>   Returning to build of cciss_vol_status-1.12a_1
[20250708194750] => cciss_vol_status-1.12a.tar.gz doesn't seem to exist in /home/opnsense/ports/distfiles/.
[20250708194750] => Attempting to fetch https://downloads.sourceforge.net/project/cciss/cciss_vol_status/cciss_vol_status-1.12a.tar.gz
cciss_vol_status-1.12a.tar.gz                          117 kB   10 kBps    11s
[20250708194841] ===> Fetching all distfiles required by cciss_vol_status-1.12a_1 for building
[20250708194841] ===> Extracting for cciss_vol_status-1.12a_1
[20250708194841] => SHA256 Checksum OK for cciss_vol_status-1.12a.tar.gz.
[20250708194841] ===> Patching for cciss_vol_status-1.12a_1
[20250708194841] ===> Configuring for cciss_vol_status-1.12a_1
configure: loading site script /home/opnsense/ports/Templates/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
/usr/obj/home/opnsense/ports/sysutils/cciss_vol_status/work/cciss_vol_status-1.12a/missing: Unknown `--is-lightweight' option
Try `/usr/obj/home/opnsense/ports/sysutils/cciss_vol_status/work/cciss_vol_status-1.12a/missing --help' for more information
configure: WARNING: 'missing' script is too old or missing
checking for a thread-safe mkdir -p... (cached) /bin/mkdir -p
checking for gawk... (cached) /usr/bin/awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking whether cc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of cc... gcc3
checking how to run the C preprocessor... cpp
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for egrep... (cached) /usr/bin/egrep
checking for ANSI C header files... (cached) yes
checking for sys/types.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for memory.h... (cached) yes
checking for strings.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking for stdbool.h that conforms to C99... (cached) yes
checking for _Bool... (cached) yes
checking for errno.h... (cached) yes
checking for fcntl.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/ioctl.h... (cached) yes
checking for unistd.h... (cached) yes
checking scsi/sg.h usability... no
checking scsi/sg.h presence... no
checking for scsi/sg.h... no
configure: WARNING: scsi/sg.h not found so MSA1000 support will not be compiled.
checking scsi/scsi.h usability... no
checking scsi/scsi.h presence... no
checking for scsi/scsi.h... no
checking linux/cciss_ioctl.h usability... no
checking linux/cciss_ioctl.h presence... no
checking for linux/cciss_ioctl.h... no
checking /usr/src/sys/dev/ciss/cissio.h usability... no
checking /usr/src/sys/dev/ciss/cissio.h presence... no
checking for /usr/src/sys/dev/ciss/cissio.h... no
checking for an ANSI C-conforming const... yes
checking whether cc needs -traditional... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... (cached) yes
checking for getopt... (cached) yes
checking for getopt_long... yes
checking for memset... (cached) yes
checking for strerror... (cached) yes
checking for strstr... (cached) yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
[20250708194843] ===> Building for cciss_vol_status-1.12a_1
--- all ---
/usr/bin/make  all-am
--- cciss_vol_status.o ---
cc -DHAVE_CONFIG_H -I.      -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT cciss_vol_status.o -MD -MP -MF .deps/cciss_vol_status.Tpo -c -o cciss_vol_status.o cciss_vol_status.c
cciss_vol_status.c:94:2: error: Neither cciss_ioctl.h (linux) nor cissio.h (FreeBSD) were found.
   94 | #error Neither cciss_ioctl.h (linux) nor cissio.h (FreeBSD) were found.
      |  ^
cciss_vol_status.c:198:2: warning: Since <scsi/sg.h> is not around, MSA1000 support will not be compiled. [-W#warnings]
  198 | #warning Since <scsi/sg.h> is not around, MSA1000 support will not be compiled.
      |  ^
cciss_vol_status.c:722:11: error: unknown type name 'IOCTL_Command_struct'
  722 |                 int rc, IOCTL_Command_struct *cmd, int ldrive_num)
      |                         ^
cciss_vol_status.c:762:29: error: unknown type name 'IOCTL_Command_struct'
  762 | static void setup_for_ioctl(IOCTL_Command_struct *cmd,
      |                             ^
cciss_vol_status.c:773:27: error: use of undeclared identifier 'TYPE_CMD'
  773 |         cmd->Request.Type.Type = TYPE_CMD;
      |                                  ^
cciss_vol_status.c:774:32: error: use of undeclared identifier 'ATTR_SIMPLE'
  774 |         cmd->Request.Type.Attribute = ATTR_SIMPLE;
      |                                       ^
cciss_vol_status.c:775:52: error: use of undeclared identifier 'XFER_WRITE'
  775 |         cmd->Request.Type.Direction = (write_direction) ? XFER_WRITE : XFER_READ;
      |                                                           ^
cciss_vol_status.c:775:65: error: use of undeclared identifier 'XFER_READ'
  775 |         cmd->Request.Type.Direction = (write_direction) ? XFER_WRITE : XFER_READ;
      |                                                                        ^
cciss_vol_status.c:809:2: error: use of undeclared identifier 'IOCTL_Command_struct'
  809 |         IOCTL_Command_struct cmd;
      |         ^
cciss_vol_status.c:824:19: error: use of undeclared identifier 'cmd'; did you mean 'rcmd'?
  824 |         setup_for_ioctl(&cmd, zero_lun, cdb, 12, 0, lun, *count * 8);
      |                          ^~~
      |                          rcmd
/usr/include/unistd.h:548:6: note: 'rcmd' declared here
  548 | int      rcmd(char **, int, const char *, const char *, const char *, int *);
      |          ^
cciss_vol_status.c:825:17: error: use of undeclared identifier 'CCISS_PASSTHRU'
  825 |         rc = ioctl(fd, CCISS_PASSTHRU, &cmd);
      |                        ^
cciss_vol_status.c:825:34: error: use of undeclared identifier 'cmd'
  825 |         rc = ioctl(fd, CCISS_PASSTHRU, &cmd);
      |                                         ^
cciss_vol_status.c:831:38: error: use of undeclared identifier 'cmd'; did you mean 'rcmd'?
  831 |         CHECK_IOCTL(filename, cmdname, rc, &cmd, -1); /* macro which may return... */
      |                                             ^~~
      |                                             rcmd
cciss_vol_status.c:759:49: note: expanded from macro 'CHECK_IOCTL'
  759 |         if (check_ioctl_results(filename, command, rc, cmd, ldrive_num) !=0) \
      |                                                        ^
/usr/include/unistd.h:548:6: note: 'rcmd' declared here
  548 | int      rcmd(char **, int, const char *, const char *, const char *, int *);
      |          ^
cciss_vol_status.c:849:2: error: use of undeclared identifier 'IOCTL_Command_struct'
  849 |         IOCTL_Command_struct cmd;
      |         ^
cciss_vol_status.c:860:19: error: use of undeclared identifier 'cmd'; did you mean 'rcmd'?
  860 |         setup_for_ioctl(&cmd, controller_lun, cdb, 16, 0, buffer, 512);
      |                          ^~~
      |                          rcmd
/usr/include/unistd.h:548:6: note: 'rcmd' declared here
  548 | int      rcmd(char **, int, const char *, const char *, const char *, int *);
      |          ^
cciss_vol_status.c:861:17: error: use of undeclared identifier 'CCISS_PASSTHRU'
  861 |         rc = ioctl(fd, CCISS_PASSTHRU, &cmd);
      |                        ^
cciss_vol_status.c:861:34: error: use of undeclared identifier 'cmd'
  861 |         rc = ioctl(fd, CCISS_PASSTHRU, &cmd);
      |                                         ^
cciss_vol_status.c:862:55: error: use of undeclared identifier 'cmd'; did you mean 'rcmd'?
  862 |         CHECK_IOCTL(filename, "IDENTIFY_LOGICAL_DRIVE", rc, &cmd, -1); /* macro which may return... */
      |                                                              ^~~
      |                                                              rcmd
cciss_vol_status.c:759:49: note: expanded from macro 'CHECK_IOCTL'
  759 |         if (check_ioctl_results(filename, command, rc, cmd, ldrive_num) !=0) \
      |                                                        ^
/usr/include/unistd.h:548:6: note: 'rcmd' declared here
  548 | int      rcmd(char **, int, const char *, const char *, const char *, int *);
      |          ^
cciss_vol_status.c:870:2: error: use of undeclared identifier 'IOCTL_Command_struct'
  870 |         IOCTL_Command_struct cmd;
      |         ^
cciss_vol_status.c:879:19: error: use of undeclared identifier 'cmd'; did you mean 'rcmd'?
  879 |         setup_for_ioctl(&cmd, controller_lun, cdb, SENSE_CACHE_CONFIG_CDB_LEN, 0,
      |                          ^~~
      |                          rcmd
/usr/include/unistd.h:548:6: note: 'rcmd' declared here
  548 | int      rcmd(char **, int, const char *, const char *, const char *, int *);
      |          ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
*** [cciss_vol_status.o] Error code 1

make[1]: stopped in /usr/obj/home/opnsense/ports/sysutils/cciss_vol_status/work/cciss_vol_status-1.12a
1 error

make[1]: stopped in /usr/obj/home/opnsense/ports/sysutils/cciss_vol_status/work/cciss_vol_status-1.12a

make: stopped in /usr/obj/home/opnsense/ports/sysutils/cciss_vol_status/work/cciss_vol_status-1.12a
[20250708194843] ===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /home/opnsense/ports/sysutils/cciss_vol_status
[20250708194843] ===> Cleaning for cciss_vol_status-1.12a_1
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages:

Installed packages to be REMOVED:
pkg: 1.19.2_5

Number of packages to be removed: 1

The operation will free 16 MiB.
[1/1] Deinstalling pkg-1.19.2_5...
[1/1] Deleting files for pkg-1.19.2_5: 100%
Creating repository in /usr/obj/home/opnsense/tools/config/25.1/amd64/.pkg-new/: 100%
Packing files for repository: 100%
>>> Removing packages set
>>> Creating package mirror set for 25.1.10-amd64... done
-rw-r--r--  1 root wheel  1.0G Jul  8 21:49 packages-25.1.10-amd64.tar
>>> WARNING: The build provided additional info.
>>> Unresolvable conflict with package frr10-pythontools-10.3.1
>>> Unresolvable conflict with package py311-yaml-6.0.1
>>> Unresolvable conflict with package awscli-1.20.61
>>> Unresolvable conflict with package zabbix6-agent-6.0.40_1
>>> ERROR: The build encountered fatal issues!
>>> Aborted version 3.2.1402000_2 for net/ndproxy (ndproxy)
>>> Aborted version 1.12a_1 for sysutils/cciss_vol_status (cciss_vol_status)
*** Error code 1

Stop.
make: stopped in /home/opnsense/tools

Hello patient0,

today I run "... make update" again and some changes were loaded in the local repository.
Now it looks like the build process is at least getting further than before. It looks promising.
Because I am running this build process on an older notebook, it may take a few hours.

Otherwise I would get back to you.
Thanks for the support so far.

Hi @cbr84, thanks for reporting back. I was to run an update and build this morning, too. And it will take some time also.
Deciso DEC740

July 11, 2025, 12:30:08 PM #9 Last Edit: July 11, 2025, 03:52:29 PM by cbr84
Hi @patient0,

now I have found out the reason why "make dvd" failed.

The instructions say "Install FreeBSD 14.2-RELEASE for amd64 on a machine with at least 40 GB hard disk and at least 8 GB RAM to successfully create all standard images."
Therefore I assumed a standard installation without FreeBSD package "src". This is the FreeBSD 14.2 default setting, not to install "src". That is the point of the problem.

If the FreeBSD installation is performed without the "src" package, then "make dvd" will fail at the following step (attention ROOTDIR) as part of "make dvd"
# cd /home/opnsense/ports/net/ndproxy
# make
This package requires the KERNEL sources from /usr/src/... => which are not available in my environment.
To remember: ndproxy -- Neighbor Discovery Proxy is  a  kernel  module  that implements IPv6 Neighbor Discovery proxying over Ethernet-like access networks, with many options to  handle several use-cases. [1]
Small note: Addition to the instructions[2] that the "src" packages must also be installed during the FreeBSD installation.

[1] https://man.freebsd.org/cgi/man.cgi?query=ndproxy&apropos=0&sektion=4&manpath=FreeBSD+11-current&format=html
[2] https://github.com/opnsense/tools#setting-up-a-build-system

This brings me to the question, is it possible to create OpnSense without IPv6?

Even with src installed it fails:

Packing files for repository: 100%
>>> Removing packages set
>>> Creating package mirror set for 25.7.r1-amd64... done
-rw-r--r--  1 root wheel  1.0G Jul 11 22:52 packages-25.7.r1-amd64.tar
>>> WARNING: The build provided additional info.
>>> Unresolvable conflict with package ap24-mod_proxy_msrpc-0.6
>>> Unresolvable conflict with package zabbix7-agent-7.0.16
>>> Unresolvable conflict with package e2fsprogs-libuuid-1.47.2
>>> Unresolvable conflict with package frr8-pythontools-8.5.7_2
>>> ERROR: The build encountered fatal issues!
>>> Aborted version 3.2.1402000_2 for net/ndproxy (ndproxy)
>>> Aborted version 1.12a_1 for sysutils/cciss_vol_status (cciss_vol_status)
*** Error code 1

Stop.
make: stopped in /home/opnsense/tools

Can you maybe list the steps you did after installing FreeBSD 14.2 with src installed?
Deciso DEC740

So after the fresh installation I carried out the following steps:
mkdir /home/opnsense
pkg install git
cd /home/opnsense/
git clone https://github.com/opnsense/tools
cd tools/
env ROOTDIR=/home/opnsense make update
env ROOTDIR=/home/opnsense make dvd

and always get the same error message as you.

I then updated the repo with "... make update". I then get the following message:


Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
net-snmp: 5.9.4_6,1

Number of packages to be removed: 1

The operation will free 12 MiB.
[1/1] Deinstalling net-snmp-5.9.4_6,1...
[1/1] Deleting files for net-snmp-5.9.4_6,1: 100%
==> You should manually remove the "snmpd" user
==> You should manually remove the "snmpd" group
Installing pkg-1.19.2_5...
the most recent version of pkg-1.19.2_5 is already installed
Could not find package: netdata
*** Error code 1

Stop.
make: stopped in /home/opnsense/tools

Could it be that the "plugins" step is defective?
I get the same message for the "plugins", "core", 'distribution' and "dvd" steps.

Where exactly am I making the mistake in creating an ISO?