Re: Raimbow screen installing / booting FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img on the raspberry pi zero 2w

From: Mario Marietto <marietto2008_at_gmail.com>
Date: Wed, 05 Feb 2025 01:08:23 UTC
--> So, while not perfect, until someone from the projects adds a zero 2
dtb, I’m guessing copying one of the pi-3 images is your best bet

In this case I think that the bug report reports misleading information.
Nowhere has been said that the proposed patches don't work. This is
confusing and brings the users to do unuseful operations.

---> (I just tried it and it works — well, boots, at least)

What happens after its booting ? Does it work properly after booting ?

Anyway,I tried to cross compile the code thinking that the patch haven't
been applied,but it failed :

marietto# git clone https://git.FreeBSD.org/src.git /mnt/da0s2a/usr/src
marietto# cd /mnt/da0s2a/usr/src
marietto# git checkout releng/14.2
marietto# env MAKEOBJDIRPREFIX=/mnt/da0s2a/usr/src make buildworld
TARGET_ARCH=aarch64

.....
cc -target x86_64-unknown-freebsd14.2
--sysroot=/usr/obj/mnt/da0s2a/usr/src/amd64.amd64/tmp
-B/usr/obj/mnt/da0s2a/usr/src/amd64.amd64/tmp/usr/bin  -O2 -pipe
-fno-common -DHAVE_SSE2     -DHAVE_SSE3 -DHAVE_AVX2 -DHAVE_AVX
-D__x86_64 -DHAVE_AVX512F  -DHAVE_AVX512BW -DIN_BASE
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/include
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/lib/libspl/include
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/lib/libspl/include/os/freebsd
 -I/mnt/da0s2a/usr/src/sys
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/include/os/freebsd/zfs
-I/mnt/da0s2a/usr/src/cddl/compat/opensolaris/include
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/module/icp/include  -include
/mnt/da0s2a/usr/src/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 -DHAVE_ISSETUGID  -include
/mnt/da0s2a/usr/src/sys/modules/zfs/zfs_config.h
-I/mnt/da0s2a/usr/src/sys/modules/zfs
-I/mnt/da0s2a/usr/src/sys/contrib/openzfs/include/os/freebsd/zfs
-DLIB_ZPOOL_BUILD -DZFS_DEBUG -DWANTS_MUTEX_OWNED
-I/mnt/da0s2a/usr/src/lib/libpthread/thread
-I/mnt/da0s2a/usr/src/lib/libpthread/sys
-I/mnt/da0s2a/usr/src/lib/libthr/arch/amd64/include -g -DDEBUG=1
-DNEED_SOLARIS_BOOLEAN -g -gz=zlib -MD  -MF.depend.zfs_znode.o
-MTzfs_znode.o -std=iso9899:1999 -Wno-format-zero-length
-fstack-protector-strong -Wsystem-headers -Werror -Wall
-Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time
-Wno-unknown-pragmas -Wno-empty-body -Wno-string-plus-int
-Wno-unused-const-variable -Wno-error=unused-but-set-parameter
-Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
-Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef
-Wno-address-of-packed-member -Wno-switch -Wno-switch-enum
-Wno-knr-promoted-parameter  -Qunused-arguments    -c
/mnt/da0s2a/usr/src/sys/contrib/openzfs/module/zfs/zfs_znode.c -o
zfs_znode.o
/mnt/da0s2a/usr/src/sys/contrib/openzfs/module/zfs/zfs_znode.c:197:24:
error: use of undeclared identifier 'ZAP_MAXNAMELEN_NEW'
  197 |         comp_buf = kmem_alloc(ZAP_MAXNAMELEN_NEW + 2, KM_SLEEP);
      |                               ^
/mnt/da0s2a/usr/src/sys/contrib/openzfs/module/zfs/zfs_znode.c:225:8:
error: use of undeclared identifier 'ZAP_MAXNAMELEN_NEW'
  225 |                             ZAP_MAXNAMELEN_NEW);
      |                             ^
/mnt/da0s2a/usr/src/sys/contrib/openzfs/module/zfs/zfs_znode.c:256:22:
error: use of undeclared identifier 'ZAP_MAXNAMELEN_NEW'
  256 |         kmem_free(comp_buf, ZAP_MAXNAMELEN_NEW +2);
      |                             ^
3 errors generated.
*** Error code 1

Stop.
make[5]: stopped in /mnt/da0s2a/usr/src/cddl/lib/libzpool
*** Error code 1

Stop.
make[4]: stopped in /mnt/da0s2a/usr/src/cddl/lib
*** Error code 1

Stop.
make[3]: stopped in /mnt/da0s2a/usr/src
*** Error code 1

Stop.
make[2]: stopped in /mnt/da0s2a/usr/src
      943.20 real       703.49 user        82.66 sys
*** Error code 1

Stop.
make[1]: stopped in /mnt/da0s2a/usr/src
*** Error code 1

Stop.


On Wed, Feb 5, 2025 at 1:37 AM Marco Devesas Campos <
devesas.campos@gmail.com> wrote:

> The problem isn’t the fix — it’s that there is simply no appropriate
> device tree for the zero-2 that is bundled with the image so the board has
> no idea how to boot.
>
> So, while not perfect, until someone from the projects adds a zero 2 dtb,
> I’m guessing copying one of the pi-3 images is your best bet (I just tried
> it and it works — well, boots, at least).
>
> Best,
> Marco
>
> On 4 Feb 2025, at 22:57, Mario Marietto <marietto2008@gmail.com> wrote:
>
> Hello.
>
> I've dd'ed FreeBSD 14.2 RELEASE on a sd card and I tried to boot it with my Raspberry Pi zero 2 w :
>
> # dd if=FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img of=/dev/sdf
>
> but unfortunately when I turned on the board I got the rainbow screen :
> https://ibb.co/cXKFCtvJ
>
>
> According with this but report :
>
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261147
>
> I should apply this fix :
>
>
> https://cgit.freebsd.org/src/commit/?id=9873b171697033f9f19608d98bcd1c16cacb92af
>
> but I see that it has already been applied :
>
> <Screenshot_2025-02-04_23-47-23.png>
>
> but I get the rainbow screen anyway. I would like to understand why,where
> is the error,how can I fix it ?
>
> Thanks.
>
> On Tue, Feb 4, 2025 at 8:31 PM Mario Marietto <marietto2008@gmail.com>
> wrote:
>
>> > If I recall correctly, it’s enough to copy  bcm2710-rpi-3-b-plus.dtb
>> to bcm2710-rpi-zero-2.dtb (in the msdos partition).
>>
>> It seems to be the wrong approach :
>>
>> Emmanuel Vadot <manu@freebsd.org> [image: freebsd_committer] [image:
>> freebsd_triage] 2022-01-24 08:09:30 UTC
>>
>> (In reply to david.elliott3040 from comment #5 <https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261147#c5>)
>>
>> This is a wrong approach, while they have the same SoC and most of the peripherals are
>> the same they are not the same board and this can only lead to problems.
>>
>> source :
>>
>> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261147
>>
>>
>> On Tue, Feb 4, 2025 at 8:19 PM Marco Devesas Campos <
>> devesas.campos@gmail.com> wrote:
>>
>>> If I recall correctly, it’s enough to copy  bcm2710-rpi-3-b-plus.dtb to
>>> bcm2710-rpi-zero-2.dtb (in the msdos partition).
>>>
>>> Best,
>>> Marco
>>>
>>>
>>> On 4 Feb 2025, at 17:35, Mario Marietto <marietto2008@gmail.com> wrote:
>>>
>>> Hello.
>>>
>>> I've dd'ed FreeBSD 14.2 RELEASE on a sd card and I tried to boot it with my Raspberry Pi zero 2 w :
>>>
>>> # dd if=FreeBSD-14.2-RELEASE-arm64-aarch64-RPI.img of=/dev/sdf
>>>
>>> but unfortunately when I turned on the board I got the rainbow screen :
>>> https://ibb.co/cXKFCtvJ
>>>
>>> So I suppose that the fix hasn't been upstreamed for FreeBSD 14.2-RELEASE.
>>>
>>> What can I do to bypass the bug ?
>>>
>>>
>>> --
>>> Mario.
>>>
>>>
>>>
>>
>> --
>> Mario.
>>
>
>
> --
> Mario.
>
>
>

-- 
Mario.