Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gondox

#1
Hi,

I have been toiling with this for quite some time, but I was finally able to compile OPNsense for my DFRobot routerboard with a RPI4 CM!  ;D


=====
Message from opnsense-22.7.1_20:

--
Yes, I'm back in black
>>> Begin extra: arm_hook
rc.loader: assembling banner
rc.loader: assembling brand
rc.loader: assembling misc
rc.loader: assembling modules
>>> End extra: arm_hook
>>> Setting up entropy in /usr/obj/usr/tools/config/22.7/OpenSSL:aarch64
1+0 records in
1+0 records out
4096 bytes transferred in 0.000429 secs (9542425 bytes/sec)
1+0 records in
1+0 records out
4096 bytes transferred in 0.000397 secs (10309668 bytes/sec)
Creating `/usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/efiboot.img'
/usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/efiboot.img: 65528 sectors in 65528 FAT32 clusters (512 bytes/cluster)
BytesPerSec=512 SecPerClust=1 ResSectors=32 FATs=2 Media=0xf0 SecPerTrack=63 Heads=255 HiddenSecs=0 HugeSectors=66584 FATsecs=512 RootCluster=2 FSInfo=1 Backup=2
Populating `/usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/efiboot.img'
Image `/usr/obj/usr/tools/config/22.7/OpenSSL:aarch64/efiboot.img' complete
>>> Building arm image... done



Fri Aug 19 17:43:59 UTC 2022

*** OPNsense.localdomain: OPNsense 22.7.1_20 (aarch64/OpenSSL) ***

LAN (re0)       -> v4: 192.168.1.1/24
WAN (genet0)    ->

HTTPS: SHA256 F4 F5 E1 90 61 4D D0 B4 78 B9 D6 21 58 0C C8 CA
               70 A5 AC B8 E1 EE B7 DD AA B3 8C EE D8 B1 DC 5D

FreeBSD/arm64 (OPNsense.localdomain) (ttyu0)

login: root
Password:
----------------------------------------------
|      Hello, this is OPNsense 22.7          |         @@@@@@@@@@@@@@@
|                                            |        @@@@         @@@@
| Website:      https://opnsense.org/        |         @@@\\\   ///@@@
| Handbook:     https://docs.opnsense.org/   |       ))))))))   ((((((((
| Forums:       https://forum.opnsense.org/  |         @@@///   \\\@@@
| Code:         https://github.com/opnsense  |        @@@@         @@@@
| Twitter:      https://twitter.com/opnsense |         @@@@@@@@@@@@@@@
----------------------------------------------

*** OPNsense.localdomain: OPNsense 22.7.1_20 (aarch64/OpenSSL) ***

LAN (re0)       -> v4: 192.168.1.1/24
WAN (genet0)    ->

HTTPS: SHA256 F4 F5 E1 90 61 4D D0 B4 78 B9 D6 21 58 0C C8 CA
               70 A5 AC B8 E1 EE B7 DD AA B3 8C EE D8 B1 DC 5D

  0) Logout                              7) Ping host
  1) Assign interfaces                   8) Shell
  2) Set interface IP address            9) pfTop
  3) Reset the root password            10) Firewall log
  4) Reset to factory defaults          11) Reload all services
  5) Power off system                   12) Update from console
  6) Reboot system                      13) Restore a backup

Enter an option:


One remaining problem is, that booting with the the files in the MSDOSBOOT FAT partition does not work. After building the image, I transferred the files from a Freebsd 13.1 RPI image to the OPNsense Partition and lo and behold: It worked!

Could it be that the build tools use the package: "u-boot-rpi4-2022.04_1" and Freebsd 13.1 uses: "u-boot-rpi-arm64-2022.04_1" ?

If so: where would I need to look next? Can I simply change the package name in some tools scripts?
#2
I think I figured out how to work around this problem, but it is incredibly clunky:

1. I set a new install of Freebsd 13.1
2. I used git and make update to get the OPNsense sources
3. I copied the /usr/ports/ directory to a remote PC via scp
5. Formated the whole raspberry pi sdcard and set up a fresh Freebsd 13.1 installation
6. Transfered the the copied sources back to the new install
7. went to the copy directory and did the following steps:
    # cd /pathtofolder/ports-mgmt/pkg
    # make package
    # make deinstall
    # make install
8. locked pkg with "pkg lock pkg"

and the proceeded with the steps in the README.

The RPI config asks for qemu-user-static, but there is none in the packages (pkg search qemu-user-static) and when I try to build it from the OPNsense sources via "make package" it tells me aarch64 is not supported. As I am compiling on a raspberry pi with aarch64, I think I shouldn't need an emulator, but who knows.

It is compiling "make arm DEVICE="RPI"" at the moment, we will see how it works out.
#3
Ok, so I did some more testing yesterday:
1. I set a new install of Freebsd 13.1
2. I used git and make update to get the OPNsense sources
3. I created the 1.17.5 package from the OPNsense sources
4. Transfered the created package to my PC via scp
5. Formated the whole raspberry pi sdcard and set up a fresh Freebsd 13.1 installation
6. Transfered the 1.17.5 package to the fresh install
7. Forced the installation of 1.17.5 pkg
and the result was: pkg 1.18 was invoked to downgrade pkg and thereby modified the sqlite database => back to square one


root@generic:/home/freebsd # ls
.cshrc .login_conf .mailrc .shrc pkg-1.17.5_1.pkg
.login .mail_aliases .profile .ssh
root@generic:/home/freebsd # pkg install --force pkg-1.17.5_1.pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:aarch64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.18.3...
Extracting pkg-1.18.3: 100%
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01   
Fetching packagesite.pkg: 100%    6 MiB   6.3MB/s    00:01   
Processing entries: 100%
FreeBSD repository update completed. 30551 packages processed.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
pkg: 1.18.3 -> 1.17.5_1

Number of packages to be downgraded: 1

The operation will free 2 MiB.

Proceed with this action? [y/N]: y
[1/1] Downgrading pkg from 1.18.3 to 1.17.5_1...
Extracting pkg-1.17.5_1: 100%
root@generic:/home/freebsd # pkg install git
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
pkg: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
root@generic:/home/freebsd #


@astronaut: I have no idea how you did it, if you tried again, would you be able to fix it on a new install? If so, can you tell me?
#4
Thanks for the link, I tried to curl it but curl isn't installed in the beginning. So I thought about moving it over with a usb thumb drive.
But then I saw that there is only a amd64 version and not an aarch64 version in https://pkg.opnsense.org/ . And I am building on a raspberry pi, . . . so no idea how to figure this out.
#5
I set it all up from scratch, this time with freebsd 13.1
and the first thing I did was to install git, because I need it to download the tools:
"pkg install git" (just as in the README)
And I guess this messes up the sqlite database, because although I do the steps described by astronaut as well as franco (I tested both)

I will get something like this:

root@generic:/usr/ports/ports-mgmt/pkg # make package
...
===>  Building package for pkg-1.17.5_1
root@generic:/usr/ports/ports-mgmt/pkg # cd work/pkg
root@generic:/usr/ports/ports-mgmt/pkg/work/pkg # pkg install --force pkg-1.17.5_1.pkg
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be DOWNGRADED:
pkg: 1.18.3 -> 1.17.5_1

Number of packages to be downgraded: 1

The operation will free 2 MiB.

Proceed with this action? [y/N]: y
[1/1] Downgrading pkg from 1.18.3 to 1.17.5_1...
Extracting pkg-1.17.5_1: 100%
root@generic:/usr/ports/ports-mgmt/pkg/work/pkg #
root@generic:/usr/tools # make arm DEVICE=RPI
...
WITHOUT_MODULES=cloudabi32
>>> Running build step: base
>>> Passing arguments: (none)
pkg: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
>>> Required package 'u-boot-rpi4' is not installed.
*** Error code 1

Stop.
make: stopped in /usr/tools
root@generic:/usr/tools #


So I am in a bit of a catch 22: I need the tools to install pkg 17.5, and to do that I need git, but as soon as I install git: I mess up the sqlite db
#6
I opted to set it all up anew, just to make sure.

While doing "make update" to get the ports directory in /usr/ports/ (so that I can reinstall pkg), I found out, that 22.7 is now the current stable branch?


>>> Fetching /usr/core:
>>> Updating branch stable/22.7 of /usr/core:
branch 'stable/22.7' set up to track 'origin/stable/22.7'.
Switched to a new branch 'stable/22.7'
Already up to date.


Does this mean I should switch to Freebsd 13.1 as host system?
#7
funnily enough, I now get the same error, when I try to install pkg version 1.17.5 from the opnsense ports  ;D


root@generic:/usr/ports/ports-mgmt/pkg # make package
...
====> Compressing man pages (compress-man)
===>   Installing ldconfig configuration file
===>  Building package for pkg-1.17.5_1
root@generic:/usr/ports/ports-mgmt/pkg # make deinstall
===>  Deinstalling for pkg
pkg-static: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg-static: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
===>   pkg not installed, skipping
root@generic:/usr/ports/ports-mgmt/pkg # make install
===>  Installing for pkg-1.17.5_1
===>  Checking if pkg is already installed
pkg-static: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg-static: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/ports-mgmt/pkg
*** Error code 1

Stop.
make: stopped in /usr/ports/ports-mgmt/pkg
root@generic:/usr/ports/ports-mgmt/pkg #


Are there any other packages I might want to build from the OPNsense ports manually instead of using the ones that come with Freebsd 13.0?
#8
@astronaut: I had used 13.1 in my first attempts as well and ran into pkg issues, then i switched to 13.0 and this "worked" for some time (although my builds failed for other reasons) and by now I seem to have pkg issues with 13.0 as well.

I assume that this needs to be fixed for OPNsense 22.7, because this is based on FreeBSD 13.1 and would then have the new pkg version automatically?

So maybe building OPNsense 22.7 on FreeBSD 13.1 might work?
#9
Ah Ok,

now I can see what you mean:


freebsd@generic:~ % uname -a
FreeBSD generic 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr  9 06:06:55 UTC 2021     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64
freebsd@generic:~ % pkg --version
1.18.3


If this causes the problem, shouldn't everyone get this sqlite error message from now on?
#10
I think the make script uses pkg 1.17.5 at least it says so in line 2:

...
Installing pkg-1.17.5_1...
...

I couldn't find a reference to a version 1.18.
Can I somehow switch to an older version that did not have these problems?
#11
I keep on trying to build an image for my raspberry pi cm4 and this time I ran into an sqlite error while running "make arm DEVICE=RPI" both on a x86 machine as well as on a raspberry pi:


Nothing to do.
Installing pkg-1.17.5_1...
the most recent version of pkg-1.17.5_1 is already installed
Installing iperf3-3.11...
Extracting iperf3-3.11: 100%
Installing ruby-2.7.6_2,1...
`-- Installing libyaml-0.2.5...
`-- Extracting libyaml-0.2.5: 100%
`-- Installing libunwind-20211201_1...
`-- Extracting libunwind-20211201_1: 100%
`-- Installing libedit-3.1.20210910,1...
`-- Extracting libedit-3.1.20210910,1: 100%
Extracting ruby-2.7.6_2,1: 100%
=====
Message from ruby-2.7.6_2,1:

--
Some of the standard commands are provided as separate ports for ease
of upgrading:

        devel/ruby-gems:                gem - RubyGems package manager
        devel/rubygem-irb:              irb - Interactive Ruby
        devel/rubygem-rake:             rake - Ruby Make
        devel/rubygem-rdoc:             rdoc - Ruby Documentation System
        sysutils/rubygem-bundler:       bundler - Tool that manages gem dependencies for ruby applications

And some of the standard libraries are provided as separate ports
since they require extra dependencies:

        databases/rubygem-dbm:  DBM module
        databases/rubygem-gdbm: GDBM module

Install them as occasion demands.
--
===>   NOTICE:

This port is deprecated; you may wish to reconsider installing it:

Please migrate to newer versions. Ruby 2.7 will reach its EoL on April 12, 2023.

It is scheduled to be removed on or after 2023-04-12.
pkg: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01   
Fetching packagesite.pkg: 100%    6 MiB   3.2MB/s    00:02   
Processing entries: 100%
FreeBSD repository update completed. 30551 packages processed.
All repositories are up to date.
pkg: warning: database version 36 is newer than libpkg(3) version 35, but still compatible
pkg: sqlite error while executing INSERT OR IGNORE INTO mtree(content) VALUES(?1) in file pkgdb.c:115: no such table: mtree
*** Error code 1

Stop.
make[1]: stopped in /usr/plugins/benchmarks/iperf
*** Error code 1

Stop.
make: stopped in /usr/tools
root@generic:/usr/tools #


Any idea how this can happen or be fixed?

EDIT: I tried to find all sqlite db files in / and tried the .selftest command on all of them as suggested here: https://forum.opnsense.org/index.php?topic=15868.msg72658#msg72658 but it found no error in any of them.
#12
yes, I think the getting stuck at "Starting start4.elf @ 0xfec00200 partition 0" issues is different from the building serial issue as well.

To check this new issue, I replaced the files in the fat partition, which is created by the opnsense arm image (OPNsense-202207031534-OpenSSL-arm-aarch64-RPI.img) with the files in the original Freebsd image (FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img) and now I at least get to the U-Boot prompt:


RPi: BOOTLOADER release VERSION:507b2360 DATE: 2022/04/26 TIME: 11:24:28 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1650968668 0xb93aeb1e 0x00b03140 0x0006a278
PM_RSTS: 0x00001000
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Samsung' 16Gb x1 total-size: 16 Gbit 3200
DDR 3200 0 0 16 152

Boot mode: SD (01) order f2564
SD HOST: 250000000 CTL0: 0x00000000 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
EMMC
SD retry 1 oc 0
SD HOST: 250000000 CTL0: 0x00000000 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
OCR c0ff8080 [0]
CID: 00150100384754463452062250934938
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 25000000 Hz actual: 25000000 HZ div: 10 (5) status: 0x1fff0000 delay: 4
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 50000000 Hz actual: 41666666 HZ div: 6 (3) status: 0x1fff0000 delay: 2
MBR: 0x00000001,15269887 type: 0xee
MBR: 0x00000000,       0 type: 0x00
MBR: 0x00000000,       0 type: 0x00
MBR: 0x00000000,       0 type: 0x00
Trying partition: 0
GPT 44d5cb73b39937419eb1cb0382cb62f1 000000001 000e8ffff num-partitions 128 entry-size 128
GPT partition: 0 ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 000000800..0000307ff
Matched GUID bootable-part-idx 0 want partition 0
type: 16 lba: 2048 oem: 'mkfs.fat' volume: '  V       ^ '
rsc 4 fat-sectors 192 c-count 49047 c-size 4
root dir cluster 1 sectors 32 entries 512
FAT16 clusters 49047
Trying partition: 0
GPT 44d5cb73b39937419eb1cb0382cb62f1 000000001 000e8ffff num-partitions 128 entry-size 128
GPT partition: 0 ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 000000800..0000307ff
Matched GUID bootable-part-idx 0 want partition 0
type: 16 lba: 2048 oem: 'mkfs.fat' volume: '  V       ^ '
rsc 4 fat-sectors 192 c-count 49047 c-size 4
root dir cluster 1 sectors 32 entries 512
FAT16 clusters 49047
Read config.txt bytes      177 hnd 0x381d
Read start4.elf bytes  2228800 hnd 0x3de3
Read fixup4.dat bytes     5448 hnd 0x3822
Firmware: 564e5f9b852b23a330b1764bcf0b2d022a20afd0 Feb 25 2021 12:10:40
0x00b03140 0x00000000 0x000000ff
MEM GPU: 76 ARM: 948 TOTAL: 1024
Starting start4.elf @ 0xfec00200 partition 0
+


U-Boot 2020.10 (Apr 09 2021 - 03:55:54 +0000)

DRAM:  1.9 GiB
RPI: Board rev 0x14 outside known range
RPI Unknown model (0xb03140)
MMC:   mmc@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 2.5 Gbps x1 (SSC)
PCI: Failed autoconfig bar 10
starting USB...
No working controllers found
Hit any key to stop autoboot:  0
starting USB...
No working controllers found
USB is stopped. Please issue 'usb start' first.
starting USB...
No working controllers found
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: pxeuuid
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/01-e4-5f-01-8d-e1-3a
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/000
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/00
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/0
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-bcm283x-rpi
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm-bcm283x
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default-arm
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
missing environment variable: bootfile
Retrieving file: pxelinux.cfg/default
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
Config file not found
starting USB...
No working controllers found
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
ethernet@7d580000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
bcmgenet: PHY startup failed: -110
U-Boot>

so what does this tell us? Maybe there are some errors in the build process of the fat partition image?
How could I check?
#13
for some reason "make arm DEVICE=RPI" worked: Yay!

But it somehow gets stuck on the boot process and I do not know why:


RPi: BOOTLOADER release VERSION:507b2360 DATE: 2022/04/26 TIME: 11:24:28 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1650968668 0xb93aeb1e 0x00b03140 0x00069bf1
PM_RSTS: 0x00001000
part 00000000 reset_info 00000000
uSD voltage 3.3V
Initialising SDRAM 'Samsung' 16Gb x1 total-size: 16 Gbit 3200
DDR 3200 0 0 16 152

Boot mode: SD (01) order f2564
SD HOST: 250000000 CTL0: 0x00000000 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
SD HOST: 250000000 CTL0: 0x00000f00 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
EMMC
SD retry 1 oc 0
SD HOST: 250000000 CTL0: 0x00000000 BUS: 200000 Hz actual: 200000 HZ div: 1250 (625) status: 0x1fff0000 delay: 540
OCR c0ff8080 [0]
CID: 00150100384754463452062250934938
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 25000000 Hz actual: 25000000 HZ div: 10 (5) status: 0x1fff0000 delay: 4
SD HOST: 250000000 CTL0: 0x00000f04 BUS: 50000000 Hz actual: 41666666 HZ div: 6 (3) status: 0x1fff0000 delay: 2
MBR: 0x00000800,  102400 type: 0x0c
MBR: 0x00019800, 6187008 type: 0xa5
MBR: 0x00000000,       0 type: 0x00
MBR: 0x00000000,       0 type: 0x00
Trying partition: 0
type: 16 lba: 2048 oem: 'BSD4.4  ' volume: '      ^     '
rsc 1 fat-sectors 50 c-count 12783 c-size 8
root dir cluster 1 sectors 32 entries 512
FAT16 clusters 12783
Trying partition: 0
type: 16 lba: 2048 oem: 'BSD4.4  ' volume: '      ^     '
rsc 1 fat-sectors 50 c-count 12783 c-size 8
root dir cluster 1 sectors 32 entries 512
FAT16 clusters 12783
Read start4.elf bytes  2228800 hnd 0x847
Read fixup4.dat bytes     5448 hnd 0x66
Firmware: 564e5f9b852b23a330b1764bcf0b2d022a20afd0 Feb 25 2021 12:10:40
0x00b03140 0x00000000 0x000000ff
MEM GPU: 76 ARM: 948 TOTAL: 1024
Starting start4.elf @ 0xfec00200 partition 0
+


this is the serial output on a CM4 module, trying to boot it from a raspberry pi 4 yields the standard rainbow colored screen without any progress.
#14
quick update: it turns out that building in a different directory is not really supported (although listed in the documentation) and will lead to the missing source files error I have seen: https://github.com/opnsense/ports/issues/150

So I did "make clean" and tried again with "make serial DEVICE=RPI" and I got to the image building stage, where it failed again:


Populating `/usr/obj/usr/tools/config/22.1/OpenSSL:aarch64/efiboot.img'
Image `/usr/obj/usr/tools/config/22.1/OpenSSL:aarch64/efiboot.img' complete
>>> Building serial image... mkimg: work/boot/pmbr: No such file or directory
*** Error code 69

Stop.
make: stopped in /usr/tools


There is an old bugticket: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257960 but its status is still "New" so I think it won't be fixed in the foreseeable future. I am not sure whether I would run into the same error if I did "make arm" instead of make serial, because the error seems to be due to the : in the path, which I assume "make arm" uses as well.

I have really hit a lot of difficulties trying to build an image for RPI4, I dont really have an idea how to proceed, will probably try "make arm DEVICE=RPI" anyway.
#15
I started another run, same directory, same comand, just logged the output to a different file.
Now I see a new error after about an hour:


Installing pkg-1.17.5_1...
the most recent version of pkg-1.17.5_1 is already installed
Installing radsecproxy-1.8.2...
`-- Installing nettle-3.8...
|   `-- Installing gmp-6.2.1...
|   `-- Extracting gmp-6.2.1: .......... done
`-- Extracting nettle-3.8: .......... done
Extracting radsecproxy-1.8.2: .......... done
>>> Generating metadata for os-radsecproxy-1.0... done
>>> Staging files for os-radsecproxy-1.0... done
>>> Generated version info for os-radsecproxy-1.0:
{
    "product_abi": "22.1",
    "product_arch": "aarch64",
    "product_email": "tobias@boehnert.dev",
    "product_flavour": "OpenSSL",
    "product_hash": "c00a41d06",
    "product_id": "os-radsecproxy",
    "product_name": "radsecproxy",
    "product_version": "1.0",
    "product_website": "https://opnsense.org/"
}
>>> Packaging files for os-radsecproxy-1.0:
file sizes/checksums    [38]: . done
packing files           [38]: . done
packing directories      [0]: . done
>>> Installing packages in /usr/obj/tmp/opnsense/tools/config/22.1/OpenSSL:aarch64: realtek-re-kmod
Updating database digests format: ... done
Checking integrity... done (0 conflicting)
The following package(s) are locked and may not be removed:

        ca_root_nss
        curl
        expat
        git
        indexinfo
        libffi
        libidn2
        libnghttp2
        libpsl
        libunistring
        mpdecimal
        openssl
        p5-Error
        pcre2
        perl5
        pkg
        python38
        readline

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

Installed packages to be REMOVED:
        gmp: 6.2.1
        nettle: 3.8
        radsecproxy: 1.8.2

Number of packages to be removed: 3

The operation will free 7 MiB.
[1/3] Deinstalling radsecproxy-1.8.2...
[1/3] Deleting files for radsecproxy-1.8.2: .......... done
[2/3] Deinstalling nettle-3.8...
[2/3] Deleting files for nettle-3.8: .......... done
[3/3] Deinstalling gmp-6.2.1...
[3/3] Deleting files for gmp-6.2.1: .......... done
Installing pkg-1.17.5_1...
the most recent version of pkg-1.17.5_1 is already installed
Could not find package: realtek-re-kmod
*** Error code 1

Stop.
make: stopped in /tmp/opnsense/tools
root@generic:/tmp/opnsense/tools # pkg search realtek-re-kmod
realtek-re-kmod-196.04         Kernel driver for Realtek PCIe Ethernet Controllers
root@generic:/tmp/opnsense/tools #


I do not know whether a rerun uses already compiled packages again or starts the whole process from the beginning, but could it be that there may be a network/disk error at work here? It says it could not find realtek-re-kmod, but looking for it manually shows me that I can download it.