From 804fd1e08e29956fd6aa364f481b589234b33a66 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 17:28:17 +0100 Subject: [PATCH 01/27] statd: fix "show firewall" crash if no zone description Signed-off-by: Joachim Wiberg --- src/statd/python/yanger/infix_firewall.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/statd/python/yanger/infix_firewall.py b/src/statd/python/yanger/infix_firewall.py index a49f807e..2d301d78 100644 --- a/src/statd/python/yanger/infix_firewall.py +++ b/src/statd/python/yanger/infix_firewall.py @@ -55,7 +55,7 @@ def get_zone_data(fw, name): "name": name, "short": short, "immutable": immutable, - "description": settings.get('description', 0), + "description": settings.get('description', ''), "interface": list(settings.get('interfaces', [])), "network": list(settings.get('sources', [])), "action": action.get(target, "accept"), From b2a41e48683890cef826c79f58c08a46b2dee841 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 12:50:20 +0200 Subject: [PATCH 02/27] board: drop team support, add common USB to Ethernet drivers Signed-off-by: Joachim Wiberg --- board/aarch64/linux_defconfig | 13 +++++++++---- board/riscv64/linux_defconfig | 17 ++++++++++++++--- board/x86_64/linux_defconfig | 3 --- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/board/aarch64/linux_defconfig b/board/aarch64/linux_defconfig index b675a907..803010f8 100644 --- a/board/aarch64/linux_defconfig +++ b/board/aarch64/linux_defconfig @@ -244,9 +244,6 @@ CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y CONFIG_NETDEVICES=y CONFIG_BONDING=m CONFIG_DUMMY=m -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m CONFIG_IPVLAN=m @@ -335,12 +332,20 @@ CONFIG_MDIO_BITBANG=y CONFIG_MDIO_MVUSB=m CONFIG_MDIO_MSCC_MIIM=y CONFIG_MDIO_BUS_MUX_MMIOREG=y +CONFIG_USB_RTL8150=m CONFIG_USB_RTL8152=m +CONFIG_USB_LAN78XX=m CONFIG_USB_USBNET=m CONFIG_USB_NET_CDC_EEM=m # CONFIG_USB_NET_CDC_NCM is not set +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m # CONFIG_USB_NET_NET1080 is not set -# CONFIG_USB_NET_CDC_SUBSET is not set +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y # CONFIG_USB_NET_ZAURUS is not set # CONFIG_WLAN is not set CONFIG_INPUT_EVDEV=y diff --git a/board/riscv64/linux_defconfig b/board/riscv64/linux_defconfig index 0933fae3..f85ecc24 100644 --- a/board/riscv64/linux_defconfig +++ b/board/riscv64/linux_defconfig @@ -258,9 +258,6 @@ CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y CONFIG_NETDEVICES=y CONFIG_BONDING=m CONFIG_DUMMY=m -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m CONFIG_IPVLAN=m @@ -281,8 +278,22 @@ CONFIG_DWMAC_DWC_QOS_ETH=y CONFIG_DWMAC_STARFIVE=y CONFIG_MICROCHIP_PHY=y CONFIG_MOTORCOMM_PHY=y +CONFIG_USB_RTL8150=m CONFIG_USB_RTL8152=m +CONFIG_USB_LAN78XX=m CONFIG_USB_USBNET=m +CONFIG_USB_NET_CDC_EEM=m +# CONFIG_USB_NET_CDC_NCM is not set +CONFIG_USB_NET_DM9601=m +CONFIG_USB_NET_SMSC75XX=m +CONFIG_USB_NET_SMSC95XX=m +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +CONFIG_USB_ALI_M5632=y +CONFIG_USB_AN2720=y +CONFIG_USB_EPSON2888=y +CONFIG_USB_KC2190=y +# CONFIG_USB_NET_ZAURUS is not set # CONFIG_WLAN is not set CONFIG_INPUT_EVDEV=y CONFIG_KEYBOARD_GPIO=y diff --git a/board/x86_64/linux_defconfig b/board/x86_64/linux_defconfig index e2328779..21787f09 100644 --- a/board/x86_64/linux_defconfig +++ b/board/x86_64/linux_defconfig @@ -191,9 +191,6 @@ CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y CONFIG_NETDEVICES=y CONFIG_BONDING=m CONFIG_DUMMY=m -CONFIG_NET_TEAM=m -CONFIG_NET_TEAM_MODE_ACTIVEBACKUP=m -CONFIG_NET_TEAM_MODE_LOADBALANCE=m CONFIG_MACVLAN=m CONFIG_MACVTAP=m CONFIG_IPVLAN=m From 937d4c38c79079f50e897ef18a6a8a8e570407b2 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 13:16:00 +0200 Subject: [PATCH 03/27] board: make usb subsystem a built-in Use kernel cmdline option 'usbcore.authorized_default=2' to lock all external/user-visible USB ports by default. The kernel distinguishes internal vs external USB ports using ACPI methods (_UPC and _PLD) on x86/x86_64 systems. On ACPI systems, ports marked as non-visible but connectable are considered internal (e.g., hard-wired USB-to-Ethernet adapters) and are automatically authorized, while user-visible external ports require manual authorization. However, on device tree systems the kernel lacks a standard mechanism for identifying internal ports. The 'authorized_default=2' setting falls back to requiring authorization for all devices on these platforms, We list user-accessible USB ports in the device tree ('usb-ports' and 'usb-port-names'), with unlisted ports being implicitly internal and managed separately. Fixes #1065 Signed-off-by: Joachim Wiberg --- board/aarch64/linux_defconfig | 2 +- board/aarch64/rootfs/boot/syslinux/syslinux.conf | 2 +- board/common/rootfs/etc/modprobe.d/usbcore.conf | 3 --- board/riscv64/rootfs/boot/syslinux/syslinux.conf | 2 +- board/x86_64/grub.cfg | 6 +++--- board/x86_64/linux_defconfig | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 board/common/rootfs/etc/modprobe.d/usbcore.conf diff --git a/board/aarch64/linux_defconfig b/board/aarch64/linux_defconfig index 803010f8..12921f27 100644 --- a/board/aarch64/linux_defconfig +++ b/board/aarch64/linux_defconfig @@ -433,7 +433,7 @@ CONFIG_REGULATOR_S2MPS11=y # CONFIG_HID_MICROSOFT is not set # CONFIG_HID_MONTEREY is not set CONFIG_USB_ULPI_BUS=y -CONFIG_USB=m +CONFIG_USB=y CONFIG_USB_OTG=y CONFIG_USB_XHCI_HCD=m CONFIG_USB_XHCI_MVEBU=m diff --git a/board/aarch64/rootfs/boot/syslinux/syslinux.conf b/board/aarch64/rootfs/boot/syslinux/syslinux.conf index f6aafd54..c7e58ab1 100644 --- a/board/aarch64/rootfs/boot/syslinux/syslinux.conf +++ b/board/aarch64/rootfs/boot/syslinux/syslinux.conf @@ -1,4 +1,4 @@ label Infix (aarch64) kernel /boot/Image fdtdir /boot - append ${bootargs_root} ${bootargs_log} -- ${bootargs_user} + append ${bootargs_root} ${bootargs_log} usbcore.authorized_default=2 -- ${bootargs_user} diff --git a/board/common/rootfs/etc/modprobe.d/usbcore.conf b/board/common/rootfs/etc/modprobe.d/usbcore.conf deleted file mode 100644 index c2100e52..00000000 --- a/board/common/rootfs/etc/modprobe.d/usbcore.conf +++ /dev/null @@ -1,3 +0,0 @@ -# Do not authorize usb ports before they have been checked in in the device-tree -options usbcore authorized_default=0 - diff --git a/board/riscv64/rootfs/boot/syslinux/syslinux.conf b/board/riscv64/rootfs/boot/syslinux/syslinux.conf index 6ea9f034..4e0dedb5 100644 --- a/board/riscv64/rootfs/boot/syslinux/syslinux.conf +++ b/board/riscv64/rootfs/boot/syslinux/syslinux.conf @@ -1,4 +1,4 @@ label Infix (riscv64) kernel /boot/Image fdtdir /boot - append ${bootargs_root} ${bootargs_log} -- ${bootargs_user} + append ${bootargs_root} ${bootargs_log} usbcore.authorized_default=2 -- ${bootargs_user} diff --git a/board/x86_64/grub.cfg b/board/x86_64/grub.cfg index 3df925a8..c62114e1 100644 --- a/board/x86_64/grub.cfg +++ b/board/x86_64/grub.cfg @@ -42,14 +42,14 @@ export secondary submenu "primary" "$log" { set slot="$1" - set append="console=ttyS0 console=hvc0 root=PARTLABEL=$slot $2" + set append="console=ttyS0 console=hvc0 usbcore.authorized_default=2 root=PARTLABEL=$slot $2" set root="($primary)" source /boot/grub/grub.cfg } submenu "secondary" "$log" { set slot="$1" - set append="console=ttyS0 console=hvc0 root=PARTLABEL=$slot $2" + set append="console=ttyS0 console=hvc0 usbcore.authorized_default=2 root=PARTLABEL=$slot $2" set root="($secondary)" source /boot/grub/grub.cfg } @@ -63,7 +63,7 @@ submenu "net" "$log" { set root=(initrd) set slot="$1" - set append="console=ttyS0 console=hvc0 qroot=/dev/ram0 ramdisk_size=65536 $2" + set append="console=ttyS0 console=hvc0 usbcore.authorized_default=2 qroot=/dev/ram0 ramdisk_size=65536 $2" source /boot/grub/grub.cfg else if [ -z "$net_efinet0_dhcp_next_server" ]; then diff --git a/board/x86_64/linux_defconfig b/board/x86_64/linux_defconfig index 21787f09..957e9f7b 100644 --- a/board/x86_64/linux_defconfig +++ b/board/x86_64/linux_defconfig @@ -219,7 +219,7 @@ CONFIG_WATCHDOG=y CONFIG_WATCHDOG_SYSFS=y CONFIG_SOFT_WATCHDOG=y CONFIG_I6300ESB_WDT=y -CONFIG_USB=m +CONFIG_USB=y CONFIG_USB_XHCI_HCD=m CONFIG_USB_EHCI_HCD=m CONFIG_USB_UHCI_HCD=m From 9b057ad54772bef4f2c1ac55c268f8e15cdf08bf Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 13:58:39 +0200 Subject: [PATCH 04/27] Support for Raspberry Pi 3B (BCM2837) The BCM2837 core is used not just in the RPi 3B but also in the Zero 2W, both device trees have been added to the board config. The BCM2711 support has been extended to include RPi 400 and CM4 I/O. To support the BCM2837 family more firmware options habe been enabled, since the RPi3 does not have bootcode.bin flashed in the SoC. The SD card image now uses a hybrid GPT/MBR format so the RPi3 bootcode.bin can read all files from the first VFAT partition. The default device tree for Linux is now chosen by the U-Boot probe and the only exception is the "laundry room" detector that looks for a RPi4 with a 7" touch screen, which then selects the DSI enabled RPi4 variant. This is enough to properly load an RPi 3B and a CM4 based router board. The BCM2837 does not have PCI/PCIe or a built-in MAC so it relies on the USB to Ethernet LAN78xx which does not support disabling pause frames. I have opted for checking for EOPNOTSUPP instead of adding yet another quirk, because it is likely to be a common limitation of more drivers and chipsets, and this code is best-effort anyway. Signed-off-by: Joachim Wiberg --- configs/rpi4_boot_defconfig | 3 ++ .../board/raspberry-pi-4/raspberry-pi-4.mk | 1 + src/board/raspberry-pi-4/config.txt | 52 ++++++++----------- src/board/raspberry-pi-4/dts/Makefile | 4 +- .../dts/broadcom/bcm2711-rpi-4-b.dts | 6 +-- .../dts/broadcom/bcm2711-rpi-400.dts | 9 ++++ .../dts/broadcom/bcm2711-rpi-cm4-io.dts | 9 ++++ .../dts/broadcom/bcm2837-rpi-3-b.dts | 9 ++++ .../dts/broadcom/bcm2837-rpi-zero-2-w.dts | 9 ++++ .../raspberry-pi-4/dts/broadcom/infix.dtsi | 13 +++++ src/board/raspberry-pi-4/genimage.cfg.in | 18 +++---- .../usr/share/product/raspberrypi,3-model-b | 1 + .../etc/factory-config.cfg | 2 +- src/board/raspberry-pi-4/uboot/rpi-env.dtso | 2 +- src/confd/src/ieee802-ethernet-interface.c | 15 +++++- 15 files changed, 104 insertions(+), 49 deletions(-) create mode 100644 src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts create mode 100644 src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts create mode 100644 src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts create mode 100644 src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts create mode 100644 src/board/raspberry-pi-4/dts/broadcom/infix.dtsi create mode 120000 src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b diff --git a/configs/rpi4_boot_defconfig b/configs/rpi4_boot_defconfig index d0a39a19..140dcdc4 100644 --- a/configs/rpi4_boot_defconfig +++ b/configs/rpi4_boot_defconfig @@ -14,6 +14,9 @@ BR2_SYSTEM_BIN_SH_NONE=y BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh" # BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_RPI_FIRMWARE=y +BR2_PACKAGE_RPI_FIRMWARE_BOOTCODE_BIN=y +BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y +BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_X=y BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X=y BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi-4/config.txt" diff --git a/package/board/raspberry-pi-4/raspberry-pi-4.mk b/package/board/raspberry-pi-4/raspberry-pi-4.mk index 2dc74bfd..88f36c8a 100644 --- a/package/board/raspberry-pi-4/raspberry-pi-4.mk +++ b/package/board/raspberry-pi-4/raspberry-pi-4.mk @@ -22,6 +22,7 @@ define RASPBERRY_PI_4_LINUX_CONFIG_FIXUPS $(call KCONFIG_SET_OPT,CONFIG_BRCMFMAC,m) $(call KCONFIG_ENABLE_OPT,CONFIG_BRCMFMAC_SDIO) $(call KCONFIG_SET_OPT,CONFIG_I2C_BCM2835,m) + $(call KCONFIG_SET_OPT,CONFIG_BCM2835_THERMAL,m) $(call KCONFIG_SET_OPT,CONFIG_BCM2711_THERMAL,m) $(call KCONFIG_ENABLE_OPT,CONFIG_MMC_BCM2835) $(call KCONFIG_ENABLE_OPT,CONFIG_MMC_SDHCI_IPROC) diff --git a/src/board/raspberry-pi-4/config.txt b/src/board/raspberry-pi-4/config.txt index 01bfe0dd..46d2e906 100644 --- a/src/board/raspberry-pi-4/config.txt +++ b/src/board/raspberry-pi-4/config.txt @@ -1,43 +1,35 @@ -# Please note that this is only a sample, we recommend you to change it to fit -# your needs. -# You should override this file using BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE. -# See http://buildroot.org/manual.html#rootfs-custom -# and http://elinux.org/RPiconfig for a description of config.txt syntax +[all] +arm_64bit=1 -start_file=start4.elf -fixup_file=fixup4.dat +arm_boost=1 +force_turbo=1 kernel=u-boot.bin -device_tree=bcm2711-rpi-4-b.dtb dtoverlay=rpi-env dtoverlay=infix-key + +disable_overscan=1 + +enable_uart=1 +uart_2ndstage=1 + +[pi3] +start_file=start.elf +fixup_file=fixup.dat + +dtoverlay=miniuart-bt + +gpu_mem=100 + +[pi4] +start_file=start4.elf +fixup_file=fixup4.dat + dtoverlay=vc4-kms-v3d-pi4 lcd_rotate=2 - # Prevent console on DSI console=map:0 -# To use an external initramfs file -#initramfs rootfs.cpio.gz - -# Disable overscan assuming the display supports displaying the full resolution -# If the text shown on the screen disappears off the edge, comment this out -disable_overscan=1 - gpu_mem=256 - -# Enable UART0 for serial console on ttyAMA0 -enable_uart=1 -force_turbo=1 -#dtoverlay=miniuart-bt - -# Run as fast as firmware / board allows -arm_boost=1 - -# enable 64bits support -arm_64bit=1 - -# Enable early debugging info -uart_2ndstage=1 diff --git a/src/board/raspberry-pi-4/dts/Makefile b/src/board/raspberry-pi-4/dts/Makefile index 0b6f5ce9..e96346bb 100644 --- a/src/board/raspberry-pi-4/dts/Makefile +++ b/src/board/raspberry-pi-4/dts/Makefile @@ -1 +1,3 @@ -dtb-y += broadcom/bcm2711-rpi-4-b.dtb broadcom/bcm2711-rpi-4-b-dsi.dtb +dtb-y += broadcom/bcm2837-rpi-3-b.dtb broadcom/bcm2837-rpi-zero-2-w.dtb \ + broadcom/bcm2711-rpi-4-b.dtb broadcom/bcm2711-rpi-4-b-dsi.dtb \ + broadcom/bcm2711-rpi-400.dtb broadcom/bcm2711-rpi-cm4-io.dtb diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts index 3153526f..2f557a9f 100644 --- a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts @@ -1,4 +1,5 @@ #include +#include "infix.dtsi" / { /* Dynamic GPU reservation */ @@ -21,11 +22,6 @@ chosen { /* 8250 auxiliary UART instead of pl011 */ stdout-path = "serial1:115200n8"; - - infix { - /* Default admin user password: 'admin' */ - factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"; - }; }; }; diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts new file mode 100644 index 00000000..4bfb26da --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts @@ -0,0 +1,9 @@ +#include +#include "infix.dtsi" + +/ { + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; +}; diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts new file mode 100644 index 00000000..370edfac --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts @@ -0,0 +1,9 @@ +#include +#include "infix.dtsi" + +/ { + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; +}; diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts new file mode 100644 index 00000000..d93a4b0c --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts @@ -0,0 +1,9 @@ +#include +#include "infix.dtsi" + +/ { + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; +}; diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts new file mode 100644 index 00000000..58623875 --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts @@ -0,0 +1,9 @@ +#include +#include "infix.dtsi" + +/ { + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; +}; diff --git a/src/board/raspberry-pi-4/dts/broadcom/infix.dtsi b/src/board/raspberry-pi-4/dts/broadcom/infix.dtsi new file mode 100644 index 00000000..16cfafc8 --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/infix.dtsi @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Common Infix OS defaults + */ + +/ { + chosen { + infix { + /* Default admin user password: 'admin' */ + factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"; + }; + }; +}; diff --git a/src/board/raspberry-pi-4/genimage.cfg.in b/src/board/raspberry-pi-4/genimage.cfg.in index ee7147d7..f78a2979 100644 --- a/src/board/raspberry-pi-4/genimage.cfg.in +++ b/src/board/raspberry-pi-4/genimage.cfg.in @@ -31,41 +31,41 @@ image var.ext4 { image #INFIX_ID##VERSION#-rpi4-sdcard.img { hdimage { - partition-table-type = "gpt" + partition-table-type = "hybrid" } partition boot { - partition-type-uuid = EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 + partition-type = 0xc bootable = "true" image = "boot.vfat" } partition aux { - partition-uuid = D4EF35A0-0652-45A1-B3DE-D63339C82035 + partition-type-uuid = srv image = "aux.ext4" } partition primary { - partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 - bootable = true + partition-type-uuid = linux + bootable = "true" size = 250M image = "rootfs.squashfs" } partition secondary { - partition-type-uuid = 0FC63DAF-8483-4772-8E79-3D69D8477DE4 - bootable = true + partition-type-uuid = linux + bootable = "true" size = 250M image = "rootfs.squashfs" } partition cfg { - partition-uuid = 7aa497f0-73b5-47e5-b2ab-8752d8a48105 + partition-type-uuid = srv image = "cfg.ext4" } partition var { - partition-uuid = 8046A06A-E45A-4A14-A6AD-6684704A393F + partition-type-uuid = var image = "var.ext4" } } diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b new file mode 120000 index 00000000..ef4c88cb --- /dev/null +++ b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b @@ -0,0 +1 @@ +raspberrypi,4-model-b \ No newline at end of file diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg index 8ebc10a6..c744b02a 100644 --- a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg +++ b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg @@ -133,7 +133,7 @@ } }, "ietf-system:system": { - "hostname": "rpi4", + "hostname": "rpi", "ntp": { "enabled": true, "server": [ diff --git a/src/board/raspberry-pi-4/uboot/rpi-env.dtso b/src/board/raspberry-pi-4/uboot/rpi-env.dtso index 14b83c25..58fdd41c 100644 --- a/src/board/raspberry-pi-4/uboot/rpi-env.dtso +++ b/src/board/raspberry-pi-4/uboot/rpi-env.dtso @@ -17,7 +17,7 @@ stdin = "serial"; splashpos = "m,m"; splashfile = "splash.bmp"; - checkdisplay = "if testrpidisplay; then; setenv fdtfile broadcom/bcm2711-rpi-4-b-dsi.dtb; else; setenv fdtfile broadcom/bcm2711-rpi-4-b.dtb; fi"; + checkdisplay = "if testrpidisplay; then; setenv fdtfile broadcom/bcm2711-rpi-4-b-dsi.dtb; fi"; bootcmd = "fatload mmc 0:1 ${loadaddr} ${splashfile}; bmp display ${loadaddr}; run checkdisplay; run ixboot"; ixpreboot = /incbin/("scripts/ixpreboot.sh"); diff --git a/src/confd/src/ieee802-ethernet-interface.c b/src/confd/src/ieee802-ethernet-interface.c index 0dae3196..42d765a4 100644 --- a/src/confd/src/ieee802-ethernet-interface.c +++ b/src/confd/src/ieee802-ethernet-interface.c @@ -45,8 +45,19 @@ static int netdag_gen_ethtool_flow_control(struct dagger *net, struct lyd_node * if (!fp) return -EIO; fprintf(fp, "[[ -n $(ethtool --json %s | jq '.[] | select(.\"supported-pause-frame-use\" == \"No\")') ]] && exit 0\n", ifname); - fprintf(fp, "ethtool --pause %s autoneg %s rx off tx off\n", - ifname, iface_uses_autoneg(cif) ? "on" : "off"); + + /* + * Some NICs report "supported-pause-frame-use": "Symmetric Receive-only", like + * RPi 3B's LAN78xx USB to Ethernet controller, but the drivers do not support + * disabling it. This call is best effort after all, so we capture and check + * the error. If the operation is not supported, we log it and exit cleanly. + */ + fprintf(fp, + "if ! err=$(ethtool --pause %s autoneg %s rx off tx off 2>&1); then\n" + " logger -it confd -p daemon.error \"%s: failed disabling flow-control\"\n" + " echo \"$err\" | grep -q \"Operation not supported\" && exit 0\n" + "fi\n", + ifname, iface_uses_autoneg(cif) ? "on" : "off", ifname); fclose(fp); return 0; From 54d88cc00e09c22ee7178aa68731529773d58626 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 17 Oct 2025 07:20:23 +0200 Subject: [PATCH 05/27] Support for Compute Module 4 IoT Router Broad Mini This commit adds support for the Raspberry Pi CM4 based mini DFRobot IoT Router board, SKU:DFR0767. It comes with an additional RTL8111 PCIe NIC hence the addidtional kernel module and firmware. The latter fixes: r8169 0000:01:00.0: Direct firmware load for rtl_nic/rtl8168h-2.fw failed with error -2 r8169 0000:01:00.0: Unable to load firmware rtl_nic/rtl8168h-2.fw (-2) Please note, the change in BCMGENET from module to built-in is to ensure it is probed before any PCIe NIC, both this board and the CM4-based NVME NAS base board enumerate the built-in MAC as eth0. Also, unlike the RPi 3B/4B, it is not a given fact that a CM4 based board comes with WiFi onboard, and since most compute module setups are DYI, we take the easy way out and leave it as an exercise to the user to add WiFi interface to the config. https://wiki.dfrobot.com/Compute_Module_4_IoT_Router_Board_Mini_SKU_DFR0767 Signed-off-by: Joachim Wiberg --- configs/aarch64_defconfig | 1 + package/board/raspberry-pi-4/raspberry-pi-4.mk | 3 ++- src/board/raspberry-pi-4/dts/Makefile | 3 ++- .../raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts | 9 +++++++++ .../etc/product/interface-quirks.json | 8 ++++++++ .../raspberrypi,4-compute-module/interface-quirks.json | 8 ++++++++ 6 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts create mode 100644 src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json create mode 100644 src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index d247a64a..69392880 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -38,6 +38,7 @@ BR2_PACKAGE_STRESS_NG=y BR2_PACKAGE_JQ=y BR2_PACKAGE_E2FSPROGS=y BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y +BR2_PACKAGE_LINUX_FIRMWARE_RTL_8169=y BR2_PACKAGE_DBUS_CXX=y BR2_PACKAGE_DBUS_GLIB=y BR2_PACKAGE_DBUS_TRIGGERD=y diff --git a/package/board/raspberry-pi-4/raspberry-pi-4.mk b/package/board/raspberry-pi-4/raspberry-pi-4.mk index 88f36c8a..43ddd8a1 100644 --- a/package/board/raspberry-pi-4/raspberry-pi-4.mk +++ b/package/board/raspberry-pi-4/raspberry-pi-4.mk @@ -33,7 +33,8 @@ define RASPBERRY_PI_4_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_EXTENDED) $(call KCONFIG_ENABLE_OPT,CONFIG_SERIAL_8250_SHARE_IRQ) $(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_BROADCOM) - $(call KCONFIG_SET_OPT,CONFIG_BCMGENET,m) + $(call KCONFIG_SET_OPT,CONFIG_BCMGENET,y) + $(call KCONFIG_SET_OPT,CONFIG_R8169,m) $(call KCONFIG_SET_OPT,CONFIG_REGULATOR_RASPBERRYPI_TOUCHSCREEN_ATTINY,m) $(call KCONFIG_SET_OPT,CONFIG_REGULATOR_GPIO,y) $(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_BCM2835) diff --git a/src/board/raspberry-pi-4/dts/Makefile b/src/board/raspberry-pi-4/dts/Makefile index e96346bb..1ac998ed 100644 --- a/src/board/raspberry-pi-4/dts/Makefile +++ b/src/board/raspberry-pi-4/dts/Makefile @@ -1,3 +1,4 @@ dtb-y += broadcom/bcm2837-rpi-3-b.dtb broadcom/bcm2837-rpi-zero-2-w.dtb \ broadcom/bcm2711-rpi-4-b.dtb broadcom/bcm2711-rpi-4-b-dsi.dtb \ - broadcom/bcm2711-rpi-400.dtb broadcom/bcm2711-rpi-cm4-io.dtb + broadcom/bcm2711-rpi-400.dtb broadcom/bcm2711-rpi-cm4-io.dtb \ + broadcom/bcm2711-rpi-cm4.dtb diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts new file mode 100644 index 00000000..73b7bfb6 --- /dev/null +++ b/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts @@ -0,0 +1,9 @@ +#include +#include "infix.dtsi" + +/ { + chosen { + /* 8250 auxiliary UART instead of pl011 */ + stdout-path = "serial1:115200n8"; + }; +}; diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json new file mode 100644 index 00000000..fa174616 --- /dev/null +++ b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json @@ -0,0 +1,8 @@ +{ + "eth0": { + "phy-detached-when-down": true + }, + "eth1": { + "phy-detached-when-down": true + } +} diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json new file mode 100644 index 00000000..fa174616 --- /dev/null +++ b/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json @@ -0,0 +1,8 @@ +{ + "eth0": { + "phy-detached-when-down": true + }, + "eth1": { + "phy-detached-when-down": true + } +} From 6aaf612095299a430432043f7a9df11e3bcdec87 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 14:21:26 +0200 Subject: [PATCH 06/27] board/common: simplify USB port discovery and fix duplicate entries This commit refactors USB port probing to: - Eliminate duplicates: previously, 'authorized' and 'authorized_default' were listed as separate USB port entries (confusing). Now each USB port is represented once, with the path pointing to the USB device directory, confd appends the appropriate attribute file as needed - Add support for Raspberry Pi 4B and CM4 USB port(s) using a generic discovery function that scans /sys/bus/usb/devices for USB root hubs. This should work seamlessly across all platforms - For backwards compatibility and better UX: - Single USB port systems: Named "USB" (no number) - Multi-port systems: Named "USB1", "USB2", etc. - Device tree-based discovery is tried first (for boards like Alder with explicit DT USB port definitions), with fallback to generic discovery for boards without DT Fixes: #315 Signed-off-by: Joachim Wiberg --- .../rootfs/usr/libexec/infix/init.d/00-probe | 137 +++++++++++------- src/confd/src/ietf-hardware.c | 32 ++-- 2 files changed, 98 insertions(+), 71 deletions(-) diff --git a/board/common/rootfs/usr/libexec/infix/init.d/00-probe b/board/common/rootfs/usr/libexec/infix/init.d/00-probe index f3e97cc6..2e4a7412 100755 --- a/board/common/rootfs/usr/libexec/infix/init.d/00-probe +++ b/board/common/rootfs/usr/libexec/infix/init.d/00-probe @@ -98,13 +98,45 @@ class DTSystem: data = dict(zip(names, phs)) if data != {}: out["usb-ports"] = [] + + name_counts = {} # Track how many times each name has been used + for name, ph in data.items(): - [out["usb-ports"].extend([{ - "name": name, - "path": dev.attrpath("authorized")}, { - "name": name, - "path": dev.attrpath("authorized_default") - }]) for dev in self.devices_from_ph(ph)] + for dev in self.devices_from_ph(ph): + # Filter to only USB bus devices (usbN) that have authorized_default + # This avoids duplicate entries for platform devices and hub interfaces + if not dev.hasattr("authorized_default"): + continue + + # Convert platform path to /sys/bus/usb/devices/usbN path + # by finding the matching symlink in /sys/bus/usb/devices/ + usb_path = dev.syspath + try: + real_device = os.path.realpath(dev.syspath) + usb_bus_dir = "/sys/bus/usb/devices" + if os.path.exists(usb_bus_dir): + for entry in os.listdir(usb_bus_dir): + if not entry.startswith("usb"): + continue + candidate = os.path.join(usb_bus_dir, entry) + if os.path.realpath(candidate) == real_device: + usb_path = candidate + break + except: + pass # Fall back to original path if resolution fails + + # Handle name deduplication: first use gets bare name, subsequent get numbers + if name not in name_counts: + name_counts[name] = 1 + final_name = name + else: + name_counts[name] += 1 + final_name = f"{name}{name_counts[name]}" + + out["usb-ports"].append({ + "name": final_name, + "path": usb_path + }) def infix_devices(self, kind): phs = self.__get_phandle_array(kind) @@ -140,20 +172,13 @@ class QEMUSystem: return [self.product_vpd()] def usb_ports(self): - ports = [ - { - "name": "USB", - "path": "/sys/bus/usb/devices/usb1/authorized" - }, { - "name": "USB", - "path": "/sys/bus/usb/devices/usb1/authorized_default" - }, { - "name": "USB2", - "path": "/sys/bus/usb/devices/usb2/authorized" - }, { - "name": "USB2", - "path": "/sys/bus/usb/devices/usb2/authorized_default" - }] + ports = [{ + "name": "USB1", + "path": "/sys/bus/usb/devices/usb1" + }, { + "name": "USB2", + "path": "/sys/bus/usb/devices/usb2" + }] return ports @@ -308,37 +333,37 @@ def probe_qemusystem(out): subprocess.run("initctl -nbq cond set qemu".split(), check=False) return 0 -def rasberry_pi_4_usb_ports(out): - out["usb-ports"] = [ - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/authorized" - }, - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/authorized_default" - }, - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/authorized", - }, - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-0:1.0/authorized" - }, - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/authorized" - }, - { - "name": "USB", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/authorized_default" - }, - { - "name": "USB3", - "path": "/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb2/2-0:1.0/authorized" - } - ] + +def generic_usb_ports(out): + """Generic USB port discovery - works for all systems""" + ports = [] + usb_base = "/sys/bus/usb/devices" + + if not os.path.exists(usb_base): + return + + for entry in sorted(os.listdir(usb_base)): + # Only look at root hubs (usbN) + if not entry.startswith("usb"): + continue + + device_path = os.path.join(usb_base, entry) + # Check if this is a root hub (has authorized files) + if os.path.exists(os.path.join(device_path, "authorized")): + # Extract number from usbN + num = entry.replace("usb", "") + ports.append({ + "num": num, + "path": device_path + }) + + # Name ports: "USB" for single port, "USB1", "USB2", etc. for multiple + if ports: + if len(ports) == 1: + out["usb-ports"] = [{"name": "USB", "path": ports[0]["path"]}] + else: + out["usb-ports"] = [{"name": f"USB{p['num']}", "path": p["path"]} for p in ports] + def probe_dtsystem(out): """Probe DTS based system, expects a VPD in ONIE PROM format.""" @@ -349,11 +374,11 @@ def probe_dtsystem(out): if model: out["product-name"] = model - # Since rpi4 has USB on PCIe, there is no phandle reference - if model and model.startswith("Raspberry Pi 4"): - rasberry_pi_4_usb_ports(out) - else: - dtsys.infix_usb_devices(out) + # Try devicetree-based USB discovery first, fallback to generic + dtsys.infix_usb_devices(out) + if "usb-ports" not in out or not out["usb-ports"]: + generic_usb_ports(out) + out["compatible"] = dtsys.base.str_array("compatible") staticpw = dtsys.infix.str("factory-password-hash") diff --git a/src/confd/src/ietf-hardware.c b/src/confd/src/ietf-hardware.c index 37143954..e2236e5f 100644 --- a/src/confd/src/ietf-hardware.c +++ b/src/confd/src/ietf-hardware.c @@ -40,41 +40,43 @@ static bool usb_authorize(struct json_t *root, const char *name, int enabled) return 0; json_array_foreach(usb_ports, index, usb_port) { - struct json_t *jname, *jpath; - const char *path; + struct json_t *jname; + jname = json_object_get(usb_port, "name"); if (!jname || !json_is_string(jname)) { ERROR("Did not find USB hardware port (name) for %s", name); continue; } if (!strcmp(name, json_string_value(jname))) { - jpath = json_object_get(usb_port, "path"); + struct json_t *jpath = json_object_get(usb_port, "path"); + char authorized_default_path[PATH_MAX]; + const char *path; + if (!jpath || !json_is_string(jpath)) { ERROR("Did not find USB hardware port (path) for %s", name); continue; } + + /* Path now points to USB device directory, not the attribute file */ path = json_string_value(jpath); + snprintf(authorized_default_path, sizeof(authorized_default_path), + "%s/authorized_default", path); + if (!enabled) { - if (fexist(path)) { - if (writedf(0, "w", "%s", path)) { - ERROR("Failed to unauthorize %s", path); + if (fexist(authorized_default_path)) { + if (writedf(0, "w", "%s", authorized_default_path)) { + ERROR("Failed to unauthorize %s", authorized_default_path); return 1; } } } else { - char *rpath, *path_dup, *dir; - path_dup = strdup(path); - if (!path_dup) { - ERROR("Failed to allocate memory."); - return 1; - } - dir = dirname((char *)path_dup); - rpath = realpath(dir, NULL); + char *rpath; + + rpath = realpath(path, NULL); if (rpath) { nftw(rpath, dir_cb, 0, FTW_DEPTH | FTW_PHYS); free(rpath); } - free(path_dup); } } } From db06ddb93b710a03484e9d3155673f60762300b5 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 20 Oct 2025 09:16:27 +0200 Subject: [PATCH 07/27] board/common: move resize2fs of /var to after reboot On some boards, and in particular with a hybrid mbr/gpt partition table, like on the RPi64, we must resize ext *after* reboot. Also, do some cleanup and consolidation of error handling to prevent us from entering an endless boot loop. Follow-up to 391e9715 Signed-off-by: Joachim Wiberg --- board/common/rootfs/usr/libexec/infix/mnt | 160 ++++++++++++++++------ 1 file changed, 117 insertions(+), 43 deletions(-) diff --git a/board/common/rootfs/usr/libexec/infix/mnt b/board/common/rootfs/usr/libexec/infix/mnt index 7c99425f..944d45e6 100755 --- a/board/common/rootfs/usr/libexec/infix/mnt +++ b/board/common/rootfs/usr/libexec/infix/mnt @@ -105,16 +105,71 @@ find_partition_by_label() return 1 } -# Expand the given partition to fill up the rest of storage (sdcard) -resize_by_label() +status() +{ + GREEN="$(printf '\033[1;32m')" + RED="$(printf '\033[1;31m')" + YELLOW="$(printf '\033[1;33m')" + BOLD="$(printf '\033[1m')" + RESET="$(printf '\033[0m')" + + case $1 in + 0) color=$GREEN; text=' OK ' ;; + 1) color=$RED; text='FAIL' ;; + 2) color=$YELLOW;text='WARN' ;; + *) color=$YELLOW;text=' ⋯ ' ;; + esac + + printf '%s[%s%s%s%s]%s ' "$BOLD" "$color" "$text" "$RESET" "$BOLD" "$RESET" +} + +print_start() +{ + printf '\r%s%s' "$(status 3)" "$*" > /dev/console +} + +print_end() +{ + rc=$1; shift + if [ $# -gt 0 ]; then + printf '\r\033[K%s%s\n' "$(status "$rc")" "$*" > /dev/console + else + printf '\r%s\n' "$(status "$rc")" > /dev/console + fi +} + +# Helper to log resize error and create failure marker (stage 1) +resize_err() +{ + print_end 1 + logger $opt -p user.err -t "$nm" "$1" + echo "1" > /mnt/aux/resized.failed + + return 1 +} + +# Helper to log filesystem resize error and rename pending marker (stage 2) +resize_fs_err() +{ + print_end 1 + logger $opt -p user.err -t "$nm" "$1" + rm -f /mnt/aux/resized.pending + echo "1" > /mnt/aux/resized.failed + + return 1 +} + +# Stage 1: Expand the given partition to fill up the rest of storage +# On success, creates "resized.pending" marker and reboots. +# On failure, creates "resized.failed" marker and returns 1. +resize_partition() { label="$1" + print_start "Resizing /var partition on sdcard, please wait ..." + devname=$(find_partition_by_label "$label") - if [ -z "$devname" ]; then - logger $opt -p user.err -t "$nm" "Label \"$label\" not found" - return 1 - fi + [ -z "$devname" ] && resize_err "Label \"$label\" not found" part="/dev/$devname" diskname=$(basename "$(readlink -f "/sys/class/block/$devname/..")") @@ -124,64 +179,83 @@ resize_by_label() logger $opt -p user.notice -t "$nm" "Found partition $part (partition $partnum on $disk)" start=$(sgdisk -i "$partnum" "$disk" 2>/dev/null | grep "First sector:" | awk '{print $3}') - if [ -z "$start" ]; then - logger $opt -p user.err -t "$nm" "Could not determine start sector for partition $partnum" - return 1 - fi + [ -z "$start" ] && resize_err "Could not determine start sector for partition $partnum" - printf "\r\033[K[ ⋯ ] Resizing /var partition on sdcard, please wait ..." > /dev/console logger $opt -p user.notice -t "$nm" "Expanding partition $partnum from sector $start to end of disk" - if ! sgdisk -e "$disk" 2>&1 | logger $opt -p user.notice -t "$nm"; then - logger $opt -p user.warn -t "$nm" "Failed expanding GPT on $disk" - return 1 - fi + sgdisk -e "$disk" 2>&1 | logger $opt -p user.notice -t "$nm" || \ + resize_err "Failed expanding GPT on $disk" - if ! sgdisk -d "$partnum" "$disk" >/dev/null 2>&1; then - logger $opt -p user.warn -t "$nm" "Failed deleting partition $partnum on $disk" - return 1 - fi + sgdisk -d "$partnum" "$disk" >/dev/null 2>&1 || \ + resize_err "Failed deleting partition $partnum on $disk" - if ! sgdisk -n "$partnum:$start:0" "$disk" >/dev/null 2>&1; then - logger $opt -p user.warn -t "$nm" "Failed recreating partition $partnum on $disk" - return 1 - fi + sgdisk -n "$partnum:$start:0" "$disk" >/dev/null 2>&1 || \ + resize_err "Failed recreating partition $partnum on $disk" - if ! sgdisk -t "$partnum:8300" "$disk" >/dev/null 2>&1; then - logger $opt -p user.warn -t "$nm" "Failed setting partition type on $disk" - return 1 - fi + sgdisk -t "$partnum:8300" "$disk" >/dev/null 2>&1 || \ + resize_err "Failed setting partition type on $disk" - if ! sgdisk -c "$partnum:$label" "$disk" >/dev/null 2>&1; then - logger $opt -p user.warn -t "$nm" "Failed setting partition label on $disk" - return 1 - fi + sgdisk -c "$partnum:$label" "$disk" >/dev/null 2>&1 || \ + resize_err "Failed setting partition label on $disk" logger $opt -p user.notice -t "$nm" "Partition table updated on $disk" partprobe "$disk" 2>/dev/null - logger $opt -p user.notice -t "$nm" "Resizing filesystem on $part" - if ! resize2fs "$part" 2>&1 | logger $opt -p user.notice -t "$nm"; then - logger $opt -p user.warn -t "$nm" "Failed resizing filesystem on $part" - return 1 - fi + # Mark stage 1 complete, stage 2 will happen after reboot + echo "1" > /mnt/aux/resized.pending + sync - tune2fs -O resize_inode "$part" 2>/dev/null - printf "\r\033[K[ \033[32mOK\033[0m ] Resizing /var partition on sdcard, done. Rebooting ...\n" > /dev/console - logger $opt -p user.notice -t "$nm" "Partition expanded, rebooting to complete filesystem resize" + print_end 0 "Resizing /var partition on sdcard, done. Rebooting ..." + logger $opt -p user.notice -t "$nm" "Partition expanded, rebooting to resize filesystem" reboot -f } +# Stage 2: Complete filesystem resize after partition table has been expanded +# On success, renames "resized.pending" to "resized". +# On failure, renames "resized.pending" to "resized.failed" and returns 1. +resize_filesystem() +{ + label="$1" + + print_start "Expanding /var filesystem, please wait ..." + + devname=$(find_partition_by_label "$label") + [ -z "$devname" ] && resize_fs_err "Label \"$label\" not found for filesystem resize" + + part="/dev/$devname" + + logger $opt -p user.notice -t "$nm" "Resizing filesystem on $part" + resize2fs "$part" 2>&1 | logger $opt -p user.notice -t "$nm" || \ + resize_fs_err "Failed resizing filesystem on $part" + + tune2fs -O resize_inode "$part" 2>/dev/null + print_end 0 "Expanding /var filesystem, done." + logger $opt -p user.notice -t "$nm" "Filesystem resize complete" + + # Mark resize complete successfully + mv /mnt/aux/resized.pending /mnt/aux/resized + sync + + # Restore Finit's original progress message so its [ OK ] appears correctly + print_start "Mounting filesystems from /etc/fstab" + + return 0 +} + mount_rw() { # If something is already setup, leave it be. mountpoint -q "/$1" && return 0 - if [ "$1" = "var" ]; then - if is_rpi && [ ! -e /mnt/aux/resized ] ; then - touch /mnt/aux/resized - resize_by_label "$1" + # Check if /var has been resized to fill the sdcard/eMMC + if [ "$1" = "var" ] && is_rpi; then + if [ -f /mnt/aux/resized ] || [ -f /mnt/aux/resized.failed ]; then + : + elif [ -f /mnt/aux/resized.pending ]; then + resize_filesystem "$1" + else + resize_partition "$1" fi fi From e39b9cfee450645301ea117ab4669072a20dced0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 14:46:26 +0100 Subject: [PATCH 08/27] board/common: allow resizing /var on any mmc block device Signed-off-by: Joachim Wiberg --- board/common/rootfs/usr/libexec/infix/mnt | 27 ++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/board/common/rootfs/usr/libexec/infix/mnt b/board/common/rootfs/usr/libexec/infix/mnt index 944d45e6..44ff6dbe 100755 --- a/board/common/rootfs/usr/libexec/infix/mnt +++ b/board/common/rootfs/usr/libexec/infix/mnt @@ -51,12 +51,20 @@ factory_reset() sync } -is_rpi() +is_mmc() { - [ -r /sys/firmware/devicetree/base/model ] || return 1 - - model=$(cat /sys/firmware/devicetree/base/model 2>/dev/null | tr -d '\0') - echo "$model" | grep -q "^Raspberry Pi" + # Check if primary or secondary partition (our rootfs) is on MMC + for label in primary secondary; do + devname=$(find_partition_by_label "$label" 2>/dev/null) + if [ -n "$devname" ]; then + case "$devname" in + mmcblk*) + return 0 + ;; + esac + fi + done + return 1 } wait_mmc() @@ -249,7 +257,7 @@ mount_rw() mountpoint -q "/$1" && return 0 # Check if /var has been resized to fill the sdcard/eMMC - if [ "$1" = "var" ] && is_rpi; then + if [ "$1" = "var" ] && is_mmc; then if [ -f /mnt/aux/resized ] || [ -f /mnt/aux/resized.failed ]; then : elif [ -f /mnt/aux/resized.pending ]; then @@ -306,10 +314,9 @@ if ! logger -? |grep -q "Log to kernel"; then opt="-c" fi - -# On Raspberry Pi, MMC controller may probe slowly, in particular if we -# netboot (ram load) the devcice wait for it -if is_rpi && ! ls /dev/mmcblk* >/dev/null 2>&1; then +# On boards with MMC/SD cards, the controller may probe slowly, in particular +# if we netboot (ram load) the device - wait for it if not already available +if is_mmc && ! ls /dev/mmcblk* >/dev/null 2>&1; then wait_mmc fi From 3265f46990439ac6d72da1e86af6eebd21d39e16 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 13:26:16 +0200 Subject: [PATCH 09/27] board/aarch64: ensure dwc2 controller is in host mode The DWC2 controller is a very common IP block in ARM and RiscV SoCs. With the USB subsystem back to a built-in we can now enable host mode for the DWC2 (USB 2.0) ports on RPi. It also opens up for merging the NanoPi R2S into the generic aarch64 build. Signed-off-by: Joachim Wiberg --- board/aarch64/linux_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/aarch64/linux_defconfig b/board/aarch64/linux_defconfig index 12921f27..0fad9453 100644 --- a/board/aarch64/linux_defconfig +++ b/board/aarch64/linux_defconfig @@ -444,6 +444,8 @@ CONFIG_USB_OHCI_HCD_PLATFORM=m CONFIG_USB_STORAGE=m CONFIG_USB_DWC3=y CONFIG_USB_DWC2=y +CONFIG_USB_DWC2_HOST=y +CONFIG_USB_DWC2_PCI=y CONFIG_USB_CHIPIDEA=m CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y From ee37a19ab069bd8421f204bdf8587a8bf9eb5a3e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 14:23:16 +0200 Subject: [PATCH 10/27] cli: add support for admin-exec 'show system' overview Signed-off-by: Joachim Wiberg --- src/klish-plugin-infix/xml/infix.xml | 6 + src/show/show.py | 91 ++++++++++++++ src/statd/python/cli_pretty/cli_pretty.py | 146 ++++++++++++++++++++-- 3 files changed, 236 insertions(+), 7 deletions(-) diff --git a/src/klish-plugin-infix/xml/infix.xml b/src/klish-plugin-infix/xml/infix.xml index e8c010b4..59831d7d 100644 --- a/src/klish-plugin-infix/xml/infix.xml +++ b/src/klish-plugin-infix/xml/infix.xml @@ -353,6 +353,12 @@ + + + show system |pager + + + diff --git a/src/show/show.py b/src/show/show.py index 42ed458c..eca68d21 100755 --- a/src/show/show.py +++ b/src/show/show.py @@ -190,6 +190,96 @@ def wifi(args: List[str]): else: print(f"Invalid interface name: {iface}") +def system(args: List[str]) -> None: + # Get system state from sysrepo + data = run_sysrepocfg("/ietf-system:system-state") + if not data: + print("No system data retrieved.") + return + + # Augment with runtime data + runtime = {} + + # Get thermal zones + thermal_zones = [] + try: + for zone in os.listdir("/sys/class/thermal"): + if zone.startswith("thermal_zone"): + try: + with open(f"/sys/class/thermal/{zone}/type") as f: + zone_type = f.read().strip() + with open(f"/sys/class/thermal/{zone}/temp") as f: + temp = int(f.read().strip()) / 1000.0 + thermal_zones.append({"type": zone_type, "temp": temp}) + except (FileNotFoundError, ValueError): + pass + except FileNotFoundError: + pass + + if thermal_zones: + runtime["thermal"] = thermal_zones + + # Get disk usage for /, /var, /cfg + disk_usage = [] + for mount in ["/", "/var", "/cfg"]: + try: + result = subprocess.run(["df", "-h", mount], + capture_output=True, text=True, check=True) + lines = result.stdout.strip().split("\n") + if len(lines) > 1: + parts = lines[1].split() + if len(parts) >= 5: + disk_usage.append({ + "mount": mount, + "size": parts[1], + "used": parts[2], + "available": parts[3], + "percent": parts[4] + }) + except subprocess.CalledProcessError: + pass + + if disk_usage: + runtime["disk"] = disk_usage + + # Get memory info + try: + with open("/proc/meminfo") as f: + mem_info = {} + for line in f: + parts = line.split(":") + if len(parts) == 2: + key = parts[0].strip() + value = parts[1].strip() + if key in ["MemTotal", "MemFree", "MemAvailable"]: + # Convert from kB to MB + mem_info[key] = int(value.split()[0]) // 1024 + runtime["memory"] = mem_info + except FileNotFoundError: + pass + + # Get load average + try: + with open("/proc/loadavg") as f: + load_parts = f.read().strip().split() + if len(load_parts) >= 3: + runtime["load"] = { + "1min": load_parts[0], + "5min": load_parts[1], + "15min": load_parts[2] + } + except FileNotFoundError: + pass + + # Add runtime data to main data structure + data["runtime"] = runtime + + if RAW_OUTPUT: + print(json.dumps(data, indent=2)) + return + + cli_pretty(data, "show-system") + def execute_command(command: str, args: List[str]): command_mapping = { 'dhcp': dhcp, @@ -201,6 +291,7 @@ def execute_command(command: str, args: List[str]): 'services' : services, 'software' : software, 'stp': stp, + 'system': system, 'wifi': wifi } diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index 7f4ebc88..f67402ca 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -193,6 +193,19 @@ class PadLldp: port_id = 20 +class PadDiskUsage: + mount = 18 + size = 12 + used = 12 + avail = 12 + percent = 6 + + @classmethod + def table_width(cls): + """Total width of disk usage table""" + return cls.mount + cls.size + cls.used + cls.avail + cls.percent + + class PadFirewall: zone_locked = 2 zone_name = 21 @@ -1589,6 +1602,121 @@ def show_ntp(json): print(row) +def show_system(json): + """System information overivew""" + if not json.get("ietf-system:system-state"): + print("Error: No system data available.") + sys.exit(1) + + system_state = json["ietf-system:system-state"] + platform = system_state.get("platform", {}) + clock = system_state.get("clock", {}) + software = system_state.get("infix-system:software", {}) + runtime = json.get("runtime", {}) + + # Calculate uptime + uptime_str = "Unknown" + if clock.get("current-datetime") and clock.get("boot-datetime"): + try: + current = datetime.fromisoformat(clock["current-datetime"].replace("Z", "+00:00")) + boot = datetime.fromisoformat(clock["boot-datetime"].replace("Z", "+00:00")) + uptime = current - boot + days = uptime.days + hours, remainder = divmod(uptime.seconds, 3600) + minutes, seconds = divmod(remainder, 60) + uptime_str = f"{days}d {hours:02d}:{minutes:02d}:{seconds:02d}" + except (ValueError, KeyError): + pass + + width = PadDiskUsage.table_width() + print(Decore.invert(f"{'SYSTEM INFORMATION':<{width}}")) + print(f"{'OS Name':<20}: {platform.get('os-name', 'Unknown')}") + print(f"{'OS Version':<20}: {platform.get('os-version', 'Unknown')}") + print(f"{'Architecture':<20}: {platform.get('machine', 'Unknown')}") + + booted = software.get("booted", "Unknown") + slots = software.get("slot", []) + booted_slot = None + for slot in slots: + if slot.get("state") == "booted": + booted_slot = slot + break + + if booted_slot: + bundle = booted_slot.get("bundle", {}) + print(f"{'Boot Partition':<20}: {booted} ({bundle.get('version', 'Unknown')})") + else: + print(f"{'Boot Partition':<20}: {booted}") + + # Format current time more readably: "2025-10-18 13:23:47 +00:00" + current_time = clock.get('current-datetime', 'Unknown') + if current_time != 'Unknown': + try: + dt = datetime.fromisoformat(current_time.replace("Z", "+00:00")) + # Format as "YYYY-MM-DD HH:MM:SS +HH:MM" (keep UTC offset) + current_time = dt.strftime('%Y-%m-%d %H:%M:%S %z') + # Insert colon in timezone offset: +0000 -> +00:00 + if len(current_time) >= 5 and current_time[-5] in ['+', '-']: + current_time = current_time[:-2] + ':' + current_time[-2:] + except (ValueError, AttributeError): + pass + + print(f"{'Current Time':<20}: {current_time}") + print(f"{'Uptime':<20}: {uptime_str}") + + Decore.title("Status", width) + + load = runtime.get("load", {}) + if load: + print(f"{'Load Average':<20}: {load.get('1min', '?')}, {load.get('5min', '?')}, {load.get('15min', '?')}") + + memory = runtime.get("memory", {}) + if memory: + total = memory.get("MemTotal", 0) + available = memory.get("MemAvailable", 0) + used = total - available + percent = int((used / total * 100)) if total > 0 else 0 + print(f"{'Memory':<20}: {used} / {total} MB ({percent}% used)") + + thermal = runtime.get("thermal", []) + if thermal: + for zone in thermal: + zone_type = zone.get("type", "Unknown").replace("-thermal", "") + temp = zone.get("temp", 0) + # Color code temperature: green < 60, yellow 60-75, red > 75 + temp_str = f"{temp:.1f}°C" + if temp < 60: + temp_colored = Decore.green(temp_str) + elif temp < 75: + temp_colored = Decore.yellow(temp_str) + else: + temp_colored = Decore.red(temp_str) + print(f"{'Temperature':<20}: {temp_colored} ({zone_type})") + + disk = runtime.get("disk", []) + # Filter out root partition (/) - it's read-only and shows confusing 100% usage + disk_filtered = [d for d in disk if d.get("mount") != "/"] + if disk_filtered: + Decore.title("Disk Usage", width) + hdr = (f"{'MOUNTPOINT':<{PadDiskUsage.mount}}" + f"{'SIZE':>{PadDiskUsage.size}}" + f"{'USED':>{PadDiskUsage.used}}" + f"{'AVAIL':>{PadDiskUsage.avail}}" + f"{'USE%':>{PadDiskUsage.percent}}") + print(Decore.invert(hdr)) + for d in disk_filtered: + mount = d.get("mount", "?") + size = d.get("size", "?") + used = d.get("used", "?") + avail = d.get("available", "?") + percent = d.get("percent", "?") + print(f"{mount:<{PadDiskUsage.mount}}" + f"{size:>{PadDiskUsage.size}}" + f"{used:>{PadDiskUsage.used}}" + f"{avail:>{PadDiskUsage.avail}}" + f"{percent:>{PadDiskUsage.percent}}") + + def show_dhcp_server(json, stats): data = json.get("infix-dhcp-server:dhcp-server") if not data: @@ -2518,31 +2646,33 @@ def main(): subparsers.add_parser('show-bridge-stp', help='Show spanning tree state') subparsers.add_parser('show-dhcp-server', help='Show DHCP server') \ - .add_argument("-s", "--stats", action="store_true", help="Show server statistics") + .add_argument("-s", "--stats", action="store_true", help="Show server statistics") subparsers.add_parser('show-hardware', help='Show USB ports') subparsers.add_parser('show-interfaces', help='Show interfaces') \ - .add_argument('-n', '--name', help='Interface name') + .add_argument('-n', '--name', help='Interface name') subparsers.add_parser('show-lldp', help='Show LLDP neighbors') subparsers.add_parser('show-firewall', help='Show firewall overview') subparsers.add_parser('show-firewall-zone', help='Show firewall zones') \ - .add_argument('name', nargs='?', help='Zone name') + .add_argument('name', nargs='?', help='Zone name') subparsers.add_parser('show-firewall-policy', help='Show firewall policies') \ - .add_argument('name', nargs='?', help='Policy name') + .add_argument('name', nargs='?', help='Policy name') subparsers.add_parser('show-firewall-service', help='Show firewall services') \ - .add_argument('name', nargs='?', help='Service name') + .add_argument('name', nargs='?', help='Service name') subparsers.add_parser('show-ntp', help='Show NTP sources') subparsers.add_parser('show-routing-table', help='Show the routing table') \ - .add_argument('-i', '--ip', required=True, help='IPv4 or IPv6 address') + .add_argument('-i', '--ip', required=True, help='IPv4 or IPv6 address') subparsers.add_parser('show-services', help='Show system services') subparsers.add_parser('show-software', help='Show software versions') \ - .add_argument('-n', '--name', help='Slotname') + .add_argument('-n', '--name', help='Slotname') + + subparsers.add_parser('show-system', help='Show system overview') args = parser.parse_args() UNIT_TEST = args.test @@ -2575,6 +2705,8 @@ def main(): show_software(json_data, args.name) elif args.command == "show-services": show_services(json_data) + elif args.command == "show-system": + show_system(json_data) else: print(f"Error, unknown command '{args.command}'") From ee6def793c1a8b438f479c2365cb0fd8fbfcc9c8 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 15:43:43 +0200 Subject: [PATCH 11/27] cli: add 'reboot' option to upgrade command Usually, when upgrading a system, you want to reboot it so the upgrade takes effect. This commit adds a 'reboot' option/flag, alongside the 'force' option, to facilitate this. Signed-off-by: Joachim Wiberg --- src/klish-plugin-infix/xml/infix.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/klish-plugin-infix/xml/infix.xml b/src/klish-plugin-infix/xml/infix.xml index 59831d7d..6f8faf8f 100644 --- a/src/klish-plugin-infix/xml/infix.xml +++ b/src/klish-plugin-infix/xml/infix.xml @@ -680,12 +680,18 @@ - + + force=${KLISH_PARAM_force:+--ignore-compatible} rauc install $force $KLISH_PARAM_URI + if [ $? -eq 0 -a -n "$KLISH_PARAM_reboot" ]; then + echo "Upgrade successful, rebooting..." + sleep 2 + reboot + fi From 8b10cce172e84ba108a709990847d0af4b9bd0ab Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sat, 18 Oct 2025 17:03:21 +0200 Subject: [PATCH 12/27] confd: add support for temperature sensors in ietf-hardware.yang - Remove class deviation to allow iana-hardware:sensor - Populate sensor operational data from /sys/class/thermal - Extend 'show hardware' Signed-off-by: Joachim Wiberg --- src/confd/yang/confd.inc | 4 +- src/confd/yang/confd/infix-hardware.yang | 23 +--- ...25.yang => infix-hardware@2025-10-18.yang} | 0 src/show/show.py | 31 ++--- src/statd/python/cli_pretty/cli_pretty.py | 106 ++++++++++++++++-- src/statd/python/yanger/ietf_hardware.py | 61 +++++++++- 6 files changed, 183 insertions(+), 42 deletions(-) rename src/confd/yang/confd/{infix-hardware@2024-04-25.yang => infix-hardware@2025-10-18.yang} (100%) diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index 0cca741d..d39401b7 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -17,8 +17,8 @@ MODULES=( "ietf-syslog@2024-03-21.yang -e file-action -e file-limit-size -e remote-action" "infix-syslog@2024-07-19.yang" "iana-hardware@2018-03-13.yang" - "ietf-hardware@2018-03-13.yang -e hardware-state" - "infix-hardware@2024-04-25.yang" + "ietf-hardware@2018-03-13.yang -e hardware-state -e hardware-sensor" + "infix-hardware@2025-10-18.yang" "ieee802-dot1q-types@2022-10-29.yang" "infix-ip@2024-09-16.yang" "infix-if-type@2025-02-12.yang" diff --git a/src/confd/yang/confd/infix-hardware.yang b/src/confd/yang/confd/infix-hardware.yang index 71ad21f4..87f683d4 100644 --- a/src/confd/yang/confd/infix-hardware.yang +++ b/src/confd/yang/confd/infix-hardware.yang @@ -17,6 +17,10 @@ module infix-hardware { contact "kernelkit@googlegroups.com"; description "Vital Product Data augmentation of ieee-hardware and deviations."; + revision 2025-10-18 { + description "Enable sensor support, starting with hwmon temperature sensors."; + reference "internal"; + } revision 2024-04-25 { description "Spellcheck leaf: coutry-code -> country-code"; reference "internal"; @@ -34,27 +38,15 @@ module infix-hardware { description "A two-letter country code."; } - identity hardware-class { - description "infix hardware base class"; - } - identity usb { - base hardware-class; + base iahw:hardware-class; description "This identity is used to describe a USB port"; } identity vpd { - base hardware-class; + base iahw:hardware-class; description "This identity is used to a VPD memory on the device."; } - deviation "/iehw:hardware/iehw:component/iehw:class" { - deviate replace { - type identityref { - base hardware-class; - } - } - } - deviation "/iehw:hardware/iehw:component/iehw:state/iehw:admin-state" { deviate add { must ". = 'locked' or . = 'unlocked'" { @@ -66,9 +58,6 @@ module infix-hardware { deviation "/iehw:hardware/iehw:component/iehw:state/iehw:standby-state" { deviate not-supported; } - deviation "/iehw:hardware/iehw:component/iehw:sensor-data" { - deviate not-supported; - } deviation "/iehw:hardware/iehw:component/iehw:parent" { deviate not-supported; } diff --git a/src/confd/yang/confd/infix-hardware@2024-04-25.yang b/src/confd/yang/confd/infix-hardware@2025-10-18.yang similarity index 100% rename from src/confd/yang/confd/infix-hardware@2024-04-25.yang rename to src/confd/yang/confd/infix-hardware@2025-10-18.yang diff --git a/src/show/show.py b/src/show/show.py index eca68d21..73d4f10f 100755 --- a/src/show/show.py +++ b/src/show/show.py @@ -197,24 +197,27 @@ def system(args: List[str]) -> None: print("No system data retrieved.") return + # Get hardware data (including thermal sensors) + hardware_data = run_sysrepocfg("/ietf-hardware:hardware") + # Augment with runtime data runtime = {} - # Get thermal zones + # Extract thermal sensors from hardware components thermal_zones = [] - try: - for zone in os.listdir("/sys/class/thermal"): - if zone.startswith("thermal_zone"): - try: - with open(f"/sys/class/thermal/{zone}/type") as f: - zone_type = f.read().strip() - with open(f"/sys/class/thermal/{zone}/temp") as f: - temp = int(f.read().strip()) / 1000.0 - thermal_zones.append({"type": zone_type, "temp": temp}) - except (FileNotFoundError, ValueError): - pass - except FileNotFoundError: - pass + if hardware_data and "ietf-hardware:hardware" in hardware_data: + components = hardware_data.get("ietf-hardware:hardware", {}).get("component", []) + for component in components: + sensor_data = component.get("sensor-data", {}) + if sensor_data and sensor_data.get("value-type") == "celsius": + # Convert from millidegrees to degrees + temp_millidegrees = sensor_data.get("value", 0) + temp_celsius = temp_millidegrees / 1000.0 + + thermal_zones.append({ + "type": component.get("name", "unknown"), + "temp": temp_celsius + }) if thermal_zones: runtime["thermal"] = thermal_zones diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index f67402ca..f9d3c37a 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -162,6 +162,24 @@ class PadUsbPort: title = 30 name = 20 state = 10 + oper = 10 + + @classmethod + def table_width(cls): + """Total width of USB port table""" + return cls.name + cls.state + cls.oper + + +class PadSensor: + name = 20 + type = 15 + value = 15 + status = 10 + + @classmethod + def table_width(cls): + """Total width of sensor table""" + return cls.name + cls.type + cls.value + cls.status class PadNtpSource: @@ -567,11 +585,54 @@ class USBport: self.data = data self.name = data.get('name', '') self.state = get_json_data('', self.data, 'state', 'admin-state') + self.oper = get_json_data('', self.data, 'state', 'oper-state') def print(self): - #print(self.name) row = f"{self.name:<{PadUsbPort.name}}" row += f"{self.state:<{PadUsbPort.state}}" + row += f"{self.oper:<{PadUsbPort.oper}}" + print(row) + + +class Sensor: + def __init__(self, data): + self.data = data + self.name = data.get('name', 'unknown') + sensor_data = data.get('sensor-data', {}) + self.value_type = sensor_data.get('value-type', 'unknown') + self.value = sensor_data.get('value', 0) + self.value_scale = sensor_data.get('value-scale', 'units') + self.oper_status = sensor_data.get('oper-status', 'unknown') + + def get_formatted_value(self): + """Convert sensor value based on scale and type""" + if self.value_type == 'celsius': + if self.value_scale == 'milli': + temp_celsius = self.value / 1000.0 + # Color code like in show system + if temp_celsius < 60: + return Decore.green(f"{temp_celsius:.1f}°C") + elif temp_celsius < 75: + return Decore.yellow(f"{temp_celsius:.1f}°C") + else: + return Decore.red(f"{temp_celsius:.1f}°C") + else: + return f"{self.value}°C" + else: + # For other sensor types, just show raw value + return f"{self.value} {self.value_type}" + + def print(self): + import re + row = f"{self.name:<{PadSensor.name}}" + row += f"{self.value_type:<{PadSensor.type}}" + # For colored value, pad manually to account for ANSI codes + value_str = self.get_formatted_value() + # Count visible characters (strip ANSI codes for length calculation) + visible_len = len(re.sub(r'\x1b\[[0-9;]*m', '', value_str)) + padding = PadSensor.value - visible_len + row += value_str + (' ' * padding) + row += f"{self.oper_status:<{PadSensor.status}}" print(row) @@ -1568,17 +1629,46 @@ def show_hardware(json): print("Error, top level \"ietf-hardware:component\" missing") sys.exit(1) - hdr = (f"{'NAME':<{PadUsbPort.name}}" - f"{'STATE':<{PadUsbPort.state}}") - Decore.title("USB PORTS", PadUsbPort.title) # TODO: could be len(hdr) - print(Decore.invert(hdr)) - components = get_json_data({}, json, "ietf-hardware:hardware", "component") - for component in components: - if component.get("class") == "infix-hardware:usb": + # Separate components by type + usb_ports = [c for c in components if c.get("class") == "infix-hardware:usb"] + sensors = [c for c in components if c.get("class") == "iana-hardware:sensor"] + + # Determine overall width (use the wider of the two sections) + width = max(PadUsbPort.table_width(), PadSensor.table_width()) + + # Display full-width inverted heading + print(Decore.invert(f"{'HARDWARE COMPONENTS':<{width}}")) + print() + + # USB Ports section + if usb_ports: + Decore.title("USB Ports", width) + hdr = (f"{'NAME':<{PadUsbPort.name}}" + f"{'STATE':<{PadUsbPort.state}}" + f"{'OPER':<{PadUsbPort.oper}}") + # Pad header to full width + hdr = f"{hdr:<{width}}" + print(Decore.invert(hdr)) + + for component in usb_ports: port = USBport(component) port.print() + print() + + # Sensors section + if sensors: + Decore.title("Sensors", width) + hdr = (f"{'NAME':<{PadSensor.name}}" + f"{'TYPE':<{PadSensor.type}}" + f"{'VALUE':<{PadSensor.value}}" + f"{'STATUS':<{PadSensor.status}}") + print(Decore.invert(hdr)) + + for component in sensors: + sensor = Sensor(component) + sensor.print() def show_ntp(json): diff --git a/src/statd/python/yanger/ietf_hardware.py b/src/statd/python/yanger/ietf_hardware.py index 94a74f65..5e7f3281 100644 --- a/src/statd/python/yanger/ietf_hardware.py +++ b/src/statd/python/yanger/ietf_hardware.py @@ -1,7 +1,8 @@ import datetime import os +import glob -from .common import insert +from .common import insert, YangDate from .host import HOST @@ -75,6 +76,63 @@ def usb_port_components(systemjson): return ports +def thermal_sensor_components(): + """ + Discover thermal zones and create sensor components. + Returns a list of hardware components with sensor-data. + """ + components = [] + + try: + # Find all thermal zones + thermal_zones = glob.glob("/sys/class/thermal/thermal_zone*") + + for zone_path in thermal_zones: + try: + # Read zone type (e.g., "cpu-thermal", "gpu-thermal") + type_path = os.path.join(zone_path, "type") + if not HOST.exists(type_path): + continue + + zone_type = HOST.read(type_path).strip() + + # Read temperature in millidegrees Celsius + temp_path = os.path.join(zone_path, "temp") + if not HOST.exists(temp_path): + continue + + temp_millidegrees = int(HOST.read(temp_path).strip()) + + # Create component with sensor-data + # Component name: strip "-thermal" suffix for cleaner display + component_name = zone_type.replace("-thermal", "") + + component = { + "name": component_name, + "class": "iana-hardware:sensor", + "sensor-data": { + "value": temp_millidegrees, + "value-type": "celsius", + "value-scale": "milli", + "value-precision": 0, + "value-timestamp": str(YangDate()), + "oper-status": "ok" + } + } + + components.append(component) + + except (FileNotFoundError, ValueError, IOError): + # Skip this thermal zone if we can't read it + continue + + except Exception: + # If we can't access /sys/class/thermal at all, just return empty list + pass + + return components + + def operational(): systemjson = HOST.read_json("/run/system.json") @@ -83,6 +141,7 @@ def operational(): "component": vpd_components(systemjson) + usb_port_components(systemjson) + + thermal_sensor_components() + [], }, } From 08c9c978233771763f68c5b5b2ad7fab1bc4787a Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 19 Oct 2025 09:56:44 +0200 Subject: [PATCH 13/27] confd: add system resource usage to ietf-system.yang This commit adds resource usage: memory, loadavg, and filesystem usage by augmenting ietf-system:/system-state. Signed-off-by: Joachim Wiberg --- src/confd/yang/confd.inc | 2 +- src/confd/yang/confd/infix-system.yang | 87 ++++++++++++++- ...4-29.yang => infix-system@2025-10-18.yang} | 0 src/show/show.py | 101 +++++++++--------- src/statd/python/yanger/ietf_system.py | 69 ++++++++++++ 5 files changed, 206 insertions(+), 53 deletions(-) rename src/confd/yang/confd/{infix-system@2025-04-29.yang => infix-system@2025-10-18.yang} (100%) diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index d39401b7..f15ac271 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -32,7 +32,7 @@ MODULES=( "infix-firewall-services@2025-04-26.yang" "infix-firewall-icmp-types@2025-04-26.yang" "infix-meta@2024-10-18.yang" - "infix-system@2025-04-29.yang" + "infix-system@2025-10-18.yang" "infix-services@2024-12-03.yang" "ieee802-ethernet-interface@2019-06-21.yang" "infix-ethernet-interface@2024-02-27.yang" diff --git a/src/confd/yang/confd/infix-system.yang b/src/confd/yang/confd/infix-system.yang index 240bef7f..805495df 100644 --- a/src/confd/yang/confd/infix-system.yang +++ b/src/confd/yang/confd/infix-system.yang @@ -28,11 +28,12 @@ module infix-system { contact "kernelkit@googlegroups.com"; description "Infix augments and deviations to ietf-system."; - revision 2025-04-29 { - description "Add services status."; + revision 2025-10-18 { + description "New system-state status: + - Add system resource usage: memory, loadavg, filesystem usage + - Add services status"; reference "internal"; } - revision 2025-01-25 { description "Add DNS resolver status."; reference "internal"; @@ -509,6 +510,86 @@ module infix-system { } } } + + container resource-usage { + description "Runtime system resource usage information"; + config false; + + container memory { + description "System memory usage"; + + leaf total { + description "Total system memory in kibibytes"; + type uint64; + units "KiB"; + } + + leaf free { + description "Free memory in kibibytes"; + type uint64; + units "KiB"; + } + + leaf available { + description "Available memory in kibibytes (includes cache that can be reclaimed)"; + type uint64; + units "KiB"; + } + } + + container load-average { + description "System load average"; + + leaf load-1min { + description "1-minute load average"; + type decimal64 { + fraction-digits 2; + } + } + + leaf load-5min { + description "5-minute load average"; + type decimal64 { + fraction-digits 2; + } + } + + leaf load-15min { + description "15-minute load average"; + type decimal64 { + fraction-digits 2; + } + } + } + + list filesystem { + key "mount-point"; + description "Filesystem usage for mounted filesystems"; + + leaf mount-point { + description "Filesystem mount point (e.g., /, /var, /cfg)"; + type string; + } + + leaf size { + description "Total filesystem size in kibibytes"; + type uint64; + units "KiB"; + } + + leaf used { + description "Used space in kibibytes"; + type uint64; + units "KiB"; + } + + leaf available { + description "Available space in kibibytes"; + type uint64; + units "KiB"; + } + } + } } deviation "/sys:system/sys:hostname" { diff --git a/src/confd/yang/confd/infix-system@2025-04-29.yang b/src/confd/yang/confd/infix-system@2025-10-18.yang similarity index 100% rename from src/confd/yang/confd/infix-system@2025-04-29.yang rename to src/confd/yang/confd/infix-system@2025-10-18.yang diff --git a/src/show/show.py b/src/show/show.py index 73d4f10f..1ce61e86 100755 --- a/src/show/show.py +++ b/src/show/show.py @@ -222,58 +222,61 @@ def system(args: List[str]) -> None: if thermal_zones: runtime["thermal"] = thermal_zones - # Get disk usage for /, /var, /cfg - disk_usage = [] - for mount in ["/", "/var", "/cfg"]: - try: - result = subprocess.run(["df", "-h", mount], - capture_output=True, text=True, check=True) - lines = result.stdout.strip().split("\n") - if len(lines) > 1: - parts = lines[1].split() - if len(parts) >= 5: - disk_usage.append({ - "mount": mount, - "size": parts[1], - "used": parts[2], - "available": parts[3], - "percent": parts[4] - }) - except subprocess.CalledProcessError: - pass + # Extract resource usage from system-state + system_state = data.get("ietf-system:system-state", {}) + resource_usage = system_state.get("infix-system:resource-usage", {}) - if disk_usage: + # Memory info - convert KiB to MiB for display + memory_kib = resource_usage.get("memory", {}) + if memory_kib: + memory = {} + if "total" in memory_kib: + memory["MemTotal"] = int(memory_kib["total"]) // 1024 + if "free" in memory_kib: + memory["MemFree"] = int(memory_kib["free"]) // 1024 + if "available" in memory_kib: + memory["MemAvailable"] = int(memory_kib["available"]) // 1024 + runtime["memory"] = memory + + # Load average + load_avg = resource_usage.get("load-average", {}) + if load_avg: + runtime["load"] = { + "1min": str(load_avg.get("load-1min", "0.00")), + "5min": str(load_avg.get("load-5min", "0.00")), + "15min": str(load_avg.get("load-15min", "0.00")) + } + + # Filesystem usage - convert KiB to human-readable format + filesystems = resource_usage.get("filesystem", []) + if filesystems: + disk_usage = [] + for fs in filesystems: + mount = fs.get("mount-point", "") + size_kib = int(fs.get("size", 0)) + used_kib = int(fs.get("used", 0)) + avail_kib = int(fs.get("available", 0)) + + # Convert KiB to human-readable format (similar to df -h) + def human_readable(kib_val): + for unit in ['K', 'M', 'G', 'T']: + if kib_val < 1024.0: + return f"{kib_val:.1f}{unit}" + kib_val /= 1024.0 + return f"{kib_val:.1f}P" + + # Calculate percentage + percent = f"{int((used_kib / size_kib * 100) if size_kib > 0 else 0)}%" + + disk_usage.append({ + "mount": mount, + "size": human_readable(size_kib), + "used": human_readable(used_kib), + "available": human_readable(avail_kib), + "percent": percent + }) runtime["disk"] = disk_usage - # Get memory info - try: - with open("/proc/meminfo") as f: - mem_info = {} - for line in f: - parts = line.split(":") - if len(parts) == 2: - key = parts[0].strip() - value = parts[1].strip() - if key in ["MemTotal", "MemFree", "MemAvailable"]: - # Convert from kB to MB - mem_info[key] = int(value.split()[0]) // 1024 - runtime["memory"] = mem_info - except FileNotFoundError: - pass - - # Get load average - try: - with open("/proc/loadavg") as f: - load_parts = f.read().strip().split() - if len(load_parts) >= 3: - runtime["load"] = { - "1min": load_parts[0], - "5min": load_parts[1], - "15min": load_parts[2] - } - except FileNotFoundError: - pass - # Add runtime data to main data structure data["runtime"] = runtime diff --git a/src/statd/python/yanger/ietf_system.py b/src/statd/python/yanger/ietf_system.py index bc032a13..23e08d0f 100644 --- a/src/statd/python/yanger/ietf_system.py +++ b/src/statd/python/yanger/ietf_system.py @@ -292,6 +292,74 @@ def add_clock(out): clock["current-datetime"] = str(clock_now) insert(out, "clock", clock) +def add_resource_usage(out): + """Add system resource usage (memory, load average, filesystem) to system-state""" + resource = {} + + # Memory usage + try: + meminfo = HOST.read("/proc/meminfo") + if not meminfo: + return + mem_info = {} + for line in meminfo.splitlines(): + parts = line.split(":") + if len(parts) == 2: + key = parts[0].strip() + value = parts[1].strip() + if key in ["MemTotal", "MemFree", "MemAvailable"]: + # Store in KiB (as provided by /proc/meminfo, mislabeled as kB) + mem_info[key] = int(value.split()[0]) + + if mem_info: + memory = {} + if "MemTotal" in mem_info: + memory["total"] = str(mem_info["MemTotal"]) + if "MemFree" in mem_info: + memory["free"] = str(mem_info["MemFree"]) + if "MemAvailable" in mem_info: + memory["available"] = str(mem_info["MemAvailable"]) + resource["memory"] = memory + except (FileNotFoundError, ValueError): + pass + + # Load average + try: + loadavg = HOST.read("/proc/loadavg") + load_parts = loadavg.strip().split() + if len(load_parts) >= 3: + load = { + "load-1min": load_parts[0], + "load-5min": load_parts[1], + "load-15min": load_parts[2] + } + resource["load-average"] = load + except (FileNotFoundError, ValueError): + pass + + # Filesystem usage + filesystems = [] + for mount in ["/", "/var", "/cfg"]: + try: + result = HOST.run_multiline(["df", "-k", mount], []) + if len(result) > 1: + parts = result[1].split() + if len(parts) >= 4: + filesystems.append({ + "mount-point": mount, + "size": str(parts[1]), + "used": str(parts[2]), + "available": str(parts[3]) + }) + except (subprocess.CalledProcessError, ValueError, IndexError): + pass + + if filesystems: + resource["filesystem"] = filesystems + + if resource: + insert(out, "infix-system:resource-usage", resource) + def operational(): out = { "ietf-system:system": { @@ -310,5 +378,6 @@ def operational(): add_clock(out_state) add_platform(out_state) add_services(out_state) + add_resource_usage(out_state) return out From 46919e2d1f1493b45619eecc984d6c39e09bf04e Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 19 Oct 2025 11:10:21 +0200 Subject: [PATCH 14/27] statd: add chassis information to ietf-hardware.yang Signed-off-by: Joachim Wiberg --- src/statd/python/cli_pretty/cli_pretty.py | 19 +++++-- src/statd/python/yanger/ietf_hardware.py | 68 +++++++++++++++++------ 2 files changed, 65 insertions(+), 22 deletions(-) diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index f9d3c37a..7ba241d1 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -1631,7 +1631,7 @@ def show_hardware(json): components = get_json_data({}, json, "ietf-hardware:hardware", "component") - # Separate components by type + motherboard = [c for c in components if c.get("class") == "iana-hardware:chassis"] usb_ports = [c for c in components if c.get("class") == "infix-hardware:usb"] sensors = [c for c in components if c.get("class") == "iana-hardware:sensor"] @@ -1640,9 +1640,20 @@ def show_hardware(json): # Display full-width inverted heading print(Decore.invert(f"{'HARDWARE COMPONENTS':<{width}}")) - print() - # USB Ports section + if motherboard: + board = motherboard[0] # Should only be one + Decore.title("Board Information", width) + + if board.get("model-name"): + print(f"Model : {board['model-name']}") + if board.get("mfg-name"): + print(f"Manufacturer : {board['mfg-name']}") + if board.get("serial-num"): + print(f"Serial Number : {board['serial-num']}") + if board.get("hardware-rev"): + print(f"Hardware Revision : {board['hardware-rev']}") + if usb_ports: Decore.title("USB Ports", width) hdr = (f"{'NAME':<{PadUsbPort.name}}" @@ -1655,9 +1666,7 @@ def show_hardware(json): for component in usb_ports: port = USBport(component) port.print() - print() - # Sensors section if sensors: Decore.title("Sensors", width) hdr = (f"{'NAME':<{PadSensor.name}}" diff --git a/src/statd/python/yanger/ietf_hardware.py b/src/statd/python/yanger/ietf_hardware.py index 5e7f3281..202cf5f1 100644 --- a/src/statd/python/yanger/ietf_hardware.py +++ b/src/statd/python/yanger/ietf_hardware.py @@ -52,30 +52,63 @@ def vpd_components(systemjson): def usb_port_components(systemjson): usb_ports = systemjson.get("usb-ports", []) - ports=[] - names=[] + ports = [] for usb_port in usb_ports: - port={} + port = {} if usb_port.get("path"): - if usb_port["name"] in names: - continue + # Path now points to the USB device directory, not the attribute + base_path = usb_port["path"] + authorized_default_path = os.path.join(base_path, "authorized_default") - path = usb_port["path"] - if os.path.basename(path) == "authorized_default": - if HOST.exists(path): - names.append(usb_port["name"]) - data = int(HOST.read(path)) - enabled = "unlocked" if data == 1 else "locked" - port["state"] = {} - port["state"]["admin-state"] = enabled - port["name"] = usb_port["name"] - port["class"] = "infix-hardware:usb" - port["state"]["oper-state"] = "enabled" - ports.append(port) + if HOST.exists(authorized_default_path): + data = int(HOST.read(authorized_default_path)) + enabled = "unlocked" if data == 1 else "locked" + port["state"] = {} + port["state"]["admin-state"] = enabled + port["name"] = usb_port["name"] + port["class"] = "infix-hardware:usb" + port["state"]["oper-state"] = "enabled" + ports.append(port) return ports +def motherboard_component(systemjson): + """ + Create a mainboard/chassis component from system.json data. + This provides a standard ietf-hardware representation of the main board. + """ + component = { + "name": "mainboard", + "class": "iana-hardware:chassis", + } + + # Add manufacturer if available (from VPD or defaults) + if systemjson.get("vendor"): + component["mfg-name"] = systemjson["vendor"] + + # Add model name (from device tree or VPD) + if systemjson.get("product-name"): + component["model-name"] = systemjson["product-name"] + + # Add serial number if available (from VPD) + if systemjson.get("serial-number"): + component["serial-num"] = systemjson["serial-number"] + + # Add part number as hardware revision if available + if systemjson.get("part-number"): + component["hardware-rev"] = systemjson["part-number"] + + # Set state - admin-state is "unknown" since chassis cannot be + # administratively controlled (locked/unlocked) + component["state"] = { + "admin-state": "unknown", + "oper-state": "enabled" + } + + return [component] + + def thermal_sensor_components(): """ Discover thermal zones and create sensor components. @@ -139,6 +172,7 @@ def operational(): return { "ietf-hardware:hardware": { "component": + motherboard_component(systemjson) + vpd_components(systemjson) + usb_port_components(systemjson) + thermal_sensor_components() + From d1fda087ece4dede57427c08a109876d51162b78 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 17:31:15 +0100 Subject: [PATCH 15/27] statd: refactor, use parent node for sensor relationships MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For more advanced hardware with multiple sensor types per device (e.g., SFP modules with temperature, voltage, current, and power sensors), use the YANG parent/child relationship to group related sensors together for better presentation. Changes: - Remove parent/parent-rel-pos deviations from infix-hardware.yang - Create parent components (class: module) for multi-sensor devices - Add parent references to child sensor components - Add human-readable descriptions from hwmon labels - Extend hwmon discovery to support voltage, current, and power - Normalize sensor names: strip vendor prefixes (mt7915_phy0 -> phy0) - Remove redundant TYPE column, clarify units (V -> VDC, add spaces) - Simplify child sensor display by stripping parent prefix - Fix "show system" to only show CPU temperature and fan speed Example output from "show hardware": NAME VALUE STATUS =================================================== sfp1: Rx Power 0.000 W ok Tx Power 0.001 W ok Vcc 3.35 VDC ok Bias 0.006 A ok Temperature 30.3 °C ok sfp2: Rx Power 0.000 W ok Tx Power 0.001 W ok Vcc 3.34 VDC ok Bias 0.006 A ok Temperature 32.0 °C ok cpu 42.8 °C ok phy0 47.0 °C ok phy1 53.0 °C ok Signed-off-by: Joachim Wiberg --- src/confd/yang/confd/infix-hardware.yang | 10 +- src/show/show.py | 30 ++- src/statd/python/cli_pretty/cli_pretty.py | 150 +++++++++-- src/statd/python/yanger/ietf_hardware.py | 299 +++++++++++++++++++++- 4 files changed, 444 insertions(+), 45 deletions(-) diff --git a/src/confd/yang/confd/infix-hardware.yang b/src/confd/yang/confd/infix-hardware.yang index 87f683d4..535b1b3d 100644 --- a/src/confd/yang/confd/infix-hardware.yang +++ b/src/confd/yang/confd/infix-hardware.yang @@ -46,6 +46,10 @@ module infix-hardware { base iahw:hardware-class; description "This identity is used to a VPD memory on the device."; } + identity wifi { + base iahw:hardware-class; + description "This identity is used to describe a WiFi radio/PHY"; + } deviation "/iehw:hardware/iehw:component/iehw:state/iehw:admin-state" { deviate add { @@ -58,12 +62,6 @@ module infix-hardware { deviation "/iehw:hardware/iehw:component/iehw:state/iehw:standby-state" { deviate not-supported; } - deviation "/iehw:hardware/iehw:component/iehw:parent" { - deviate not-supported; - } - deviation "/iehw:hardware/iehw:component/iehw:parent-rel-pos" { - deviate not-supported; - } deviation "/iehw:hardware/iehw:component/iehw:alias" { deviate not-supported; } diff --git a/src/show/show.py b/src/show/show.py index 1ce61e86..68b16c61 100755 --- a/src/show/show.py +++ b/src/show/show.py @@ -203,24 +203,32 @@ def system(args: List[str]) -> None: # Augment with runtime data runtime = {} - # Extract thermal sensors from hardware components - thermal_zones = [] + # Extract CPU temperature and fan speed from hardware components + cpu_temp = None + fan_rpm = None if hardware_data and "ietf-hardware:hardware" in hardware_data: components = hardware_data.get("ietf-hardware:hardware", {}).get("component", []) for component in components: sensor_data = component.get("sensor-data", {}) - if sensor_data and sensor_data.get("value-type") == "celsius": - # Convert from millidegrees to degrees + if not sensor_data: + continue + + name = component.get("name", "") + value_type = sensor_data.get("value-type") + + # Only capture CPU temperature (ignore phy, sfp, etc.) + if value_type == "celsius" and name == "cpu" and cpu_temp is None: temp_millidegrees = sensor_data.get("value", 0) - temp_celsius = temp_millidegrees / 1000.0 + cpu_temp = temp_millidegrees / 1000.0 - thermal_zones.append({ - "type": component.get("name", "unknown"), - "temp": temp_celsius - }) + # Capture fan speed if available + elif value_type == "rpm" and fan_rpm is None: + fan_rpm = sensor_data.get("value", 0) - if thermal_zones: - runtime["thermal"] = thermal_zones + if cpu_temp is not None: + runtime["cpu_temp"] = cpu_temp + if fan_rpm is not None: + runtime["fan_rpm"] = fan_rpm # Extract resource usage from system-state system_state = data.get("ietf-system:system-state", {}) diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index 7ba241d1..9ffee87f 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -171,15 +171,14 @@ class PadUsbPort: class PadSensor: - name = 20 - type = 15 - value = 15 + name = 30 + value = 20 status = 10 @classmethod def table_width(cls): - """Total width of sensor table""" - return cls.name + cls.type + cls.value + cls.status + """Total width of sensor table (matches show system width)""" + return cls.name + cls.value + cls.status class PadNtpSource: @@ -598,6 +597,8 @@ class Sensor: def __init__(self, data): self.data = data self.name = data.get('name', 'unknown') + self.description = data.get('description') # Human-readable description + self.parent = data.get('parent') # Parent component name sensor_data = data.get('sensor-data', {}) self.value_type = sensor_data.get('value-type', 'unknown') self.value = sensor_data.get('value', 0) @@ -606,26 +607,77 @@ class Sensor: def get_formatted_value(self): """Convert sensor value based on scale and type""" + # Handle temperature sensors if self.value_type == 'celsius': if self.value_scale == 'milli': temp_celsius = self.value / 1000.0 - # Color code like in show system + # Color code based on temperature thresholds if temp_celsius < 60: - return Decore.green(f"{temp_celsius:.1f}°C") + return Decore.green(f"{temp_celsius:.1f} °C") elif temp_celsius < 75: - return Decore.yellow(f"{temp_celsius:.1f}°C") + return Decore.yellow(f"{temp_celsius:.1f} °C") else: - return Decore.red(f"{temp_celsius:.1f}°C") + return Decore.red(f"{temp_celsius:.1f} °C") else: - return f"{self.value}°C" + return f"{self.value} °C" + + # Handle fan speed sensors + elif self.value_type == 'rpm': + return f"{self.value} RPM" + + # Handle voltage sensors + elif self.value_type == 'volts-DC': + if self.value_scale == 'milli': + volts = self.value / 1000.0 + return f"{volts:.2f} VDC" + else: + return f"{self.value} VDC" + + # Handle current sensors + elif self.value_type == 'amperes': + if self.value_scale == 'milli': + amps = self.value / 1000.0 + return f"{amps:.3f} A" + else: + return f"{self.value} A" + + # Handle power sensors + elif self.value_type == 'watts': + if self.value_scale == 'micro': + watts = self.value / 1000000.0 + return f"{watts:.3f} W" + elif self.value_scale == 'milli': + watts = self.value / 1000.0 + return f"{watts:.2f} W" + else: + return f"{self.value} W" + + # For unknown sensor types, show raw value else: - # For other sensor types, just show raw value return f"{self.value} {self.value_type}" - def print(self): + def print(self, indent=0): import re - row = f"{self.name:<{PadSensor.name}}" - row += f"{self.value_type:<{PadSensor.type}}" + # Add indentation for child sensors + indent_str = " " * indent + + # Determine display name: prefer description, fallback to name + if self.description: + # Use description if available (e.g., "WiFi Radio wlan0 (2.4 GHz)") + display_name = self.description + elif indent > 0 and self.parent: + # Child sensor: strip parent prefix from name + # "sfp1-RX_power" -> "RX_power" -> "Rx Power" + display_name = self.name + if display_name.startswith(self.parent + "-"): + display_name = display_name[len(self.parent) + 1:] + # Format: "RX_power" -> "Rx Power" + display_name = display_name.replace('_', ' ').replace('-', ' ').title() + else: + # Standalone sensor without description: use name as-is + display_name = self.name + + row = f"{indent_str}{display_name:<{PadSensor.name - len(indent_str)}}" # For colored value, pad manually to account for ANSI codes value_str = self.get_formatted_value() # Count visible characters (strip ANSI codes for length calculation) @@ -1669,15 +1721,46 @@ def show_hardware(json): if sensors: Decore.title("Sensors", width) + + # Print header hdr = (f"{'NAME':<{PadSensor.name}}" - f"{'TYPE':<{PadSensor.type}}" f"{'VALUE':<{PadSensor.value}}" f"{'STATUS':<{PadSensor.status}}") print(Decore.invert(hdr)) + # Build parent-child map + children = {} # parent_name -> [child_components] + standalone = [] # components without parents + for component in sensors: - sensor = Sensor(component) - sensor.print() + parent = component.get("parent") + if parent: + if parent not in children: + children[parent] = [] + children[parent].append(component) + else: + standalone.append(component) + + # Get all parent modules (non-sensor components) + modules = [c for c in components if c.get("class") == "iana-hardware:module"] + + # Display modules with their child sensors (indented) + for module in sorted(modules, key=lambda m: m.get("name", "")): + module_name = module.get("name", "unknown") + print(f"\n{module_name}:") + + if module_name in children: + for child in sorted(children[module_name], key=lambda c: c.get("name", "")): + sensor = Sensor(child) + sensor.print(indent=1) + + # Display standalone sensors (no parent) + if standalone: + if modules: + print() # Add blank line between modules and standalone + for component in sorted(standalone, key=lambda c: c.get("name", "")): + sensor = Sensor(component) + sensor.print() def show_ntp(json): @@ -1777,20 +1860,33 @@ def show_system(json): percent = int((used / total * 100)) if total > 0 else 0 print(f"{'Memory':<20}: {used} / {total} MB ({percent}% used)") - thermal = runtime.get("thermal", []) - if thermal: - for zone in thermal: - zone_type = zone.get("type", "Unknown").replace("-thermal", "") - temp = zone.get("temp", 0) - # Color code temperature: green < 60, yellow 60-75, red > 75 - temp_str = f"{temp:.1f}°C" - if temp < 60: + # Show CPU temperature and fan speed on one line + cpu_temp = runtime.get("cpu_temp") + fan_rpm = runtime.get("fan_rpm") + + if cpu_temp is not None or fan_rpm is not None: + status_line = "" + + # Add CPU temperature with color coding + if cpu_temp is not None: + temp_str = f"{cpu_temp:.1f} °C" + if cpu_temp < 60: temp_colored = Decore.green(temp_str) - elif temp < 75: + elif cpu_temp < 75: temp_colored = Decore.yellow(temp_str) else: temp_colored = Decore.red(temp_str) - print(f"{'Temperature':<20}: {temp_colored} ({zone_type})") + status_line = f"CPU: {temp_colored}" + + # Add fan speed if available + if fan_rpm is not None: + if status_line: + status_line += f", Fan: {fan_rpm} RPM" + else: + status_line = f"Fan: {fan_rpm} RPM" + + if status_line: + print(f"{'Hardware':<20}: {status_line}") disk = runtime.get("disk", []) # Filter out root partition (/) - it's read-only and shows confusing 100% usage diff --git a/src/statd/python/yanger/ietf_hardware.py b/src/statd/python/yanger/ietf_hardware.py index 202cf5f1..1cbf15a9 100644 --- a/src/statd/python/yanger/ietf_hardware.py +++ b/src/statd/python/yanger/ietf_hardware.py @@ -109,6 +109,302 @@ def motherboard_component(systemjson): return [component] +def normalize_sensor_name(name): + """ + Normalize sensor names for cleaner display. + + Examples: + sfp_2 -> sfp2 + mt7915_phy0 -> phy0 + marvell_alaska_tomte_phy7 -> phy7 + cpu_thermal -> cpu + pwmfan -> pwmfan + + Strategy: + 1. Strip common suffixes like -thermal/_thermal + 2. Extract well-known sensor type names (phy, sfp, fan, etc.) from + the end of the name, stripping any vendor/chipset prefix + 3. Remove underscores before trailing numbers (sfp_2 -> sfp2) + """ + import re + + # Strip common suffixes + name = name.replace("-thermal", "").replace("_thermal", "") + + # Extract well-known sensor types from end of name, stripping any prefix + # This handles: mt7915_phy0 -> phy0, marvell_alaska_phy7 -> phy7, etc. + sensor_types = r'(phy|sfp|fan|temp|sensor|psu|cpu|gpu|memory|disk)' + match = re.search(rf'.*_({sensor_types}\d*)$', name) + if match: + name = match.group(1) + + # Remove underscores before trailing numbers (sfp_2 -> sfp2) + name = re.sub(r'_(\d+)$', r'\1', name) + + return name + + +def get_wifi_phy_info(): + """ + Discover WiFi PHYs and map them to bands and interface names. + Returns dict: {phy_name: {band: str, iface: str, description: str}} + + Example: {"phy0": {"band": "2.4 GHz", "iface": "wlan0", "description": "WiFi Radio (2.4 GHz)"}} + """ + phy_info = {} + + try: + # Enumerate PHYs from /sys/class/ieee80211/ + ieee80211_path = "/sys/class/ieee80211" + if not os.path.exists(ieee80211_path): + return phy_info + + for phy in os.listdir(ieee80211_path): + if not phy.startswith("phy"): + continue + + phy_path = os.path.join(ieee80211_path, phy) + info = {"band": "Unknown", "iface": None, "description": None} + + # Try to determine band from device path or hwmon name + # The hwmon device usually tells us: mt7915_phy0, mt7915_phy1, etc. + # We'll check supported frequencies to determine band + try: + # Read supported bands - check if device supports 5 GHz + # Most dual-band chips expose phy0 as 2.4 GHz and phy1 as 5 GHz + device_path = os.path.join(phy_path, "device") + if os.path.exists(device_path): + # Simple heuristic: phy0 is usually 2.4 GHz, phy1 is 5 GHz + # This works for most MediaTek chips (mt7915, mt7921, etc.) + if phy == "phy0": + info["band"] = "2.4 GHz" + elif phy == "phy1": + info["band"] = "5 GHz" + elif phy == "phy2": + info["band"] = "6 GHz" # WiFi 6E + except: + pass + + # Find associated interface by checking which interface has a phy80211 link to this PHY + try: + net_path = "/sys/class/net" + if os.path.exists(net_path): + for iface in os.listdir(net_path): + phy_link = os.path.join(net_path, iface, "phy80211") + if os.path.islink(phy_link): + # Read the link target and extract PHY name + try: + link_target = os.readlink(phy_link) + linked_phy = os.path.basename(link_target) + if linked_phy == phy: + info["iface"] = iface + break + except: + continue + except: + pass + + # Build description + if info["iface"] and info["band"] != "Unknown": + info["description"] = f"WiFi Radio {info['iface']} ({info['band']})" + elif info["band"] != "Unknown": + info["description"] = f"WiFi Radio ({info['band']})" + elif info["iface"]: + info["description"] = f"WiFi Radio {info['iface']}" + else: + info["description"] = "WiFi Radio" + + phy_info[phy] = info + + except Exception: + pass + + return phy_info + + +def hwmon_sensor_components(): + """ + Discover hwmon sensors and create sensor components with parent/child relationships. + Returns a list of hardware components with sensor-data for temperature, + fan, voltage, current, and power sensors. + + For devices with multiple sensors (like SFP modules), creates: + - A parent component representing the device (class: module/container) + - Child sensor components that reference the parent via "parent" field + + For simple devices with only one sensor, creates standalone sensor components. + """ + components = [] + device_sensors = {} # Track {device_base_name: [list of sensor components]} + + def add_sensor(base_name, sensor_component): + """Helper to track sensors per device""" + if base_name not in device_sensors: + device_sensors[base_name] = [] + device_sensors[base_name].append(sensor_component) + + try: + hwmon_devices = glob.glob("/sys/class/hwmon/hwmon*") + + for hwmon_path in hwmon_devices: + try: + name_path = os.path.join(hwmon_path, "name") + if not HOST.exists(name_path): + continue + + device_name = HOST.read(name_path).strip() + base_name = normalize_sensor_name(device_name) + + # Helper to create sensor component with human-readable description + def create_sensor(sensor_name, value, value_type, value_scale, label=None): + component = { + "name": sensor_name, + "class": "iana-hardware:sensor", + "sensor-data": { + "value": value, + "value-type": value_type, + "value-scale": value_scale, + "value-precision": 0, + "value-timestamp": str(YangDate()), + "oper-status": "ok" + } + } + # Add human-readable description if we have a label + if label: + # Format label nicely: "RX_power" -> "RX Power", "VCC" -> "VCC" + desc = label.replace('_', ' ').title() + component["description"] = desc + return component + + # Temperature sensors + for temp_file in glob.glob(os.path.join(hwmon_path, "temp*_input")): + try: + sensor_num = os.path.basename(temp_file).split('_')[0].replace('temp', '') + value = int(HOST.read(temp_file).strip()) + label_file = os.path.join(hwmon_path, f"temp{sensor_num}_label") + raw_label = None + if HOST.exists(label_file): + raw_label = HOST.read(label_file).strip() + label = normalize_sensor_name(raw_label) + sensor_name = f"{base_name}-{label}" + else: + sensor_name = base_name if sensor_num == '1' else f"{base_name}{sensor_num}" + add_sensor(base_name, create_sensor(sensor_name, value, "celsius", "milli", raw_label)) + except (FileNotFoundError, ValueError, IOError): + continue + + # Fan sensors + for fan_file in glob.glob(os.path.join(hwmon_path, "fan*_input")): + try: + sensor_num = os.path.basename(fan_file).split('_')[0].replace('fan', '') + value = int(HOST.read(fan_file).strip()) + label_file = os.path.join(hwmon_path, f"fan{sensor_num}_label") + raw_label = None + if HOST.exists(label_file): + raw_label = HOST.read(label_file).strip() + label = normalize_sensor_name(raw_label) + sensor_name = f"{base_name}-{label}" + else: + sensor_name = base_name if sensor_num == '1' else f"{base_name}{sensor_num}" + add_sensor(base_name, create_sensor(sensor_name, value, "rpm", "units", raw_label)) + except (FileNotFoundError, ValueError, IOError): + continue + + # Voltage sensors + for voltage_file in glob.glob(os.path.join(hwmon_path, "in*_input")): + try: + sensor_num = os.path.basename(voltage_file).split('_')[0].replace('in', '') + value = int(HOST.read(voltage_file).strip()) + label_file = os.path.join(hwmon_path, f"in{sensor_num}_label") + raw_label = None + if HOST.exists(label_file): + raw_label = HOST.read(label_file).strip() + label = normalize_sensor_name(raw_label) + sensor_name = f"{base_name}-{label}" + else: + raw_label = "voltage" + sensor_name = f"{base_name}-voltage" if sensor_num == '0' else f"{base_name}-voltage{sensor_num}" + add_sensor(base_name, create_sensor(sensor_name, value, "volts-DC", "milli", raw_label)) + except (FileNotFoundError, ValueError, IOError): + continue + + # Current sensors + for current_file in glob.glob(os.path.join(hwmon_path, "curr*_input")): + try: + sensor_num = os.path.basename(current_file).split('_')[0].replace('curr', '') + value = int(HOST.read(current_file).strip()) + label_file = os.path.join(hwmon_path, f"curr{sensor_num}_label") + raw_label = None + if HOST.exists(label_file): + raw_label = HOST.read(label_file).strip() + label = normalize_sensor_name(raw_label) + sensor_name = f"{base_name}-{label}" + else: + raw_label = "current" + sensor_name = f"{base_name}-current" if sensor_num == '1' else f"{base_name}-current{sensor_num}" + add_sensor(base_name, create_sensor(sensor_name, value, "amperes", "milli", raw_label)) + except (FileNotFoundError, ValueError, IOError): + continue + + # Power sensors + for power_file in glob.glob(os.path.join(hwmon_path, "power*_input")): + try: + sensor_num = os.path.basename(power_file).split('_')[0].replace('power', '') + value = int(HOST.read(power_file).strip()) + label_file = os.path.join(hwmon_path, f"power{sensor_num}_label") + raw_label = None + if HOST.exists(label_file): + raw_label = HOST.read(label_file).strip() + label = normalize_sensor_name(raw_label) + sensor_name = f"{base_name}-{label}" + else: + raw_label = "power" + sensor_name = f"{base_name}-power" if sensor_num == '1' else f"{base_name}-power{sensor_num}" + add_sensor(base_name, create_sensor(sensor_name, value, "watts", "micro", raw_label)) + except (FileNotFoundError, ValueError, IOError): + continue + + except (FileNotFoundError, ValueError, IOError): + continue + + except Exception: + pass + + # Now create parent/child relationships + for base_name, sensors in device_sensors.items(): + if len(sensors) > 1: + # Multiple sensors: create parent component + parent = { + "name": base_name, + "class": "iana-hardware:module", # Use "module" for multi-sensor devices like SFP + } + components.append(parent) + + # Add parent reference to all child sensors + for sensor in sensors: + sensor["parent"] = base_name + components.append(sensor) + else: + # Single sensor: add without parent + components.extend(sensors) + + # Enrich WiFi PHY sensors with descriptive information + wifi_info = get_wifi_phy_info() + for component in components: + name = component.get("name", "") + # Match phy0, phy1, etc. sensors + if name.startswith("phy") and name in wifi_info: + phy = wifi_info[name] + # Add WiFi-specific description + component["description"] = phy["description"] + # Optionally change class to wifi for WiFi PHY sensors + if component.get("class") == "iana-hardware:sensor": + # Keep as sensor but we could create a parent WiFi component later if needed + pass + + return components + + def thermal_sensor_components(): """ Discover thermal zones and create sensor components. @@ -138,7 +434,7 @@ def thermal_sensor_components(): # Create component with sensor-data # Component name: strip "-thermal" suffix for cleaner display - component_name = zone_type.replace("-thermal", "") + component_name = normalize_sensor_name(zone_type) component = { "name": component_name, @@ -175,6 +471,7 @@ def operational(): motherboard_component(systemjson) + vpd_components(systemjson) + usb_port_components(systemjson) + + hwmon_sensor_components() + thermal_sensor_components() + [], }, From 921c4c809d0062186a3d06f4c5b84c63f9f99214 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 21:54:51 +0100 Subject: [PATCH 16/27] test: update mock data for 'show hardware' Signed-off-by: Joachim Wiberg --- test/case/statd/system/cli/show-hardware | 15 ++++++++++----- test/case/statd/system/ietf-hardware.json | 10 ++++++++++ test/case/statd/system/operational.json | 12 +++++++++++- .../statd/system/system/rootfs/run/system.json | 2 +- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/test/case/statd/system/cli/show-hardware b/test/case/statd/system/cli/show-hardware index 10645d55..841e9ef4 100644 --- a/test/case/statd/system/cli/show-hardware +++ b/test/case/statd/system/cli/show-hardware @@ -1,5 +1,10 @@ -────────────────────────────── -USB PORTS -NAME STATE  -USB locked -USB2 locked +HARDWARE COMPONENTS  +──────────────────────────────────────────────────────────── +Board Information +Model : VM +Manufacturer : QEMU +──────────────────────────────────────────────────────────── +USB Ports +NAME STATE OPER  +USB locked enabled +USB2 locked enabled diff --git a/test/case/statd/system/ietf-hardware.json b/test/case/statd/system/ietf-hardware.json index cea9cbe9..4ced153b 100644 --- a/test/case/statd/system/ietf-hardware.json +++ b/test/case/statd/system/ietf-hardware.json @@ -1,6 +1,16 @@ { "ietf-hardware:hardware": { "component": [ + { + "name": "mainboard", + "class": "iana-hardware:chassis", + "mfg-name": "QEMU", + "model-name": "VM", + "state": { + "admin-state": "unknown", + "oper-state": "enabled" + } + }, { "name": "product", "infix-hardware:vpd-data": {} diff --git a/test/case/statd/system/operational.json b/test/case/statd/system/operational.json index b07d9bbf..e2621efc 100644 --- a/test/case/statd/system/operational.json +++ b/test/case/statd/system/operational.json @@ -1,6 +1,16 @@ { "ietf-hardware:hardware": { "component": [ + { + "name": "mainboard", + "class": "iana-hardware:chassis", + "mfg-name": "QEMU", + "model-name": "VM", + "state": { + "admin-state": "unknown", + "oper-state": "enabled" + } + }, { "infix-hardware:vpd-data": {}, "name": "product" @@ -296,4 +306,4 @@ "os-version": "v25.04.0-rc1-3-g8daf1571-dirty" } } -} +} \ No newline at end of file diff --git a/test/case/statd/system/system/rootfs/run/system.json b/test/case/statd/system/system/rootfs/run/system.json index 9bd199c1..8957fcdb 100644 --- a/test/case/statd/system/system/rootfs/run/system.json +++ b/test/case/statd/system/system/rootfs/run/system.json @@ -1 +1 @@ -{"vendor": "QEMU", "product-name": "VM", "part-number": null, "serial-number": null, "mac-address": "00:a0:85:00:03:00", "factory-password-hash": "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A", "vpd": {"product": {"board": "product", "available": false, "trusted": true, "data": {}}}, "usb-ports": [{"name": "USB", "path": "/sys/bus/usb/devices/usb1/authorized"}, {"name": "USB", "path": "/sys/bus/usb/devices/usb1/authorized_default"}, {"name": "USB2", "path": "/sys/bus/usb/devices/usb2/authorized"}, {"name": "USB2", "path": "/sys/bus/usb/devices/usb2/authorized_default"}]} \ No newline at end of file +{"vendor": "QEMU", "product-name": "VM", "part-number": null, "serial-number": null, "mac-address": "00:a0:85:00:03:00", "factory-password-hash": "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A", "vpd": {"product": {"board": "product", "available": false, "trusted": true, "data": {}}}, "usb-ports": [{"name": "USB", "path": "/sys/bus/usb/devices/usb1"}, {"name": "USB2", "path": "/sys/bus/usb/devices/usb2"}]} From 20d09febebb7fe0a84b77e39e44b6f2b7de8545f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 31 Oct 2025 13:24:40 +0100 Subject: [PATCH 17/27] test: fix container-upgrade $ARCH mapping on Aarch64 systems Signed-off-by: Joachim Wiberg --- test/case/infix_containers/upgrade/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/case/infix_containers/upgrade/test.py b/test/case/infix_containers/upgrade/test.py index 7193c87e..2e37f697 100755 --- a/test/case/infix_containers/upgrade/test.py +++ b/test/case/infix_containers/upgrade/test.py @@ -40,9 +40,11 @@ with infamy.Test() as test: # Map kernel arch to our image naming arch_map = { + "amd64": "amd64", "x86_64": "amd64", + "arm64": "arm64", "aarch64": "arm64", - "armv7l": "arm64", # Fallback for ARM variants + "armv7l": "arm64", } image_arch = arch_map.get(arch, "amd64") print(f"Detected architecture: {arch} -> using {image_arch} images") From 8af593707acb693aafd1c99c43c67a4060b01983 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 20 Oct 2025 17:38:25 +0200 Subject: [PATCH 18/27] Rename raspberry-pi-4 -> raspberry-pi64 With the additional support for RPi3, including Zero 2W, this commit renames all relevant directories and Config.In options to match. Signed-off-by: Joachim Wiberg --- .github/workflows/build-image.yml | 6 +- board/aarch64/README.md | 2 +- board/aarch64/raspberry-pi-4/README.md | 46 --------------- board/aarch64/raspberry-pi64/README.md | 59 +++++++++++++++++++ configs/aarch64_defconfig | 2 +- configs/rpi4_boot_defconfig | 9 ++- package/board/Config.in | 2 +- package/board/raspberry-pi-4/Config.in | 10 ---- package/board/raspberry-pi64/Config.in | 13 ++++ .../raspberry-pi64.mk} | 0 .../LICENSE | 0 .../cmdline.txt | 0 .../config.txt | 0 .../dts/Makefile | 0 .../dts/broadcom/bcm2711-rpi-4-b-dsi.dts | 0 .../dts/broadcom/bcm2711-rpi-4-b.dts | 0 .../dts/broadcom/bcm2711-rpi-400.dts | 0 .../dts/broadcom/bcm2711-rpi-cm4-io.dts | 0 .../dts/broadcom/bcm2711-rpi-cm4.dts | 0 .../dts/broadcom/bcm2837-rpi-3-b.dts | 0 .../dts/broadcom/bcm2837-rpi-zero-2-w.dts | 0 .../dts/broadcom/infix.dtsi | 0 .../genimage.cfg.in | 0 .../mkimage.sh | 2 +- .../post-build.sh | 0 .../usr/share/product/raspberrypi,3-model-b | 0 .../etc/product/interface-quirks.json | 0 .../interface-quirks.json | 0 .../etc/factory-config.cfg | 0 .../etc/product/interface-quirks.json | 0 .../usr/libexec/confd/product/gen-interfaces | 0 .../uboot/extras.config | 0 .../uboot/rpi-env.dtso | 0 33 files changed, 83 insertions(+), 68 deletions(-) delete mode 100644 board/aarch64/raspberry-pi-4/README.md create mode 100644 board/aarch64/raspberry-pi64/README.md delete mode 100644 package/board/raspberry-pi-4/Config.in create mode 100644 package/board/raspberry-pi64/Config.in rename package/board/{raspberry-pi-4/raspberry-pi-4.mk => raspberry-pi64/raspberry-pi64.mk} (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/LICENSE (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/cmdline.txt (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/config.txt (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/Makefile (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2711-rpi-4-b-dsi.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2711-rpi-4-b.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2711-rpi-400.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2711-rpi-cm4-io.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2711-rpi-cm4.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2837-rpi-3-b.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/bcm2837-rpi-zero-2-w.dts (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/dts/broadcom/infix.dtsi (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/genimage.cfg.in (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/mkimage.sh (99%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/post-build.sh (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,3-model-b (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/uboot/extras.config (100%) rename src/board/{raspberry-pi-4 => raspberry-pi64}/uboot/rpi-env.dtso (100%) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 31ed52dd..25120562 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -8,9 +8,9 @@ on: type: choice required: true options: - - raspberry-pi-4 + - raspberry-pi64 - banana-pi-r3 - default: 'raspberry-pi-4' + default: 'raspberry-pi64' use_latest_release: description: 'Use latest release artifacts instead of workflow artifacts' type: boolean @@ -52,7 +52,7 @@ jobs: - name: Set bootloader and target based on board run: | case "${{ inputs.board }}" in - raspberry-pi-4) + raspberry-pi64) echo "BOOTLOADER=rpi4_boot" >> $GITHUB_ENV echo "TARGET=aarch64" >> $GITHUB_ENV ;; diff --git a/board/aarch64/README.md b/board/aarch64/README.md index 8d3e1089..9f2e217a 100644 --- a/board/aarch64/README.md +++ b/board/aarch64/README.md @@ -8,4 +8,4 @@ Board Specific Documentation - [Marvell CN9130-CRB](cn9130-crb/) - [Microchip SparX-5i PCB135 (eMMC)](sparx5-pcb135/) - [NanoPi R2S](r2s/) -- [Raspberry Pi 4 b](raspberry-pi-4/) +- [Raspberry Pi 64-bit](raspberry-pi64/) diff --git a/board/aarch64/raspberry-pi-4/README.md b/board/aarch64/raspberry-pi-4/README.md deleted file mode 100644 index e0fb9d26..00000000 --- a/board/aarch64/raspberry-pi-4/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# Raspberry Pi 4 b - -## Support level -Full support for base board but not any extension board on the -GPIOs. - -### Touch screen -The [Raspberry Pi touch display v1][RPI-TOUCH] is supported, including -touch functionality. There are multiple touchscreens on the market for -Raspberry Pi, but only the official (first version with 800x480 -resolution) is currently supported. Infix supplies all drivers -required to utilize the hardware, but you need to add the actual -graphical application in a container. - -There are some important considerations you need to know about when -using Infix for graphical applications. The container needs access to -/dev/dri/ to be able to access the graphics card, and it also needs -access to /run/udev to be able to find the input devices. - -Example of running Doom in Infix: - -```cli - admin@example:/> configure - admin@example:/config/> edit container doom - admin@example:/config/container/doom/> set image docker://mattiaswal/alpine-doom:latest - admin@example:/config/container/doom/> set privileged - admin@example:/config/container/doom/> edit mount udev - admin@example:/config/container/doom/mount/udev/> set type bind - admin@example:/config/container/doom/mount/udev/> set target /run/udev/ - admin@example:/config/container/doom/mount/udev/> set source /run/udev/ - admin@example:/config/container/doom/mount/udev/> end - admin@example:/config/container/doom/mount/xorg.conf/> set content U2VjdGlvbiAiT3V0cHV0Q2xhc3MiCiAgSWRlbnRpZmllciAidmM0IgogIE1hdGNoRHJpdmVyICJ2YzQiCiAgRHJpdmVyICJtb2Rlc2V0dGluZyIKICBPcHRpb24gIlByaW1hcnlHUFUiICJ0cnVlIgpFbmRTZWN0aW9uCg== - admin@example:/config/container/doom/mount/xorg.conf/> set target /etc/X11/xorg.conf - admin@example:/config/container/doom/mount/xorg.conf/> end - admin@example:/config/container/doom/> edit volume var - admin@example:/config/container/doom/volume/var/> set target /var - admin@example:/config/container/doom/volume/var/> leave - admin@example:/> - -``` - -### Pre-built images -SD card image: [infix-rpi4-sdcard.img](https://github.com/kernelkit/infix/releases/download/latest-boot/infix-rpi4-sdcard.img) - - -[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/ diff --git a/board/aarch64/raspberry-pi64/README.md b/board/aarch64/raspberry-pi64/README.md new file mode 100644 index 00000000..24d86025 --- /dev/null +++ b/board/aarch64/raspberry-pi64/README.md @@ -0,0 +1,59 @@ +# Raspberry Pi 3B/4B + +## Support level + +Full support for base board but not any extension board on the GPIOs. +Other RPi boards of the same generation may work as well, but may need +some additional testing/work. A few CM4 variants have been tested and +seem to work as expected, but YMMV as always. + +### Touch screen + +The [Raspberry Pi touch display v1][0] is supported on the 4B, including +touch functionality. There are multiple touchscreens on the market for +Raspberry Pi, but currently only the official first version with 800x480 +resolution is supported. Infix supplies all drivers required to utilize +the hardware, but you need to add the actual graphical application in a +container. + +There are some important considerations you need to know about when +using Infix for graphical applications. The container needs access to +`/dev/dri/` to be able to access the graphics card, it also need access +to `/run/udev` to be able to find the input devices. + +Example of running Doom in Infix: + +``` +admin@example:/> configure +admin@example:/config/> edit container doom +admin@example:/config/container/doom/> set image docker://mattiaswal/alpine-doom:latest +admin@example:/config/container/doom/> set privileged +admin@example:/config/container/doom/> edit mount udev +admin@example:/config/container/doom/mount/udev/> set type bind +admin@example:/config/container/doom/mount/udev/> set target /run/udev/ +admin@example:/config/container/doom/mount/udev/> set source /run/udev/ +admin@example:/config/container/doom/mount/udev/> end +admin@example:/config/container/doom/mount/xorg.conf/> set content U2VjdGlvbiAiT3V0cHV0Q2xhc3MiCiAgSWRlbnRpZmllciAidmM0IgogIE1hdGNoRHJpdmVyICJ2YzQiCiAgRHJpdmVyICJtb2Rlc2V0dGluZyIKICBPcHRpb24gIlByaW1hcnlHUFUiICJ0cnVlIgpFbmRTZWN0aW9uCg== +admin@example:/config/container/doom/mount/xorg.conf/> set target /etc/X11/xorg.conf +admin@example:/config/container/doom/mount/xorg.conf/> end +admin@example:/config/container/doom/> edit volume var +admin@example:/config/container/doom/volume/var/> set target /var +admin@example:/config/container/doom/volume/var/> leave +admin@example:/> +``` + +> [!NOTE] +> The `xorg.conf` [content mount][2] is a nifty detail of Infix that +> allows you to keep all the relevant configuration in a single file. +> The deta is "simply" `base64` encoded, so you do not really need the +> features of the Infix CLI, everything can be set up remotely [using +> `curl`][3] if you like. + +### Pre-built images + +Pre-built SD card images are available here: [infix-rpi4-sdcard.img][sdcard] + +[0]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/ +[1]: https://github.com/kernelkit/infix/releases/download/latest-boot/infix-rpi4-sdcard.img +[2]: https://kernelkit.org/infix/latest/container/#content-mounts +[3]: https://kernelkit.org/infix/latest/scripting-restconf/ diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index 69392880..22024f10 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -142,7 +142,7 @@ BR2_PACKAGE_ALDER_ALDER=y BR2_PACKAGE_MARVELL_CN9130_CRB=y BR2_PACKAGE_MARVELL_ESPRESSOBIN=y BR2_PACKAGE_STYX_DCP_SC_28P=y -BR2_PACKAGE_RASPBERRY_PI_4=y +BR2_PACKAGE_RASPBERRY_PI64=y BR2_PACKAGE_BANANA_PI_R3=y BR2_PACKAGE_FEATURE_WIFI_DONGLE_REALTEK=y BR2_PACKAGE_CONFD=y diff --git a/configs/rpi4_boot_defconfig b/configs/rpi4_boot_defconfig index 140dcdc4..8bcefb01 100644 --- a/configs/rpi4_boot_defconfig +++ b/configs/rpi4_boot_defconfig @@ -1,5 +1,4 @@ BR2_aarch64=y -BR2_cortex_a72=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_DL_DIR="$(BR2_EXTERNAL_INFIX_PATH)/dl" @@ -19,8 +18,8 @@ BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI=y BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI_X=y BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4=y BR2_PACKAGE_RPI_FIRMWARE_VARIANT_PI4_X=y -BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi-4/config.txt" -BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi-4/cmdline.txt" +BR2_PACKAGE_RPI_FIRMWARE_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi64/config.txt" +BR2_PACKAGE_RPI_FIRMWARE_CMDLINE_FILE="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi64/cmdline.txt" # BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set # BR2_TARGET_ROOTFS_TAR is not set BR2_TARGET_UBOOT=y @@ -28,12 +27,12 @@ BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2025.01" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="rpi_arm64" -BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi-4/uboot/extras.config" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi64/uboot/extras.config" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_FORMAT_DTB=y BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="arch/arm/dts/infix-key.dtbo arch/arm/dts/rpi-env.dtbo" -BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi-4/uboot/rpi-env.dtso" +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi64/uboot/rpi-env.dtso" BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/package/board/Config.in b/package/board/Config.in index 40e7c5e1..f9a16c68 100644 --- a/package/board/Config.in +++ b/package/board/Config.in @@ -6,7 +6,7 @@ source "$BR2_EXTERNAL_INFIX_PATH/package/board/marvell-cn9130-crb/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/marvell-espressobin/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/microchip-sparx5-pcb135/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/styx-dcp-sc-28p/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/raspberry-pi-4/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/package/board/raspberry-pi64/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/board/banana-pi-r3/Config.in" diff --git a/package/board/raspberry-pi-4/Config.in b/package/board/raspberry-pi-4/Config.in deleted file mode 100644 index 31a01632..00000000 --- a/package/board/raspberry-pi-4/Config.in +++ /dev/null @@ -1,10 +0,0 @@ -config BR2_PACKAGE_RASPBERRY_PI_4 - bool "Raspberry Pi 4" - depends on BR2_aarch64 - select SDCARD_AUX - select BR2_PACKAGE_FEATURE_WIFI - select BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI - select BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_WIFI - - help - Raspberry Pi 4 diff --git a/package/board/raspberry-pi64/Config.in b/package/board/raspberry-pi64/Config.in new file mode 100644 index 00000000..3fe7d1d2 --- /dev/null +++ b/package/board/raspberry-pi64/Config.in @@ -0,0 +1,13 @@ +config BR2_PACKAGE_RASPBERRY_PI64 + bool "Raspberry Pi 64-bit (RPi3 and later)" + depends on BR2_aarch64 + select SDCARD_AUX + select BR2_PACKAGE_FEATURE_WIFI + select BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI + select BR2_PACKAGE_BRCMFMAC_SDIO_FIRMWARE_RPI_WIFI + + help + Raspberry Pi 64-bit adds support for the Raspberry Pi family of + of single-board computers (SBC), RPi 3B and later, including the + Raspberry Pi 2W, which shares the same CPU core as RPi 3B. + diff --git a/package/board/raspberry-pi-4/raspberry-pi-4.mk b/package/board/raspberry-pi64/raspberry-pi64.mk similarity index 100% rename from package/board/raspberry-pi-4/raspberry-pi-4.mk rename to package/board/raspberry-pi64/raspberry-pi64.mk diff --git a/src/board/raspberry-pi-4/LICENSE b/src/board/raspberry-pi64/LICENSE similarity index 100% rename from src/board/raspberry-pi-4/LICENSE rename to src/board/raspberry-pi64/LICENSE diff --git a/src/board/raspberry-pi-4/cmdline.txt b/src/board/raspberry-pi64/cmdline.txt similarity index 100% rename from src/board/raspberry-pi-4/cmdline.txt rename to src/board/raspberry-pi64/cmdline.txt diff --git a/src/board/raspberry-pi-4/config.txt b/src/board/raspberry-pi64/config.txt similarity index 100% rename from src/board/raspberry-pi-4/config.txt rename to src/board/raspberry-pi64/config.txt diff --git a/src/board/raspberry-pi-4/dts/Makefile b/src/board/raspberry-pi64/dts/Makefile similarity index 100% rename from src/board/raspberry-pi-4/dts/Makefile rename to src/board/raspberry-pi64/dts/Makefile diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b-dsi.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b-dsi.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-4-b.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-400.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-400.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-400.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4-io.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4-io.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4-io.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2711-rpi-cm4.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-3-b.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-3-b.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-3-b.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts b/src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/bcm2837-rpi-zero-2-w.dts rename to src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts diff --git a/src/board/raspberry-pi-4/dts/broadcom/infix.dtsi b/src/board/raspberry-pi64/dts/broadcom/infix.dtsi similarity index 100% rename from src/board/raspberry-pi-4/dts/broadcom/infix.dtsi rename to src/board/raspberry-pi64/dts/broadcom/infix.dtsi diff --git a/src/board/raspberry-pi-4/genimage.cfg.in b/src/board/raspberry-pi64/genimage.cfg.in similarity index 100% rename from src/board/raspberry-pi-4/genimage.cfg.in rename to src/board/raspberry-pi64/genimage.cfg.in diff --git a/src/board/raspberry-pi-4/mkimage.sh b/src/board/raspberry-pi64/mkimage.sh similarity index 99% rename from src/board/raspberry-pi-4/mkimage.sh rename to src/board/raspberry-pi64/mkimage.sh index b7b4c9d4..fafeb593 100755 --- a/src/board/raspberry-pi-4/mkimage.sh +++ b/src/board/raspberry-pi64/mkimage.sh @@ -72,7 +72,7 @@ done if [ "$STANDALONE" -eq 1 ] || [ $# -gt 0 ]; then STANDALONE=1 - # Find BR2_EXTERNAL_INFIX_PATH (current script is in src/board/raspberry-pi-4/) + # Find BR2_EXTERNAL_INFIX_PATH (current script is in src/board/raspberry-pi64/) SCRIPT_DIR=$(dirname "$0") BR2_EXTERNAL_INFIX_PATH=$(cd "$SCRIPT_DIR/../../.." && pwd) diff --git a/src/board/raspberry-pi-4/post-build.sh b/src/board/raspberry-pi64/post-build.sh similarity index 100% rename from src/board/raspberry-pi-4/post-build.sh rename to src/board/raspberry-pi64/post-build.sh diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,3-model-b similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,3-model-b rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,3-model-b diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json diff --git a/src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces b/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces similarity index 100% rename from src/board/raspberry-pi-4/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces rename to src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces diff --git a/src/board/raspberry-pi-4/uboot/extras.config b/src/board/raspberry-pi64/uboot/extras.config similarity index 100% rename from src/board/raspberry-pi-4/uboot/extras.config rename to src/board/raspberry-pi64/uboot/extras.config diff --git a/src/board/raspberry-pi-4/uboot/rpi-env.dtso b/src/board/raspberry-pi64/uboot/rpi-env.dtso similarity index 100% rename from src/board/raspberry-pi-4/uboot/rpi-env.dtso rename to src/board/raspberry-pi64/uboot/rpi-env.dtso From ab56c1be506e95e9299e93ed73ffdd407c4a6e96 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 24 Oct 2025 07:38:45 +0200 Subject: [PATCH 19/27] Relocate src/board/* and package/board/* to board/ This commit consolidates all BSP support files into the Buildroot standard board/ directory. The concept of selectable boards in menuconfig remains as-is but now lives in board/ instead. Drop support for board-specific post-build.sh scripts, not needed atm. and we should really use Buildroot _POST_INSTALL_HOOKS in the board .mk files instead. Signed-off-by: Joachim Wiberg --- Config.in | 2 + board/Config.in | 7 ++++ board/aarch64/Config.in | 12 ++++++ .../aarch64}/alder-alder/Config.in | 0 .../aarch64}/alder-alder/LICENSE | 0 .../aarch64}/alder-alder/alder-alder.mk | 0 .../aarch64}/alder-alder/dts/Makefile | 0 .../alder-alder/dts/alder/alder-mpp.h | 0 .../aarch64}/alder-alder/dts/alder/alder.dts | 0 .../aarch64}/alder-alder/dts/alder/alder.dtsi | 0 .../dts/marvell/cn9130-patched.dtsi | 0 .../aarch64/bananapi-bpi-r3}/Config.in | 2 +- .../aarch64/bananapi-bpi-r3}/LICENSE | 0 .../README.md | 0 .../bananapi-bpi-r3/bananapi-bpi-r3.mk | 6 +-- .../aarch64/bananapi-bpi-r3}/dts/Makefile | 0 .../mediatek/mt7986a-bananapi-bpi-r3-sd.dts | 0 .../mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi | 0 .../dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi | 0 .../aarch64/bananapi-bpi-r3}/genimage.cfg.in | 0 .../aarch64/bananapi-bpi-r3}/mkimage.sh | 0 .../bananapi,bpi-r3/etc/factory-config.cfg | 0 .../etc/product/init.d/S01-trigger-udev.sh | 0 .../udev/rules.d/90-bpi-r3-rename-eth1.rules | 0 .../bananapi-bpi-r3}/uboot/extras.config | 0 .../bananapi-bpi-r3}/uboot/mt7986-env.dtsi | 0 .../bananapi-bpi-r3}/uboot/mt7986-sd-env.dtsi | 0 .../bananapi-bpi-r3}/uboot/sd-extras.config | 0 .../aarch64}/freescale-imx8mp-evk/Config.in | 0 .../aarch64}/freescale-imx8mp-evk/LICENSE | 0 .../freescale-imx8mp-evk/dts/Makefile | 0 .../dts/freescale/imx8mp-evk.dts | 0 .../freescale-imx8mp-evk.mk | 0 .../etc/product/interface-quirks.json | 0 .../nanopi-r2s}/README.md | 0 .../nanopi-r2s}/genimage.cfg | 0 .../nanopi-r2s}/linux_defconfig | 0 .../nanopi-r2s}/post-build.sh | 0 .../nanopi-r2s}/rk3328-nanopi-r2s-dts.patch | 0 .../nanopi-r2s}/rootfs/etc/factory-config.cfg | 0 .../finit.d/enabled/input-event-daemon.conf | 0 .../rootfs/etc/finit.d/wan-monitor.conf | 0 .../nanopi-r2s}/rootfs/etc/iitod.json | 0 .../rootfs/etc/input-event-daemon.conf | 0 .../etc/udev/rules.d/90-persistent-net.rules | 0 .../rootfs/usr/sbin/wan-monitor.sh | 0 .../nanopi-r2s}/uboot/extras.config | 0 .../nanopi-r2s}/uboot/r2s-env.dtsi | 0 .../aarch64}/marvell-cn9130-crb/Config.in | 0 .../aarch64}/marvell-cn9130-crb/LICENSE | 0 .../README.md | 0 .../aarch64}/marvell-cn9130-crb/dts/Makefile | 0 .../dts/marvell/cn9130-crb-A.dts | 0 .../marvell-cn9130-crb/marvell-cn9130-crb.mk | 0 .../uboot/cn9130-crb-env.dtsi | 0 .../uboot/extras.config | 0 .../aarch64}/marvell-espressobin/Config.in | 0 .../aarch64}/marvell-espressobin/LICENSE | 0 .../aarch64}/marvell-espressobin/dts/Makefile | 0 .../marvell/armada-3720-espressobin-emmc.dts | 0 .../marvell/armada-3720-espressobin-ultra.dts | 0 .../armada-3720-espressobin-v7-emmc.dts | 0 .../marvell/armada-3720-espressobin-v7.dts | 0 .../dts/marvell/armada-3720-espressobin.dts | 0 .../genimage.cfg | 0 .../marvell-espressobin.mk | 0 .../microchip-sparx5-pcb135/Config.in | 0 .../aarch64}/microchip-sparx5-pcb135/LICENSE | 0 .../README.md | 0 .../microchip-sparx5-pcb135/dts/Makefile | 0 .../microchip/sparx5_pcb135_emmc_no_psci.dts | 0 .../microchip-sparx5-pcb135.mk | 0 .../{qemu/uboot => qemu-uboot}/extras.config | 0 .../aarch64/raspberrypi-rpi64}/Config.in | 3 +- .../aarch64/raspberrypi-rpi64}/LICENSE | 0 .../README.md | 0 .../aarch64/raspberrypi-rpi64}/cmdline.txt | 0 .../aarch64/raspberrypi-rpi64}/config.txt | 0 .../aarch64/raspberrypi-rpi64}/dts/Makefile | 0 .../dts/broadcom/bcm2711-rpi-4-b-dsi.dts | 0 .../dts/broadcom/bcm2711-rpi-4-b.dts | 0 .../dts/broadcom/bcm2711-rpi-400.dts | 0 .../dts/broadcom/bcm2711-rpi-cm4-io.dts | 0 .../dts/broadcom/bcm2711-rpi-cm4.dts | 0 .../dts/broadcom/bcm2837-rpi-3-b.dts | 0 .../dts/broadcom/bcm2837-rpi-zero-2-w.dts | 0 .../dts/broadcom/infix.dtsi | 0 .../raspberrypi-rpi64}/genimage.cfg.in | 0 .../aarch64/raspberrypi-rpi64}/mkimage.sh | 0 .../raspberrypi-rpi64/raspberrypi-rpi64.mk | 3 +- .../usr/share/product/raspberrypi,3-model-b | 0 .../etc/product/interface-quirks.json | 0 .../interface-quirks.json | 0 .../etc/factory-config.cfg | 0 .../etc/product/interface-quirks.json | 0 .../usr/libexec/confd/product/gen-interfaces | 0 .../raspberrypi-rpi64}/uboot/extras.config | 0 .../raspberrypi-rpi64}/uboot/rpi-env.dtso | 0 .../aarch64}/styx-dcp-sc-28p/Config.in | 0 .../aarch64}/styx-dcp-sc-28p/LICENSE | 0 .../aarch64}/styx-dcp-sc-28p/dts/Makefile | 0 .../dts/marvell/cn9130-patched.dtsi | 0 .../styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts | 0 .../styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts | 0 .../styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h | 0 .../styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi | 0 .../rootfs/boot/styx/styx-b.dtb | 0 .../styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb | 0 .../rootfs/usr/libexec/styx/led.sh | 0 .../etc/finit.d/available/iitod.conf | 0 .../etc/product/init.d/S10-led | 0 .../styx-dcp-sc-28p/styx-dcp-sc-28p.mk | 0 board/board.mk | 2 + board/common/README.txt | 21 +++++----- board/common/post-build.sh | 40 +++++++------------ {package/board => board}/dtb-inst.makefile | 0 {package/board => board}/ix-board.mk | 6 +-- board/riscv64/Config.in | 5 +++ .../README.md | 0 .../board.mk | 0 .../genimage.cfg | 0 .../jh7110-starfive-visionfive-2-dtsi.patch | 0 .../uboot/extras.config | 0 .../uboot/visionfive2-env.dtsi | 0 board/x86_64/Config.in | 5 +++ configs/aarch64_defconfig | 4 +- external.mk | 1 + package/Config.in | 1 - package/board/Config.in | 13 ------ package/board/board.mk | 2 - src/board/raspberry-pi64/post-build.sh | 7 ---- 131 files changed, 67 insertions(+), 75 deletions(-) create mode 100644 board/Config.in create mode 100644 board/aarch64/Config.in rename {package/board => board/aarch64}/alder-alder/Config.in (100%) rename {src/board => board/aarch64}/alder-alder/LICENSE (100%) rename {package/board => board/aarch64}/alder-alder/alder-alder.mk (100%) rename {src/board => board/aarch64}/alder-alder/dts/Makefile (100%) rename {src/board => board/aarch64}/alder-alder/dts/alder/alder-mpp.h (100%) rename {src/board => board/aarch64}/alder-alder/dts/alder/alder.dts (100%) rename {src/board => board/aarch64}/alder-alder/dts/alder/alder.dtsi (100%) rename {src/board => board/aarch64}/alder-alder/dts/marvell/cn9130-patched.dtsi (100%) rename {package/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/Config.in (88%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/LICENSE (100%) rename board/aarch64/{banana-pi-r3 => bananapi-bpi-r3}/README.md (100%) rename package/board/banana-pi-r3/banana-pi-r3.mk => board/aarch64/bananapi-bpi-r3/bananapi-bpi-r3.mk (89%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/dts/Makefile (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/genimage.cfg.in (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/mkimage.sh (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/uboot/extras.config (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/uboot/mt7986-env.dtsi (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/uboot/mt7986-sd-env.dtsi (100%) rename {src/board/banana-pi-r3 => board/aarch64/bananapi-bpi-r3}/uboot/sd-extras.config (100%) rename {package/board => board/aarch64}/freescale-imx8mp-evk/Config.in (100%) rename {src/board => board/aarch64}/freescale-imx8mp-evk/LICENSE (100%) rename {src/board => board/aarch64}/freescale-imx8mp-evk/dts/Makefile (100%) rename {src/board => board/aarch64}/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts (100%) rename package/board/freescale-imx8mp-evk/imx8mp-evk.mk => board/aarch64/freescale-imx8mp-evk/freescale-imx8mp-evk.mk (100%) rename {src/board => board/aarch64}/freescale-imx8mp-evk/rootfs/usr/share/product/fsl,imx8mp-evk/etc/product/interface-quirks.json (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/README.md (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/genimage.cfg (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/linux_defconfig (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/post-build.sh (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rk3328-nanopi-r2s-dts.patch (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/factory-config.cfg (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/finit.d/enabled/input-event-daemon.conf (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/finit.d/wan-monitor.conf (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/iitod.json (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/input-event-daemon.conf (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/etc/udev/rules.d/90-persistent-net.rules (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/rootfs/usr/sbin/wan-monitor.sh (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/uboot/extras.config (100%) rename board/aarch64/{r2s => friendlyelec/nanopi-r2s}/uboot/r2s-env.dtsi (100%) rename {package/board => board/aarch64}/marvell-cn9130-crb/Config.in (100%) rename {src/board => board/aarch64}/marvell-cn9130-crb/LICENSE (100%) rename board/aarch64/{cn9130-crb => marvell-cn9130-crb}/README.md (100%) rename {src/board => board/aarch64}/marvell-cn9130-crb/dts/Makefile (100%) rename {src/board => board/aarch64}/marvell-cn9130-crb/dts/marvell/cn9130-crb-A.dts (100%) rename {package/board => board/aarch64}/marvell-cn9130-crb/marvell-cn9130-crb.mk (100%) rename board/aarch64/{cn9130-crb => marvell-cn9130-crb}/uboot/cn9130-crb-env.dtsi (100%) rename board/aarch64/{cn9130-crb => marvell-cn9130-crb}/uboot/extras.config (100%) rename {package/board => board/aarch64}/marvell-espressobin/Config.in (100%) rename {src/board => board/aarch64}/marvell-espressobin/LICENSE (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/Makefile (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/marvell/armada-3720-espressobin-emmc.dts (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/marvell/armada-3720-espressobin-ultra.dts (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7-emmc.dts (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7.dts (100%) rename {src/board => board/aarch64}/marvell-espressobin/dts/marvell/armada-3720-espressobin.dts (100%) rename board/aarch64/{espressobin => marvell-espressobin}/genimage.cfg (100%) rename {package/board => board/aarch64}/marvell-espressobin/marvell-espressobin.mk (100%) rename {package/board => board/aarch64}/microchip-sparx5-pcb135/Config.in (100%) rename {src/board => board/aarch64}/microchip-sparx5-pcb135/LICENSE (100%) rename board/aarch64/{sparx5-pcb135 => microchip-sparx5-pcb135}/README.md (100%) rename {src/board => board/aarch64}/microchip-sparx5-pcb135/dts/Makefile (100%) rename {src/board => board/aarch64}/microchip-sparx5-pcb135/dts/microchip/sparx5_pcb135_emmc_no_psci.dts (100%) rename {package/board => board/aarch64}/microchip-sparx5-pcb135/microchip-sparx5-pcb135.mk (100%) rename board/aarch64/{qemu/uboot => qemu-uboot}/extras.config (100%) rename {package/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/Config.in (91%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/LICENSE (100%) rename board/aarch64/{raspberry-pi64 => raspberrypi-rpi64}/README.md (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/cmdline.txt (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/config.txt (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/Makefile (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2711-rpi-4-b-dsi.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2711-rpi-4-b.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2711-rpi-400.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2711-rpi-cm4-io.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2711-rpi-cm4.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2837-rpi-3-b.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/bcm2837-rpi-zero-2-w.dts (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/dts/broadcom/infix.dtsi (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/genimage.cfg.in (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/mkimage.sh (100%) rename package/board/raspberry-pi64/raspberry-pi64.mk => board/aarch64/raspberrypi-rpi64/raspberrypi-rpi64.mk (98%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,3-model-b (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/uboot/extras.config (100%) rename {src/board/raspberry-pi64 => board/aarch64/raspberrypi-rpi64}/uboot/rpi-env.dtso (100%) rename {package/board => board/aarch64}/styx-dcp-sc-28p/Config.in (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/LICENSE (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/Makefile (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/marvell/cn9130-patched.dtsi (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/rootfs/boot/styx/styx-b.dtb (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/rootfs/usr/libexec/styx/led.sh (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/rootfs/usr/share/product/dcp-sc-28p/etc/finit.d/available/iitod.conf (100%) rename {src/board => board/aarch64}/styx-dcp-sc-28p/rootfs/usr/share/product/styx,dcp-sc-28p/etc/product/init.d/S10-led (100%) rename {package/board => board/aarch64}/styx-dcp-sc-28p/styx-dcp-sc-28p.mk (100%) create mode 100644 board/board.mk rename {package/board => board}/dtb-inst.makefile (100%) rename {package/board => board}/ix-board.mk (87%) create mode 100644 board/riscv64/Config.in rename board/riscv64/{visionfive2 => starfive-visionfive2}/README.md (100%) rename board/riscv64/{visionfive2 => starfive-visionfive2}/board.mk (100%) rename board/riscv64/{visionfive2 => starfive-visionfive2}/genimage.cfg (100%) rename board/riscv64/{visionfive2 => starfive-visionfive2}/jh7110-starfive-visionfive-2-dtsi.patch (100%) rename board/riscv64/{visionfive2 => starfive-visionfive2}/uboot/extras.config (100%) rename board/riscv64/{visionfive2 => starfive-visionfive2}/uboot/visionfive2-env.dtsi (100%) create mode 100644 board/x86_64/Config.in delete mode 100644 package/board/Config.in delete mode 100644 package/board/board.mk delete mode 100755 src/board/raspberry-pi64/post-build.sh diff --git a/Config.in b/Config.in index bdc6f06c..49f37390 100644 --- a/Config.in +++ b/Config.in @@ -1,3 +1,5 @@ +source "$BR2_EXTERNAL_INFIX_PATH/board/Config.in" + menu "Branding" config INFIX_VENDOR diff --git a/board/Config.in b/board/Config.in new file mode 100644 index 00000000..2fd7fadb --- /dev/null +++ b/board/Config.in @@ -0,0 +1,7 @@ +menu "Board Support" + +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/riscv64/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/x86_64/Config.in" + +endmenu diff --git a/board/aarch64/Config.in b/board/aarch64/Config.in new file mode 100644 index 00000000..4808b6d7 --- /dev/null +++ b/board/aarch64/Config.in @@ -0,0 +1,12 @@ +if BR2_aarch64 + +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/alder-alder/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r3/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/freescale-imx8mp-evk/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-cn9130-crb/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-espressobin/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/microchip-sparx5-pcb135/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/raspberrypi-rpi64/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/styx-dcp-sc-28p/Config.in" + +endif diff --git a/package/board/alder-alder/Config.in b/board/aarch64/alder-alder/Config.in similarity index 100% rename from package/board/alder-alder/Config.in rename to board/aarch64/alder-alder/Config.in diff --git a/src/board/alder-alder/LICENSE b/board/aarch64/alder-alder/LICENSE similarity index 100% rename from src/board/alder-alder/LICENSE rename to board/aarch64/alder-alder/LICENSE diff --git a/package/board/alder-alder/alder-alder.mk b/board/aarch64/alder-alder/alder-alder.mk similarity index 100% rename from package/board/alder-alder/alder-alder.mk rename to board/aarch64/alder-alder/alder-alder.mk diff --git a/src/board/alder-alder/dts/Makefile b/board/aarch64/alder-alder/dts/Makefile similarity index 100% rename from src/board/alder-alder/dts/Makefile rename to board/aarch64/alder-alder/dts/Makefile diff --git a/src/board/alder-alder/dts/alder/alder-mpp.h b/board/aarch64/alder-alder/dts/alder/alder-mpp.h similarity index 100% rename from src/board/alder-alder/dts/alder/alder-mpp.h rename to board/aarch64/alder-alder/dts/alder/alder-mpp.h diff --git a/src/board/alder-alder/dts/alder/alder.dts b/board/aarch64/alder-alder/dts/alder/alder.dts similarity index 100% rename from src/board/alder-alder/dts/alder/alder.dts rename to board/aarch64/alder-alder/dts/alder/alder.dts diff --git a/src/board/alder-alder/dts/alder/alder.dtsi b/board/aarch64/alder-alder/dts/alder/alder.dtsi similarity index 100% rename from src/board/alder-alder/dts/alder/alder.dtsi rename to board/aarch64/alder-alder/dts/alder/alder.dtsi diff --git a/src/board/alder-alder/dts/marvell/cn9130-patched.dtsi b/board/aarch64/alder-alder/dts/marvell/cn9130-patched.dtsi similarity index 100% rename from src/board/alder-alder/dts/marvell/cn9130-patched.dtsi rename to board/aarch64/alder-alder/dts/marvell/cn9130-patched.dtsi diff --git a/package/board/banana-pi-r3/Config.in b/board/aarch64/bananapi-bpi-r3/Config.in similarity index 88% rename from package/board/banana-pi-r3/Config.in rename to board/aarch64/bananapi-bpi-r3/Config.in index 6c7578cc..c7cccf3f 100644 --- a/package/board/banana-pi-r3/Config.in +++ b/board/aarch64/bananapi-bpi-r3/Config.in @@ -1,4 +1,4 @@ -config BR2_PACKAGE_BANANA_PI_R3 +config BR2_PACKAGE_BANANAPI_BPI_R3 bool "Banana Pi R3" depends on BR2_aarch64 select BR2_PACKAGE_FEATURE_WIFI diff --git a/src/board/banana-pi-r3/LICENSE b/board/aarch64/bananapi-bpi-r3/LICENSE similarity index 100% rename from src/board/banana-pi-r3/LICENSE rename to board/aarch64/bananapi-bpi-r3/LICENSE diff --git a/board/aarch64/banana-pi-r3/README.md b/board/aarch64/bananapi-bpi-r3/README.md similarity index 100% rename from board/aarch64/banana-pi-r3/README.md rename to board/aarch64/bananapi-bpi-r3/README.md diff --git a/package/board/banana-pi-r3/banana-pi-r3.mk b/board/aarch64/bananapi-bpi-r3/bananapi-bpi-r3.mk similarity index 89% rename from package/board/banana-pi-r3/banana-pi-r3.mk rename to board/aarch64/bananapi-bpi-r3/bananapi-bpi-r3.mk index a000411c..506114f4 100644 --- a/package/board/banana-pi-r3/banana-pi-r3.mk +++ b/board/aarch64/bananapi-bpi-r3/bananapi-bpi-r3.mk @@ -1,8 +1,4 @@ -GENIMAGE_CFG="$(BUILD_DIR)/genimage.cfg" -GENIMAGE_TMP="$(BUILD_DIR)/genimage.tmp" -BOARD_DIR="$(BR2_EXTERNAL_INFIX_PATH)/src/board/banana-pi-r3" - -define BANANA_PI_R3_LINUX_CONFIG_FIXUPS +define BANANAPI_BPI_R3_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_MEDIATEK) $(call KCONFIG_ENABLE_OPT,CONFIG_MACH_MT7986) $(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_MT7986) diff --git a/src/board/banana-pi-r3/dts/Makefile b/board/aarch64/bananapi-bpi-r3/dts/Makefile similarity index 100% rename from src/board/banana-pi-r3/dts/Makefile rename to board/aarch64/bananapi-bpi-r3/dts/Makefile diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts b/board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts similarity index 100% rename from src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts rename to board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dts diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi b/board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi similarity index 100% rename from src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi rename to board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3-sd.dtsi diff --git a/src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi b/board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi similarity index 100% rename from src/board/banana-pi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi rename to board/aarch64/bananapi-bpi-r3/dts/mediatek/mt7986a-bananapi-bpi-r3.dtsi diff --git a/src/board/banana-pi-r3/genimage.cfg.in b/board/aarch64/bananapi-bpi-r3/genimage.cfg.in similarity index 100% rename from src/board/banana-pi-r3/genimage.cfg.in rename to board/aarch64/bananapi-bpi-r3/genimage.cfg.in diff --git a/src/board/banana-pi-r3/mkimage.sh b/board/aarch64/bananapi-bpi-r3/mkimage.sh similarity index 100% rename from src/board/banana-pi-r3/mkimage.sh rename to board/aarch64/bananapi-bpi-r3/mkimage.sh diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg similarity index 100% rename from src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg rename to board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh similarity index 100% rename from src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh rename to board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/product/init.d/S01-trigger-udev.sh diff --git a/src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules similarity index 100% rename from src/board/banana-pi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules rename to board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/udev/rules.d/90-bpi-r3-rename-eth1.rules diff --git a/src/board/banana-pi-r3/uboot/extras.config b/board/aarch64/bananapi-bpi-r3/uboot/extras.config similarity index 100% rename from src/board/banana-pi-r3/uboot/extras.config rename to board/aarch64/bananapi-bpi-r3/uboot/extras.config diff --git a/src/board/banana-pi-r3/uboot/mt7986-env.dtsi b/board/aarch64/bananapi-bpi-r3/uboot/mt7986-env.dtsi similarity index 100% rename from src/board/banana-pi-r3/uboot/mt7986-env.dtsi rename to board/aarch64/bananapi-bpi-r3/uboot/mt7986-env.dtsi diff --git a/src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi b/board/aarch64/bananapi-bpi-r3/uboot/mt7986-sd-env.dtsi similarity index 100% rename from src/board/banana-pi-r3/uboot/mt7986-sd-env.dtsi rename to board/aarch64/bananapi-bpi-r3/uboot/mt7986-sd-env.dtsi diff --git a/src/board/banana-pi-r3/uboot/sd-extras.config b/board/aarch64/bananapi-bpi-r3/uboot/sd-extras.config similarity index 100% rename from src/board/banana-pi-r3/uboot/sd-extras.config rename to board/aarch64/bananapi-bpi-r3/uboot/sd-extras.config diff --git a/package/board/freescale-imx8mp-evk/Config.in b/board/aarch64/freescale-imx8mp-evk/Config.in similarity index 100% rename from package/board/freescale-imx8mp-evk/Config.in rename to board/aarch64/freescale-imx8mp-evk/Config.in diff --git a/src/board/freescale-imx8mp-evk/LICENSE b/board/aarch64/freescale-imx8mp-evk/LICENSE similarity index 100% rename from src/board/freescale-imx8mp-evk/LICENSE rename to board/aarch64/freescale-imx8mp-evk/LICENSE diff --git a/src/board/freescale-imx8mp-evk/dts/Makefile b/board/aarch64/freescale-imx8mp-evk/dts/Makefile similarity index 100% rename from src/board/freescale-imx8mp-evk/dts/Makefile rename to board/aarch64/freescale-imx8mp-evk/dts/Makefile diff --git a/src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts b/board/aarch64/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts similarity index 100% rename from src/board/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts rename to board/aarch64/freescale-imx8mp-evk/dts/freescale/imx8mp-evk.dts diff --git a/package/board/freescale-imx8mp-evk/imx8mp-evk.mk b/board/aarch64/freescale-imx8mp-evk/freescale-imx8mp-evk.mk similarity index 100% rename from package/board/freescale-imx8mp-evk/imx8mp-evk.mk rename to board/aarch64/freescale-imx8mp-evk/freescale-imx8mp-evk.mk diff --git a/src/board/freescale-imx8mp-evk/rootfs/usr/share/product/fsl,imx8mp-evk/etc/product/interface-quirks.json b/board/aarch64/freescale-imx8mp-evk/rootfs/usr/share/product/fsl,imx8mp-evk/etc/product/interface-quirks.json similarity index 100% rename from src/board/freescale-imx8mp-evk/rootfs/usr/share/product/fsl,imx8mp-evk/etc/product/interface-quirks.json rename to board/aarch64/freescale-imx8mp-evk/rootfs/usr/share/product/fsl,imx8mp-evk/etc/product/interface-quirks.json diff --git a/board/aarch64/r2s/README.md b/board/aarch64/friendlyelec/nanopi-r2s/README.md similarity index 100% rename from board/aarch64/r2s/README.md rename to board/aarch64/friendlyelec/nanopi-r2s/README.md diff --git a/board/aarch64/r2s/genimage.cfg b/board/aarch64/friendlyelec/nanopi-r2s/genimage.cfg similarity index 100% rename from board/aarch64/r2s/genimage.cfg rename to board/aarch64/friendlyelec/nanopi-r2s/genimage.cfg diff --git a/board/aarch64/r2s/linux_defconfig b/board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig similarity index 100% rename from board/aarch64/r2s/linux_defconfig rename to board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig diff --git a/board/aarch64/r2s/post-build.sh b/board/aarch64/friendlyelec/nanopi-r2s/post-build.sh similarity index 100% rename from board/aarch64/r2s/post-build.sh rename to board/aarch64/friendlyelec/nanopi-r2s/post-build.sh diff --git a/board/aarch64/r2s/rk3328-nanopi-r2s-dts.patch b/board/aarch64/friendlyelec/nanopi-r2s/rk3328-nanopi-r2s-dts.patch similarity index 100% rename from board/aarch64/r2s/rk3328-nanopi-r2s-dts.patch rename to board/aarch64/friendlyelec/nanopi-r2s/rk3328-nanopi-r2s-dts.patch diff --git a/board/aarch64/r2s/rootfs/etc/factory-config.cfg b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/factory-config.cfg similarity index 100% rename from board/aarch64/r2s/rootfs/etc/factory-config.cfg rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/factory-config.cfg diff --git a/board/aarch64/r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf similarity index 100% rename from board/aarch64/r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf diff --git a/board/aarch64/r2s/rootfs/etc/finit.d/wan-monitor.conf b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/wan-monitor.conf similarity index 100% rename from board/aarch64/r2s/rootfs/etc/finit.d/wan-monitor.conf rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/wan-monitor.conf diff --git a/board/aarch64/r2s/rootfs/etc/iitod.json b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/iitod.json similarity index 100% rename from board/aarch64/r2s/rootfs/etc/iitod.json rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/iitod.json diff --git a/board/aarch64/r2s/rootfs/etc/input-event-daemon.conf b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/input-event-daemon.conf similarity index 100% rename from board/aarch64/r2s/rootfs/etc/input-event-daemon.conf rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/input-event-daemon.conf diff --git a/board/aarch64/r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules similarity index 100% rename from board/aarch64/r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules diff --git a/board/aarch64/r2s/rootfs/usr/sbin/wan-monitor.sh b/board/aarch64/friendlyelec/nanopi-r2s/rootfs/usr/sbin/wan-monitor.sh similarity index 100% rename from board/aarch64/r2s/rootfs/usr/sbin/wan-monitor.sh rename to board/aarch64/friendlyelec/nanopi-r2s/rootfs/usr/sbin/wan-monitor.sh diff --git a/board/aarch64/r2s/uboot/extras.config b/board/aarch64/friendlyelec/nanopi-r2s/uboot/extras.config similarity index 100% rename from board/aarch64/r2s/uboot/extras.config rename to board/aarch64/friendlyelec/nanopi-r2s/uboot/extras.config diff --git a/board/aarch64/r2s/uboot/r2s-env.dtsi b/board/aarch64/friendlyelec/nanopi-r2s/uboot/r2s-env.dtsi similarity index 100% rename from board/aarch64/r2s/uboot/r2s-env.dtsi rename to board/aarch64/friendlyelec/nanopi-r2s/uboot/r2s-env.dtsi diff --git a/package/board/marvell-cn9130-crb/Config.in b/board/aarch64/marvell-cn9130-crb/Config.in similarity index 100% rename from package/board/marvell-cn9130-crb/Config.in rename to board/aarch64/marvell-cn9130-crb/Config.in diff --git a/src/board/marvell-cn9130-crb/LICENSE b/board/aarch64/marvell-cn9130-crb/LICENSE similarity index 100% rename from src/board/marvell-cn9130-crb/LICENSE rename to board/aarch64/marvell-cn9130-crb/LICENSE diff --git a/board/aarch64/cn9130-crb/README.md b/board/aarch64/marvell-cn9130-crb/README.md similarity index 100% rename from board/aarch64/cn9130-crb/README.md rename to board/aarch64/marvell-cn9130-crb/README.md diff --git a/src/board/marvell-cn9130-crb/dts/Makefile b/board/aarch64/marvell-cn9130-crb/dts/Makefile similarity index 100% rename from src/board/marvell-cn9130-crb/dts/Makefile rename to board/aarch64/marvell-cn9130-crb/dts/Makefile diff --git a/src/board/marvell-cn9130-crb/dts/marvell/cn9130-crb-A.dts b/board/aarch64/marvell-cn9130-crb/dts/marvell/cn9130-crb-A.dts similarity index 100% rename from src/board/marvell-cn9130-crb/dts/marvell/cn9130-crb-A.dts rename to board/aarch64/marvell-cn9130-crb/dts/marvell/cn9130-crb-A.dts diff --git a/package/board/marvell-cn9130-crb/marvell-cn9130-crb.mk b/board/aarch64/marvell-cn9130-crb/marvell-cn9130-crb.mk similarity index 100% rename from package/board/marvell-cn9130-crb/marvell-cn9130-crb.mk rename to board/aarch64/marvell-cn9130-crb/marvell-cn9130-crb.mk diff --git a/board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi b/board/aarch64/marvell-cn9130-crb/uboot/cn9130-crb-env.dtsi similarity index 100% rename from board/aarch64/cn9130-crb/uboot/cn9130-crb-env.dtsi rename to board/aarch64/marvell-cn9130-crb/uboot/cn9130-crb-env.dtsi diff --git a/board/aarch64/cn9130-crb/uboot/extras.config b/board/aarch64/marvell-cn9130-crb/uboot/extras.config similarity index 100% rename from board/aarch64/cn9130-crb/uboot/extras.config rename to board/aarch64/marvell-cn9130-crb/uboot/extras.config diff --git a/package/board/marvell-espressobin/Config.in b/board/aarch64/marvell-espressobin/Config.in similarity index 100% rename from package/board/marvell-espressobin/Config.in rename to board/aarch64/marvell-espressobin/Config.in diff --git a/src/board/marvell-espressobin/LICENSE b/board/aarch64/marvell-espressobin/LICENSE similarity index 100% rename from src/board/marvell-espressobin/LICENSE rename to board/aarch64/marvell-espressobin/LICENSE diff --git a/src/board/marvell-espressobin/dts/Makefile b/board/aarch64/marvell-espressobin/dts/Makefile similarity index 100% rename from src/board/marvell-espressobin/dts/Makefile rename to board/aarch64/marvell-espressobin/dts/Makefile diff --git a/src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-emmc.dts b/board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-emmc.dts similarity index 100% rename from src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-emmc.dts rename to board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-emmc.dts diff --git a/src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-ultra.dts b/board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-ultra.dts similarity index 100% rename from src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-ultra.dts rename to board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-ultra.dts diff --git a/src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7-emmc.dts b/board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7-emmc.dts similarity index 100% rename from src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7-emmc.dts rename to board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7-emmc.dts diff --git a/src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7.dts b/board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7.dts similarity index 100% rename from src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7.dts rename to board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin-v7.dts diff --git a/src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin.dts b/board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin.dts similarity index 100% rename from src/board/marvell-espressobin/dts/marvell/armada-3720-espressobin.dts rename to board/aarch64/marvell-espressobin/dts/marvell/armada-3720-espressobin.dts diff --git a/board/aarch64/espressobin/genimage.cfg b/board/aarch64/marvell-espressobin/genimage.cfg similarity index 100% rename from board/aarch64/espressobin/genimage.cfg rename to board/aarch64/marvell-espressobin/genimage.cfg diff --git a/package/board/marvell-espressobin/marvell-espressobin.mk b/board/aarch64/marvell-espressobin/marvell-espressobin.mk similarity index 100% rename from package/board/marvell-espressobin/marvell-espressobin.mk rename to board/aarch64/marvell-espressobin/marvell-espressobin.mk diff --git a/package/board/microchip-sparx5-pcb135/Config.in b/board/aarch64/microchip-sparx5-pcb135/Config.in similarity index 100% rename from package/board/microchip-sparx5-pcb135/Config.in rename to board/aarch64/microchip-sparx5-pcb135/Config.in diff --git a/src/board/microchip-sparx5-pcb135/LICENSE b/board/aarch64/microchip-sparx5-pcb135/LICENSE similarity index 100% rename from src/board/microchip-sparx5-pcb135/LICENSE rename to board/aarch64/microchip-sparx5-pcb135/LICENSE diff --git a/board/aarch64/sparx5-pcb135/README.md b/board/aarch64/microchip-sparx5-pcb135/README.md similarity index 100% rename from board/aarch64/sparx5-pcb135/README.md rename to board/aarch64/microchip-sparx5-pcb135/README.md diff --git a/src/board/microchip-sparx5-pcb135/dts/Makefile b/board/aarch64/microchip-sparx5-pcb135/dts/Makefile similarity index 100% rename from src/board/microchip-sparx5-pcb135/dts/Makefile rename to board/aarch64/microchip-sparx5-pcb135/dts/Makefile diff --git a/src/board/microchip-sparx5-pcb135/dts/microchip/sparx5_pcb135_emmc_no_psci.dts b/board/aarch64/microchip-sparx5-pcb135/dts/microchip/sparx5_pcb135_emmc_no_psci.dts similarity index 100% rename from src/board/microchip-sparx5-pcb135/dts/microchip/sparx5_pcb135_emmc_no_psci.dts rename to board/aarch64/microchip-sparx5-pcb135/dts/microchip/sparx5_pcb135_emmc_no_psci.dts diff --git a/package/board/microchip-sparx5-pcb135/microchip-sparx5-pcb135.mk b/board/aarch64/microchip-sparx5-pcb135/microchip-sparx5-pcb135.mk similarity index 100% rename from package/board/microchip-sparx5-pcb135/microchip-sparx5-pcb135.mk rename to board/aarch64/microchip-sparx5-pcb135/microchip-sparx5-pcb135.mk diff --git a/board/aarch64/qemu/uboot/extras.config b/board/aarch64/qemu-uboot/extras.config similarity index 100% rename from board/aarch64/qemu/uboot/extras.config rename to board/aarch64/qemu-uboot/extras.config diff --git a/package/board/raspberry-pi64/Config.in b/board/aarch64/raspberrypi-rpi64/Config.in similarity index 91% rename from package/board/raspberry-pi64/Config.in rename to board/aarch64/raspberrypi-rpi64/Config.in index 3fe7d1d2..3596de7c 100644 --- a/package/board/raspberry-pi64/Config.in +++ b/board/aarch64/raspberrypi-rpi64/Config.in @@ -1,4 +1,4 @@ -config BR2_PACKAGE_RASPBERRY_PI64 +config BR2_PACKAGE_RASPBERRYPI_RPI64 bool "Raspberry Pi 64-bit (RPi3 and later)" depends on BR2_aarch64 select SDCARD_AUX @@ -10,4 +10,3 @@ config BR2_PACKAGE_RASPBERRY_PI64 Raspberry Pi 64-bit adds support for the Raspberry Pi family of of single-board computers (SBC), RPi 3B and later, including the Raspberry Pi 2W, which shares the same CPU core as RPi 3B. - diff --git a/src/board/raspberry-pi64/LICENSE b/board/aarch64/raspberrypi-rpi64/LICENSE similarity index 100% rename from src/board/raspberry-pi64/LICENSE rename to board/aarch64/raspberrypi-rpi64/LICENSE diff --git a/board/aarch64/raspberry-pi64/README.md b/board/aarch64/raspberrypi-rpi64/README.md similarity index 100% rename from board/aarch64/raspberry-pi64/README.md rename to board/aarch64/raspberrypi-rpi64/README.md diff --git a/src/board/raspberry-pi64/cmdline.txt b/board/aarch64/raspberrypi-rpi64/cmdline.txt similarity index 100% rename from src/board/raspberry-pi64/cmdline.txt rename to board/aarch64/raspberrypi-rpi64/cmdline.txt diff --git a/src/board/raspberry-pi64/config.txt b/board/aarch64/raspberrypi-rpi64/config.txt similarity index 100% rename from src/board/raspberry-pi64/config.txt rename to board/aarch64/raspberrypi-rpi64/config.txt diff --git a/src/board/raspberry-pi64/dts/Makefile b/board/aarch64/raspberrypi-rpi64/dts/Makefile similarity index 100% rename from src/board/raspberry-pi64/dts/Makefile rename to board/aarch64/raspberrypi-rpi64/dts/Makefile diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-4-b-dsi.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-4-b.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-4-b.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-4-b.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-400.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-400.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-400.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-400.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4-io.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-cm4-io.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4-io.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-cm4-io.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-cm4.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2711-rpi-cm4.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2711-rpi-cm4.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-3-b.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2837-rpi-3-b.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-3-b.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2837-rpi-3-b.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts b/board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/bcm2837-rpi-zero-2-w.dts diff --git a/src/board/raspberry-pi64/dts/broadcom/infix.dtsi b/board/aarch64/raspberrypi-rpi64/dts/broadcom/infix.dtsi similarity index 100% rename from src/board/raspberry-pi64/dts/broadcom/infix.dtsi rename to board/aarch64/raspberrypi-rpi64/dts/broadcom/infix.dtsi diff --git a/src/board/raspberry-pi64/genimage.cfg.in b/board/aarch64/raspberrypi-rpi64/genimage.cfg.in similarity index 100% rename from src/board/raspberry-pi64/genimage.cfg.in rename to board/aarch64/raspberrypi-rpi64/genimage.cfg.in diff --git a/src/board/raspberry-pi64/mkimage.sh b/board/aarch64/raspberrypi-rpi64/mkimage.sh similarity index 100% rename from src/board/raspberry-pi64/mkimage.sh rename to board/aarch64/raspberrypi-rpi64/mkimage.sh diff --git a/package/board/raspberry-pi64/raspberry-pi64.mk b/board/aarch64/raspberrypi-rpi64/raspberrypi-rpi64.mk similarity index 98% rename from package/board/raspberry-pi64/raspberry-pi64.mk rename to board/aarch64/raspberrypi-rpi64/raspberrypi-rpi64.mk index 43ddd8a1..341407ad 100644 --- a/package/board/raspberry-pi64/raspberry-pi64.mk +++ b/board/aarch64/raspberrypi-rpi64/raspberrypi-rpi64.mk @@ -1,6 +1,6 @@ # The CONFIG_REGULATOR_GPIO=y is load bearing for booting the RPi4 from # SD card, see regulator-sd-io-1v8 in bcm2711-rpi-4-b.dts for details. -define RASPBERRY_PI_4_LINUX_CONFIG_FIXUPS +define RASPBERRYPI_RPI64_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_SOUND) $(call KCONFIG_ENABLE_OPT,CONFIG_SND) $(call KCONFIG_ENABLE_OPT,CONFIG_SND_SOC) @@ -62,5 +62,6 @@ define RASPBERRY_PI_4_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,CONFIG_BACKLIGHT_CLASS_DEVICE) endef + $(eval $(ix-board)) $(eval $(generic-package)) diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,3-model-b b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,3-model-b similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,3-model-b rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,3-model-b diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/interface-quirks.json diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json diff --git a/src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces similarity index 100% rename from src/board/raspberry-pi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces rename to board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/usr/libexec/confd/product/gen-interfaces diff --git a/src/board/raspberry-pi64/uboot/extras.config b/board/aarch64/raspberrypi-rpi64/uboot/extras.config similarity index 100% rename from src/board/raspberry-pi64/uboot/extras.config rename to board/aarch64/raspberrypi-rpi64/uboot/extras.config diff --git a/src/board/raspberry-pi64/uboot/rpi-env.dtso b/board/aarch64/raspberrypi-rpi64/uboot/rpi-env.dtso similarity index 100% rename from src/board/raspberry-pi64/uboot/rpi-env.dtso rename to board/aarch64/raspberrypi-rpi64/uboot/rpi-env.dtso diff --git a/package/board/styx-dcp-sc-28p/Config.in b/board/aarch64/styx-dcp-sc-28p/Config.in similarity index 100% rename from package/board/styx-dcp-sc-28p/Config.in rename to board/aarch64/styx-dcp-sc-28p/Config.in diff --git a/src/board/styx-dcp-sc-28p/LICENSE b/board/aarch64/styx-dcp-sc-28p/LICENSE similarity index 100% rename from src/board/styx-dcp-sc-28p/LICENSE rename to board/aarch64/styx-dcp-sc-28p/LICENSE diff --git a/src/board/styx-dcp-sc-28p/dts/Makefile b/board/aarch64/styx-dcp-sc-28p/dts/Makefile similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/Makefile rename to board/aarch64/styx-dcp-sc-28p/dts/Makefile diff --git a/src/board/styx-dcp-sc-28p/dts/marvell/cn9130-patched.dtsi b/board/aarch64/styx-dcp-sc-28p/dts/marvell/cn9130-patched.dtsi similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/marvell/cn9130-patched.dtsi rename to board/aarch64/styx-dcp-sc-28p/dts/marvell/cn9130-patched.dtsi diff --git a/src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts b/board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts rename to board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-a.dts diff --git a/src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts b/board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts rename to board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-b.dts diff --git a/src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h b/board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h rename to board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p-mpp.h diff --git a/src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi b/board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi similarity index 100% rename from src/board/styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi rename to board/aarch64/styx-dcp-sc-28p/dts/styx/dcp-sc-28p.dtsi diff --git a/src/board/styx-dcp-sc-28p/rootfs/boot/styx/styx-b.dtb b/board/aarch64/styx-dcp-sc-28p/rootfs/boot/styx/styx-b.dtb similarity index 100% rename from src/board/styx-dcp-sc-28p/rootfs/boot/styx/styx-b.dtb rename to board/aarch64/styx-dcp-sc-28p/rootfs/boot/styx/styx-b.dtb diff --git a/src/board/styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb b/board/aarch64/styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb similarity index 100% rename from src/board/styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb rename to board/aarch64/styx-dcp-sc-28p/rootfs/boot/styx/styx.dtb diff --git a/src/board/styx-dcp-sc-28p/rootfs/usr/libexec/styx/led.sh b/board/aarch64/styx-dcp-sc-28p/rootfs/usr/libexec/styx/led.sh similarity index 100% rename from src/board/styx-dcp-sc-28p/rootfs/usr/libexec/styx/led.sh rename to board/aarch64/styx-dcp-sc-28p/rootfs/usr/libexec/styx/led.sh diff --git a/src/board/styx-dcp-sc-28p/rootfs/usr/share/product/dcp-sc-28p/etc/finit.d/available/iitod.conf b/board/aarch64/styx-dcp-sc-28p/rootfs/usr/share/product/dcp-sc-28p/etc/finit.d/available/iitod.conf similarity index 100% rename from src/board/styx-dcp-sc-28p/rootfs/usr/share/product/dcp-sc-28p/etc/finit.d/available/iitod.conf rename to board/aarch64/styx-dcp-sc-28p/rootfs/usr/share/product/dcp-sc-28p/etc/finit.d/available/iitod.conf diff --git a/src/board/styx-dcp-sc-28p/rootfs/usr/share/product/styx,dcp-sc-28p/etc/product/init.d/S10-led b/board/aarch64/styx-dcp-sc-28p/rootfs/usr/share/product/styx,dcp-sc-28p/etc/product/init.d/S10-led similarity index 100% rename from src/board/styx-dcp-sc-28p/rootfs/usr/share/product/styx,dcp-sc-28p/etc/product/init.d/S10-led rename to board/aarch64/styx-dcp-sc-28p/rootfs/usr/share/product/styx,dcp-sc-28p/etc/product/init.d/S10-led diff --git a/package/board/styx-dcp-sc-28p/styx-dcp-sc-28p.mk b/board/aarch64/styx-dcp-sc-28p/styx-dcp-sc-28p.mk similarity index 100% rename from package/board/styx-dcp-sc-28p/styx-dcp-sc-28p.mk rename to board/aarch64/styx-dcp-sc-28p/styx-dcp-sc-28p.mk diff --git a/board/board.mk b/board/board.mk new file mode 100644 index 00000000..a87a8715 --- /dev/null +++ b/board/board.mk @@ -0,0 +1,2 @@ +include $(BR2_EXTERNAL_INFIX_PATH)/board/ix-board.mk +include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/board/*/*/*.mk)) diff --git a/board/common/README.txt b/board/common/README.txt index 2ab5592d..b11a3b77 100644 --- a/board/common/README.txt +++ b/board/common/README.txt @@ -94,10 +94,9 @@ If you see the following line printed one or more times, don't panic. LABEL=var: Can't lookup blockdev -See the Customizing section above. To silence the error you need to -create another writable partition for Infix to store logs, container -images, etc. Look for the 'var' keyword, you can adjust the size of -the partition. +See the Customizing section above. Silence the error by selecting one +more writable partition (/var) in menuconfig for log files, container +images, etc. The size can also be adjusted there. Graphical Network Simulator 3 (GNS3) @@ -105,12 +104,11 @@ Graphical Network Simulator 3 (GNS3) GNS3 is a very powerful front-end to Qemu which takes care of creating virtual links between network devices running in Qemu. This README is -only link to the material you need. This directory holds the appliance -file, .gns3a, that references image files also in this directory, that -you need to load into GNS3. +all you need to get going, alongisde it is the appliance file (.gns3a) +that reference image files in this directory needed to load into GNS3. -The necessary extra packages are available through the offical PPA. If -you don't know what a PPA is, read up on that first: +Necessary Ubuntu packages are available through the offical GNS3 PPA. +If you don't know what a PPA is, read up on that first: - https://launchpad.net/~gns3/+archive/ubuntu/ppa @@ -122,9 +120,8 @@ There's a lot of tutorials and guides online, start here: About ----- -Infix is a free, Linux-based, immutable operating system built around +Infix is a free, Linux-based, immutable operating system, built around Buildroot, and sysrepo. A powerful mix that ease porting to different platforms, simplify long-term maintenance, and provide easy management -using NETCONF, RESTCONF, or the built-in command line interface (CLI) +using NETCONF, RESTCONF, or the built-in, command line interface (CLI) from a console or SSH login. - diff --git a/board/common/post-build.sh b/board/common/post-build.sh index 7f8be343..d707991f 100755 --- a/board/common/post-build.sh +++ b/board/common/post-build.sh @@ -1,6 +1,8 @@ -#!/bin/sh -# shellcheck disable=SC1090,SC1091 +#!/usr/bin/env bash +# shellcheck disable=SC1090,SC1091,SC3053 + common=$(dirname "$(readlink -f "$0")") +. "$common/lib.sh" . "$BR2_CONFIG" 2>/dev/null . "$TARGET_DIR/usr/lib/os-release" @@ -30,27 +32,21 @@ EOF # Ignore a few top-level oddballs not used by core Infix cmd="$cmd -x supported-algorithms" - # Execute the command - echo "Calling: $cmd" + ixmsg "Calling $cmd" $cmd } -if [ -n "${ID_LIKE}" ]; then - ID="${ID} ${ID_LIKE}" -fi - -if [ -n "$INFIX_IMAGE_ID" ]; then - NAME="$INFIX_IMAGE_ID" -else - NAME="$INFIX_ID"-$(echo "$BR2_ARCH" | tr _ - | sed 's/x86-64/x86_64/') -fi - if [ -f "$TARGET_DIR/etc/rauc/system.conf" ]; then sed -i "s/compatible=.*/compatible=$INFIX_COMPATIBLE/" "$TARGET_DIR/etc/rauc/system.conf" fi +if [ -n "${ID_LIKE}" ]; then + ID="${ID} ${ID_LIKE}" +fi + # This is a symlink to /usr/lib/os-release, so we remove this to keep # original Buildroot information. +ixmsg "Creating /etc/os-release" rm -f "$TARGET_DIR/etc/os-release" { echo "NAME=\"$INFIX_NAME\"" @@ -87,6 +83,7 @@ rm -f "$TARGET_DIR/etc/os-release" } > "$TARGET_DIR/etc/os-release" echo "$INFIX_TAGLINE $INFIX_VERSION -- $(date +"%b %e %H:%M %Z %Y")" > "$TARGET_DIR/etc/version" +ixmsg "Creating /etc/version: $(cat "$TARGET_DIR/etc/version")" # In case of ambguities, this is what the image was built from cp "$BR2_CONFIG" "$TARGET_DIR/usr/share/infix/config" @@ -101,12 +98,9 @@ fi # Drop Buildroot default pam_lastlog.so from login chain sed -i '/^[^#]*pam_lastlog.so/s/^/# /' "$TARGET_DIR/etc/pam.d/login" -# Allow pdmenu (setup) and bash to be login shells, bash is added -# automatically when selected in menuyconfig, but not when BusyBox -# provides a symlink (for ash). The /bin/{true,false} are old UNIX -# beart means of disabling a user. -grep -qsE '^/usr/bin/pdmenu$$' "$TARGET_DIR/etc/shells" \ - || echo "/usr/bin/pdmenu" >> "$TARGET_DIR/etc/shells" +# Allow bash to be login shells, it is added automatically when selected +# in menuyconfig, but not when BusyBox provides a symlink (for ash). +# The /bin/{true,false} are old UNIX beart means of disabling a user. grep -qsE '^/bin/bash$$' "$TARGET_DIR/etc/shells" \ || echo "/bin/bash" >> "$TARGET_DIR/etc/shells" grep -qsE '^/bin/true$$' "$TARGET_DIR/etc/shells" \ @@ -114,12 +108,6 @@ grep -qsE '^/bin/true$$' "$TARGET_DIR/etc/shells" \ grep -qsE '^/bin/false$$' "$TARGET_DIR/etc/shells" \ || echo "/bin/false" >> "$TARGET_DIR/etc/shells" -boards=$(${BR2_EXTERNAL_INFIX_PATH}/board/common/selected-boards.sh ${BR2_EXTERNAL_INFIX_PATH} ${O}) - -for board in $boards; do - [ ! -f "${BR2_EXTERNAL_INFIX_PATH}/src/board/${board}/post-build.sh" ] && continue - ${BR2_EXTERNAL_INFIX_PATH}/src/board/${board}/post-build.sh -done # Allow clish (symlink to /usr/bin/klish) to be a login shell grep -qsE '^/bin/clish$$' "$TARGET_DIR/etc/shells" \ || echo "/bin/clish" >> "$TARGET_DIR/etc/shells" diff --git a/package/board/dtb-inst.makefile b/board/dtb-inst.makefile similarity index 100% rename from package/board/dtb-inst.makefile rename to board/dtb-inst.makefile diff --git a/package/board/ix-board.mk b/board/ix-board.mk similarity index 87% rename from package/board/ix-board.mk rename to board/ix-board.mk index 391cb8be..1f6509ff 100644 --- a/package/board/ix-board.mk +++ b/board/ix-board.mk @@ -4,7 +4,7 @@ $(2)_VERSION = ix-board $(2)_LICENSE = BSD-3-Clause $(2)_LICENSE_FILES = LICENSE $(2)_SITE_METHOD = local -$(2)_SITE = $$(BR2_EXTERNAL_INFIX_PATH)/src/board/$(1) +$(2)_SITE ?= $$(BR2_EXTERNAL_INFIX_PATH)/board/$(3) $(2)_REDISTRIBUTE = NO # The kernel must be built first. @@ -31,7 +31,7 @@ $(2)_POST_BUILD_HOOKS += $(2)_DTBS_BUILD define $(2)_DTBS_INSTALL_TARGET @$$(call MESSAGE,"Installing device tree blob(s)") $$(TARGET_MAKE_ENV) $$(TARGET_CONFIGURE_OPTS) $$($$(PKG)_MAKE) \ - -f $$(BR2_EXTERNAL_INFIX_PATH)/package/board/dtb-inst.makefile \ + -f $$(BR2_EXTERNAL_INFIX_PATH)/board/dtb-inst.makefile \ -C $$(@D)/dts \ DESTDIR="$$(TARGET_DIR)" \ install @@ -48,4 +48,4 @@ $(2)_POST_INSTALL_TARGET_HOOKS += $(2)_OVERLAY_INSTALL_TARGET endef -ix-board = $(call inner-ix-board,$(pkgname),$(call UPPERCASE,$(pkgname))) +ix-board = $(call inner-ix-board,$(pkgname),$(call UPPERCASE,$(pkgname)),$(patsubst $(BR2_EXTERNAL_INFIX_PATH)/board/%,%,$(pkgdir))) diff --git a/board/riscv64/Config.in b/board/riscv64/Config.in new file mode 100644 index 00000000..906f84c4 --- /dev/null +++ b/board/riscv64/Config.in @@ -0,0 +1,5 @@ +if BR2_riscv + +# No boards yet in tree, visionfive2 is not integrated + +endif diff --git a/board/riscv64/visionfive2/README.md b/board/riscv64/starfive-visionfive2/README.md similarity index 100% rename from board/riscv64/visionfive2/README.md rename to board/riscv64/starfive-visionfive2/README.md diff --git a/board/riscv64/visionfive2/board.mk b/board/riscv64/starfive-visionfive2/board.mk similarity index 100% rename from board/riscv64/visionfive2/board.mk rename to board/riscv64/starfive-visionfive2/board.mk diff --git a/board/riscv64/visionfive2/genimage.cfg b/board/riscv64/starfive-visionfive2/genimage.cfg similarity index 100% rename from board/riscv64/visionfive2/genimage.cfg rename to board/riscv64/starfive-visionfive2/genimage.cfg diff --git a/board/riscv64/visionfive2/jh7110-starfive-visionfive-2-dtsi.patch b/board/riscv64/starfive-visionfive2/jh7110-starfive-visionfive-2-dtsi.patch similarity index 100% rename from board/riscv64/visionfive2/jh7110-starfive-visionfive-2-dtsi.patch rename to board/riscv64/starfive-visionfive2/jh7110-starfive-visionfive-2-dtsi.patch diff --git a/board/riscv64/visionfive2/uboot/extras.config b/board/riscv64/starfive-visionfive2/uboot/extras.config similarity index 100% rename from board/riscv64/visionfive2/uboot/extras.config rename to board/riscv64/starfive-visionfive2/uboot/extras.config diff --git a/board/riscv64/visionfive2/uboot/visionfive2-env.dtsi b/board/riscv64/starfive-visionfive2/uboot/visionfive2-env.dtsi similarity index 100% rename from board/riscv64/visionfive2/uboot/visionfive2-env.dtsi rename to board/riscv64/starfive-visionfive2/uboot/visionfive2-env.dtsi diff --git a/board/x86_64/Config.in b/board/x86_64/Config.in new file mode 100644 index 00000000..144dba73 --- /dev/null +++ b/board/x86_64/Config.in @@ -0,0 +1,5 @@ +if BR2_x86_64 + +# No boards yet in tree + +endif diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index 22024f10..d0d837f4 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -142,8 +142,8 @@ BR2_PACKAGE_ALDER_ALDER=y BR2_PACKAGE_MARVELL_CN9130_CRB=y BR2_PACKAGE_MARVELL_ESPRESSOBIN=y BR2_PACKAGE_STYX_DCP_SC_28P=y -BR2_PACKAGE_RASPBERRY_PI64=y -BR2_PACKAGE_BANANA_PI_R3=y +BR2_PACKAGE_RASPBERRYPI_RPI64=y +BR2_PACKAGE_BANANAPI_BPI_R3=y BR2_PACKAGE_FEATURE_WIFI_DONGLE_REALTEK=y BR2_PACKAGE_CONFD=y BR2_PACKAGE_CONFD_TEST_MODE=y diff --git a/external.mk b/external.mk index 773e586f..2a4a4874 100644 --- a/external.mk +++ b/external.mk @@ -1,6 +1,7 @@ include $(BR2_EXTERNAL_INFIX_PATH)/infix.mk include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/package/*/*.mk)) include $(BR2_EXTERNAL_INFIX_PATH)/board/common/common.mk +include $(BR2_EXTERNAL_INFIX_PATH)/board/board.mk -include $(BR2_EXTERNAL_INFIX_PATH)/board/$(patsubst "%",%,$(BR2_ARCH))/board.mk include $(BR2_EXTERNAL_INFIX_PATH)/test/test.mk diff --git a/package/Config.in b/package/Config.in index 90636287..e9de36d7 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1,7 +1,6 @@ menu "Packages" comment "Hardware Support" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/package/feature-wifi/Config.in" comment "Software Packages" diff --git a/package/board/Config.in b/package/board/Config.in deleted file mode 100644 index f9a16c68..00000000 --- a/package/board/Config.in +++ /dev/null @@ -1,13 +0,0 @@ -menu "Boards" - -source "$BR2_EXTERNAL_INFIX_PATH/package/board/alder-alder/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/freescale-imx8mp-evk/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/marvell-cn9130-crb/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/marvell-espressobin/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/microchip-sparx5-pcb135/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/styx-dcp-sc-28p/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/raspberry-pi64/Config.in" -source "$BR2_EXTERNAL_INFIX_PATH/package/board/banana-pi-r3/Config.in" - - -endmenu diff --git a/package/board/board.mk b/package/board/board.mk deleted file mode 100644 index 22050631..00000000 --- a/package/board/board.mk +++ /dev/null @@ -1,2 +0,0 @@ -include $(BR2_EXTERNAL_INFIX_PATH)/package/board/ix-board.mk -include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/package/board/*/*.mk)) diff --git a/src/board/raspberry-pi64/post-build.sh b/src/board/raspberry-pi64/post-build.sh deleted file mode 100755 index 8e9d6006..00000000 --- a/src/board/raspberry-pi64/post-build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Armbian firmware installs to /lib/firmware but driver wants the -# file(s) in /lib/firmware/brcm/ -if [ -f "${TARGET_DIR}/lib/firmware/BCM4345C0.hcd" ]; then - mv "${TARGET_DIR}/lib/firmware/BCM4345C0.hcd" "${TARGET_DIR}/lib/firmware/brcm/" -fi From 7784e683475c45970330b52867085aa705185640 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 26 Oct 2025 09:28:28 +0100 Subject: [PATCH 20/27] board/aarch64: bump NanoPi R2S to tier 2 status This commit drops the board specific defconfig in favor of proper BSP support for the FriendlyARM NanoPi R2S to Infix as part of the default Aarch64 build. The name FriendlyARM was elected over FriendlyELEC ("new" name) to be consistent with both kernel and Buildroot naming standards. Signed-off-by: Joachim Wiberg --- board/aarch64/Config.in | 1 + .../aarch64/friendlyarm-nanopi-r2s/Config.in | 9 + board/aarch64/friendlyarm-nanopi-r2s/LICENSE | 13 + .../README.md | 0 .../friendlyarm-nanopi-r2s/dts/Makefile | 1 + .../dts/rockchip/infix.dtsi | 13 + .../dts/rockchip/rk3328-nanopi-r2s.dts | 23 + .../friendlyarm-nanopi-r2s.mk | 78 ++ .../genimage.cfg | 0 .../rk3328-nanopi-r2s-dts.patch | 0 .../etc/factory-config.cfg | 170 +++- .../finit.d/enabled/input-event-daemon.conf | 0 .../etc/finit.d/wan-monitor.conf | 0 .../friendlyarm,nanopi-r2s}/etc/iitod.json | 0 .../etc/input-event-daemon.conf | 0 .../etc/product/init.d/S01-trigger-udev.sh | 3 + .../etc/udev/rules.d/90-persistent-net.rules | 2 +- .../usr/sbin/wan-monitor.sh | 0 .../uboot/extras.config | 0 .../uboot/r2s-env.dtsi | 0 .../friendlyelec/nanopi-r2s/linux_defconfig | 743 ------------------ .../friendlyelec/nanopi-r2s/post-build.sh | 5 - configs/aarch64_defconfig | 5 +- configs/nanopi_r2s_boot_defconfig | 47 ++ configs/r2s_defconfig | 217 ----- 25 files changed, 324 insertions(+), 1006 deletions(-) create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/Config.in create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/LICENSE rename board/aarch64/{friendlyelec/nanopi-r2s => friendlyarm-nanopi-r2s}/README.md (100%) create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/dts/Makefile create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/infix.dtsi create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/rk3328-nanopi-r2s.dts create mode 100644 board/aarch64/friendlyarm-nanopi-r2s/friendlyarm-nanopi-r2s.mk rename board/aarch64/{friendlyelec/nanopi-r2s => friendlyarm-nanopi-r2s}/genimage.cfg (100%) rename board/aarch64/{friendlyelec/nanopi-r2s => friendlyarm-nanopi-r2s}/rk3328-nanopi-r2s-dts.patch (100%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/factory-config.cfg (58%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/finit.d/enabled/input-event-daemon.conf (100%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/finit.d/wan-monitor.conf (100%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/iitod.json (100%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/input-event-daemon.conf (100%) create mode 100755 board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/product/init.d/S01-trigger-udev.sh rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/etc/udev/rules.d/90-persistent-net.rules (72%) rename board/aarch64/{friendlyelec/nanopi-r2s/rootfs => friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s}/usr/sbin/wan-monitor.sh (100%) rename board/aarch64/{friendlyelec/nanopi-r2s => friendlyarm-nanopi-r2s}/uboot/extras.config (100%) rename board/aarch64/{friendlyelec/nanopi-r2s => friendlyarm-nanopi-r2s}/uboot/r2s-env.dtsi (100%) delete mode 100644 board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig delete mode 100755 board/aarch64/friendlyelec/nanopi-r2s/post-build.sh create mode 100644 configs/nanopi_r2s_boot_defconfig delete mode 100644 configs/r2s_defconfig diff --git a/board/aarch64/Config.in b/board/aarch64/Config.in index 4808b6d7..eac6607e 100644 --- a/board/aarch64/Config.in +++ b/board/aarch64/Config.in @@ -3,6 +3,7 @@ if BR2_aarch64 source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/alder-alder/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/bananapi-bpi-r3/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/freescale-imx8mp-evk/Config.in" +source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/friendlyarm-nanopi-r2s/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-cn9130-crb/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/marvell-espressobin/Config.in" source "$BR2_EXTERNAL_INFIX_PATH/board/aarch64/microchip-sparx5-pcb135/Config.in" diff --git a/board/aarch64/friendlyarm-nanopi-r2s/Config.in b/board/aarch64/friendlyarm-nanopi-r2s/Config.in new file mode 100644 index 00000000..bb5b2a4b --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/Config.in @@ -0,0 +1,9 @@ +config BR2_PACKAGE_FRIENDLYARM_NANOPI_R2S + bool "FriendlyElec NanoPi R2S" + depends on BR2_aarch64 + select SDCARD_AUX + select BR2_PACKAGE_INPUT_EVENT_DAEMON + select BR2_PACKAGE_LINUX_FIRMWARE_RTL_815X + help + FriendlyElec NanoPi R2S is a compact router board based on + the Rockchip RK3328 SoC with dual Gigabit Ethernet ports. diff --git a/board/aarch64/friendlyarm-nanopi-r2s/LICENSE b/board/aarch64/friendlyarm-nanopi-r2s/LICENSE new file mode 100644 index 00000000..01952175 --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2025 The KernelKit Authors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/board/aarch64/friendlyelec/nanopi-r2s/README.md b/board/aarch64/friendlyarm-nanopi-r2s/README.md similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/README.md rename to board/aarch64/friendlyarm-nanopi-r2s/README.md diff --git a/board/aarch64/friendlyarm-nanopi-r2s/dts/Makefile b/board/aarch64/friendlyarm-nanopi-r2s/dts/Makefile new file mode 100644 index 00000000..22365b25 --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/dts/Makefile @@ -0,0 +1 @@ +dtb-y += rockchip/rk3328-nanopi-r2s.dtb diff --git a/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/infix.dtsi b/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/infix.dtsi new file mode 100644 index 00000000..16cfafc8 --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/infix.dtsi @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Common Infix OS defaults + */ + +/ { + chosen { + infix { + /* Default admin user password: 'admin' */ + factory-password-hash = "$5$mI/zpOAqZYKLC2WU$i7iPzZiIjOjrBF3NyftS9CCq8dfYwHwrmUK097Jca9A"; + }; + }; +}; diff --git a/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/rk3328-nanopi-r2s.dts b/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/rk3328-nanopi-r2s.dts new file mode 100644 index 00000000..15bfef2e --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/dts/rockchip/rk3328-nanopi-r2s.dts @@ -0,0 +1,23 @@ +#include +#include "infix.dtsi" + +&rtl8153 { + /* + * Fix port number: device is on port 1, not port 2 + * + * The kernel's usb_of_get_connect_type() function checks for child + * nodes with a 'reg' property matching the physical port number to + * determine if a USB port is "hard-wired" (internal) vs external. + * With authorized_default=2, only hard-wired ports are automatically + * authorized. The RTL8153 shows up as device 3-1 (hub 3, port 1), so + * reg must be <1> for the kernel to mark it as USB_PORT_CONNECT_TYPE_HARD_WIRED + * and authorize it automatically at boot. + */ + reg = <1>; +}; + +&{/chosen/infix} { + /* Expose only the external USB 2.0 port for user management */ + usb-ports = <&usb_host0_ehci>; + usb-port-names = "USB"; +}; diff --git a/board/aarch64/friendlyarm-nanopi-r2s/friendlyarm-nanopi-r2s.mk b/board/aarch64/friendlyarm-nanopi-r2s/friendlyarm-nanopi-r2s.mk new file mode 100644 index 00000000..24ecbd6c --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/friendlyarm-nanopi-r2s.mk @@ -0,0 +1,78 @@ +define FRIENDLYARM_NANOPI_R2S_LINUX_CONFIG_FIXUPS + # Rockchip RK3328 SoC + $(call KCONFIG_ENABLE_OPT,CONFIG_ARCH_ROCKCHIP) + $(call KCONFIG_ENABLE_OPT,CONFIG_ROCKCHIP_IOMMU) + $(call KCONFIG_ENABLE_OPT,CONFIG_ROCKCHIP_PM_DOMAINS) + $(call KCONFIG_ENABLE_OPT,CONFIG_ROCKCHIP_IODOMAIN) + + # PHY drivers + $(call KCONFIG_ENABLE_OPT,CONFIG_PHY_ROCKCHIP_EMMC) + $(call KCONFIG_ENABLE_OPT,CONFIG_PHY_ROCKCHIP_INNO_USB2) + $(call KCONFIG_ENABLE_OPT,CONFIG_PHY_ROCKCHIP_TYPEC) + $(call KCONFIG_SET_OPT,CONFIG_PHY_ROCKCHIP_USB,m) + $(call KCONFIG_SET_OPT,CONFIG_PHY_ROCKCHIP_PCIE,m) + $(call KCONFIG_ENABLE_OPT,CONFIG_ROCKCHIP_PHY) + + # Clocks and Power Management + $(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_ROCKCHIP) + $(call KCONFIG_ENABLE_OPT,CONFIG_CLK_RK3328) + $(call KCONFIG_ENABLE_OPT,CONFIG_COMMON_CLK_PWM) + $(call KCONFIG_ENABLE_OPT,CONFIG_PWM_ROCKCHIP) + $(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR_GPIO) + $(call KCONFIG_ENABLE_OPT,CONFIG_REGULATOR_RK808) + $(call KCONFIG_ENABLE_OPT,CONFIG_CHARGER_RK817) + $(call KCONFIG_ENABLE_OPT,CONFIG_PINCTRL_RK805) + + # I2C Controller + $(call KCONFIG_ENABLE_OPT,CONFIG_I2C_RK3X) + + # I2C/SPI/MFD + $(call KCONFIG_ENABLE_OPT,CONFIG_MFD_RK8XX_I2C) + $(call KCONFIG_ENABLE_OPT,CONFIG_MFD_RK8XX_SPI) + $(call KCONFIG_ENABLE_OPT,CONFIG_SPI_ROCKCHIP) + $(call KCONFIG_ENABLE_OPT,CONFIG_INPUT_RK805_PWRKEY) + $(call KCONFIG_ENABLE_OPT,CONFIG_RTC_DRV_RK808) + + # MMC/Storage + $(call KCONFIG_ENABLE_OPT,CONFIG_MMC_DW_ROCKCHIP) + + # PCIe + $(call KCONFIG_SET_OPT,CONFIG_PCIE_ROCKCHIP_HOST,m) + $(call KCONFIG_ENABLE_OPT,CONFIG_PCIE_ROCKCHIP_DW_HOST) + + # Thermal and ADC + $(call KCONFIG_SET_OPT,CONFIG_ROCKCHIP_THERMAL,m) + $(call KCONFIG_SET_OPT,CONFIG_ROCKCHIP_SARADC,m) + + # Crypto + $(call KCONFIG_ENABLE_OPT,CONFIG_CRYPTO_DEV_ROCKCHIP) + + # NVMEM + $(call KCONFIG_SET_OPT,CONFIG_NVMEM_ROCKCHIP_EFUSE,m) + $(call KCONFIG_SET_OPT,CONFIG_NVMEM_ROCKCHIP_OTP,m) + + # Network: STMMAC Ethernet (WAN port - RK3328 GMAC with RTL8211E PHY) + $(call KCONFIG_ENABLE_OPT,CONFIG_NET_VENDOR_STMICRO) + $(call KCONFIG_ENABLE_OPT,CONFIG_STMMAC_ETH) + $(call KCONFIG_ENABLE_OPT,CONFIG_STMMAC_PLATFORM) + $(call KCONFIG_ENABLE_OPT,CONFIG_DWMAC_ROCKCHIP) + $(call KCONFIG_ENABLE_OPT,CONFIG_REALTEK_PHY) + + # Network: USB Ethernet (LAN port - RTL8153 via USB 3.0) + $(call KCONFIG_SET_OPT,CONFIG_USB_NET_DRIVERS,m) + $(call KCONFIG_SET_OPT,CONFIG_USB_RTL8152,m) + + # USB 3.0 xHCI Controller (required for RTL8153 LAN port) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_XHCI_HCD) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_XHCI_PLATFORM) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_DWC3) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_DWC3_HOST) + + # USB 2.0 Host + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_EHCI_HCD) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_EHCI_HCD_PLATFORM) + $(call KCONFIG_ENABLE_OPT,CONFIG_USB_EHCI_ROOT_HUB_TT) +endef + +$(eval $(ix-board)) +$(eval $(generic-package)) diff --git a/board/aarch64/friendlyelec/nanopi-r2s/genimage.cfg b/board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/genimage.cfg rename to board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rk3328-nanopi-r2s-dts.patch b/board/aarch64/friendlyarm-nanopi-r2s/rk3328-nanopi-r2s-dts.patch similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rk3328-nanopi-r2s-dts.patch rename to board/aarch64/friendlyarm-nanopi-r2s/rk3328-nanopi-r2s-dts.patch diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/factory-config.cfg b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg similarity index 58% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/factory-config.cfg rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg index 61d10305..eca53da5 100644 --- a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/factory-config.cfg +++ b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg @@ -2,8 +2,39 @@ "ieee802-dot1ab-lldp:lldp": { "infix-lldp:enabled": true }, + "ietf-hardware:hardware": { + "component": [ + { + "class": "infix-hardware:usb", + "name": "USB", + "state": { + "admin-state": "unlocked" + } + } + ] + }, "ietf-interfaces:interfaces": { "interface": [ + { + "name": "br0", + "type": "infix-if-type:bridge", + "ietf-ip:ipv4": { + "address": [ + { + "ip": "192.168.0.1", + "prefix-length": 24 + } + ] + } + }, + { + "name": "lan", + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {}, + "infix-interfaces:bridge-port": { + "bridge": "br0" + } + }, { "name": "lo", "type": "infix-if-type:loopback", @@ -24,38 +55,26 @@ ] } }, - { - "name": "lan", - "type": "infix-if-type:ethernet", - "ietf-ip:ipv4": { - "address": [ - { - "ip": "192.168.2.1", - "prefix-length": 24 - } - ] - }, - "ietf-ip:ipv6": {} - }, { "name": "wan", - "type": "infix-if-type:ethernet" + "type": "infix-if-type:ethernet", + "ietf-ip:ipv6": {} } ] }, "ietf-keystore:keystore": { - "asymmetric-keys": { - "asymmetric-key": [ - { - "name": "genkey", - "public-key-format": "ietf-crypto-types:ssh-public-key-format", - "public-key": "", - "private-key-format": "ietf-crypto-types:rsa-private-key-format", - "cleartext-private-key": "", - "certificates": {} + "asymmetric-keys": { + "asymmetric-key": [ + { + "name": "genkey", + "public-key-format": "infix-crypto-types:ssh-public-key-format", + "public-key": "", + "private-key-format": "infix-crypto-types:rsa-private-key-format", + "cleartext-private-key": "", + "certificates": {} + } + ] } - ] - } }, "ietf-netconf-acm:nacm": { "enable-nacm": true, @@ -92,7 +111,7 @@ ], "rule": [ { - "name": "deny-password-read", + "name": "deny-password-read", "module-name": "ietf-system", "path": "/ietf-system:system/authentication/user/password", "access-operations": "*", @@ -133,14 +152,12 @@ "ietf-system:system": { "hostname": "r2s", "ntp": { - "enabled": true, "server": [ { - "name": "ntp.org", + "name": "default", "udp": { "address": "pool.ntp.org" - }, - "iburst": true + } } ] }, @@ -161,36 +178,113 @@ "if-name": "wan", "option": [ { - "name": "broadcast" + "id": "ntp-server" }, { - "name": "dns" + "id": "broadcast" }, { - "name": "domain" + "id": "domain" }, { - "name": "hostname" + "id": "hostname" }, { - "name": "ntpsrv" + "id": "dns-server" }, { - "name": "router" + "id": "router" }, { - "name": "subnet" + "id": "netmask" } ] } ] }, + "infix-dhcp-server:dhcp-server": { + "option": [ + { + "id": "ntp-server", + "address": "auto" + }, + { + "id": "dns-server", + "address": "auto" + }, + { + "id": "router", + "address": "auto" + } + ], + "subnet": [ + { + "subnet": "192.168.0.0/24", + "pool": { + "start-address": "192.168.0.100", + "end-address": "192.168.0.250" + } + } + ] + }, + "infix-firewall:firewall": { + "default": "wan", + "zone": [ + { + "name": "lan", + "action": "accept", + "interface": [ + "br0" + ] + }, + { + "name": "wan", + "action": "drop", + "interface": [ + "wan" + ], + "service": [ + "dhcpv6-client" + ] + } + ], + "policy": [ + { + "name": "lan-to-wan", + "ingress": [ + "lan" + ], + "egress": [ + "wan" + ], + "masquerade": true + } + ] + }, "infix-meta:meta": { - "infix-meta:version": "1.2" + "version": "1.5" }, "infix-services:mdns": { "enabled": true }, + "infix-services:ssh": { + "enabled": true, + "hostkey": [ + "genkey" + ], + "listen": [ + { + "name": "ipv4", + "address": "0.0.0.0", + "port": 22 + }, + { + "name": "ipv6", + "address": "::", + "port": 22 + } + ] + }, "infix-services:web": { "enabled": true, "console": { diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/finit.d/enabled/input-event-daemon.conf similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/enabled/input-event-daemon.conf rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/finit.d/enabled/input-event-daemon.conf diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/wan-monitor.conf b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/finit.d/wan-monitor.conf similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/finit.d/wan-monitor.conf rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/finit.d/wan-monitor.conf diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/iitod.json b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/iitod.json similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/iitod.json rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/iitod.json diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/input-event-daemon.conf b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/input-event-daemon.conf similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/input-event-daemon.conf rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/input-event-daemon.conf diff --git a/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/product/init.d/S01-trigger-udev.sh b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/product/init.d/S01-trigger-udev.sh new file mode 100755 index 00000000..facaccd1 --- /dev/null +++ b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/product/init.d/S01-trigger-udev.sh @@ -0,0 +1,3 @@ +#!/bin/sh +udevadm control --reload-rules +udevadm trigger --subsystem-match=net --action=add diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/udev/rules.d/90-persistent-net.rules similarity index 72% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/udev/rules.d/90-persistent-net.rules index ab603dde..7929a454 100644 --- a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/etc/udev/rules.d/90-persistent-net.rules +++ b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/udev/rules.d/90-persistent-net.rules @@ -1,2 +1,2 @@ ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff540000.ethernet/net/eth0", NAME="wan" -ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff600000.usb/xhci-hcd.0.auto/usb3/3-1/3-1:1.0/net/*", NAME="lan" +ACTION=="add", SUBSYSTEM=="net", DEVPATH=="/devices/platform/ff600000.usb/xhci-hcd.0.auto/usb5/5-1/5-1:1.0/net/*", NAME="lan" diff --git a/board/aarch64/friendlyelec/nanopi-r2s/rootfs/usr/sbin/wan-monitor.sh b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/usr/sbin/wan-monitor.sh similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/rootfs/usr/sbin/wan-monitor.sh rename to board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/usr/sbin/wan-monitor.sh diff --git a/board/aarch64/friendlyelec/nanopi-r2s/uboot/extras.config b/board/aarch64/friendlyarm-nanopi-r2s/uboot/extras.config similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/uboot/extras.config rename to board/aarch64/friendlyarm-nanopi-r2s/uboot/extras.config diff --git a/board/aarch64/friendlyelec/nanopi-r2s/uboot/r2s-env.dtsi b/board/aarch64/friendlyarm-nanopi-r2s/uboot/r2s-env.dtsi similarity index 100% rename from board/aarch64/friendlyelec/nanopi-r2s/uboot/r2s-env.dtsi rename to board/aarch64/friendlyarm-nanopi-r2s/uboot/r2s-env.dtsi diff --git a/board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig b/board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig deleted file mode 100644 index 02edbd1f..00000000 --- a/board/aarch64/friendlyelec/nanopi-r2s/linux_defconfig +++ /dev/null @@ -1,743 +0,0 @@ -CONFIG_SYSVIPC=y -CONFIG_POSIX_MQUEUE=y -CONFIG_AUDIT=y -CONFIG_NO_HZ_IDLE=y -CONFIG_HIGH_RES_TIMERS=y -CONFIG_BPF_SYSCALL=y -CONFIG_BPF_JIT=y -CONFIG_PREEMPT=y -CONFIG_IRQ_TIME_ACCOUNTING=y -CONFIG_BSD_PROCESS_ACCT=y -CONFIG_BSD_PROCESS_ACCT_V3=y -CONFIG_TASKSTATS=y -CONFIG_TASK_DELAY_ACCT=y -CONFIG_TASK_XACCT=y -CONFIG_PSI=y -CONFIG_IKCONFIG=y -CONFIG_IKCONFIG_PROC=y -CONFIG_LOG_BUF_SHIFT=18 -CONFIG_MEMCG=y -CONFIG_BLK_CGROUP=y -CONFIG_CFS_BANDWIDTH=y -CONFIG_RT_GROUP_SCHED=y -CONFIG_CGROUP_PIDS=y -CONFIG_CGROUP_FREEZER=y -CONFIG_CGROUP_HUGETLB=y -CONFIG_CPUSETS=y -CONFIG_CGROUP_DEVICE=y -CONFIG_CGROUP_CPUACCT=y -CONFIG_CGROUP_PERF=y -CONFIG_CGROUP_BPF=y -CONFIG_NAMESPACES=y -CONFIG_USER_NS=y -CONFIG_SCHED_AUTOGROUP=y -CONFIG_BLK_DEV_INITRD=y -CONFIG_EXPERT=y -CONFIG_KALLSYMS_ALL=y -CONFIG_PROFILING=y -CONFIG_KEXEC_FILE=y -CONFIG_ARCH_ROCKCHIP=y -CONFIG_ARM64_VA_BITS_48=y -CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y -CONFIG_NR_CPUS=8 -CONFIG_COMPAT=y -CONFIG_RANDOMIZE_BASE=y -# CONFIG_SUSPEND is not set -CONFIG_ARM_PSCI_CPUIDLE=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=m -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m -CONFIG_CPUFREQ_DT=y -CONFIG_ARM_SCMI_CPUFREQ=y -CONFIG_ACPI_CPPC_CPUFREQ=m -CONFIG_ACPI=y -CONFIG_ACPI_APEI=y -CONFIG_ACPI_APEI_GHES=y -CONFIG_ACPI_APEI_MEMORY_FAILURE=y -CONFIG_ACPI_APEI_EINJ=y -CONFIG_VIRTUALIZATION=y -CONFIG_KVM=y -CONFIG_KPROBES=y -CONFIG_JUMP_LABEL=y -# CONFIG_GCC_PLUGINS is not set -CONFIG_MODULES=y -CONFIG_MODULE_UNLOAD=y -# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set -# CONFIG_COMPAT_BRK is not set -CONFIG_KSM=y -CONFIG_MEMORY_FAILURE=y -CONFIG_TRANSPARENT_HUGEPAGE=y -CONFIG_CMA=y -CONFIG_CMA_AREAS=20 -CONFIG_NET=y -CONFIG_PACKET=y -CONFIG_XDP_SOCKETS=y -CONFIG_XDP_SOCKETS_DIAG=y -CONFIG_IP_MULTICAST=y -CONFIG_IP_ADVANCED_ROUTER=y -CONFIG_IP_MULTIPLE_TABLES=y -CONFIG_IP_ROUTE_MULTIPATH=y -CONFIG_IP_PNP=y -CONFIG_IP_PNP_DHCP=y -CONFIG_IP_PNP_BOOTP=y -CONFIG_NET_IPIP=m -CONFIG_NET_IPGRE_DEMUX=m -CONFIG_NET_IPGRE=m -CONFIG_NET_IPGRE_BROADCAST=y -CONFIG_IP_MROUTE=y -CONFIG_IP_MROUTE_MULTIPLE_TABLES=y -CONFIG_IP_PIMSM_V1=y -CONFIG_IP_PIMSM_V2=y -CONFIG_SYN_COOKIES=y -CONFIG_IPV6_SIT=m -CONFIG_IPV6_GRE=m -CONFIG_IPV6_MULTIPLE_TABLES=y -CONFIG_IPV6_SUBTREES=y -CONFIG_IPV6_MROUTE=y -CONFIG_IPV6_MROUTE_MULTIPLE_TABLES=y -CONFIG_IPV6_PIMSM_V2=y -CONFIG_NETWORK_PHY_TIMESTAMPING=y -CONFIG_NETFILTER=y -CONFIG_BRIDGE_NETFILTER=y -CONFIG_NETFILTER_NETLINK_QUEUE=y -CONFIG_NETFILTER_NETLINK_LOG=y -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_FTP=y -CONFIG_NF_TABLES=y -CONFIG_NF_TABLES_INET=y -CONFIG_NF_TABLES_NETDEV=y -CONFIG_NFT_CT=m -CONFIG_NFT_CONNLIMIT=m -CONFIG_NFT_LOG=m -CONFIG_NFT_LIMIT=m -CONFIG_NFT_MASQ=m -CONFIG_NFT_REDIR=m -CONFIG_NFT_NAT=m -CONFIG_NFT_TUNNEL=m -CONFIG_NFT_QUEUE=m -CONFIG_NFT_REJECT=m -CONFIG_NFT_COMPAT=m -CONFIG_NFT_HASH=m -CONFIG_NFT_SOCKET=m -CONFIG_NFT_OSF=m -CONFIG_NFT_DUP_NETDEV=m -CONFIG_NFT_FWD_NETDEV=m -CONFIG_NFT_REJECT_NETDEV=m -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m -CONFIG_NETFILTER_XT_TARGET_LOG=m -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m -CONFIG_NETFILTER_XT_MATCH_BPF=m -CONFIG_NETFILTER_XT_MATCH_CGROUP=m -CONFIG_NETFILTER_XT_MATCH_COMMENT=m -CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m -CONFIG_NETFILTER_XT_MATCH_CONNMARK=m -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m -CONFIG_NETFILTER_XT_MATCH_DSCP=m -CONFIG_NETFILTER_XT_MATCH_HELPER=m -CONFIG_NETFILTER_XT_MATCH_LIMIT=m -CONFIG_NETFILTER_XT_MATCH_MAC=m -CONFIG_NETFILTER_XT_MATCH_MARK=m -CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m -CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m -CONFIG_IP_NF_IPTABLES=m -CONFIG_IP_NF_FILTER=m -CONFIG_IP_NF_TARGET_REJECT=m -CONFIG_IP_NF_NAT=m -CONFIG_IP_NF_TARGET_MASQUERADE=m -CONFIG_IP_NF_MANGLE=m -CONFIG_IP6_NF_IPTABLES=m -CONFIG_IP6_NF_MATCH_AH=m -CONFIG_IP6_NF_MATCH_EUI64=m -CONFIG_IP6_NF_MATCH_IPV6HEADER=m -CONFIG_IP6_NF_FILTER=m -CONFIG_IP6_NF_TARGET_REJECT=m -CONFIG_IP6_NF_MANGLE=m -CONFIG_IP6_NF_RAW=m -CONFIG_IP6_NF_NAT=m -CONFIG_IP6_NF_TARGET_MASQUERADE=m -CONFIG_IP6_NF_TARGET_NPT=m -CONFIG_NF_TABLES_BRIDGE=m -CONFIG_NFT_BRIDGE_META=m -CONFIG_NFT_BRIDGE_REJECT=m -CONFIG_NF_CONNTRACK_BRIDGE=y -CONFIG_BRIDGE_NF_EBTABLES=m -CONFIG_BRIDGE_EBT_BROUTE=m -CONFIG_BRIDGE_EBT_T_FILTER=m -CONFIG_BRIDGE_EBT_T_NAT=m -CONFIG_BRIDGE_EBT_802_3=m -CONFIG_BRIDGE_EBT_AMONG=m -CONFIG_BRIDGE_EBT_ARP=m -CONFIG_BRIDGE_EBT_IP=m -CONFIG_BRIDGE_EBT_IP6=m -CONFIG_BRIDGE_EBT_LIMIT=m -CONFIG_BRIDGE_EBT_MARK=m -CONFIG_BRIDGE_EBT_PKTTYPE=m -CONFIG_BRIDGE_EBT_STP=m -CONFIG_BRIDGE_EBT_VLAN=m -CONFIG_BRIDGE_EBT_ARPREPLY=m -CONFIG_BRIDGE_EBT_DNAT=m -CONFIG_BRIDGE_EBT_MARK_T=m -CONFIG_BRIDGE_EBT_REDIRECT=m -CONFIG_BRIDGE_EBT_SNAT=m -CONFIG_BRIDGE_EBT_LOG=m -CONFIG_BRIDGE_EBT_NFLOG=m -CONFIG_BRIDGE=y -CONFIG_BRIDGE_VLAN_FILTERING=y -CONFIG_BRIDGE_MRP=y -CONFIG_BRIDGE_CFM=y -CONFIG_VLAN_8021Q=y -CONFIG_VLAN_8021Q_GVRP=y -CONFIG_VLAN_8021Q_MVRP=y -CONFIG_NET_SCHED=y -CONFIG_NET_SCH_CBS=m -CONFIG_NET_SCH_ETF=m -CONFIG_NET_SCH_TAPRIO=m -CONFIG_NET_SCH_MQPRIO=m -CONFIG_NET_SCH_INGRESS=m -CONFIG_NET_CLS_BASIC=m -CONFIG_NET_CLS_BPF=m -CONFIG_NET_CLS_FLOWER=m -CONFIG_NET_CLS_ACT=y -CONFIG_NET_ACT_GACT=y -CONFIG_NET_ACT_MIRRED=y -CONFIG_NET_ACT_NAT=y -CONFIG_NET_ACT_SKBEDIT=y -CONFIG_NET_ACT_VLAN=y -CONFIG_NET_ACT_BPF=y -CONFIG_DCB=y -CONFIG_NETLINK_DIAG=y -CONFIG_MPLS=y -CONFIG_NET_MPLS_GSO=y -CONFIG_MPLS_ROUTING=m -CONFIG_NET_PKTGEN=y -CONFIG_BT=m -# CONFIG_BT_LE is not set -CONFIG_BT_LEDS=y -# CONFIG_BT_DEBUGFS is not set -CONFIG_BT_HCIBTUSB=m -CONFIG_BT_HCIUART=m -CONFIG_BT_HCIUART_LL=y -CONFIG_BT_HCIUART_BCM=y -CONFIG_BT_HCIUART_QCA=y -CONFIG_CFG80211=y -CONFIG_MAC80211=y -CONFIG_MAC80211_LEDS=y -CONFIG_RFKILL=y -CONFIG_NET_9P=y -CONFIG_NET_9P_VIRTIO=y -CONFIG_PCI=y -CONFIG_PCIEPORTBUS=y -CONFIG_PCI_IOV=y -CONFIG_PCI_PASID=y -CONFIG_HOTPLUG_PCI=y -CONFIG_HOTPLUG_PCI_ACPI=y -CONFIG_PCI_HOST_GENERIC=y -CONFIG_PCIE_ROCKCHIP_HOST=m -CONFIG_PCIE_ROCKCHIP_DW_HOST=y -CONFIG_PCI_ENDPOINT=y -CONFIG_PCI_ENDPOINT_CONFIGFS=y -CONFIG_PCI_EPF_TEST=m -CONFIG_DEVTMPFS=y -CONFIG_DEVTMPFS_MOUNT=y -CONFIG_FW_LOADER_USER_HELPER=y -CONFIG_VEXPRESS_CONFIG=y -CONFIG_ARM_SCMI_PROTOCOL=y -CONFIG_ARM_SCPI_PROTOCOL=y -CONFIG_EFI_CAPSULE_LOADER=y -CONFIG_MTD=y -CONFIG_MTD_BLOCK=y -CONFIG_MTD_CFI=y -CONFIG_MTD_CFI_ADV_OPTIONS=y -CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_CFI_STAA=y -CONFIG_MTD_PHYSMAP=y -CONFIG_MTD_PHYSMAP_OF=y -CONFIG_MTD_DATAFLASH=y -CONFIG_MTD_SST25L=y -CONFIG_MTD_BLOCK2MTD=y -CONFIG_MTD_RAW_NAND=y -CONFIG_MTD_NAND_DENALI_DT=y -CONFIG_MTD_SPI_NOR=y -CONFIG_OF_OVERLAY=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BLK_DEV_NBD=m -CONFIG_VIRTIO_BLK=y -CONFIG_BLK_DEV_NVME=m -CONFIG_SRAM=y -CONFIG_PCI_ENDPOINT_TEST=m -CONFIG_EEPROM_AT24=m -CONFIG_EEPROM_AT25=m -CONFIG_UACCE=m -# CONFIG_SCSI_PROC_FS is not set -CONFIG_BLK_DEV_SD=y -CONFIG_SCSI_SAS_ATA=y -CONFIG_SCSI_HISI_SAS=y -CONFIG_SCSI_HISI_SAS_PCI=y -CONFIG_MEGARAID_SAS=y -CONFIG_SCSI_MPT3SAS=m -CONFIG_SCSI_VIRTIO=y -CONFIG_ATA=y -CONFIG_SATA_AHCI=y -CONFIG_SATA_AHCI_PLATFORM=y -CONFIG_AHCI_CEVA=y -CONFIG_SATA_SIL24=y -CONFIG_PATA_OF_PLATFORM=y -CONFIG_MD=y -# CONFIG_MD_BITMAP_FILE is not set -CONFIG_BLK_DEV_DM=y -CONFIG_DM_INIT=y -CONFIG_DM_VERITY=y -CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG=y -CONFIG_NETDEVICES=y -CONFIG_BONDING=m -CONFIG_DUMMY=m -CONFIG_WIREGUARD=m -CONFIG_MACVLAN=m -CONFIG_MACVTAP=m -CONFIG_IPVLAN=m -CONFIG_IPVTAP=m -CONFIG_VXLAN=m -CONFIG_GENEVE=m -CONFIG_BAREUDP=m -CONFIG_MACSEC=m -CONFIG_TUN=m -CONFIG_VETH=m -CONFIG_VIRTIO_NET=y -CONFIG_NLMON=y -CONFIG_NET_VRF=y -# CONFIG_NET_VENDOR_3COM is not set -# CONFIG_NET_VENDOR_ADAPTEC is not set -# CONFIG_NET_VENDOR_AGERE is not set -# CONFIG_NET_VENDOR_ALACRITECH is not set -# CONFIG_NET_VENDOR_ALTEON is not set -# CONFIG_NET_VENDOR_AMAZON is not set -# CONFIG_NET_VENDOR_AMD is not set -# CONFIG_NET_VENDOR_AQUANTIA is not set -# CONFIG_NET_VENDOR_ARC is not set -# CONFIG_NET_VENDOR_ASIX is not set -CONFIG_ATL2=m -CONFIG_ALX=m -# CONFIG_NET_VENDOR_BROADCOM is not set -# CONFIG_NET_VENDOR_CADENCE is not set -# CONFIG_NET_VENDOR_CAVIUM is not set -# CONFIG_NET_VENDOR_CHELSIO is not set -# CONFIG_NET_VENDOR_CISCO is not set -# CONFIG_NET_VENDOR_CORTINA is not set -# CONFIG_NET_VENDOR_DEC is not set -# CONFIG_NET_VENDOR_DLINK is not set -# CONFIG_NET_VENDOR_EMULEX is not set -# CONFIG_NET_VENDOR_EZCHIP is not set -# CONFIG_NET_VENDOR_GOOGLE is not set -# CONFIG_NET_VENDOR_HISILICON is not set -# CONFIG_NET_VENDOR_HUAWEI is not set -# CONFIG_NET_VENDOR_INTEL is not set -# CONFIG_NET_VENDOR_LITEX is not set -# CONFIG_NET_VENDOR_MARVELL is not set -# CONFIG_NET_VENDOR_MELLANOX is not set -# CONFIG_NET_VENDOR_MICREL is not set -# CONFIG_NET_VENDOR_MICROCHIP is not set -# CONFIG_NET_VENDOR_MICROSEMI is not set -# CONFIG_NET_VENDOR_MICROSOFT is not set -# CONFIG_NET_VENDOR_MYRI is not set -# CONFIG_NET_VENDOR_NI is not set -# CONFIG_NET_VENDOR_NATSEMI is not set -# CONFIG_NET_VENDOR_NETERION is not set -# CONFIG_NET_VENDOR_NETRONOME is not set -# CONFIG_NET_VENDOR_NVIDIA is not set -# CONFIG_NET_VENDOR_OKI is not set -# CONFIG_NET_VENDOR_PACKET_ENGINES is not set -# CONFIG_NET_VENDOR_PENSANDO is not set -# CONFIG_NET_VENDOR_QLOGIC is not set -# CONFIG_NET_VENDOR_BROCADE is not set -# CONFIG_NET_VENDOR_QUALCOMM is not set -# CONFIG_NET_VENDOR_RDC is not set -CONFIG_8139CP=m -CONFIG_8139TOO=m -# CONFIG_8139TOO_PIO is not set -CONFIG_R8169=m -# CONFIG_NET_VENDOR_RENESAS is not set -# CONFIG_NET_VENDOR_ROCKER is not set -# CONFIG_NET_VENDOR_SAMSUNG is not set -# CONFIG_NET_VENDOR_SEEQ is not set -# CONFIG_NET_VENDOR_SILAN is not set -# CONFIG_NET_VENDOR_SIS is not set -# CONFIG_NET_VENDOR_SOLARFLARE is not set -# CONFIG_NET_VENDOR_SMSC is not set -# CONFIG_NET_VENDOR_SOCIONEXT is not set -CONFIG_STMMAC_ETH=y -# CONFIG_DWMAC_GENERIC is not set -# CONFIG_NET_VENDOR_SUN is not set -# CONFIG_NET_VENDOR_SYNOPSYS is not set -# CONFIG_NET_VENDOR_TEHUTI is not set -# CONFIG_NET_VENDOR_TI is not set -# CONFIG_NET_VENDOR_VIA is not set -# CONFIG_NET_VENDOR_WIZNET is not set -# CONFIG_NET_VENDOR_XILINX is not set -CONFIG_LED_TRIGGER_PHY=y -CONFIG_AX88796B_PHY=y -CONFIG_DAVICOM_PHY=m -CONFIG_REALTEK_PHY=y -CONFIG_ROCKCHIP_PHY=y -CONFIG_MDIO_BITBANG=y -CONFIG_MDIO_BUS_MUX_MULTIPLEXER=y -CONFIG_MDIO_BUS_MUX_MMIOREG=y -CONFIG_USB_RTL8150=m -CONFIG_USB_RTL8152=m -CONFIG_USB_USBNET=y -CONFIG_USB_NET_AX8817X=m -CONFIG_USB_NET_AX88179_178A=m -CONFIG_USB_NET_CDC_NCM=m -CONFIG_USB_NET_DM9601=m -CONFIG_USB_NET_SMSC75XX=m -CONFIG_USB_NET_SMSC95XX=m -CONFIG_USB_NET_NET1080=m -CONFIG_USB_NET_PLUSB=m -CONFIG_USB_NET_MCS7830=m -CONFIG_USB_NET_CDC_SUBSET=m -# CONFIG_USB_NET_ZAURUS is not set -CONFIG_ATH10K=m -CONFIG_ATH10K_PCI=m -CONFIG_WCN36XX=m -# CONFIG_WLAN_VENDOR_ATMEL is not set -# CONFIG_WLAN_VENDOR_BROADCOM is not set -# CONFIG_WLAN_VENDOR_INTEL is not set -# CONFIG_WLAN_VENDOR_INTERSIL is not set -# CONFIG_WLAN_VENDOR_MARVELL is not set -# CONFIG_WLAN_VENDOR_MEDIATEK is not set -CONFIG_RTL8180=m -CONFIG_RTL8187=m -CONFIG_RTL_CARDS=m -CONFIG_RTL8192CE=m -CONFIG_RTL8192SE=m -CONFIG_RTL8192DE=m -CONFIG_RTL8723AE=m -CONFIG_RTL8723BE=m -CONFIG_RTL8188EE=m -CONFIG_RTL8192EE=m -CONFIG_RTL8821AE=m -CONFIG_RTL8192CU=m -CONFIG_RTL8XXXU=m -CONFIG_RTL8XXXU_UNTESTED=y -CONFIG_RTW88=m -CONFIG_RTW88_8822BE=m -CONFIG_RTW88_8822BS=m -CONFIG_RTW88_8822BU=m -CONFIG_RTW88_8822CE=m -CONFIG_RTW88_8822CS=m -CONFIG_RTW88_8822CU=m -CONFIG_RTW88_8723DE=m -CONFIG_RTW88_8723DS=m -CONFIG_RTW88_8723DU=m -CONFIG_RTW88_8821CE=m -CONFIG_RTW88_8821CS=m -CONFIG_RTW88_8821CU=m -CONFIG_RTW88_DEBUG=y -CONFIG_RTW89=m -CONFIG_RTW89_8851BE=m -CONFIG_RTW89_8852AE=m -CONFIG_RTW89_8852BE=m -CONFIG_RTW89_8852CE=m -CONFIG_RTW89_DEBUGMSG=y -# CONFIG_WLAN_VENDOR_RSI is not set -# CONFIG_WLAN_VENDOR_TI is not set -# CONFIG_WLAN_VENDOR_ZYDAS is not set -# CONFIG_WLAN_VENDOR_QUANTENNA is not set -CONFIG_INPUT_FF_MEMLESS=y -CONFIG_INPUT_EVDEV=y -CONFIG_INPUT_EVBUG=y -CONFIG_KEYBOARD_GPIO=y -CONFIG_KEYBOARD_GPIO_POLLED=y -# CONFIG_INPUT_MOUSE is not set -CONFIG_INPUT_MISC=y -CONFIG_INPUT_RK805_PWRKEY=y -# CONFIG_SERIO_SERPORT is not set -CONFIG_SERIO_AMBAKMI=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_LEGACY_PTY_COUNT=16 -CONFIG_SERIAL_8250=y -CONFIG_SERIAL_8250_CONSOLE=y -CONFIG_SERIAL_8250_EXTENDED=y -CONFIG_SERIAL_8250_SHARE_IRQ=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_RT288X=y -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIAL_AMBA_PL010=y -CONFIG_SERIAL_AMBA_PL010_CONSOLE=y -CONFIG_SERIAL_AMBA_PL011=y -CONFIG_SERIAL_AMBA_PL011_CONSOLE=y -CONFIG_SERIAL_DEV_BUS=y -CONFIG_VIRTIO_CONSOLE=y -CONFIG_HW_RANDOM_VIRTIO=m -CONFIG_TCG_TPM=y -CONFIG_TCG_TIS_I2C_INFINEON=y -CONFIG_I2C=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_MUX=y -CONFIG_I2C_MUX_PCA954x=y -CONFIG_I2C_GPIO=m -CONFIG_I2C_RK3X=y -CONFIG_I2C_SLAVE=y -CONFIG_SPI=y -CONFIG_SPI_BITBANG=m -CONFIG_SPI_CADENCE_QUADSPI=y -CONFIG_SPI_DESIGNWARE=m -CONFIG_SPI_DW_DMA=y -CONFIG_SPI_DW_MMIO=m -CONFIG_SPI_PL022=y -CONFIG_SPI_ROCKCHIP=y -CONFIG_SPI_SPIDEV=m -CONFIG_SPMI=y -CONFIG_PPS=y -# CONFIG_PTP_1588_CLOCK is not set -CONFIG_DEBUG_PINCTRL=y -CONFIG_PINCTRL_RK805=y -CONFIG_PINCTRL_SINGLE=y -CONFIG_GPIO_SYSFS=y -CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_GPIO_MAX732X=y -CONFIG_GPIO_PCA953X=y -CONFIG_GPIO_PCA953X_IRQ=y -CONFIG_POWER_RESET_GPIO_RESTART=y -CONFIG_POWER_RESET_SYSCON=y -CONFIG_SYSCON_REBOOT_MODE=y -CONFIG_CHARGER_RK817=y -CONFIG_SENSORS_ARM_SCMI=y -CONFIG_SENSORS_ARM_SCPI=y -CONFIG_SENSORS_PWM_FAN=m -CONFIG_CPU_THERMAL=y -CONFIG_THERMAL_EMULATION=y -CONFIG_ROCKCHIP_THERMAL=m -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_SYSFS=y -CONFIG_SOFT_WATCHDOG=y -CONFIG_MFD_RK8XX_I2C=y -CONFIG_MFD_RK8XX_SPI=y -# CONFIG_MFD_VEXPRESS_SYSREG is not set -CONFIG_REGULATOR=y -CONFIG_REGULATOR_DEBUG=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_USERSPACE_CONSUMER=y -CONFIG_REGULATOR_NETLINK_EVENTS=y -CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_PWM=y -CONFIG_REGULATOR_RK808=y -CONFIG_REGULATOR_VCTRL=y -# CONFIG_HID_SUPPORT is not set -CONFIG_USB_ULPI_BUS=y -CONFIG_USB_CONN_GPIO=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -CONFIG_USB_DYNAMIC_MINORS=y -CONFIG_USB_OTG=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_ROOT_HUB_TT=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_ACM=m -CONFIG_USB_STORAGE=y -CONFIG_USB_MUSB_HDRC=y -CONFIG_USB_DWC3=y -CONFIG_USB_DWC2=y -CONFIG_USB_SERIAL=m -CONFIG_USB_SERIAL_GENERIC=y -CONFIG_USB_SERIAL_SIMPLE=m -CONFIG_USB_SERIAL_CP210X=m -CONFIG_USB_SERIAL_FTDI_SIO=m -CONFIG_USB_SERIAL_PL2303=m -CONFIG_USB_SERIAL_OPTION=m -CONFIG_NOP_USB_XCEIV=y -CONFIG_USB_ULPI=y -CONFIG_USB_GADGET=y -CONFIG_USB_SNP_UDC_PLAT=y -CONFIG_USB_BDC_UDC=y -CONFIG_USB_CONFIGFS=m -CONFIG_USB_CONFIGFS_SERIAL=y -CONFIG_USB_CONFIGFS_ACM=y -CONFIG_USB_CONFIGFS_OBEX=y -CONFIG_USB_CONFIGFS_NCM=y -CONFIG_USB_CONFIGFS_ECM=y -CONFIG_USB_CONFIGFS_ECM_SUBSET=y -CONFIG_USB_CONFIGFS_RNDIS=y -CONFIG_USB_CONFIGFS_EEM=y -CONFIG_USB_CONFIGFS_MASS_STORAGE=y -CONFIG_USB_CONFIGFS_F_FS=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK_MINORS=32 -CONFIG_MMC_ARMMMCI=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_ACPI=y -CONFIG_MMC_SDHCI_PLTFM=y -CONFIG_MMC_SDHCI_OF_ARASAN=y -CONFIG_MMC_SDHCI_CADENCE=y -CONFIG_MMC_SDHCI_F_SDH30=y -CONFIG_MMC_SPI=y -CONFIG_MMC_DW=y -CONFIG_MMC_DW_HI3798CV200=y -CONFIG_MMC_DW_K3=y -CONFIG_MMC_DW_ROCKCHIP=y -CONFIG_SCSI_UFSHCD=y -CONFIG_SCSI_UFSHCD_PLATFORM=y -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y -CONFIG_LEDS_CLASS_FLASH=y -CONFIG_LEDS_CLASS_MULTICOLOR=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_PWM=y -CONFIG_LEDS_SYSCON=y -CONFIG_LEDS_TRIGGER_TIMER=y -CONFIG_LEDS_TRIGGER_DISK=y -CONFIG_LEDS_TRIGGER_HEARTBEAT=y -CONFIG_LEDS_TRIGGER_CPU=y -CONFIG_LEDS_TRIGGER_DEFAULT_ON=y -CONFIG_LEDS_TRIGGER_PANIC=y -CONFIG_LEDS_TRIGGER_NETDEV=y -CONFIG_RTC_CLASS=y -CONFIG_RTC_DRV_RK808=y -CONFIG_RTC_DRV_EFI=y -CONFIG_RTC_DRV_PL030=y -CONFIG_RTC_DRV_PL031=y -CONFIG_DMADEVICES=y -CONFIG_PL330_DMA=y -CONFIG_SYNC_FILE=y -CONFIG_VIRTIO_PCI=y -CONFIG_VIRTIO_BALLOON=y -CONFIG_VIRTIO_INPUT=y -CONFIG_VIRTIO_MMIO=y -# CONFIG_VHOST_MENU is not set -CONFIG_STAGING=y -CONFIG_RTLLIB=m -CONFIG_RTL8192E=m -CONFIG_RTL8723BS=m -CONFIG_R8712U=m -CONFIG_RTS5208=m -# CONFIG_SURFACE_PLATFORMS is not set -CONFIG_COMMON_CLK_SCMI=y -CONFIG_COMMON_CLK_SCPI=y -CONFIG_COMMON_CLK_PWM=y -CONFIG_HWSPINLOCK=y -# CONFIG_FSL_ERRATUM_A008585 is not set -# CONFIG_HISILICON_ERRATUM_161010101 is not set -# CONFIG_ARM64_ERRATUM_858921 is not set -CONFIG_ARM_MHU=y -CONFIG_PLATFORM_MHU=y -CONFIG_IOMMU_IO_PGTABLE_ARMV7S=y -CONFIG_ROCKCHIP_IOMMU=y -CONFIG_ARM_SMMU=y -CONFIG_ARM_SMMU_V3=y -CONFIG_ROCKCHIP_IODOMAIN=y -CONFIG_ROCKCHIP_DTPM=m -CONFIG_ROCKCHIP_PM_DOMAINS=y -CONFIG_DEVFREQ_GOV_USERSPACE=m -CONFIG_EXTCON_USB_GPIO=y -CONFIG_MEMORY=y -CONFIG_IIO=y -CONFIG_MAX9611=m -CONFIG_ROCKCHIP_SARADC=m -CONFIG_IIO_ST_LSM6DSX=m -CONFIG_SENSORS_ISL29018=m -CONFIG_VCNL4000=m -CONFIG_IIO_ST_MAGN_3AXIS=m -CONFIG_MPL3115=m -CONFIG_PWM=y -CONFIG_PWM_ROCKCHIP=y -CONFIG_RESET_GPIO=y -CONFIG_PHY_ROCKCHIP_DPHY_RX0=m -CONFIG_PHY_ROCKCHIP_EMMC=y -CONFIG_PHY_ROCKCHIP_INNO_HDMI=m -CONFIG_PHY_ROCKCHIP_INNO_USB2=y -CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY=m -CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=m -CONFIG_PHY_ROCKCHIP_PCIE=m -CONFIG_PHY_ROCKCHIP_TYPEC=y -CONFIG_PHY_ROCKCHIP_USB=m -CONFIG_POWERCAP=y -CONFIG_ARM_SCMI_POWERCAP=y -CONFIG_DTPM=y -CONFIG_ARM_SMMU_V3_PMU=m -CONFIG_NVMEM_RMEM=m -CONFIG_NVMEM_ROCKCHIP_EFUSE=m -CONFIG_NVMEM_ROCKCHIP_OTP=m -CONFIG_TEE=y -CONFIG_OPTEE=y -CONFIG_MUX_MMIO=y -CONFIG_INTERCONNECT=y -CONFIG_EXT2_FS=y -CONFIG_EXT3_FS=y -CONFIG_EXT4_FS_POSIX_ACL=y -CONFIG_BTRFS_FS=y -CONFIG_BTRFS_FS_POSIX_ACL=y -CONFIG_FANOTIFY=y -CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y -CONFIG_QUOTA=y -CONFIG_AUTOFS_FS=y -CONFIG_FUSE_FS=y -CONFIG_VIRTIO_FS=y -CONFIG_OVERLAY_FS=y -CONFIG_MSDOS_FS=y -CONFIG_VFAT_FS=y -CONFIG_FAT_DEFAULT_UTF8=y -CONFIG_EXFAT_FS=y -CONFIG_PROC_KCORE=y -CONFIG_PROC_CHILDREN=y -CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_HUGETLBFS=y -CONFIG_EFIVAR_FS=y -CONFIG_JFFS2_FS=y -CONFIG_JFFS2_FS_XATTR=y -CONFIG_SQUASHFS=y -CONFIG_SQUASHFS_LZO=y -CONFIG_SQUASHFS_XZ=y -CONFIG_SQUASHFS_ZSTD=y -CONFIG_NFS_FS=y -CONFIG_NFS_V4=y -CONFIG_NFS_V4_1=y -CONFIG_NFS_V4_2=y -CONFIG_ROOT_NFS=y -CONFIG_9P_FS=y -CONFIG_NLS_DEFAULT="iso8859-15" -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NLS_ISO8859_15=y -CONFIG_NLS_UTF8=y -CONFIG_SECURITY=y -CONFIG_CRYPTO_DH=m -CONFIG_CRYPTO_CURVE25519=m -CONFIG_CRYPTO_ECHAINIV=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_ZSTD=y -CONFIG_CRYPTO_ANSI_CPRNG=y -CONFIG_CRYPTO_USER_API_RNG=m -CONFIG_CRYPTO_GHASH_ARM64_CE=y -CONFIG_CRYPTO_SHA1_ARM64_CE=y -CONFIG_CRYPTO_SHA2_ARM64_CE=y -CONFIG_CRYPTO_SHA512_ARM64_CE=m -CONFIG_CRYPTO_SHA3_ARM64=m -CONFIG_CRYPTO_SM3_ARM64_CE=m -CONFIG_CRYPTO_AES_ARM64_BS=m -CONFIG_CRYPTO_AES_ARM64_CE_CCM=y -CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m -CONFIG_CRYPTO_DEV_ROCKCHIP=y -CONFIG_CRYPTO_DEV_CCREE=m -CONFIG_PACKING=y -CONFIG_INDIRECT_PIO=y -CONFIG_CRC_CCITT=m -CONFIG_CRC8=y -CONFIG_DMA_CMA=y -CONFIG_CMA_SIZE_MBYTES=32 -CONFIG_PRINTK_TIME=y -CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_DEBUG_FS=y -CONFIG_DETECT_HUNG_TASK=y -# CONFIG_SCHED_DEBUG is not set -CONFIG_FUNCTION_TRACER=y -CONFIG_MEMTEST=y diff --git a/board/aarch64/friendlyelec/nanopi-r2s/post-build.sh b/board/aarch64/friendlyelec/nanopi-r2s/post-build.sh deleted file mode 100755 index 1f5ff6a6..00000000 --- a/board/aarch64/friendlyelec/nanopi-r2s/post-build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -BOARD_DIR="$(dirname $0)" - -install -m 0644 -D $BOARD_DIR/extlinux.conf $TARGET_DIR/boot/extlinux/extlinux.conf diff --git a/configs/aarch64_defconfig b/configs/aarch64_defconfig index d0d837f4..553c6157 100644 --- a/configs/aarch64_defconfig +++ b/configs/aarch64_defconfig @@ -139,11 +139,12 @@ INFIX_HOME="https://github.com/kernelkit/infix/" INFIX_DOC="https://kernelkit.org/infix/" INFIX_SUPPORT="mailto:kernelkit@googlegroups.com" BR2_PACKAGE_ALDER_ALDER=y +BR2_PACKAGE_BANANAPI_BPI_R3=y +BR2_PACKAGE_FRIENDLYARM_NANOPI_R2S=y BR2_PACKAGE_MARVELL_CN9130_CRB=y BR2_PACKAGE_MARVELL_ESPRESSOBIN=y -BR2_PACKAGE_STYX_DCP_SC_28P=y BR2_PACKAGE_RASPBERRYPI_RPI64=y -BR2_PACKAGE_BANANAPI_BPI_R3=y +BR2_PACKAGE_STYX_DCP_SC_28P=y BR2_PACKAGE_FEATURE_WIFI_DONGLE_REALTEK=y BR2_PACKAGE_CONFD=y BR2_PACKAGE_CONFD_TEST_MODE=y diff --git a/configs/nanopi_r2s_boot_defconfig b/configs/nanopi_r2s_boot_defconfig new file mode 100644 index 00000000..36bd87e3 --- /dev/null +++ b/configs/nanopi_r2s_boot_defconfig @@ -0,0 +1,47 @@ +BR2_aarch64=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y +BR2_DL_DIR="$(BR2_EXTERNAL_INFIX_PATH)/dl" +BR2_CCACHE=y +BR2_CCACHE_DIR="$(BR2_EXTERNAL_INFIX_PATH)/.ccache" +BR2_ENABLE_DEBUG=y +BR2_PACKAGE_OVERRIDE_FILE="$(BR2_EXTERNAL_INFIX_PATH)/local.mk" +BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_INFIX_PATH)/patches" +BR2_SSP_NONE=y +BR2_INIT_NONE=y +BR2_SYSTEM_BIN_SH_NONE=y +# BR2_PACKAGE_BUSYBOX is not set +# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.12" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3328" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_VERSION=y +BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2025.01" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi-r2s-rk3328" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/extras.config $(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/friendlyarm-nanopi-r2s/uboot/extras.config" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y +BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y +BR2_TARGET_UBOOT_FORMAT_DTB=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb" +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="idbloader.img" +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/friendlyarm-nanopi-r2s/uboot/r2s-env.dtsi" +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_RAUC=y +BR2_PACKAGE_HOST_UBOOT_TOOLS=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y +BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y +BR2_PACKAGE_BOOTLOADER_SPLASHSCREEN=y +TRUSTED_KEYS=y +TRUSTED_KEYS_DEVELOPMENT=y diff --git a/configs/r2s_defconfig b/configs/r2s_defconfig deleted file mode 100644 index d5ddf94d..00000000 --- a/configs/r2s_defconfig +++ /dev/null @@ -1,217 +0,0 @@ -BR2_aarch64=y -BR2_ARM_FPU_VFPV4=y -BR2_TOOLCHAIN_EXTERNAL=y -BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y -BR2_TOOLCHAIN_EXTERNAL_GDB_SERVER_COPY=y -BR2_DL_DIR="${BR2_EXTERNAL_INFIX_PATH}/dl" -BR2_CCACHE=y -BR2_CCACHE_DIR="${BR2_EXTERNAL_INFIX_PATH}/.ccache" -BR2_ENABLE_DEBUG=y -BR2_GLOBAL_PATCH_DIR="${BR2_EXTERNAL_INFIX_PATH}/patches" -BR2_TARGET_GENERIC_HOSTNAME="infix" -BR2_TARGET_GENERIC_ISSUE="Infix by KernelKit" -BR2_INIT_FINIT=y -BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y -BR2_ROOTFS_DEVICE_TABLE="system/device_table.txt ${BR2_EXTERNAL_INFIX_PATH}/board/common/xattrs" -BR2_ROOTFS_MERGED_USR=y -# BR2_TARGET_ENABLE_ROOT_LOGIN is not set -BR2_SYSTEM_BIN_SH_BASH=y -BR2_TARGET_GENERIC_GETTY_PORT="@console" -BR2_TARGET_GENERIC_GETTY_TERM="xterm" -BR2_SYSTEM_DHCP="eth0" -BR2_SYSTEM_DEFAULT_PATH="/bin:/sbin:/usr/bin:/usr/sbin" -BR2_ENABLE_LOCALE_WHITELIST="C en_US en_CA C.UTF-8" -BR2_GENERATE_LOCALE="en_US en_CA C.UTF-8" -BR2_TARGET_TZ_INFO=y -BR2_ROOTFS_OVERLAY="${BR2_EXTERNAL_INFIX_PATH}/board/common/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/rootfs ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/r2s/rootfs" -BR2_ROOTFS_POST_BUILD_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-build.sh" -BR2_ROOTFS_POST_IMAGE_SCRIPT="${BR2_EXTERNAL_INFIX_PATH}/board/common/post-image.sh support/scripts/genimage.sh" -BR2_ROOTFS_POST_SCRIPT_ARGS="-c $(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/r2s/genimage.cfg" -BR2_LINUX_KERNEL=y -BR2_LINUX_KERNEL_CUSTOM_VERSION=y -BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.12.56" -BR2_LINUX_KERNEL_PATCH="$(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/r2s/rk3328-nanopi-r2s-dts.patch" -BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y -BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/r2s/linux_defconfig" -BR2_LINUX_KERNEL_DTS_SUPPORT=y -BR2_LINUX_KERNEL_INTREE_DTS_NAME="rockchip/rk3328-nanopi-r2s" -BR2_LINUX_KERNEL_DTB_KEEP_DIRNAME=y -BR2_LINUX_KERNEL_INSTALL_TARGET=y -BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y -BR2_PACKAGE_BUSYBOX_CONFIG="$(BR2_EXTERNAL_INFIX_PATH)/board/common/busybox_defconfig" -BR2_PACKAGE_STRACE=y -BR2_PACKAGE_STRESS_NG=y -BR2_PACKAGE_SYSREPO_GROUP="sys-cli" -BR2_PACKAGE_JQ=y -BR2_PACKAGE_E2FSPROGS=y -BR2_PACKAGE_E2FSPROGS_RESIZE2FS=y -BR2_PACKAGE_LINUX_FIRMWARE=y -BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT61=y -BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT73=y -BR2_PACKAGE_LINUX_FIRMWARE_RALINK_RT2XX=y -BR2_PACKAGE_LINUX_FIRMWARE_RTL_81XX=y -BR2_PACKAGE_LINUX_FIRMWARE_RTL_87XX=y -BR2_PACKAGE_LINUX_FIRMWARE_RTL_88XX=y -BR2_PACKAGE_LINUX_FIRMWARE_RTL_RTW88=y -BR2_PACKAGE_LINUX_FIRMWARE_RTL_815X=y -BR2_PACKAGE_DBUS_CXX=y -BR2_PACKAGE_DBUS_GLIB=y -BR2_PACKAGE_DBUS_TRIGGERD=y -BR2_PACKAGE_EUDEV_RULES_GEN=y -# BR2_PACKAGE_EUDEV_ENABLE_HWDB is not set -BR2_PACKAGE_EVEMU=y -BR2_PACKAGE_EVTEST=y -BR2_PACKAGE_GPTFDISK=y -BR2_PACKAGE_GPTFDISK_SGDISK=y -BR2_PACKAGE_INPUT_EVENT_DAEMON=y -BR2_PACKAGE_MDIO_TOOLS=y -BR2_PACKAGE_RNG_TOOLS=y -BR2_PACKAGE_UBOOT_TOOLS=y -BR2_PACKAGE_UBOOT_TOOLS_FIT_SUPPORT=y -BR2_PACKAGE_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y -BR2_PACKAGE_UBOOT_TOOLS_FIT_CHECK_SIGN=y -BR2_PACKAGE_UBOOT_TOOLS_MKENVIMAGE=y -BR2_PACKAGE_PYTHON3=y -BR2_PACKAGE_PYTHON_GUNICORN=y -BR2_PACKAGE_LIBSSH_OPENSSL=y -BR2_PACKAGE_LIBSSH2=y -BR2_PACKAGE_LIBSSH2_OPENSSL=y -BR2_PACKAGE_LIBOPENSSL_BIN=y -BR2_PACKAGE_LIBINPUT=y -BR2_PACKAGE_LIBCURL_CURL=y -BR2_PACKAGE_NETOPEER2_CLI=y -BR2_PACKAGE_NSS_MDNS=y -BR2_PACKAGE_LINUX_PAM=y -BR2_PACKAGE_LIBPAM_RADIUS_AUTH=y -BR2_PACKAGE_ONIGURUMA=y -BR2_PACKAGE_AVAHI_DAEMON=y -BR2_PACKAGE_AVAHI_DEFAULT_SERVICES=y -BR2_PACKAGE_CHRONY=y -BR2_PACKAGE_CONNTRACK_TOOLS=y -BR2_PACKAGE_DNSMASQ=y -BR2_PACKAGE_ETHTOOL=y -BR2_PACKAGE_FPING=y -BR2_PACKAGE_FIREWALL=y -BR2_PACKAGE_FRR=y -# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set -BR2_PACKAGE_IPERF3=y -BR2_PACKAGE_IPROUTE2=y -BR2_PACKAGE_IPTABLES_NFTABLES=y -BR2_PACKAGE_IPUTILS=y -BR2_PACKAGE_LLDPD=y -BR2_PACKAGE_MTR=y -BR2_PACKAGE_NETCALC=y -BR2_PACKAGE_NETCAT_OPENBSD=y -BR2_PACKAGE_NETSNMP=y -BR2_PACKAGE_NFTABLES=y -BR2_PACKAGE_NGINX=y -BR2_PACKAGE_NGINX_HTTP_SSL_MODULE=y -BR2_PACKAGE_NGINX_HTTP_V2_MODULE=y -BR2_PACKAGE_NMAP=y -BR2_PACKAGE_NMAP_NCAT=y -BR2_PACKAGE_NMAP_NMAP=y -BR2_PACKAGE_NMAP_NPING=y -BR2_PACKAGE_OPENRESOLV=y -BR2_PACKAGE_OPENSSH=y -BR2_PACKAGE_SOCAT=y -BR2_PACKAGE_TCPDUMP=y -BR2_PACKAGE_TRACEROUTE=y -BR2_PACKAGE_ULOGD=y -BR2_PACKAGE_WHOIS=y -BR2_PACKAGE_WIRELESS_REGDB=y -BR2_PACKAGE_WIRELESS_TOOLS=y -BR2_PACKAGE_WPA_SUPPLICANT=y -BR2_PACKAGE_BASH_COMPLETION=y -BR2_PACKAGE_NEOFETCH=y -BR2_PACKAGE_SUDO=y -BR2_PACKAGE_TTYD=y -BR2_PACKAGE_HTOP=y -BR2_PACKAGE_IRQBALANCE=y -BR2_PACKAGE_KMOD_TOOLS=y -BR2_PACKAGE_PWGEN=y -BR2_PACKAGE_RAUC=y -BR2_PACKAGE_RAUC_DBUS=y -BR2_PACKAGE_RAUC_GPT=y -BR2_PACKAGE_RAUC_NETWORK=y -BR2_PACKAGE_RAUC_JSON=y -BR2_PACKAGE_SYSKLOGD=y -BR2_PACKAGE_SYSKLOGD_LOGGER=y -BR2_PACKAGE_WATCHDOGD=y -BR2_PACKAGE_LESS=y -BR2_PACKAGE_MG=y -BR2_PACKAGE_NANO=y -BR2_TARGET_ROOTFS_SQUASHFS=y -# BR2_TARGET_ROOTFS_TAR is not set -BR2_TARGET_ARM_TRUSTED_FIRMWARE=y -BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y -BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.9" -BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="rk3328" -BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES="" -BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN=y -BR2_TARGET_UBOOT=y -BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y -BR2_TARGET_UBOOT_CUSTOM_VERSION=y -BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2024.07" -BR2_TARGET_UBOOT_BOARD_DEFCONFIG="nanopi-r2s-rk3328" -BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="$(BR2_EXTERNAL_INFIX_PATH)/board/common/uboot/extras.config $(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/r2s/uboot/extras.config" -BR2_TARGET_UBOOT_NEEDS_DTC=y -BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y -BR2_TARGET_UBOOT_NEEDS_PYELFTOOLS=y -BR2_TARGET_UBOOT_NEEDS_OPENSSL=y -BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y -BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF=y -BR2_TARGET_UBOOT_FORMAT_DTB=y -BR2_TARGET_UBOOT_FORMAT_CUSTOM=y -BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb" -BR2_TARGET_UBOOT_SPL=y -BR2_TARGET_UBOOT_SPL_NAME="idbloader.img" -BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/r2s/uboot/r2s-env.dtsi" -BR2_PACKAGE_HOST_E2FSPROGS=y -BR2_PACKAGE_HOST_ENVIRONMENT_SETUP=y -BR2_PACKAGE_HOST_GENEXT2FS=y -BR2_PACKAGE_HOST_GENIMAGE=y -BR2_PACKAGE_HOST_RAUC=y -BR2_PACKAGE_HOST_UBOOT_TOOLS=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT=y -BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SIGNATURE_SUPPORT=y -INFIX_VENDOR_HOME="https://kernelkit.org" -INFIX_IMAGE_ID="${INFIX_ID}-r2s" -INFIX_DESC="Infix is an immutable, friendly, and secure operating system that turns any ARM or x86 device into a powerful, manageable network appliance. Deploy on anything from $35 Raspberry Pi boards to enterprise switches as routers, IoT gateways, or edge devices. Infix models Linux networking features using YANG so you can manage your devices using NETCONF/RESTCONF APIs and focus on your business logic running in isolated containers." -INFIX_HOME="https://github.com/kernelkit/infix/" -INFIX_DOC="https://kernelkit.org/infix/" -INFIX_SUPPORT="mailto:kernelkit@googlegroups.com" -BR2_PACKAGE_CONFD=y -BR2_PACKAGE_GENCERT=y -BR2_PACKAGE_STATD=y -BR2_PACKAGE_SHOW=y -BR2_PACKAGE_FACTORY=y -BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG=y -BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS=y -BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD=y -BR2_PACKAGE_FINIT_PLUGIN_RTC=y -BR2_PACKAGE_FINIT_RTC_DATE="2024-11-04 10:54:00" -BR2_PACKAGE_FINIT_RTC_FILE="/var/lib/misc/rtc" -BR2_PACKAGE_FINIT_PLUGIN_TTY=y -BR2_PACKAGE_FINIT_PLUGIN_URANDOM=y -BR2_PACKAGE_IITO=y -BR2_PACKAGE_KEYACK=y -BR2_PACKAGE_KLISH_PLUGIN_INFIX=y -BR2_PACKAGE_LANDING=y -BR2_PACKAGE_LOWDOWN=y -BR2_PACKAGE_MCD=y -BR2_PACKAGE_MDNS_ALIAS=y -BR2_PACKAGE_NETBROWSE=y -BR2_PACKAGE_PODMAN=y -BR2_PACKAGE_PODMAN_DRIVER_BTRFS=y -BR2_PACKAGE_PODMAN_DRIVER_DEVICEMAPPER=y -BR2_PACKAGE_PODMAN_DRIVER_VFS=y -BR2_PACKAGE_TETRIS=y -BR2_PACKAGE_ROUSETTE=y -BR2_PACKAGE_RAUC_INSTALLATION_STATUS=y -BR2_PACKAGE_HOST_PYTHON_YANGDOC=y -BR2_DOWNLOAD_FORCE_CHECK_HASHES=y -BR2_PACKAGE_GETENT=y -TRUSTED_KEYS=y -TRUSTED_KEYS_DEVELOPMENT=y -# GNS3_APPLIANCE is not set -SDCARD_AUX=y From c66c0b46b5a8d5745cd1f3dded80541a25e5bd8d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 17:31:32 +0100 Subject: [PATCH 21/27] board/aarch64: update BPi-R3 factory-config - Enable bridging of LAN ports in br0, default IP: 192.168.0.1/24 - Enable firewall with two zones: 'wan' and 'lan', policy: lan-to-wan - Enable DHCP server on br0 Signed-off-by: Joachim Wiberg --- .../bananapi,bpi-r3/etc/factory-config.cfg | 110 +++++++++++++++++- 1 file changed, 105 insertions(+), 5 deletions(-) diff --git a/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg index 8eef6793..8d94c11b 100644 --- a/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg +++ b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg @@ -10,30 +10,61 @@ "state": { "admin-state": "unlocked" } + }, + { + "class": "infix-hardware:usb", + "name": "USB2", + "state": { + "admin-state": "unlocked" + } } ] }, "ietf-interfaces:interfaces": { "interface": [ + { + "name": "br0", + "type": "infix-if-type:bridge", + "ietf-ip:ipv4": { + "address": [ + { + "ip": "192.168.0.1", + "prefix-length": 24 + } + ] + } + }, { "name": "lan1", "type": "infix-if-type:ethernet", - "ietf-ip:ipv6": {} + "ietf-ip:ipv6": {}, + "infix-interfaces:bridge-port": { + "bridge": "br0" + } }, { "name": "lan2", "type": "infix-if-type:ethernet", - "ietf-ip:ipv6": {} + "ietf-ip:ipv6": {}, + "infix-interfaces:bridge-port": { + "bridge": "br0" + } }, { "name": "lan3", "type": "infix-if-type:ethernet", - "ietf-ip:ipv6": {} + "ietf-ip:ipv6": {}, + "infix-interfaces:bridge-port": { + "bridge": "br0" + } }, { "name": "lan4", "type": "infix-if-type:ethernet", - "ietf-ip:ipv6": {} + "ietf-ip:ipv6": {}, + "infix-interfaces:bridge-port": { + "bridge": "br0" + } }, { "name": "lo", @@ -168,7 +199,17 @@ } }, "ietf-system:system": { - "hostname": "infix-00-00-00", + "hostname": "bpi-r3", + "ntp": { + "server": [ + { + "name": "default", + "udp": { + "address": "pool.ntp.org" + } + } + ] + }, "authentication": { "user": [ { @@ -210,6 +251,65 @@ } ] }, + "infix-dhcp-server:dhcp-server": { + "option": [ + { + "id": "ntp-server", + "address": "auto" + }, + { + "id": "dns-server", + "address": "auto" + }, + { + "id": "router", + "address": "auto" + } + ], + "subnet": [ + { + "subnet": "192.168.0.0/24", + "pool": { + "start-address": "192.168.0.100", + "end-address": "192.168.0.250" + } + } + ] + }, + "infix-firewall:firewall": { + "default": "wan", + "zone": [ + { + "name": "lan", + "action": "accept", + "interface": [ + "br0" + ] + }, + { + "name": "wan", + "action": "drop", + "interface": [ + "wan" + ], + "service": [ + "dhcpv6-client" + ] + } + ], + "policy": [ + { + "name": "lan-to-wan", + "ingress": [ + "lan" + ], + "egress": [ + "wan" + ], + "masquerade": true + } + ] + }, "infix-meta:meta": { "version": "1.5" }, From 4b55e3874126c5403011c6b9098dfaf0975d7cfa Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 30 Oct 2025 10:09:56 +0100 Subject: [PATCH 22/27] board/aarch64: use %m modifier in default xPi hostnames The xPi's usually don't have a VPD so the chassis mac-address probed at boot is usually null in /run/system.json. This commit adds a fallbkack mechanism to populate this field so it can be used for unique hostnames even on these boards. Ths ietf-hardware.yang model does not have a notion of physical address, so we augment one tht is generic enought to be used for other hardware components than Ethernet, similar to what ietf-interfaces.yang use. Signed-off-by: Joachim Wiberg --- .../bananapi,bpi-r3/etc/factory-config.cfg | 2 +- .../etc/factory-config.cfg | 2 +- .../etc/factory-config.cfg | 2 +- .../rootfs/usr/libexec/infix/init.d/00-probe | 47 +++++++++++++++++-- src/confd/yang/confd.inc | 2 +- src/confd/yang/confd/infix-hardware.yang | 16 ++++++- ...18.yang => infix-hardware@2025-10-30.yang} | 0 src/statd/python/cli_pretty/cli_pretty.py | 2 + src/statd/python/yanger/ietf_hardware.py | 4 ++ test/case/statd/system/ietf-hardware.json | 1 + 10 files changed, 67 insertions(+), 11 deletions(-) rename src/confd/yang/confd/{infix-hardware@2025-10-18.yang => infix-hardware@2025-10-30.yang} (100%) diff --git a/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg index 8d94c11b..aa8740c3 100644 --- a/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg +++ b/board/aarch64/bananapi-bpi-r3/rootfs/usr/share/product/bananapi,bpi-r3/etc/factory-config.cfg @@ -199,7 +199,7 @@ } }, "ietf-system:system": { - "hostname": "bpi-r3", + "hostname": "bpi-%m", "ntp": { "server": [ { diff --git a/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg index eca53da5..f4511ef1 100644 --- a/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg +++ b/board/aarch64/friendlyarm-nanopi-r2s/rootfs/usr/share/product/friendlyarm,nanopi-r2s/etc/factory-config.cfg @@ -150,7 +150,7 @@ } }, "ietf-system:system": { - "hostname": "r2s", + "hostname": "r2s-%m", "ntp": { "server": [ { diff --git a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg index c744b02a..42ae38cc 100644 --- a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg +++ b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/factory-config.cfg @@ -133,7 +133,7 @@ } }, "ietf-system:system": { - "hostname": "rpi", + "hostname": "rpi-%m", "ntp": { "enabled": true, "server": [ diff --git a/board/common/rootfs/usr/libexec/infix/init.d/00-probe b/board/common/rootfs/usr/libexec/infix/init.d/00-probe index 2e4a7412..618f4ba8 100755 --- a/board/common/rootfs/usr/libexec/infix/init.d/00-probe +++ b/board/common/rootfs/usr/libexec/infix/init.d/00-probe @@ -277,8 +277,12 @@ def vpd_inject(out, vpds): break -def qemu_base_mac(): - """Find MAC address of first non-loopback interface, subtract with 1""" +def fallback_base_mac(): + """Find MAC address of first suitable non-loopback interface. + + Prefers real (globally unique) MACs over locally administered ones. + Prioritizes interface types: eth* > wan > wifi* > others. + """ base_path = '/sys/class/net' interfaces = [] @@ -290,13 +294,41 @@ def qemu_base_mac(): fn = os.path.join(base_path, iface, 'address') with open(fn, 'r', encoding='ascii') as f: mac = f.read().strip() - interfaces.append((mac, iface)) + + # Check if locally administered (bit 1 of first octet is set) + first_byte = int(mac.split(':')[0], 16) + is_local = bool(first_byte & 0x02) + + # Prefer: eth* > wan > wifi* > others, then real MACs > local MACs + priority = 0 + if iface.startswith('eth'): + priority = 400 + elif iface == 'wan': + priority = 300 + elif iface.startswith('wifi'): + priority = 200 + else: + priority = 100 + + # Real MACs get +100 bonus + if not is_local: + priority += 100 + + interfaces.append((priority, iface, mac)) except FileNotFoundError: continue if interfaces: - interfaces.sort() - mac = interfaces[0][0] + interfaces.sort(reverse=True) # Highest priority first + return interfaces[0][2] # Return MAC + + return None + + +def qemu_base_mac(): + """Find MAC address of first non-loopback interface, subtract with 1""" + mac = fallback_base_mac() + if mac: mac = int(mac.replace(':', ''), 16) mac -= 1 mac %= 1 << 48 @@ -386,6 +418,11 @@ def probe_dtsystem(out): out["factory-password-hash"] = staticpw vpd_inject(out, vpds) + + # Fallback to interface MAC if VPD doesn't provide one (e.g., SBCs) + if not out["mac-address"]: + out["mac-address"] = fallback_base_mac() + return 0 diff --git a/src/confd/yang/confd.inc b/src/confd/yang/confd.inc index f15ac271..03b03a70 100644 --- a/src/confd/yang/confd.inc +++ b/src/confd/yang/confd.inc @@ -18,7 +18,7 @@ MODULES=( "infix-syslog@2024-07-19.yang" "iana-hardware@2018-03-13.yang" "ietf-hardware@2018-03-13.yang -e hardware-state -e hardware-sensor" - "infix-hardware@2025-10-18.yang" + "infix-hardware@2025-10-30.yang" "ieee802-dot1q-types@2022-10-29.yang" "infix-ip@2024-09-16.yang" "infix-if-type@2025-02-12.yang" diff --git a/src/confd/yang/confd/infix-hardware.yang b/src/confd/yang/confd/infix-hardware.yang index 535b1b3d..d702994f 100644 --- a/src/confd/yang/confd/infix-hardware.yang +++ b/src/confd/yang/confd/infix-hardware.yang @@ -17,8 +17,8 @@ module infix-hardware { contact "kernelkit@googlegroups.com"; description "Vital Product Data augmentation of ieee-hardware and deviations."; - revision 2025-10-18 { - description "Enable sensor support, starting with hwmon temperature sensors."; + revision 2025-10-30 { + description "Add phys-address leaf for hardware components and enable sensor support."; reference "internal"; } revision 2024-04-25 { @@ -72,6 +72,18 @@ module infix-hardware { deviate not-supported; } augment "/iehw:hardware/iehw:component" { + leaf phys-address { + type yang:phys-address; + config false; + description + "The physical address of the hardware component. For chassis components, + this represents the base MAC address used for the system. This is + typically sourced from VPD data on enterprise hardware, or derived from + the first physical interface on single-board computers (SBCs) without + VPD. May be used as the base for generating addresses for virtual + interfaces. For other component types, this could represent various + physical layer addresses (e.g., Fibre Channel WWN, InfiniBand GUID)."; + } container vpd-data { config false; leaf product-name { diff --git a/src/confd/yang/confd/infix-hardware@2025-10-18.yang b/src/confd/yang/confd/infix-hardware@2025-10-30.yang similarity index 100% rename from src/confd/yang/confd/infix-hardware@2025-10-18.yang rename to src/confd/yang/confd/infix-hardware@2025-10-30.yang diff --git a/src/statd/python/cli_pretty/cli_pretty.py b/src/statd/python/cli_pretty/cli_pretty.py index 9ffee87f..a364db97 100755 --- a/src/statd/python/cli_pretty/cli_pretty.py +++ b/src/statd/python/cli_pretty/cli_pretty.py @@ -1703,6 +1703,8 @@ def show_hardware(json): print(f"Manufacturer : {board['mfg-name']}") if board.get("serial-num"): print(f"Serial Number : {board['serial-num']}") + if board.get("infix-hardware:phys-address"): + print(f"Base MAC Address : {board['infix-hardware:phys-address']}") if board.get("hardware-rev"): print(f"Hardware Revision : {board['hardware-rev']}") diff --git a/src/statd/python/yanger/ietf_hardware.py b/src/statd/python/yanger/ietf_hardware.py index 1cbf15a9..3535cbc6 100644 --- a/src/statd/python/yanger/ietf_hardware.py +++ b/src/statd/python/yanger/ietf_hardware.py @@ -99,6 +99,10 @@ def motherboard_component(systemjson): if systemjson.get("part-number"): component["hardware-rev"] = systemjson["part-number"] + # Add chassis physical address (MAC) if available (from VPD or interface fallback) + if systemjson.get("mac-address"): + component["infix-hardware:phys-address"] = systemjson["mac-address"] + # Set state - admin-state is "unknown" since chassis cannot be # administratively controlled (locked/unlocked) component["state"] = { diff --git a/test/case/statd/system/ietf-hardware.json b/test/case/statd/system/ietf-hardware.json index 4ced153b..637b5c3e 100644 --- a/test/case/statd/system/ietf-hardware.json +++ b/test/case/statd/system/ietf-hardware.json @@ -6,6 +6,7 @@ "class": "iana-hardware:chassis", "mfg-name": "QEMU", "model-name": "VM", + "infix-hardware:phys-address": "00:a0:85:00:03:00", "state": { "admin-state": "unknown", "oper-state": "enabled" From 24755e7e5fde99b37dcad07e8e0820416884fe02 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 30 Oct 2025 10:59:59 +0100 Subject: [PATCH 23/27] board/aarch64: add broken-flow-control interface quirk Add new interface quirk to allow skipping disabling of flow control on all RPi 3B/4B devices that have the smsc95xx driver. Signed-off-by: Joachim Wiberg --- .../etc/product/interface-quirks.json | 2 ++ .../etc/product/interface-quirks.json | 5 +++++ src/confd/src/ieee802-ethernet-interface.c | 21 ++++++++----------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json index fa174616..0c2c17cd 100644 --- a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json +++ b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-compute-module/etc/product/interface-quirks.json @@ -1,8 +1,10 @@ { "eth0": { + "comment": "Primary Ethernet controller, native BCM2711", "phy-detached-when-down": true }, "eth1": { + "comment": "Second Ethernet controller on CM4 boards, attached over PCIe", "phy-detached-when-down": true } } diff --git a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json index 70098394..26be2da0 100644 --- a/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json +++ b/board/aarch64/raspberrypi-rpi64/rootfs/usr/share/product/raspberrypi,4-model-b/etc/product/interface-quirks.json @@ -1,5 +1,10 @@ { "eth0": { + "comment": "Primary Ethernet controller, native on BCM2711, and smsc95xx on BCM2837", "phy-detached-when-down": true + }, + "@ethtool:driver=smsc95xx": { + "comment": "BCM2837 smsc95xx driver does not support disabling flow control", + "broken-flow-control": true } } diff --git a/src/confd/src/ieee802-ethernet-interface.c b/src/confd/src/ieee802-ethernet-interface.c index 42d765a4..754e1446 100644 --- a/src/confd/src/ieee802-ethernet-interface.c +++ b/src/confd/src/ieee802-ethernet-interface.c @@ -38,26 +38,23 @@ static int netdag_gen_ethtool_flow_control(struct dagger *net, struct lyd_node * enum netdag_init phase = NETDAG_INIT_PHYS; FILE *fp; + /* Skip flow control configuration for NICs with broken support */ + if (iface_has_quirk(ifname, "broken-flow-control")) + return 0; + if (iface_has_quirk(ifname, "phy-detached-when-down")) phase = NETDAG_INIT_POST; fp = dagger_fopen_net_init(net, ifname, phase, "ethtool-flow-control.sh"); if (!fp) return -EIO; + + /* Check if the NIC supports pause frames at all */ fprintf(fp, "[[ -n $(ethtool --json %s | jq '.[] | select(.\"supported-pause-frame-use\" == \"No\")') ]] && exit 0\n", ifname); - /* - * Some NICs report "supported-pause-frame-use": "Symmetric Receive-only", like - * RPi 3B's LAN78xx USB to Ethernet controller, but the drivers do not support - * disabling it. This call is best effort after all, so we capture and check - * the error. If the operation is not supported, we log it and exit cleanly. - */ - fprintf(fp, - "if ! err=$(ethtool --pause %s autoneg %s rx off tx off 2>&1); then\n" - " logger -it confd -p daemon.error \"%s: failed disabling flow-control\"\n" - " echo \"$err\" | grep -q \"Operation not supported\" && exit 0\n" - "fi\n", - ifname, iface_uses_autoneg(cif) ? "on" : "off", ifname); + /* Disable flow control */ + fprintf(fp, "ethtool --pause %s autoneg %s rx off tx off\n", + ifname, iface_uses_autoneg(cif) ? "on" : "off"); fclose(fp); return 0; From daf8b29178a00d2e9708b0d8e74c183c98831f07 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 28 Oct 2025 16:58:25 +0100 Subject: [PATCH 24/27] uttls/mkimage.sh: consolidate sdcard.img generation This commit consolidates mkimage.sh scripts into a unified SD card image creation tool that works for all boards. It needs a bootloader an $ARCH rootfs.squashfs image and a genimage.cfg.in template. - Detects build directories from `O=` environment variable or `output/` - Sources `.config` to discover Buildroot paths - Uses Buildroot's `support/scripts/genimage.sh` when available - Automatically generates `.bmap` files if `bmaptool` is available - Fallback to direct `genimage` invocation if wrapper not found See the online instructions for usage. Signed-off-by: Joachim Wiberg --- .github/workflows/build-image.yml | 33 +- board/aarch64/bananapi-bpi-r3/mkimage.sh | 27 -- .../{genimage.cfg => genimage.cfg.in} | 2 +- board/aarch64/raspberrypi-rpi64/mkimage.sh | 211 ----------- configs/mt7986_sd_boot_defconfig | 1 + configs/nanopi_r2s_boot_defconfig | 1 + configs/rpi4_boot_defconfig | 1 + utils/mkimage.sh | 357 ++++++++++++++++++ 8 files changed, 374 insertions(+), 259 deletions(-) delete mode 100755 board/aarch64/bananapi-bpi-r3/mkimage.sh rename board/aarch64/friendlyarm-nanopi-r2s/{genimage.cfg => genimage.cfg.in} (95%) delete mode 100755 board/aarch64/raspberrypi-rpi64/mkimage.sh create mode 100755 utils/mkimage.sh diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 25120562..0875e28e 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -8,9 +8,10 @@ on: type: choice required: true options: - - raspberry-pi64 - - banana-pi-r3 - default: 'raspberry-pi64' + - raspberrypi-rpi64 + - bananapi-bpi-r3 + - friendlyarm-nanopi-r2s + default: 'raspberrypi-rpi64' use_latest_release: description: 'Use latest release artifacts instead of workflow artifacts' type: boolean @@ -52,14 +53,18 @@ jobs: - name: Set bootloader and target based on board run: | case "${{ inputs.board }}" in - raspberry-pi64) + raspberrypi-rpi64) echo "BOOTLOADER=rpi4_boot" >> $GITHUB_ENV echo "TARGET=aarch64" >> $GITHUB_ENV ;; - banana-pi-r3) + bananapi-bpi-r3) echo "BOOTLOADER=mt7986_sd_boot" >> $GITHUB_ENV echo "TARGET=aarch64" >> $GITHUB_ENV ;; + friendlyarm-nanopi-r2s) + echo "BOOTLOADER=nanopi_r2s_boot" >> $GITHUB_ENV + echo "TARGET=aarch64" >> $GITHUB_ENV + ;; *) echo "Error: Unknown board ${{ inputs.board }}" exit 1 @@ -144,19 +149,7 @@ jobs: export BR2_EXTERNAL_INFIX_PATH=$PWD export RELEASE="" export INFIX_ID="infix" - - # Use the standardized mkimage.sh path for the selected board - # BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh" - BOARD_SCRIPT="src/board/${{ inputs.board }}/mkimage.sh" - - if [ -f "$BOARD_SCRIPT" ]; then - echo "Using board-specific image creation script: $BOARD_SCRIPT" - chmod +x "$BOARD_SCRIPT" - "$BOARD_SCRIPT" - else - echo "Error: Board script $BOARD_SCRIPT not found!" - exit 1 - fi + ./utils/mkimage.sh ${{ inputs.board }} - name: Verify created image run: | @@ -183,7 +176,7 @@ jobs: with: name: sdcard-image-${{ inputs.board }}-${{ env.BOOTLOADER }} path: | - output/images/*-sdcard.img + output/images/*-sdcard.img* retention-days: 30 - name: Create checksums @@ -218,7 +211,7 @@ jobs: **Artifact Source:** ${{ inputs.use_latest_release && 'Latest Release' || 'Latest Workflow Run' }} ## Created Images - $(find output/images/ -name "*.img" -o -name "*.qcow2" -o -name "*.raw" | xargs ls -lh 2>/dev/null | sed 's/^/- /' || echo "- No images found") + $(find output/images/ -name "*.img*" -o -name "*.qcow2" -o -name "*.raw" | xargs ls -lh 2>/dev/null | sed 's/^/- /' || echo "- No images found") ## Download The SD card image is available as a workflow artifact above. diff --git a/board/aarch64/bananapi-bpi-r3/mkimage.sh b/board/aarch64/bananapi-bpi-r3/mkimage.sh deleted file mode 100755 index b61cbabc..00000000 --- a/board/aarch64/bananapi-bpi-r3/mkimage.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -set -e - -TARGET=sd - -BOARD_DIR=$(dirname "$0") -GENIMAGE_CFG="${BUILD_DIR}/genimage.cfg" -GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" - -sed "s|#VERSION#|${RELEASE}|" "${BOARD_DIR}/genimage.cfg.in" | \ -sed "s|#TARGET#|${TARGET}|" | \ -sed "s|#INFIX_ID#|${INFIX_ID}|" > "${GENIMAGE_CFG}" - -# Create temporary root path -ROOTPATH_TMP=$(mktemp -d) -trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT - -# Clean previous genimage temp directory -rm -rf "${GENIMAGE_TMP}" - -# Generate the SD card image -genimage \ - --rootpath "${ROOTPATH_TMP}" \ - --tmppath "${GENIMAGE_TMP}" \ - --inputpath "${BINARIES_DIR}" \ - --outputpath "${BINARIES_DIR}" \ - --config "${GENIMAGE_CFG}" diff --git a/board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg b/board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg.in similarity index 95% rename from board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg rename to board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg.in index a7513740..6a069181 100644 --- a/board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg +++ b/board/aarch64/friendlyarm-nanopi-r2s/genimage.cfg.in @@ -19,7 +19,7 @@ image var.ext4 { } } -image sdcard.img { +image #INFIX_ID##VERSION#-nanopi-r2s-sdcard.img { hdimage { partition-table-type = "gpt" } diff --git a/board/aarch64/raspberrypi-rpi64/mkimage.sh b/board/aarch64/raspberrypi-rpi64/mkimage.sh deleted file mode 100755 index fafeb593..00000000 --- a/board/aarch64/raspberrypi-rpi64/mkimage.sh +++ /dev/null @@ -1,211 +0,0 @@ -#!/bin/sh -set -e - -usage() -{ - cat <&2 - exit 1 - } - fi - fi - - # Find rootfs if not specified - if [ -z "$ROOT_DIR" ]; then - ROOT_DIR=$(find_build_dir) || { - echo "Error: Could not find rootfs directory. Set O= or use -r option" >&2 - exit 1 - } - fi - - # Set up environment variables (use BOOT_DIR as base) - export BINARIES_DIR="$BOOT_DIR/images" - export BUILD_DIR="$BOOT_DIR/build" - export BR2_EXTERNAL_INFIX_PATH - export RELEASE=${RELEASE:-""} - export INFIX_ID=${INFIX_ID:-"infix"} - - # Add host tools to PATH (for genimage, etc.) - for dir in "$BOOT_DIR" "$ROOT_DIR"; do - if [ -d "$dir/host/bin" ]; then - export PATH="$dir/host/bin:$PATH" - break - fi - done - - # Copy rootfs and partition images to boot directory - mkdir -p "$BINARIES_DIR" - if [ -f "$ROOT_DIR" ]; then - # Direct path to rootfs.squashfs file - echo "Copying rootfs from $ROOT_DIR to $BINARIES_DIR/rootfs.squashfs" - cp "$ROOT_DIR" "$BINARIES_DIR/rootfs.squashfs" - elif [ -f "$ROOT_DIR/images/rootfs.squashfs" ]; then - # Build directory with images/ - copy rootfs and partition images - echo "Copying rootfs and partitions from $ROOT_DIR/images/ to $BINARIES_DIR/" - cp "$ROOT_DIR/images/rootfs.squashfs" "$BINARIES_DIR/" - # Copy partition images (aux.ext4, cfg.ext4, var.ext4) if they exist - for img in aux.ext4 cfg.ext4 var.ext4; do - if [ -f "$ROOT_DIR/images/$img" ]; then - cp "$ROOT_DIR/images/$img" "$BINARIES_DIR/" - fi - done - elif [ -f "$ROOT_DIR/rootfs.squashfs" ]; then - # Directory directly containing rootfs.squashfs - echo "Copying rootfs from $ROOT_DIR/rootfs.squashfs to $BINARIES_DIR/" - cp "$ROOT_DIR/rootfs.squashfs" "$BINARIES_DIR/" - # Copy partition images if they exist in same directory - for img in aux.ext4 cfg.ext4 var.ext4; do - if [ -f "$ROOT_DIR/$img" ]; then - cp "$ROOT_DIR/$img" "$BINARIES_DIR/" - fi - done - else - echo "Error: Could not find rootfs.squashfs in $ROOT_DIR" >&2 - exit 1 - fi -fi - -BOARD_DIR=$(dirname "$0") -GENIMAGE_CFG="${BUILD_DIR}/genimage.cfg" -GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp" - -# We've asked U-Boot previously to build overlays for us: Infix signing -# key and our ixboot scripts. Make sure here they are installed in the -# proper directory so genimage can create the DOS partition the SPL -# reads config.txt from. -find "${BINARIES_DIR}" -type f -name '*.dtbo' ! -path "${BINARIES_DIR}/rpi-firmware/overlays/*" -exec \ - mv '{}' "${BINARIES_DIR}/rpi-firmware/overlays/" \; - -# Create FILES array for the genimage.cfg generation -FILES="" -for f in "${BINARIES_DIR}"/rpi-firmware/*; do - case "$f" in - *~ | *.bak) - continue - ;; - esac - # If already exist it has been added by us. - echo "${FILES}" | grep -q "$(basename "$f")" && continue - FILES="${FILES}\t\t\t\"${f#"${BINARIES_DIR}/"}\",\n" -done - - -FILES="${FILES}\t\t\t\"splash.bmp\",\n" - -KERNEL=$(sed -n 's/^kernel=//p' "${BINARIES_DIR}/rpi-firmware/config.txt") -FILES="${FILES}\t\t\t\"${KERNEL}\"" - -# Create genimage.cfg from template .in -sed "s|#BOOT_FILES#|${FILES}|" "${BOARD_DIR}/genimage.cfg.in" | \ -sed "s|#INFIX_ID#|${INFIX_ID}|" | \ -sed "s|#VERSION#|${RELEASE}|" > "${GENIMAGE_CFG}" - -# Create temporary root path -ROOTPATH_TMP=$(mktemp -d) -trap 'rm -rf \"$ROOTPATH_TMP\"' EXIT - -# Clean previous genimage temp directory -rm -rf "${GENIMAGE_TMP}" - -# Generate the SD card image -genimage \ - --rootpath "${ROOTPATH_TMP}" \ - --tmppath "${GENIMAGE_TMP}" \ - --inputpath "${BINARIES_DIR}" \ - --outputpath "${BINARIES_DIR}" \ - --config "${GENIMAGE_CFG}" - -# Print the resulting image path -if [ "$STANDALONE" -eq 1 ]; then - echo "" - echo "SD card image created successfully:" - for img in "${BINARIES_DIR}"/*-sdcard.img; do - if [ -f "$img" ]; then - # Get relative path from current directory - rel_path=$(realpath --relative-to="$PWD" "$img" 2>/dev/null || echo "$img") - echo " $rel_path" - fi - done -fi diff --git a/configs/mt7986_sd_boot_defconfig b/configs/mt7986_sd_boot_defconfig index 7b76f885..af465dfe 100644 --- a/configs/mt7986_sd_boot_defconfig +++ b/configs/mt7986_sd_boot_defconfig @@ -31,6 +31,7 @@ BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/ BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_FORMAT_DTB=y BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/*.dtsi" +BR2_PACKAGE_HOST_BMAP_TOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/configs/nanopi_r2s_boot_defconfig b/configs/nanopi_r2s_boot_defconfig index 36bd87e3..2ea68514 100644 --- a/configs/nanopi_r2s_boot_defconfig +++ b/configs/nanopi_r2s_boot_defconfig @@ -37,6 +37,7 @@ BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.itb" BR2_TARGET_UBOOT_SPL=y BR2_TARGET_UBOOT_SPL_NAME="idbloader.img" BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="$(BR2_EXTERNAL_INFIX_PATH)/board/aarch64/friendlyarm-nanopi-r2s/uboot/r2s-env.dtsi" +BR2_PACKAGE_HOST_BMAP_TOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/configs/rpi4_boot_defconfig b/configs/rpi4_boot_defconfig index 8bcefb01..e64e1e30 100644 --- a/configs/rpi4_boot_defconfig +++ b/configs/rpi4_boot_defconfig @@ -33,6 +33,7 @@ BR2_TARGET_UBOOT_FORMAT_DTB=y BR2_TARGET_UBOOT_FORMAT_CUSTOM=y BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="arch/arm/dts/infix-key.dtbo arch/arm/dts/rpi-env.dtbo" BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/raspberry-pi64/uboot/rpi-env.dtso" +BR2_PACKAGE_HOST_BMAP_TOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y BR2_PACKAGE_HOST_UBOOT_TOOLS=y diff --git a/utils/mkimage.sh b/utils/mkimage.sh new file mode 100755 index 00000000..b2b25519 --- /dev/null +++ b/utils/mkimage.sh @@ -0,0 +1,357 @@ +#!/bin/sh +# Unified SD card image creation script for all boards +# Consolidates logic from board-specific mkimage.sh scripts +set -e + +STANDALONE="" +if [ -z "$BR2_EXTERNAL_INFIX_PATH" ]; then + SCRIPT_DIR=$(dirname "$0") + BR2_EXTERNAL_INFIX_PATH=$(cd "$SCRIPT_DIR/.." && pwd) +fi + +usage() +{ + cat < + +Options: + -h This help text + -l List available boards + -o Override auto-detection of genimage.sh, use host installed version + -b boot-dir Path to bootloader build directory (default: O= or output/) + -r root-dir Path to rootfs build directory or rootfs.squashfs file (default: O= or output/) + +Arguments: + board-name Board identifier (must come after options) + +Description: + When called from Buildroot (no options), uses environment variables: + BINARIES_DIR, BUILD_DIR, BR2_EXTERNAL_INFIX_PATH, RELEASE, INFIX_ID + + When called with -b/-r options, enters standalone mode and combines artifacts + from separate boot and rootfs sources. Useful for CI or manual image creation. + +Output: + SD card image saved to \$BINARIES_DIR/*-sdcard.img + +Examples: + # From Buildroot build: + $0 raspberrypi-rpi64 + + # Standalone with separate boot/rootfs builds: + $0 -b x-boot -r output raspberrypi-rpi64 + + # With downloaded rootfs: + $0 -b x-boot -r ~/Downloads/rootfs.squashfs friendlyarm-nanopi-r2s + +EOF +} + +log() +{ + printf '\033[7m>>> %s\033[0m\n' "$*" +} + +err() +{ + echo "Error: $*" >&2 +} + +die() +{ + err "$*" + exit 1 +} + +# List all supported boards by scanning for genimage.cfg.in files +list_boards() +{ + script_dir=$(dirname "$0") + board_base=$(cd "$script_dir/../board" 2>/dev/null && pwd) + + if [ -z "$board_base" ] || [ ! -d "$board_base" ]; then + echo "Error: Could not find board directory" >&2 + return 1 + fi + + echo "Available boards:" + find "$board_base" -name "genimage.cfg.in" -type f 2>/dev/null | \ + grep -v '/common/' | \ + sed 's|.*/board/\([^/]*\)/\([^/]*\)/.*| \2 (\1)|' | \ + sort -u +} + +# Run genimage directly (fallback when Buildroot wrapper not available) +run_genimage() +{ + genimage_cfg="$1" + genimage_tmp="${BUILD_DIR}/genimage.tmp" + rootpath_tmp=$(mktemp -d) + trap 'rm -rf "$rootpath_tmp"' EXIT + + rm -rf "$genimage_tmp" + + genimage \ + --rootpath "$rootpath_tmp" \ + --tmppath "$genimage_tmp" \ + --inputpath "${BINARIES_DIR}" \ + --outputpath "${BINARIES_DIR}" \ + --config "$genimage_cfg" + + if command -v bmaptool >/dev/null 2>&1; then + for img in "${BINARIES_DIR}"/*-sdcard.img; do + [ -f "$img" ] || continue + log "Generating block map for $(basename "$img")..." + bmaptool create -o "${img}.bmap" "$img" + done + fi +} + +# Validate board argument and find board directory +# Sets BOARD and BOARD_DIR globals or exits with error +validate_board() +{ + BOARD="$1" + if [ -z "$BOARD" ]; then + err "Board name required. Use -h for help." + return 1 + fi + + board_underscore=$(echo "$BOARD" | tr '-' '_') + for arch in aarch64 x86_64 riscv64; do + for variant in "$BOARD" "$board_underscore"; do + candidate="$BR2_EXTERNAL_INFIX_PATH/board/$arch/$variant" + if [ -d "$candidate" ]; then + BOARD_DIR="$candidate" + return 0 + fi + done + done + + err "Board directory not found for: $BOARD" + return 1 +} + +# Find build directory by checking O= or output/ +find_build_dir() +{ + # Check O= environment variable first + if [ -n "$O" ] && [ -f "$O/.config" ]; then + echo "$O" + return 0 + fi + + # Check output/ directory + if [ -f "output/.config" ]; then + echo "output" + return 0 + fi + + return 1 +} + +# Discover boot files for Raspberry Pi boot partition +# Scans rpi-firmware directory and builds file list for genimage +discover_rpi_boot_files() +{ + binaries_dir="$1" + files="" + + # Move any .dtbo overlays to proper location + find "${binaries_dir}" -type f -name '*.dtbo' ! -path "${binaries_dir}/rpi-firmware/overlays/*" -exec \ + mv '{}' "${binaries_dir}/rpi-firmware/overlays/" \; 2>/dev/null || true + + # Scan rpi-firmware directory for boot files + for f in "${binaries_dir}"/rpi-firmware/*; do + [ -e "$f" ] || continue + case "$f" in + *~ | *.bak) + continue + ;; + esac + # Skip if already in list + echo "${files}" | grep -q "$(basename "$f")" && continue + files="${files}\t\t\t\"${f#"${binaries_dir}/"}\",\n" + done + + # Add splash screen + files="${files}\t\t\t\"splash.bmp\",\n" + + # Add kernel (extract name from config.txt) + if [ -f "${binaries_dir}/rpi-firmware/config.txt" ]; then + kernel=$(sed -n 's/^kernel=//p' "${binaries_dir}/rpi-firmware/config.txt") + files="${files}\t\t\t\"${kernel}\"" + fi + + echo "$files" +} + +while getopts "hlob:r:" opt; do + case $opt in + h) + usage + exit 0 + ;; + l) + list_boards + exit 0 + ;; + b) + BOOT_DIR="$OPTARG" + STANDALONE=1 + ;; + o) + OVERRIDE=1 + ;; + r) + ROOT_DIR="$OPTARG" + STANDALONE=1 + ;; + *) + usage + exit 1 + ;; + esac +done +shift $((OPTIND - 1)) + +if ! validate_board "$1"; then + usage + exit 1 +fi + +# Standalone mode: set up environment from build directories +if [ -n "$STANDALONE" ]; then + if [ -z "$BOOT_DIR" ]; then + BOOT_DIR=$(find_build_dir) || die "Could not find boot directory. Use -b option" + fi + + if [ -z "$ROOT_DIR" ]; then + ROOT_DIR=$(find_build_dir) || die "Could not find rootfs directory. Set O= or use -r option" + fi + + # Set up environment variables, some required by genimage.sh + export BINARIES_DIR="$BOOT_DIR/images" + export BUILD_DIR="$BOOT_DIR/build" + export BR2_EXTERNAL_INFIX_PATH + export RELEASE="${RELEASE:-""}" + export INFIX_ID="${INFIX_ID:-"infix"}" + + # Add host tools to PATH (for genimage, bmaptool, etc.) + for dir in "$BOOT_DIR" "$ROOT_DIR"; do + if [ -d "$dir/host/bin" ]; then + export PATH="$dir/host/bin:$PATH" + break + fi + done + + # Copy rootfs and partition images to BINARIES_DIR + mkdir -p "$BINARIES_DIR" + if [ -f "$ROOT_DIR" ]; then + # Direct path to rootfs.squashfs file + log "Copying rootfs from $ROOT_DIR to $BINARIES_DIR/rootfs.squashfs" + cp "$ROOT_DIR" "$BINARIES_DIR/rootfs.squashfs" + elif [ -f "$ROOT_DIR/images/rootfs.squashfs" ]; then + # Build directory with images/ - copy rootfs and partition images + log "Copying artifacts from $ROOT_DIR/images/ to $BINARIES_DIR/" + cp "$ROOT_DIR/images/rootfs.squashfs" "$BINARIES_DIR/" + # Copy partition images if they exist + for img in aux.ext4 cfg.ext4 var.ext4; do + if [ -f "$ROOT_DIR/images/$img" ]; then + cp "$ROOT_DIR/images/$img" "$BINARIES_DIR/" + fi + done + elif [ -f "$ROOT_DIR/rootfs.squashfs" ]; then + # Directory directly containing rootfs.squashfs + log "Copying rootfs from $ROOT_DIR/rootfs.squashfs" + cp "$ROOT_DIR/rootfs.squashfs" "$BINARIES_DIR/" + # Copy partition images if they exist + for img in aux.ext4 cfg.ext4 var.ext4; do + if [ -f "$ROOT_DIR/$img" ]; then + cp "$ROOT_DIR/$img" "$BINARIES_DIR/" + fi + done + else + die "Could not find rootfs.squashfs in $ROOT_DIR" + fi +else + # Export for Buildroot genimage.sh wrapper + export BINARIES_DIR + export BUILD_DIR +fi + +# Validate required environment variables +: "${BINARIES_DIR:?'not set'}" +: "${BUILD_DIR:?'not set'}" +: "${BR2_EXTERNAL_INFIX_PATH:?'not set'}" + +# Set defaults for optional variables +: "${RELEASE:=""}" +: "${INFIX_ID:="infix"}" + +# Template expansion +log "Generating genimage configuration for $BOARD..." + +GENIMAGE_CFG="${BUILD_DIR}/genimage.cfg" +GENIMAGE_TEMPLATE="$BOARD_DIR/genimage.cfg.in" +[ -f "$GENIMAGE_TEMPLATE" ] || die "genimage.cfg.in not found in $BOARD_DIR" + +# Check if board needs special boot file discovery (Raspberry Pi) +if [ "$BOARD" = "raspberrypi-rpi64" ] && grep -q '#BOOT_FILES#' "$GENIMAGE_TEMPLATE"; then + log "Discovering Raspberry Pi boot files..." + BOOT_FILES=$(discover_rpi_boot_files "$BINARIES_DIR") + # Create temp file with interpreted escape sequences + bootfiles_tmp="${BUILD_DIR}/bootfiles.tmp" + printf '%b' "$BOOT_FILES" > "$bootfiles_tmp" + # Use sed to insert content and delete placeholder + sed -e "/#BOOT_FILES#/r $bootfiles_tmp" -e "/#BOOT_FILES#/d" "$GENIMAGE_TEMPLATE" > "${GENIMAGE_CFG}.tmp" + rm -f "$bootfiles_tmp" + GENIMAGE_TEMPLATE="${GENIMAGE_CFG}.tmp" +fi + +# Epxand template variables +sed "s|#VERSION#|${RELEASE}|" "$GENIMAGE_TEMPLATE" | \ +sed "s|#INFIX_ID#|${INFIX_ID}|" | \ +sed "s|#TARGET#|sd|" > "$GENIMAGE_CFG" + +# Clean up temp file if created +rm -f "${GENIMAGE_CFG}.tmp" + +# Find and set up for calling genimage/genimage.sh +if [ -z "$BR2_CONFIG" ]; then + BR2_CONFIG="/dev/null" + if [ -f "${BUILD_DIR}/../.config" ]; then + BR2_CONFIG="$(realpath "${BUILD_DIR}/../.config")" + fi + export BR2_CONFIG + + if [ -f "$BR2_EXTERNAL_INFIX_PATH/../buildroot/support/scripts/genimage.sh" ]; then + GENIMAGE_WRAPPER="$(realpath "$BR2_EXTERNAL_INFIX_PATH/../buildroot/support/scripts/genimage.sh")" + fi +else + GENIMAGE_WRAPPER="support/scripts/genimage.sh" +fi + +if [ -z "$OVERRIDE" ] && command -v "$GENIMAGE_WRAPPER" >/dev/null 2>&1; then + log "Creating SD card image using Buildroot $(basename "$GENIMAGE_WRAPPER") ..." + "$GENIMAGE_WRAPPER" -c "$GENIMAGE_CFG" +else + log "Creating SD card image ..." + run_genimage "$GENIMAGE_CFG" +fi + +log "SD card image created successfully:" +for img in "${BINARIES_DIR}"/*-sdcard.img*; do + if [ -f "$img" ]; then + if [ -n "$STANDALONE" ]; then + # Show relative path in standalone mode + rel_path=$(realpath --relative-to="$PWD" "$img" 2>/dev/null || echo "$img") + echo " $rel_path" + else + echo " $(basename "$img")" + fi + fi +done From 02615be500ab6e16d2e1c9f4948095f7e2fab3c0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 12:28:04 +0100 Subject: [PATCH 25/27] configs: rename BPi-R3 bootloader defconfig for consistency Signed-off-by: Joachim Wiberg --- .github/workflows/build-boot.yml | 2 +- .github/workflows/build-image.yml | 2 +- configs/{mt7986_sd_boot_defconfig => bpi_r3_boot_defconfig} | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename configs/{mt7986_sd_boot_defconfig => bpi_r3_boot_defconfig} (85%) diff --git a/.github/workflows/build-boot.yml b/.github/workflows/build-boot.yml index 708337dc..bf445b41 100644 --- a/.github/workflows/build-boot.yml +++ b/.github/workflows/build-boot.yml @@ -20,7 +20,7 @@ jobs: - cn9130_crb_boot - aarch64_qemu_boot - rpi4_boot - - mt7986_sd_boot + - bpi_r3_boot env: MAKEFLAGS: -j5 steps: diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 0875e28e..2dea91f7 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -58,7 +58,7 @@ jobs: echo "TARGET=aarch64" >> $GITHUB_ENV ;; bananapi-bpi-r3) - echo "BOOTLOADER=mt7986_sd_boot" >> $GITHUB_ENV + echo "BOOTLOADER=bpi_r3_boot" >> $GITHUB_ENV echo "TARGET=aarch64" >> $GITHUB_ENV ;; friendlyarm-nanopi-r2s) diff --git a/configs/mt7986_sd_boot_defconfig b/configs/bpi_r3_boot_defconfig similarity index 85% rename from configs/mt7986_sd_boot_defconfig rename to configs/bpi_r3_boot_defconfig index af465dfe..35515bd8 100644 --- a/configs/mt7986_sd_boot_defconfig +++ b/configs/bpi_r3_boot_defconfig @@ -27,10 +27,10 @@ BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y BR2_TARGET_UBOOT_CUSTOM_VERSION=y BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2025.01" BR2_TARGET_UBOOT_BOARD_DEFCONFIG="mt7986a_bpir3_sd" -BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/sd-extras.config" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="${BR2_EXTERNAL_INFIX_PATH}/board/common/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/bananapi-bpi-r3/uboot/extras.config ${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/bananapi-bpi-r3/uboot/sd-extras.config" BR2_TARGET_UBOOT_NEEDS_DTC=y BR2_TARGET_UBOOT_FORMAT_DTB=y -BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/src/board/banana-pi-r3/uboot/*.dtsi" +BR2_TARGET_UBOOT_CUSTOM_DTS_PATH="${BR2_EXTERNAL_INFIX_PATH}/board/aarch64/bananapi-bpi-r3/uboot/*.dtsi" BR2_PACKAGE_HOST_BMAP_TOOLS=y BR2_PACKAGE_HOST_GENIMAGE=y BR2_PACKAGE_HOST_RAUC=y From 2fa495b11278b0c67dcb2585aed1c53f2998da8f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 31 Oct 2025 11:39:59 +0100 Subject: [PATCH 26/27] .github: cleanup podman state before each run Signed-off-by: Joachim Wiberg --- .github/workflows/build-release.yml | 12 +++++++++++- .github/workflows/build.yml | 9 +++++++++ .github/workflows/release.yml | 12 +++++++++++- .github/workflows/test.yml | 10 ++++++++++ 4 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 3c4f3117..4b0e997a 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -14,12 +14,22 @@ on: jobs: build: name: Build Infix ${{ inputs.version }} [${{ matrix.target }}] - runs-on: [ self-hosted, release ] + runs-on: [self-hosted, release] strategy: matrix: target: [aarch64, x86_64] fail-fast: false steps: + - name: Cleanup podman state + run: | + set -x + podman ps -a || true + podman stop -a || true + podman rm -a -f || true + podman volume prune -f || true + podman system prune -a -f || true + podman system migrate || true + - uses: actions/checkout@v4 with: clean: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5856dec..a58b2d54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,15 @@ jobs: rm -rf ./* || true rm -rf ./.??* || true ls -la ./ + - name: Cleanup podman state + run: | + set -x + podman ps -a || true + podman stop -a || true + podman rm -a -f || true + podman volume prune -f || true + podman system prune -a -f || true + podman system migrate || true - name: Checkout infix repo uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cddcabe1..d9734393 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,11 +43,21 @@ jobs: release: name: Release Infix ${{ github.ref_name }} needs: build - runs-on: [ self-hosted, release ] + runs-on: [self-hosted, release] permissions: contents: write discussions: write steps: + - name: Cleanup podman state + run: | + set -x + podman ps -a || true + podman stop -a || true + podman rm -a -f || true + podman volume prune -f || true + podman system prune -a -f || true + podman system migrate || true + - uses: actions/checkout@v4 with: submodules: 'true' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f55cf245..c9f96e99 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,16 @@ jobs: name: Regression Test ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.name || inputs.name }} ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.target || inputs.target }} runs-on: [self-hosted, regression] steps: + - name: Cleanup podman state + run: | + set -x + podman ps -a || true + podman stop -a || true + podman rm -a -f || true + podman volume prune -f || true + podman system prune -a -f || true + podman system migrate || true + - name: Checkout infix repo uses: actions/checkout@v4 with: From b1e08bd32fc1344cd52aa050bb769fb0f571a6be Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 29 Oct 2025 20:30:49 +0100 Subject: [PATCH 27/27] doc: update ChangeLog for v25.10 release Signed-off-by: Joachim Wiberg --- doc/ChangeLog.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 0cc4e024..bfcd8206 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -6,19 +6,38 @@ All notable changes to the project are documented in this file. [v25.10.0][] - 2025-10-31 ------------------------- +> [!NOTE] +> Noteworthy changes and additions in this release: +> +> **🛡️ Zone-Based Firewall (ZBF):** Protect your network with our zone-based +> firewall powered by [firewalld][]. Define security zones, set policies +> between them, and enable masquerading. +> +> **📊 System & Hardware Monitoring:** CLI `show system`, `show services`, and +> `show hardware` now give you instant visibility into CPU temperature, fan +> speeds, memory, running services, and sensor data from SFP modules, WiFi radios, +> and more. All operational data also available over NETCONF and RESTCONF. +> +> **🚀 Expanded Hardware Support:** The NanoPi R2S is now included in the +> default Aarch64 build, which also adds support for Raspberry Pi 3B, and +> Raspberry Pi CM4 variants. All boards now benefit from automatic `/var` +> partition expansion on first boot. + +[firewalld]: https://firewalld.org + ### Changes - Upgrade Buildroot to 2025.02.7 (LTS) - Upgrade Linux kernel to 6.12.56 (LTS) -- Extend NETCONF and RESTCONF scripting documentation with operational - data examples, discovery patterns, and common workflow examples, issue #1156 +- Extend NETCONF and RESTCONF scripting documentation with operational data + examples, discovery patterns, and common workflow examples, issue #1156 - Initial support for a zone-based firewall, based on `firewalld`, issue #448 - Add `validate` option to CLI `copy` command. This can be used before doing a restore of a backup, or when having edited configuration files manually. With the validate flag (`-n` from the shell) the file is only loaded and validated against the YANG models, it is *not* rolled in if validation is successful. Example: `copy /media/backup/old.cfg running-config validate`, issue #373 -- Automatically expand `/var` partition on SD card at first boot on RPi +- Automatically expand `/var` partition at first boot on all MMC-based devices - New `upgrade` RPC (action) for containers using images with mutable tags - Optimize startup of preexisting containers by adding metadata to track all OCI archives loaded into container store, and all container configurations @@ -26,6 +45,17 @@ All notable changes to the project are documented in this file. metadata from an existing instance does not match either the configuration or the image — because of configuration changes or image upgrades - Updated container documentation on volumes, image tags, and image upgrade +- Add new `show services` command to display running system services +- Add new `show system` command with comprehensive system overview including + hostname, uptime, load average, CPU/fan temperatures, memory, disk usage +- Add hardware sensor monitoring support in `show hardware` with hierarchical + display of temperature, fan, voltage, current, and power sensors +- Add support for NanoPi R2S router platform to the default Aarch64 build, + bumping it to Tier 2 support (SD-card images built separately) +- Add support for Raspberry Pi 3B (BCM2837) +- Add support for Raspberry Pi Compute Module 4 IoT Router Board Mini +- Add support for Raspberry Pi Compute Module 4 NVME NAS box +- Add `reboot` option to CLI `upgrade` command for automatic system restart ### Fixes