Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144976621
D54981.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D54981.diff
View Options
diff --git a/tools/tools/nanobsd/embedded/rpi.cfg b/tools/tools/nanobsd/embedded/rpi.cfg
new file mode 100644
--- /dev/null
+++ b/tools/tools/nanobsd/embedded/rpi.cfg
@@ -0,0 +1,155 @@
+#
+# Copyright (c) 2026 Jose Luis Duran <jlduran@FreeBSD.org>
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+
+NANO_ARCH=aarch64
+NANO_BOOT_PKG=u-boot-rpi-arm64
+NANO_DRIVE=sdda0
+NANO_DTB_PACKAGE=rpi-firmware
+NANO_KERNEL=GENERIC-MMCCAM # -NODEBUG
+NANO_MODULES=default
+# NANO_MODULES="dtb/rpi usb/mtw wlan wlan_acl wlan_amrr wlan_ccmp wlan_gcmp wlan_rssadapt wlan_tkip wlan_wep wlan_xauth"
+NANO_NAME=RPI
+NANO_PACKAGE_DIR=/var/cache/pkg
+NANO_PACKAGE_LIST=wifi-firmware-mt7601u-kmod-20251125.pkg
+NANO_RAM_ETCSIZE=10240
+NANO_RAM_TMPVARSIZE=20480
+
+# From release/arm64/RPI.conf
+UBOOT_FILES="README u-boot.bin"
+DTB="bcm2710-rpi-2-b.dtb bcm2710-rpi-3-b.dtb bcm2710-rpi-3-b-plus.dtb \
+ bcm2710-rpi-cm3.dtb bcm2710-rpi-zero-2-w.dtb bcm2711-rpi-4-b.dtb \
+ bcm2711-rpi-cm4-io.dtb bcm2711-rpi-cm4.dtb"
+DTB_FILES="armstub8.bin armstub8-gic.bin bootcode.bin fixup_cd.dat \
+ fixup_db.dat fixup_x.dat fixup.dat LICENCE.broadcom \
+ start_cd.elf start_db.elf start_x.elf start.elf \
+ fixup4.dat fixup4cd.dat fixup4db.dat fixup4x.dat start4.elf \
+ start4cd.elf start4db.elf start4x.elf ${DTB}"
+OVERLAYS="mmc.dtbo pwm.dtbo disable-bt.dtbo"
+# Missing:
+# bcm2710-rpi-cm0.dtb
+# bcm2710-rpi-zero-2.dtb
+# bcm2711-rpi-400.dtb
+# bcm2711-rpi-cm4s.dtb
+# bcm2712-d-rpi-5-b.dtb
+# bcm2712-rpi-5-b.dtb
+# bcm2712-rpi-500.dtb
+# bcm2712-rpi-cm5-cm4io.dtb
+# bcm2712-rpi-cm5-cm5io.dtb
+# bcm2712-rpi-cm5l-cm4io.dtb
+# bcm2712-rpi-cm5l-cm5io.dtb
+# bcm2712d0-rpi-5-b.dtb
+# cmdline.txt
+# issue.txt
+# meta-data
+# network-config
+# user-data
+
+. common # Pull in common definitions
+
+NANO_SLICE_FAT_SIZE=256m
+
+# Override the FAT (MS-DOS) partition to add needed binaries
+dos_boot_part() (
+ local uboot_dir=/usr/local/share/u-boot/${NANO_BOOT_PKG}
+ local dtb_dir=/usr/local/share/${NANO_DTB_PACKAGE}
+ ol_dir="${dtb_dir}/overlays"
+ local fat_dir=${NANO_FAT_DIR}
+
+ rm -rf $fat_dir
+ mkdir $fat_dir
+ chdir $fat_dir
+
+ # Copy U-boot files
+ for _UF in ${UBOOT_FILES}; do
+ cp -p ${uboot_dir}/${_UF} .
+ done
+
+ # Copy DTB files
+ for _DF in ${DTB_FILES}; do
+ cp -p ${dtb_dir}/${_DF} .
+ done
+ cp -p ${dtb_dir}/config_arm64.txt config.txt
+
+ # Copy overlays
+ mkdir -p overlays
+ for _OL in ${OVERLAYS}; do
+ cp -p ${ol_dir}/${_OL} ./overlays/${_OL}
+ done
+
+ # Copy the EFI bootloader
+ mkdir EFI
+ mkdir EFI/BOOT
+ mkdir EFI/FreeBSD
+
+ cp -p ${NANO_WORLDDIR}/boot/loader_lua.efi ./EFI/BOOT/BOOTAA64.EFI
+ cp -p ${NANO_WORLDDIR}/boot/loader_lua.efi ./EFI/FreeBSD/loader.efi
+
+ # Set the currdev in the EFI environment
+ echo "set currdev=disk0s3a:" > ./EFI/FreeBSD/loader.env
+)
+
+typical_embedded() {
+ # Need to create rc.conf before we copy over /etc to /conf/base/etc
+ # so now's a good time.
+
+ local rc=${NANO_WORLDDIR}/etc/rc.conf
+
+ echo "hostname=\"${NANO_NAME}\"" > $rc
+ echo 'growfs_enable="YES"' >> $rc
+ echo 'growfs_swapsize=0' >> $rc
+ echo 'ifconfig_DEFAULT="DHCP"' >> $rc
+ echo 'wlans_mtw0="wlan0"' >> $rc
+ echo 'ifconfig_wlan0="WPA DHCP"' >> $rc
+ echo 'kld_list="wlan_amrr"' >> $rc
+ echo 'ntpdate_enable="YES"' >> $rc
+ echo 'ntpdate_sync_on_start="YES"' >> $rc
+ echo 'sshd_enable="YES"' >> $rc
+ # Make sure that firstboot scripts run so growfs works.
+ touch ${NANO_WORLDDIR}/firstboot
+}
+
+cust_allow_ssh_root() {
+ sed -i "" -E 's/^#?PermitRootLogin.*/PermitRootLogin yes/' \
+ ${NANO_WORLDDIR}/etc/ssh/sshd_config
+ sed -i "" -E 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/' \
+ ${NANO_WORLDDIR}/etc/ssh/sshd_config
+}
+
+# XXX mostly /usr/embedded/Files/etc/wpa_supplicant.conf
+cust_install_machine_files() (
+ cd /usr/embedded/Files
+ find . -print | grep -Ev '/(CVS|\.svn|\.hg|\.git)' | cpio ${CPIO_SYMLINK} -Ldumpv ${NANO_WORLDDIR}
+
+ if [ -n "${NANO_CUST_MACHINE_FILES_MTREE}" -a -f ${NANO_CUST_MACHINE_FILES_MTREE} ]; then
+ CR "mtree -eiU -p /" <${NANO_CUST_MACHINE_FILES_MTREE}
+ fi
+
+ tgt_touch $(find * -type f)
+)
+
+setup_nanobsd_loader_conf() {
+ pprint 2 "configure nanobsd loader.conf"
+
+ (
+ cd "${NANO_WORLDDIR}"
+
+ [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 boot/defaults/loader.conf
+ {
+ echo 'boot_multicons="YES" # -D: Use multiple consoles'
+ echo 'boot_serial="YES" # -h: Use serial console'
+ } >> boot/defaults/loader.conf
+ [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 boot/defaults/loader.conf
+ )
+}
+customize_cmd setup_nanobsd_loader_conf
+
+customize_cmd cust_pkgng
+
+product_custom2() {
+ # Not yet ping-ponging images
+ rm -f ${NANO_WORLDDIR}/root/update*
+}
+late_customize_cmd product_custom2
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Feb 15, 4:22 PM (6 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28170206
Default Alt Text
D54981.diff (4 KB)
Attached To
Mode
D54981: XXX WIP nanobsd: Add a RaspberryPi configuration
Attached
Detach File
Event Timeline
Log In to Comment