OPNsense Forum

English Forums => Development and Code Review => Topic started by: gondox on June 16, 2022, 10:18:34 am

Title: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: gondox on June 16, 2022, 10:18:34 am
Hi,

I tried to compile DEVICE=ARM64 images in the past, which had some issues. Now I try to build a DEVICE=RPI serial image on my Raspberry Pi 4 which has Freebsd 13.0 installed.

The compilation ran for two days but got stuck today and so far I do not know what is missing. I would appreciate any help.

This is the error I see:

Code: [Select]
configure: loading site script /tmp/opnsense/ports/Templates/config.site
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 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 minix/config.h... (cached) no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
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 for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of cc... gcc3
checking for cc option to accept ISO C99... none needed
checking whether __clang__ is declared... yes
checking whether __INTEL_COMPILER is declared... no
checking whether __SUNPRO_C is declared... no
checking pkg-config is at least version 0.9.0... yes
checking build system type... aarch64-portbld-freebsd13.0
checking host system type... aarch64-portbld-freebsd13.0
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking if cc supports -Werror=unknown-warning-option... yes
checking if cc supports -Werror=unused-command-line-argument... yes
checking if cc supports -Wall... yes
checking if cc supports -Wpointer-arith... yes
checking if cc supports -Wmissing-declarations... yes
checking if cc supports -Wformat=2... yes
checking if cc supports -Wstrict-prototypes... yes
checking if cc supports -Wmissing-prototypes... yes
checking if cc supports -Wnested-externs... yes
checking if cc supports -Wbad-function-cast... yes
checking if cc supports -Wold-style-definition... yes
checking if cc supports -Wdeclaration-after-statement... yes
checking if cc supports -Wunused... yes
checking if cc supports -Wuninitialized... yes
checking if cc supports -Wshadow... yes
checking if cc supports -Wmissing-noreturn... yes
checking if cc supports -Wmissing-format-attribute... yes
checking if cc supports -Wredundant-decls... yes
checking if cc supports -Wlogical-op... no
checking if cc supports -Werror=implicit... yes
checking if cc supports -Werror=nonnull... yes
checking if cc supports -Werror=init-self... yes
checking if cc supports -Werror=main... yes
checking if cc supports -Werror=missing-braces... yes
checking if cc supports -Werror=sequence-point... yes
checking if cc supports -Werror=return-type... yes
checking if cc supports -Werror=trigraphs... yes
checking if cc supports -Werror=array-bounds... yes
checking if cc supports -Werror=write-strings... yes
checking if cc supports -Werror=address... yes
checking if cc supports -Werror=int-to-pointer-cast... yes
checking if cc supports -Werror=pointer-to-int-cast... yes
checking if cc supports -pedantic... yes
checking if cc supports -Werror... yes
checking if cc supports -Werror=attributes... yes
checking whether make supports nested variables... (cached) yes
checking for gzopen in -lz... yes
checking for vasprintf... (cached) yes
checking for MKFONTSCALE... yes
checking for X11... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating man/Makefile
config.status: creating config.h
config.status: executing depfiles commands
[20220616005411] ===> Building for mkfontscale-1.2.1
--- all ---
/usr/bin/make  all-recursive
--- all-recursive ---
Making all in man
--- mkfontdir.1 ---
--- mkfontscale.1 ---
--- mkfontdir.1 ---
/usr/bin/sed -e 's|__vendorversion__|"mkfontscale 1.2.1" "X Version 11"|' -e 's|__xorgversion__|"mkfontscale 1.2.1" "X Version 11"|' -e 's|__xservername__|Xorg|g' -e 's|__xconfigfile__|xorg.conf|g' -e 's|__projectroot__|/usr/local|g' -e 's|__apploaddir__||g' -e 's|__appmansuffix__|1|g' -e 's|__drivermansuffix__|4|g' -e 's|__adminmansuffix__|8|g' -e 's|__libmansuffix__|3|g' -e 's|__miscmansuffix__|7|g' -e 's|__filemansuffix__|5|g' < mkfontdir.man > mkfontdir.1
--- mkfontscale.1 ---
/usr/bin/sed -e 's|__vendorversion__|"mkfontscale 1.2.1" "X Version 11"|' -e 's|__xorgversion__|"mkfontscale 1.2.1" "X Version 11"|' -e 's|__xservername__|Xorg|g' -e 's|__xconfigfile__|xorg.conf|g' -e 's|__projectroot__|/usr/local|g' -e 's|__apploaddir__||g' -e 's|__appmansuffix__|1|g' -e 's|__drivermansuffix__|4|g' -e 's|__adminmansuffix__|8|g' -e 's|__libmansuffix__|3|g' -e 's|__miscmansuffix__|7|g' -e 's|__filemansuffix__|5|g' < mkfontscale.man > mkfontscale.1
--- constlist.o ---
--- hash.o ---
--- ident.o ---
--- list.o ---
--- constlist.o ---
cc -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include  -D_BSD_SOURCE   -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT constlist.o -MD -MP -MF .deps/constlist.Tpo -c -o constlist.o constlist.c
--- hash.o ---
cc -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include  -D_BSD_SOURCE   -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT hash.o -MD -MP -MF .deps/hash.Tpo -c -o hash.o hash.c
--- ident.o ---
cc -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include  -D_BSD_SOURCE   -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT ident.o -MD -MP -MF .deps/ident.Tpo -c -o ident.o ident.c
--- list.o ---
cc -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include  -D_BSD_SOURCE   -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT list.o -MD -MP -MF .deps/list.Tpo -c -o list.o list.c
--- constlist.o ---
mv -f .deps/constlist.Tpo .deps/constlist.Po
--- mkfontscale.o ---
cc -DHAVE_CONFIG_H -I.  -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/local/include/libpng16  -I/usr/local/include  -D_BSD_SOURCE   -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT mkfontscale.o -MD -MP -MF .deps/mkfontscale.Tpo -c -o mkfontscale.o mkfontscale.c
--- hash.o ---
mv -f .deps/hash.Tpo .deps/hash.Po
--- mkfontdir ---
/usr/bin/sed -e 's|@bindir[@]|/usr/local/bin|g' < ./mkfontdir.in > mkfontdir
--- list.o ---
mv -f .deps/list.Tpo .deps/list.Po
--- mkfontscale.o ---
mkfontscale.c:779:66: warning: declaration shadows a variable in the global scope [-Wshadow]
doDirectory(const char *dirname_given, int numEncodings, ListPtr encodingsToDo)
                                                                 ^
mkfontscale.c:115:16: note: previous declaration is here
static ListPtr encodingsToDo;
               ^
mkfontscale.c:1293:23: warning: declaration shadows a variable in the global scope [-Wshadow]
readEncodings(ListPtr encodings, char *dirname)
                      ^
mkfontscale.c:92:21: note: previous declaration is here
static ConstListPtr encodings, extra_encodings;
                    ^
--- ident.o ---
mv -f .deps/ident.Tpo .deps/ident.Po
--- mkfontscale.o ---
2 warnings generated.
mv -f .deps/mkfontscale.Tpo .deps/mkfontscale.Po
--- mkfontscale ---
cc -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -fstack-protector-strong -o mkfontscale constlist.o hash.o  ident.o list.o mkfontscale.o -L/usr/local/lib -lfontenc -lfreetype -lz
[20220616005414] ===> Staging for mkfontscale-1.2.1
===>   mkfontscale-1.2.1 depends on file: /usr/local/libdata/pkgconfig/fontenc.pc - found
[20220616005414] ===> Generating temporary packing list
Making install in man
 /bin/mkdir -p '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/man/man1'
 install  -m 0644 mkfontdir.1 mkfontscale.1 '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/man/man1'
 /bin/mkdir -p '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/bin'
  install  -s -m 555 mkfontscale '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/bin'
 /bin/mkdir -p '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/bin'
 install  -m 555 mkfontdir '/usr/obj/tmp/opnsense/ports/x11-fonts/mkfontscale/work/stage/usr/local/bin'
[20220616005415] ====> Compressing man pages (compress-man)
[20220616005415] ===> Installing for mkfontscale-1.2.1
[20220616005415] ===> Checking if mkfontscale is already installed
[20220616005415] ===> Registering installation for mkfontscale-1.2.1 as automatic
Installing mkfontscale-1.2.1...
===>   urwfonts-1.0_8 depends on executable: mkfontscale - found
===>   Returning to build of urwfonts-1.0_8
[20220616005415] ===> Generating temporary packing list
install  -m 0644 /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/URW/Fontmap /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/stage/usr/local/share/fonts/urwfonts
install  -m 0644 /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/URW/*.pfb /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/stage/usr/local/share/fonts/urwfonts
install  -m 0644 /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/URW/*.afm /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/stage/usr/local/share/fonts/urwfonts
install  -m 0644 /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/URW/*.pfm /usr/obj/tmp/opnsense/ports/x11-fonts/urwfonts/work/stage/usr/local/share/fonts/urwfonts
[20220616005415] ====> Compressing man pages (compress-man)
[20220616005416] ===> Installing for urwfonts-1.0_8
[20220616005416] ===> Checking if urwfonts is already installed
[20220616005416] ===> Registering installation for urwfonts-1.0_8
Installing urwfonts-1.0_8...
You'll have to add /usr/local/share/fonts/urwfonts
to your X font path by either:

$ xset fp+ /usr/local/share/fonts/urwfonts
$ xset fp rehash

or by adding it to your X-server configuration file (usually
/etc/X11/xorg.conf) and restarting the X-server.

[20220616005417] ====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
===> Checking for items in pkg-plist which are not in STAGEDIR
[20220616005417] ===> No pkg-plist issues found (check-plist)
Creating package for expat-2.4.8
expat-2.4.8 already packaged, skipping...
Creating package for fontconfig-2.13.94_2,1
fontconfig-2.13.94_2,1 already packaged, skipping...
Creating package for freetype2-2.12.1
freetype2-2.12.1 already packaged, skipping...
Creating package for libfontenc-1.1.4
Creating package for mkfontscale-1.2.1
Creating package for pkg-1.17.5_1
pkg-1.17.5_1 already packaged, skipping...
Creating package for pkgconf-1.8.0,1
pkgconf-1.8.0,1 already packaged, skipping...
Creating package for png-1.6.37_1
png-1.6.37_1 already packaged, skipping...
Creating package for urwfonts-1.0_8
Creating package for xorg-macros-1.19.3
xorg-macros-1.19.3 already packaged, skipping...
Creating package for xorgproto-2021.5
xorgproto-2021.5 already packaged, skipping...
>>> Locking package dependency: pkgconf
>>> Locking package dependency: pkg
>>> Locking package dependency: urwfonts
Updating database digests format: .......... done
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 2 packages:

Installed packages to be REMOVED:
xorg-macros: 1.19.3
xorgproto: 2021.5

Number of packages to be removed: 2

The operation will free 1 MiB.
[1/2] Deinstalling xorg-macros-1.19.3...
[1/2] Deleting files for xorg-macros-1.19.3: ...... done
[2/2] Deinstalling xorgproto-2021.5...
[2/2] Deleting files for xorgproto-2021.5: .......... done
>>> Saving runtime package: libfontenc
>>> Saving runtime package: mkfontscale
>>> Saving runtime package: urwfonts
[20220616005440] ===> Cleaning for mkfontscale-1.2.1
[20220616005440] ===> Cleaning for libfontenc-1.1.4
[20220616005440] ===> Cleaning for urwfonts-1.0_8
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 9 packages:

Installed packages to be REMOVED:
expat: 2.4.8
fontconfig: 2.13.94_2,1
freetype2: 2.12.1
libfontenc: 1.1.4
mkfontscale: 1.2.1
pkg: 1.17.5_1
pkgconf: 1.8.0,1
png: 1.6.37_1
urwfonts: 1.0_8

Number of packages to be removed: 9

The operation will free 20 MiB.
[1/9] Deinstalling urwfonts-1.0_8...
[1/9] Deleting files for urwfonts-1.0_8: .......... done
[2/9] Deinstalling fontconfig-2.13.94_2,1...
[2/9] Deleting files for fontconfig-2.13.94_2,1: .......... done
[3/9] Deinstalling mkfontscale-1.2.1...
[3/9] Deleting files for mkfontscale-1.2.1: ....... done
[4/9] Deinstalling freetype2-2.12.1...
[4/9] Deleting files for freetype2-2.12.1: .......... done
[5/9] Deinstalling expat-2.4.8...
[5/9] Deleting files for expat-2.4.8: .......... done
[6/9] Deinstalling libfontenc-1.1.4...
[6/9] Deleting files for libfontenc-1.1.4: ......... done
[7/9] Deinstalling pkg-1.17.5_1...
[7/9] Deleting files for pkg-1.17.5_1: .......... done
[8/9] Deinstalling pkgconf-1.8.0,1...
[8/9] Deleting files for pkgconf-1.8.0,1: .......... done
[9/9] Deinstalling png-1.6.37_1...
[9/9] Deleting files for png-1.6.37_1: .......... done
Creating repository in /usr/obj/tmp/opnsense/tools/config/22.1/OpenSSL:aarch64/.pkg-new/: .......... done
Packing files for repository: .... done
>>> Running build step: clean
>>> Passing arguments: packages
>>> Removing packages set
>>> Creating package mirror set for 22.1.8_170-OpenSSL-aarch64... done
-rw-r--r--  1 root  wheel   678M Jun 16 00:58 packages-22.1.8_170-OpenSSL-aarch64.tar
>>> WARNING: The build provided additional info.
>>> Package list inconsistency for emulators/qemu-guest-agent
>>> ERROR: The build encountered fatal issues!
>>> Aborted version 196.04 for net/realtek-re-kmod
>>> Aborted version 3.3.5_1 for net/shadowsocks-libev
>>> Aborted version 2,1 for net/wireguard
>>> Aborted version 0.0.20211105_1 for net/wireguard-kmod
>>> Aborted version 1.12a for sysutils/cciss_vol_status
*** Error code 1

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

I have checked whether qemu-guest-agent is installed:
Code: [Select]
root@generic:/tmp/opnsense # pkg install qemu-guest-agent
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed

and it already was.

kind regards,
Gondox
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: gondox on June 16, 2022, 11:23:51 am
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:

Code: [Select]
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.
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: gondox on July 06, 2022, 06:05:04 pm
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:

Code: [Select]
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.
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: gondox on July 06, 2022, 07:34:38 pm
for some reason "make arm DEVICE=RPI" worked: Yay!

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

Code: [Select]
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.
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: franco on July 06, 2022, 08:35:49 pm
I'm the author of the bug ticket and pmbr is simply not available on arm, that's why a separate arm image target exists. The issue is not the same and was worked around via https://github.com/opnsense/tools/commit/d6d65fc0b4 specifically for mkimg...


Cheers,
Franco
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: gondox on July 06, 2022, 08:54:35 pm
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:

Code: [Select]
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?
Title: Re: Build fail on Freebsd 13.0 RPi4 for DEVICE=RPI with Error code 1
Post by: franco on July 07, 2022, 10:58:39 am
Don't know. I was testing this on RPI2 years back and I don't have a recent device.


Cheers,
Franco