FreeBSD u boot silent - BYO-NTP/recipes GitHub Wiki

WHY

The FreeBSD PI image reasonably defaults to booting on the console, which is useful without a KVM. If a GNSS hat is installed before preparing FreeBSD to ignore console input, then the hat will be spewing data on the console. That will first interrupt u-boot and prevent booting. Once u-boot is patched, the hat will interrupt the FreeBSD boot loader.

configure the boot loader

Tell the FreeBSD boot loader to ignore serial input.

sysrc -f /boot/loader.conf autoboot_delay=-1

install a silent u-boot

Install a u-boot that ignores serial input.

cp /boot/efi/u-boot.bin /boot/efi/u-boot.bin.dist
curl -o /boot/efi/u-boot.bin https://byo-ntp.github.io/tools/uboot/u-boot-rpi4-2025.04-silent

build a silent u-boot

This section is for DIY types, especially for the author who will likely need to do this again.

On FreeBSD

If /usr/ports is empty, populate it:

pkg install -y git-lite
git clone --depth=1 https://github.com/freebsd/freebsd-ports.git /usr/ports/

Build u-boot

Save a bunch of time and install the build tools from packages. Then patch the u-boot port and build the silent u-boot.

pkg install -y aarch64-none-elf-gcc bison dtc e2fsprogs-libuuid gsed gcc gmake \
  gnutls pkgconf portconfig py311-setuptools py311-setuptools-pkg py311-wheel044 \
  swig u-boot-tools
cd /usr/ports/sysutils/u-boot-rpi4

cat > files/patch-board-rpi.env <<EOF
--- board/raspberrypi/rpi/rpi.env.orig	2025-04-29 21:55:55.789451000 -0700
+++ board/raspberrypi/rpi/rpi.env	2025-04-29 21:56:15.202324000 -0700
@@ -3,6 +3,8 @@
 /* environment for Raspberry Pi boards */
 
 dhcpuboot=usb start; dhcp u-boot.uimg; bootm
+bootdelay=-2
+silent=1
 
 /* Environment */
 stdin=serial,usbkbd
EOF

patch -u <<EOPATCH
--- files/rpi4_fragment
+++ files/rpi4_fragment
@@ -1,2 +1,7 @@
 CONFIG_ENV_FAT_DEVICE_AND_PART="1:1"
 CONFIG_RPI_EFI_NR_SPIN_PAGES=2
+CONFIG_BOOTDELAY=-2
+CONFIG_SILENT_CONSOLE=y
+CONFIG_SYS_DEVICE_NULLDEV=y
+CONFIG_SILENT_CONSOLE_UPDATE_ON_SET=y
+CONFIG_SILENT_U_BOOT_ONLY=y
EOPATCH

make install clean
cp /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin /boot/efi/

References

⚠️ **GitHub.com Fallback** ⚠️