RPi 4 not booting even after u-boot.bin is replaced

Here is the contents of the just made USB Flash drive stick from 'dd' the FreeBSD-13.1 image file
ls -lh
ls: bin: No such file or directory
ls: boot: No such file or directory
ls: dev: No such file or directory
ls: etc: No such file or directory
ls: lib: No such file or directory
ls: net: No such file or directory
ls: rescue: No such file or directory
ls: sbin: No such file or directory
ls: usr: No such file or directory
total 80
-r--r--r-- 1 root wheel 6.0K May 12 2022 COPYRIGHT
-rw-r--r-- 1 root wheel 0B May 12 2022 firstboot
drwxr-xr-x 3 root wheel 512B May 12 2022 home/
drwxr-xr-x 3 root wheel 512B May 12 2022 libexec/
drwxr-xr-x 2 root wheel 512B May 12 2022 media/
drwxr-xr-x 2 root wheel 512B May 12 2022 mnt/
dr-xr-xr-x 2 root wheel 512B May 12 2022 proc/
drwxr-xr-x 2 root wheel 512B May 12 2022 root/
drwxrwxrwt 2 root wheel 512B May 12 2022 tmp/
drwxr-xr-x 24 root wheel 512B May 12 2022 var/

fred@fredTC93-pc ~> mount
zroot/ROOT/default on / (zfs, local, nfsv4acls)
devfs on /dev (devfs)
procfs on /proc (procfs, local)
zroot/usr/ports on /usr/ports (zfs, local, nosuid, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noexec, nosuid, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, nosuid, nfsv4acls)
zroot/var/mail on /var/mail (zfs, local, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noexec, nosuid, nfsv4acls)
zroot/usr/home on /usr/home (zfs, local, nfsv4acls)
zroot/tmp on /tmp (zfs, local, nosuid, nfsv4acls)
linprocfs on /compat/linux/proc (linprocfs, local)
linsysfs on /compat/linux/sys (linsysfs, local)
devfs on /compat/linux/dev (devfs)
fdescfs on /compat/linux/dev/fd (fdescfs)
tmpfs on /compat/linux/dev/shm (tmpfs, local)
devfs on /compat/ubuntu/dev (devfs)
tmpfs on /compat/ubuntu/dev/shm (tmpfs, local)
fdescfs on /compat/ubuntu/dev/fd (fdescfs)
linprocfs on /compat/ubuntu/proc (linprocfs, local)
linsysfs on /compat/ubuntu/sys (linsysfs, local)
/tmp on /compat/ubuntu/tmp (nullfs, local, nosuid, nfsv4acls)
/usr/home on /compat/ubuntu/home (nullfs, local, nfsv4acls)
/dev/da1s2a on /media/da1s2a (ufs, local, noatime, soft-updates)
/dev/da1s1 on /media/da1s1 (msdosfs, local, noatime)

fred@fredTC93-pc ~> cd /media/da1s2a
fred@fredTC93-pc /m/da1s2a> ls -lh
ls: bin: No such file or directory
ls: boot: No such file or directory
ls: dev: No such file or directory
ls: etc: No such file or directory
ls: lib: No such file or directory
ls: net: No such file or directory
ls: rescue: No such file or directory
ls: sbin: No such file or directory
ls: usr: No such file or directory
total 80
-r--r--r-- 1 root wheel 6.0K May 12 2022 COPYRIGHT
-rw-r--r-- 1 root wheel 0B May 12 2022 firstboot
drwxr-xr-x 3 root wheel 512B May 12 2022 home/
drwxr-xr-x 3 root wheel 512B May 12 2022 libexec/
drwxr-xr-x 2 root wheel 512B May 12 2022 media/
drwxr-xr-x 2 root wheel 512B May 12 2022 mnt/
dr-xr-xr-x 2 root wheel 512B May 12 2022 proc/
drwxr-xr-x 2 root wheel 512B May 12 2022 root/
drwxrwxrwt 2 root wheel 512B May 12 2022 tmp/
drwxr-xr-x 24 root wheel 512B May 12 2022 var/
fred@fredTC93-pc /m/da1s2a [1]> ls -lh home
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh libexec/
total 232
-r-xr-xr-x 1 root wheel 110K May 12 2022 ld-elf.so.1*
drwxr-xr-x 2 root wheel 512B May 12 2022 resolvconf/
fred@fredTC93-pc /m/da1s2a> ls -lh libexec/resolvconf
total 72
-r--r--r-- 1 root wheel 5.7K May 12 2022 dnsmasq
-r--r--r-- 1 root wheel 6.6K May 12 2022 libc
-r--r--r-- 1 root wheel 3.6K May 12 2022 named
-r--r--r-- 1 root wheel 2.4K May 12 2022 pdns_recursor
-r--r--r-- 1 root wheel 4.3K May 12 2022 pdnsd
-r--r--r-- 1 root wheel 2.9K May 12 2022 unbound
fred@fredTC93-pc /m/da1s2a> ls -lh media
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh mnt
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh proc
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh root
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh tmp
total 0
fred@fredTC93-pc /m/da1s2a> ls -lh var
total 176
drwxr-x--- 2 root wheel 512B May 12 2022 account/
drwxr-xr-x 4 root wheel 512B May 12 2022 at/
drwxr-x--- 4 root audit 512B May 12 2022 audit/
drwxrwx--- 2 root authpf 512B May 12 2022 authpf/
drwxr-x--- 2 root wheel 512B May 12 2022 backups/
drwxr-xr-x 2 root wheel 512B May 12 2022 cache/
drwxr-x--- 2 root wheel 512B May 12 2022 crash/
drwxr-x--- 3 root wheel 512B May 12 2022 cron/
drwxr-xr-x 11 root wheel 512B May 12 2022 db/
dr-xr-xr-x 2 root wheel 512B May 12 2022 empty/
drwxrwxr-x 2 root games 512B May 12 2022 games/
drwx------ 2 root wheel 512B May 12 2022 heimdal/
drwxr-xr-x 2 root wheel 512B May 12 2022 log/
drwxrwxr-x 2 root mail 512B May 12 2022 mail/
drwxr-xr-x 2 daemon wheel 512B May 12 2022 msgs/
drwxr-xr-x 2 root wheel 512B May 12 2022 preserve/
drwxr-xr-x 5 root wheel 512B May 12 2022 run/
drwxrwxr-x 2 root daemon 512B May 12 2022 rwho/
drwxr-xr-x 9 root wheel 512B May 12 2022 spool/
drwxrwxrwt 3 root wheel 512B May 12 2022 tmp/
drwxr-xr-x 3 unbound unbound 512B May 12 2022 unbound/
drwxr-xr-x 2 root wheel 512B May 12 2022 yp/

Notice that the USB Flash Disk Stick 128GB was recognized and automounted as 2 partitions
Security policy loaded: MAC/ntpd (mac_ntpd)
ugen0.5: <Kingston DataTraveler 3.0> at usbus0
umass1 on uhub0
umass1: <Kingston DataTraveler 3.0, class 0/0, rev 3.20/0.01, addr 5> on usbus0
umass1: SCSI over Bulk-Only; quirks = 0xc000
umass1:3:1: Attached to scbus3
pass2 at umass-sim1 bus 1 scbus3 target 0 lun 0
pass2: <Kingston DataTraveler 3.0 > Removable Direct Access SPC-4 SCSI device
pass2: Serial Number E0D55E6CBD05F671E9483985
pass2: 400.000MB/s transfers
GEOM: new disk da1
da1 at umass-sim1 bus 1 scbus3 target 0 lun 0
da1: <Kingston DataTraveler 3.0 > Removable Direct Access SPC-4 SCSI device
da1: Serial Number E0D55E6CBD05F671E9483985
da1: 400.000MB/s transfers
da1: 117998MB (241660916 512 byte sectors)
da1: quirks=0x2<NO_6_BYTE>
da1: Delete methods: <NONE(*),ZERO>
WARNING: /media/da1s2a was not properly dismounted
Dismount the disk partitions
umount /dev/da1s2a /dev/da1s1
dmesg | grep -n /da[0-1]
986: eg. ufs:/dev/da0s1a
1203:WARNING: /media/da1s2a was not properly dismounted
 
OK, You are right. This FreeBSD-13.1-Release is not booting for me on my Raspberry Pi 4B.
Let me figure it out. ERROR: cannot open /boot/lua/loader.lua: no such file or directory
OK
Try writing the image into the USB Flash Drive stick a second time and see if that boots up. This worked for me correctly. The file path /boot/lua/loader.lua was there and the O/S booted up on my 128GB USB Flash drive.

Has anybody else went from downloading a FreeBSD 13.1 RELEASE image, uncompressed image, 'dd' written image to a USB Flash drive stick and plugged disk into the blue USB 3.0 socket and booted up? Let me know.
The USB 3.2 Kingston 128GB Flash Drive stick. DTXM/128GB UPC Code 7 40617 32637 6. Now will try in the black USB 2.0 socket on the outer left side edge of this Raspberry Pi 4B B0T Rev 1.4? bought in January 2021.

Raspberry Pi 4B booting FreeBSD Release 13.1, Error can not open file /boot/lua/loader.lua . Problem directory /boot has not been populated yet, by execution of firstboot !? /boot directory shows, but is not physically real. see below:
Firstboot file and script explanation
firstboot bug.cgi?id=258985
ls
.cshrc bin firstboot media rescue usr
.profile boot home mnt root var
.snap dev lib net sbin
COPYRIGHT etc libexec proc tmp
root@fredTC93-pc:/media/da1s2a # ls -la
ls: bin: No such file or directory
ls: boot: No such file or directory
ls: dev: No such file or directory
ls: etc: No such file or directory
ls: lib: No such file or directory
ls: net: No such file or directory
ls: rescue: No such file or directory
ls: sbin: No such file or directory
ls: usr: No such file or directory
total 65
 

Attachments

  • Raspi4B_photo_2023-02-10_19-14-45.jpg
    Raspi4B_photo_2023-02-10_19-14-45.jpg
    110.2 KB · Views: 86
Last edited:
SOLVED: Now looking to see how to repair this problem for RaspberryPi 4 snapshot image FreeBSD 13.1 Release?
Shall we Create a Real /boot/lua/loader.lua pathname and file loader.lua? Or just use a zero length file loader.lua? https://man.freebsd.org/cgi/man.cgi?rc.conf(5)

https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/

Code:
curl -o https://download.freebsd.org/releases/arm64/aarch64/ISO-IMAGES/13.1/FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz
Code:
xz -decompress FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img.xz

Code:
mount
dmesg | -15
# Check for using the proper # Number of the disk  /dev/daX
dd if=FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img of=/dev/daX bs=1m status=progress conv=sync

when finished writing usb flash disk drive stick, remove it and plug into USB 2.0 Black or USB 3.0 Blue ports on the Raspberry Pi 4B. Hook up the cables, micro HDMI into the left side one next to the USB C power port, plug your usb keyboard and usb mouse, and last if you have an external USB SSD disk drive, plug that into a USB 3.0 port. Last plug the power into the USB micro C power port and turn on the power switch if you have one. Wait and watch the boot progress. Later edit the config.txt add uart_enable=1 and comment out # hdmi_safe=1 add hdmi_group=16 hdmi_mode=2. Be patient, sometimes growing a partition size takes time. FreeBSD is stable and should run through to completion. Be patient for a great stable operating system on your Raspberry Pi 4B.

freebsd@generic:~ % pwd
/home/freebsd
freebsd@generic:~ % ls
freebsd@generic:~ % mount
/dev/ufs/rootfs on / (ufs, local, soft-updates)
devfs on /dev (devfs)
/dev/msdosfs/MSDOSBOOT on /boot/msdos (msdosfs, local, noatime)
tmpfs on /tmp (tmpfs, local)
freebsd@generic:~ % cd /boot/msdos
freebsd@generic:/boot/msdos % ls
EFI config.txt.original start.elf
LICENCE.broadcom dtb start4.elf
README fixup.dat start4cd.elf
armstub8-gic.bin fixup4.dat start4db.elf
armstub8.bin fixup4cd.dat start4x.elf
bcm2710-rpi-2-b.dtb fixup4db.dat start_cd.elf
bcm2710-rpi-3-b-plus.dtb fixup4x.dat start_db.elf
bcm2710-rpi-3-b.dtb fixup_cd.dat start_x.elf
bcm2711-rpi-4-b.dtb fixup_db.dat u-boot.bin
bootcode.bin fixup_x.dat
config.txt overlays
freebsd@generic:/boot/msdos % ls -l bootcode.bin u-boot.bin config.txt* fixup4.dat start4.elf
-rwxr-xr-x 1 root wheel 52456 Mar 3 2021 bootcode.bin
-rwxr-xr-x 1 root wheel 220 Feb 11 06:34 config.txt
-rwxr-xr-x 1 root wheel 177 May 12 2022 config.txt.original
-rwxr-xr-x 1 root wheel 5448 Mar 3 2021 fixup4.dat
-rwxr-xr-x 1 root wheel 2228800 Mar 3 2021 start4.elf
-rwxr-xr-x 1 root wheel 569000 May 12 2022 u-boot.bin
freebsd@generic:/boot/msdos %
 
Well that seemed easier to read. I have no idea what eeprom does on Pi. So you lost me there.

Wait and watch the boot progress.
I highly recommend using UART console if available. HDMI can be iffy.
So this user could use his Rpi3 and a USB-TTL UART Cable to the RPi4.
That is square one on Arm. Serial Console.

Later edit the config.txt add uart_enable=1 and comment out # hdmi_safe=1 add hdmi_group=16 hdmi_mode=2.
I would recommend doing this after you burn the image to media.
Mount it and make your mods.

I would also download the u-boot package for RPi4 and write it to medium after you write the image.

I still stand by my advice of familiarizing yourself with u-boot before booting the OS.
It is a good diagnostic.

Be patient, sometimes growing a partition size takes time.
Very wise words. Especially pertinent if using a headless install and waiting for sshd to come up.
Many times ssh has been a savior. You just need to have patience.
 
Hi,

Like swt I have a RPI 4B 8G, and same as him but not for the same reason I barely touched it since I bought it now 1.5 year ago. So I didn't update anything in it.
For what it worth I tried the FreeBSD installation on usb key, usb SSD drive, and sd card, basically if you don't interrupt the process during the boot (like I did 2 times ^_^) it works without any problem.
Once the OS installed on USB key/drive the RPI boots directly to the device, in this case the SD card it not needed anymore, no worry about the SD card health, well done guys.
Overall I just followed the basic instructions like wb7odyfred already described above, I didn't do anything fancy and used the recommended release (not stable or snapshot) and then copied the .imgfile with the command dd to the device.

To add some comfort I bought a cheap cable usb-to-serial (cost me less than 10€), now if I want to access the RPI's display I just need to fire up a terminal and launch tio (you can use screen or minicom if you prefer), no need to bring a monitor with a keyboard anymore, what a relief! honestly I recommend it.
 
Back
Top