NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-evbarm/58035: [RB] evbarm/earmv6: sshramdisk probably has firmware files in a wrong place



>Number:         58035
>Category:       port-evbarm
>Synopsis:       [RB] evbarm/earmv6: sshramdisk probably has firmware files in a wrong place
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-evbarm-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 14 09:05:00 +0000 2024
>Originator:     Jan-Benedict Glaw
>Release:        current
>Organization:
>Environment:
Linux lili 5.16.0-4-amd64 #1 SMP PREEMPT Debian 5.16.12-1 (2022-03-08) x86_64 GNU/Linux

NetBSD "src" trees (GIT) in /tmp/netbsd-earmv6-test1/NetBSD-src and /tmp/netbsd-earmv6-test2/NetBSD-src.

>Description:
The evbarm sshramdisk gets firmware files included (to be able to use el-cheapo USB network adapters):

distrib/evbarm/instkernel/sshramdisk/Makefile contains:

IMAGEPREBUILD=  ${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR}

The problem here is that all the ${DESTDIR} path is kept while copying to ${WORKDIR}, so with my setup (CI builds with randomized directories, manual builds in /tmp/netbsd-earmv6-test1/*), this ends in something like
${WORKDIR}/tmp/netbsd-earmv6-test1/_dest_/.... which is certainly not the expected destination.

So I guess that firmware loading didn't ever work as the firmware files probably ended up in the wrong place.
>How-To-Repeat:
Just build a release for eg. evbarm / earmv6 and have a look at [...]/src/distrib/evbarm/instkernel/sshramdisk/obj/work (probably with the sources not in NetBSD's standard location.) For me, I'm having temporary source trees in /tmp/netbsd-earmv6-test1 + test2 (to compare builds) running:


```
declare -a args
nb_mach=evbarm
nb_arch=earmv6
nb_srcdir="$(pwd)/NetBSD-src"
nb_reldir="$(pwd)/_rel_"
nb_destdir="$(pwd)/_dest_"
nb_tooldir="$(pwd)/_tools_"
logdir=$(pwd)

args+=(-N 4)                    # Be noisy.
args+=(-P)                      # Reproducible build.
args+=(-U)                      # Unprivileged build.
args+=(-u)                      # Don't run `make cleandir`.
args+=(-m "${nb_mach}")         # Port name.
args+=(-a "${nb_arch}")         # CPU architecture.
args+=(-E)                      # Expert mode.
args+=(-D "${nb_destdir}")      # Destination directory.
args+=(-R "${nb_reldir}")       # Release directory.
args+=(-T "${nb_tooldir}")      # Tools directory.
#args+=(-j 4)                   # Build in parallel.

pushd "${nb_srcdir}"
        ./build.sh "${args[@]}" tools           2>&1 | tee "${logdir}/1-tools.log"
        ./build.sh "${args[@]}" libs            2>&1 | tee "${logdir}/2-libs.log"
        ./build.sh "${args[@]}" release         2>&1 | tee "${logdir}/3-release.log"
        ./build.sh "${args[@]}" iso-image       2>&1 | tee "${logdir}/4-iso-image.log"
        ./build.sh "${args[@]}" install-image   2>&1 | tee "${logdir}/5-install-image.log"
        ./build.sh "${args[@]}" live-image      2>&1 | tee "${logdir}/6-live-image.log"
popd
```



So destdir is "/tmp/netbsd-earmv6-test1/_dest_". With the above `nbpax`, that initial part is kept instead of only firmware files being copied into the right place.
>Fix:
I tried this patch:

diff --git a/distrib/evbarm/instkernel/sshramdisk/Makefile b/distrib/evbarm/instkernel/sshramdisk/Makefile
index 95aec3490f5c..5c964b16a267 100644
--- a/distrib/evbarm/instkernel/sshramdisk/Makefile
+++ b/distrib/evbarm/instkernel/sshramdisk/Makefile
@@ -29,7 +29,7 @@ IMAGEDEPENDS= ${CRUNCHBIN} \
                ${NETBSDSRCDIR}/etc/group \
                ${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \
                ${DISTRIBDIR}/common/services
-IMAGEPREBUILD= ${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${DESTDIR}/libdata/firmware ${WORKDIR}
+IMAGEPREBUILD= (cd ${DESTDIR} && ${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp libdata/firmware ${WORKDIR})
 
 # Use stubs to eliminate some large stuff from libc
 HACKSRC=       ${DISTRIBDIR}/utils/libhack





However, that results in

#   execute  checkflist
[...]
=======  259 extra files in DESTDIR  =========
Files in DESTDIR but missing from flist.
File is obsolete or flist is out of date ?
------------------------------------------
./work
./work/libdata
./work/libdata/firmware
./work/libdata/firmware/amdgpu
./work/libdata/firmware/if_athn
./work/libdata/firmware/if_athn/athn-ar7010
./work/libdata/firmware/if_athn/athn-ar7010-11
./work/libdata/firmware/if_athn/athn-ar9271
./work/libdata/firmware/if_athn/athn-license
./work/libdata/firmware/if_bwfm
./work/libdata/firmware/if_bwfm/LICENCE.broadcom_bcm43xx
./work/libdata/firmware/if_bwfm/brcmfmac43143-sdio.bin
./work/libdata/firmware/if_bwfm/brcmfmac43143.bin
./work/libdata/firmware/if_bwfm/brcmfmac43236b.bin
./work/libdata/firmware/if_bwfm/brcmfmac43241b0-sdio.bin
./work/libdata/firmware/if_bwfm/brcmfmac43241b4-sdio.bin
./work/libdata/firmware/if_bwfm/brcmfmac43241b5-sdio.bin
[...]

So I guess while trying to fix one, I broke another. Maybe you instantly recognize the issue.



Home | Main Index | Thread Index | Old Index