Skip to content

bananapi_bpi r4pro 8x

Benjamin Yousefi edited this page Jun 8, 2026 · 5 revisions

BPI-R4 Pro (8X)

Hardware Implementation
Chipset MediaTek MT7988A (Filogic 880)
CPU Quad-core Arm Cortex-A73, 1.8GHz processor
RAM 8GB DDR4
M.2 E-Key 2230 (2x) PCIe3.0 1-lane interface for NVME SSD

Network

Hardware and driver mapping

Group DTB Interface Name OS Renamed To Speed Driver / Underlying Hardware
CPU Link eth0 eth0 10Gbps mtk_soc_eth (Internal link to MT7530)
CPU Link eth1 lan 10Gbps mtk_soc_eth (Direct link to WAN Mux)
CPU Link eth2 eth2 10Gbps mtk_soc_eth (Internal link to MxL86252C)
1G LAN lan0@eth0 lan5@eth0 1Gbps MediaTek MT7530 (Internal PHY)
1G LAN lan3@eth0 lan3@eth0 1Gbps MediaTek MT7530 (Internal PHY)
2.5G LAN mxl_lan0@eth2 lan1@eth2 2.5Gbps MaxLinear MxL86252C (Internal GPY PHY)
2.5G LAN mxl_lan1@eth2 lan2@eth2 2.5Gbps MaxLinear MxL86252C (Internal GPY PHY)
2.5G LAN mxl_lan2@eth2 mxl_lan2@eth2 2.5Gbps MaxLinear MxL86252C (Internal GPY PHY)
2.5G LAN mxl_lan3@eth2 lan4@eth2 2.5Gbps MaxLinear MxL86252C (Internal GPY PHY)
10G WAN eth1 (Mux Ch0) lan 10Gbps Aeonsemi AS21xxx (phy@28)
10G WAN eth1 (Mux Ch1) lan 10Gbps SFP+ Module (sfp2 / sfp@5f)
10G LAN mxl_lan5@eth2 (Mux Ch1) mxl_lan5@eth2 10Gbps Aeonsemi AS21xxx (phy@24)
10G LAN mxl_lan5@eth2 (Mux Ch0) mxl_lan5@eth2 10Gbps SFP+ Module (sfp1 / sfp@57)

Port numbered from left (1) to right, where the last right port is next to DC12V connection.

Architecture and routing

RJ45 Interface Name Logical Type Intermediary Switch / Mux Physical Endpoint
- eth0 CPU Master Port None (Direct to Switch) SoC Internal -> MT7530 Switch
7 eth1 (lan) 10G WAN Shared ethernet-mux@1 (GPIO 3) RJ45: Aeonsemi PHYSFP+: SFP Cage 2
- eth2 CPU Master Port None (Direct to Switch) SoC Internal -> MxL86252C Switch
5 lan0@eth0 1G User Port MediaTek MT7530 MT7530 Port 0
- lan3@eth0 1G User Port MediaTek MT7530 MT7530 Port 3
1 mxl_lan0@eth2 2.5G User Port MaxLinear MxL86252C MxL86252C Port 0
2 mxl_lan1@eth2 2.5G User Port MaxLinear MxL86252C MxL86252C Port 1
3 mxl_lan2@eth2 2.5G User Port MaxLinear MxL86252C MxL86252C Port 2
4 mxl_lan3@eth2 2.5G User Port MaxLinear MxL86252C MxL86252C Port 3
- mxl_lan4@eth2 Disabled in DTB MaxLinear MxL86252C MxL86252C Port 4 (Unused)
6 mxl_lan5@eth2 10G LAN Shared MxL86252C Port 6 -> ds-mux@0 (GPIO 54) RJ45: Aeonsemi PHYSFP+: SFP Cage 1

Partition

  • Hardware
block Device Size Comment
mtdblock0 SPI NAND 256 MB Initial bootloader
mtdblock1 SPI NAND 256 MB Initial bootloader
mtdblock2 SPI NAND 256 MB Initial bootloader
mtdblock3 SPI NAND 256 MB Initial bootloader
mmcblk? eMMC 8 GB Requires to be set by DIP switch
ubiblock0_4 SPI NAND UBI 256 MB Initial bootloader
  • BPI-R4Pro-8X-BE14-MT76-OpenWRT24.10-DSA-sdcard-251229
# Sector Start Sector Stop Size Name Content
1 34 8191 4.0 MiB bl2 idbloader.img
2 8192 9215 512 KiB ubootenv U-Boot env (empty)
3 9216 13311 2.0 MiB factory Factory data (empty)
4 13312 21503 4.0 MiB fip fip-full.bin (BL31+U-Boot)
5 24576 286719 128 MiB recovery Recovery squashfs
6 286720 327679 20 MiB install SPINAND installer
7 327680 1245183 448 MiB production Root filesystem

Partition overview:

Dec      Hexa       Description
--------------------------------------------------------------
0        0x0       Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 4096 bytes
4096     0x1000    gzip compressed data, operating system:
                   Unix, timestamp: 1970-01-01 00:00:00,
                   total size: 6744914 bytes
6750208  0x670000  Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 55905 bytes
6807552  0x67E000  Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 1550 bytes
6811648  0x67F000  Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 289 bytes
6815744  0x680000  Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 1478 bytes
6819840  0x681000  Device tree blob (DTB), version: 17, CPU ID: 0,
                   total size: 2293 bytes
6823936  0x682000  SquashFS file system, little endian, version: 4.0,
                   compression: xz, inode count: 3874,
                   block size: 262144,
                   image size: 105268801 bytes, created: 2025-06-17 03:09:13

Where the DTBs:

Name  Position      Description
      0x0.dtb       FIT image metadata (describes kernel image), not a hardware DTB – Can be ignored
main  0x670000.dtb  Main board DTB – contains most hardware (CPU, PCIe, Ethernet, I2C, etc.) but no MMC node.
emmc  0x67E000.dtb  Overlay that configures mmc0 for eMMC (8‑bit, HS400).
rtc   0x67F000.dtb  Overlay to enable the RTC (pcf8563).
sd    0x680000.dtb  Overlay that configures mmc0 for SD card (4‑bit, CD pin, etc.).
wifi  0x681000.dtb  Overlays for WiFi regulators and PCIe WiFi nodes

Extract

Partition 7

  1. Write the official SD-card system image dd if=BPI-R4Pro-8X-BE14-MT76-OpenWRT24.10-DSA-sdcard-251229.img of=/dev/sd? bs=1M count=20 conv=fsync
  2. Repair the partition, e.g.
    • gdisk /dev/sd?
    • Warning! Secondary header is placed too early on the disk! Do you want to correct this problem? (Y/N): n
  3. Extract partition 7 dd if=/BPI-R4Pro-8X-BE14-MT76-OpenWRT24.10-DSA-sdcard-251229.img of=prod.bin bs=512 skip=327680 count=$((546816 - 327680)) status=progress

Create partition on SD

  1. Make sure the storage device is unmounted lslbk -f
  2. Wipe the existing partition table sgdisk -Z /dev/sd?
  3. Ensure the beginning of the device is empty dd if=/dev/zero of=/dev/sd? bs=1M count=20

I could not recreate a working partition map and boot process. The approach taken:

  1. Write the official SD-card system image dd if=BPI-R4Pro-8X-BE14-MT76-OpenWRT24.10-DSA-sdcard-251229.img of=/dev/sd? bs=1M count=20 conv=fsync
  2. Delete partitions 5, 6, 7, e.g.
    • fdisk /dev/sdb? and d
  3. Create a new partition; it becomes the fifth, e.g.
    • fdisk /dev/sdb? and n
  4. Format the partition 5 to ext4 mkfs.ext4 -L root /dev/sd?5
  5. Make a note of the PARTUUID: blkid /dev/sd?5

Boot-loader

Copy from BPI-R4Pro-8X-BE14-MT76-OpenWRT (24.10-DSA-251229)

I tried many different methods to extract the boot loader from the image. They all failed. The successful solution was to boot the OS and copy:

  • /sys/firmware/fdt
  • Rename it to mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb

Linux

Boot kernel - Probe and test

Boot up with the SD-card. The official boot menu should come up:

      ( ( ( OpenWrt ) ) )  [SD card]       U-Boot 2024.10-OpenWrt-unknown (Jun 17 2025 - 03:09:13 +00
    1. Run default boot command.
    2. Boot system via TFTP.
    3. Boot production system from SD card.
    4. Boot recovery system from SD card.
    5. Load production system via TFTP then write to SD card.
    6. Load recovery system via TFTP then write to SD card.
    7. Install bootloader, recovery and production to NAND.
    8. Reboot.
    9. Reset all settings to factory defaults.
    0. Exit


Press UP/DOWN to move, ENTER to select, ESC to quit
  1. Exit the menu (0)

Confirm root and boot:

  • ls mmc 0:5
  • ls mmc 0:5 /boot

Test kernel boot: setenv kernel_addr_r 0x50000000 setenv fdt_addr_r 0x60000000 setenv ramdisk_addr_r 0x62000000

  1. Load the Kernel (usually around 20-30MB) ext4load mmc 0:5 ${kernel_addr_r} /boot/Image

  2. Load the Device Tree Blob (the hardware map) ext4load mmc 0:5 ${fdt_addr_r} /boot/dtbs/mediatek/mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb

  3. Set the Kernel command line setenv bootargs "console=ttyS0,115200 root=/dev/mmcblk0p5 rw rootwait" setenv bootargs "console=ttyS0,115200 root=/dev/mmcblk0p5 rw rootwait earlycon=uart8250,mmio32,0x11000000"

  4. Boot the ARM64 kernel image booti ${kernel_addr_r} - ${fdt_addr_r}

Configuration

The OpenWRT U-boot does not support "sysboot".

If using initrd:

  • setenv boot_arch 'setenv kernel_addr_r 0x50000000; setenv fdt_addr_r 0x60000000; setenv ramdisk_addr_r 0x62000000; ext4load mmc 0:5 ${kernel_addr_r} /boot/Image; ext4load mmc 0:5 ${fdt_addr_r} /boot/dtbs/mediatek/mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb; ext4load mmc 0:5 ${ramdisk_addr_r} /boot/uInitrd; setenv bootargs "console=ttyS0,115200 pci=rescan root=/dev/mmcblk0p5 rw rootwait earlycon=uart8250,mmio32,0x11000000"; booti ${kernel_addr_r} ${ramdisk_addr_r} ${fdt_addr_r}'
  • The NVMe modules are however loaded before the PCI bridge. The kernel command line pci=rescan scans the bus after the modules loaded. However, it rescans for all modules. If required to only load specific modules, use initramfs "hooks".

Else:

  • setenv boot_arch 'setenv kernel_addr_r 0x50000000; setenv fdt_addr_r 0x60000000; ext4load mmc 0:5 ${kernel_addr_r} /boot/Image; ext4load mmc 0:5 ${fdt_addr_r} /boot/dtbs/mediatek/mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb; setenv bootargs "console=ttyS0,115200 root=/dev/mmcblk0p5 rw rootwait earlycon=uart8250,mmio32,0x11000000"; booti ${kernel_addr_r} - ${fdt_addr_r}'

Test run:

  • run boot_arch # test that boot_arch works

Permanently store the settings:

setenv bootcmd "run boot_arch"
setenv bootdelay 2
saveenv

Arch Linux Arm

Official version (Linux kernel 6.18.3-1-aarch64-ARCH updated to 7.0.3)

As if writing (2026-06) the mainline support for the board is still in progress and is still not sufficient for the system to boot up. The working approach to achieve full support for DTB, SystemD, NVMe and Ethernet ports was to compile the official SINOVOIP BPI-R4Pro-8X-BE14-MT76-OpenWRT (24.10-DSA-251229) and use its DTB, firmware, Image, modules.

  1. Mount the root partition mount /dev/sd?5 /mnt
  2. Extract Arch Linux ARM distribution to mount point as root user and not as sudo in order to preserve the extended attributes and ACL:
  • tar -xvpf ArchLinuxARM-aarch64-latest.tar -C /mnt or
  • bsdtar -xpf ArchLinuxARM-aarch64-latest.tar -C /mnt and
  • sync
  1. arch-chroot /mnt
  • Setup the system and install necessary packages:
    • pacman-key --init
    • pacman-key --populate archlinuxarm
    • pacman --disable-sandbox -Syy
    • pacman --disable-sandbox -Sy archlinux-keyring
    • pacman --disable-sandbox -Syu
    • pacman --disable-sandbox -S linux-firmware-mediatek linux-firmware-other libgpiod
  • Recommended packages:
    • pacman --disable-sandbox -S dtc ethtool i2c-tools libgpiod uboot-tools usbtools
  1. If pre-configuring the system:
    • Basic system configuration
    • Install necessary packages, for example to read manuals, compile, copy files, network.
    • Exit arch-chroot
  2. If intending to install on the eMMC (8GB) or SPI NAND (256MB) or SSD/NVMe.
    • Copy ArchLinuxARM-aarch64-latest.tar or ensure that rsync is installed
    • Boot with SD-Card then mount local eMMC or SPI NAND:
      • Partition the eMMC, for example mmcblk0
      • Extract Arch Linux Arm to mounted root (step 2 above) or
      • Copy OS from SD to local eMMC rsync -avxHAXhn --exclude='/mnt' / /mnt
  3. Build BPI-R4Pro-8X-BE14-MT76-OpenWRT (24.10-DSA-251229)
    • Copy the Image: build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/arch/arm64/boot/Image /mnt/boot/
    • Copy modules:
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/packages/ipkg-aarch64_cortex-a53/*/lib/modules/6.6.93/* /mnt/lib/modules/6.6.93/
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/modules.builtin /mnt/lib/modules/6.6.93/
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/modules.order /mnt/lib/modules/6.6.93/
    • Copy firmware:
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-firmware-20241110/mediatek /mnt/lib/firmware/
    • Copy Aeonsemi AS21xxx module and firmware
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/phy-as21xxx/ipkg-aarch64_cortex-a53/as21xxx-firmware/lib/firmware/as21x1x_fw.bin /mnt/lib/firmware/
        • May be necessary to create a symbolic link to it from /mnt/lib/firmware/
      • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/phy-as21xxx/ipkg-aarch64_cortex-a53/kmod-phy-as21xxx/lib/modules/6.6.93/aeon_as21xxx.ko /mnt/lib/modules/6.6.93/
    • Build module dependency map depmod -a 6.6.93
    • Load modules:
      • Test: modprobe <modulenmae without the KO extension>"
      • echo "i2c_mux_pca954x" > /etc/modprobe.d/05-rtc.conf
      • echo "rtc_pcf8563" >> /etc/modprobe.d/05-rtc.conf
      • echo "aeon_as21xxx" > /mnt/etc/modules-load.d/10-ethernet.conf
      • echo "xhci-mtk-hcd" > /mnt/etc/modules-load.d/15-usb.conf
      • echo "usb-storage" >> /mnt/etc/modules-load.d/15-usb.conf
      • echo "nvme" > /mnt/etc/modules-load.d/20-nvme.conf
      • echo "nfs" > /mnt/etc/modules-load.d/30-nfs.conf
    • arch-chroot /mnt
      • "Mask" EFI mounting:
        • systemctl mask efi.mount
        • systemctl mask efi.automount
      • If intending to mount root on NVMe then initramfs/initrd is necessary:
        • Add NVMe modules MODULES=(nvme nvme-core)
        • mkinitcpio -k 6.6.93 -g /boot/initramfs-linux.img
        • Verify lsinitcpio /boot/initramfs-linux.img | grep -i nvme
        • The OpenWRT U-boot does not support initramfs. Create initrd from initramfs:
        • mkimage -A arm64 -O linux -T ramdisk -C none -n "Arch Linux ARM initramfs" -d /boot/initramfs-linux.img /boot/uInitrd
      • Exit arch-chroot
  4. unmount /mnt
  5. The system should boot, with working NVMe and Ethernet.
    • User account and password: alarm
    • Root password: root
  6. Full system update to the latest Linux kernel but with risk that boot will fail or break NVMe or Ethernet.

Package

package description
... ...

Basic system configuration

A minimal configuration to expand depending on additional functional requirements:

  • Enable NTP system clock: systemctl enable --now systemd-timesyncd
  • Change root password
  • Remove user "alarm", add users
file package configure
/etc/adjtime (base) Adjust the hardware clock from the system clock with the assumption that the hardware clock is in UTC: hwclock --systohc --utc
/etc/hostname (base) Edit file in a text editor; add <hostname>. Alternatively, use SystemD hostnamectl set-hostname <hostname>
/etc/hosts (base) Edit file in a text editor: 127.0.0.1 <hostname>.localdomain <hostname>
/etc/localtime (base) A syslink from the Time Zone Database database to localtime: ln -sf /usr/share/zoneinfo/<region>/<city> /etc/localtime
/etc/locale.conf (base) Add locale, for example, LANG=en_US.UTF-8.
/etc/locale.gen (base) Uncomment locale in locale.gen and generate locale.conf and resources in /usr/lib/locale with locale-gen. Remember, any additional language later assigned requires to be uncommented in the locale.gen and locale-gen re-generated.
/etc/vconsole.conf (base) Add keyboard loadkeys keymap as KEYMAP=<keymap>.

BPI-R4Pro-8X-BE14-MT76-OpenWRT (24.10-DSA-251229)

Build

Overview:

  1. Do not follow the official documentation
    • ./scripts/feeds update -a can introduce errors
  2. Build toolchain
  3. Compile firmware
  4. Compile Image
  5. Compile modules
  6. Compile out-of-tree module and firmware
    • as21xxx

All modules must be replaced if compiling modules that requires re-compiling the kernel image.

On Arch Linux with GCC version 16.1.1 2026-04-30:

  • pacman -S --needed base-devel git bzip2 gawk gettext grep libunistring unzip which python perl wget subversion rsync time

When running code ensure as same user as owner of downloaded repository, for example

  • sudo -u nobody ... V=sc
  • sudo -u nobody sh -c '...' # Requires "user" sudo permission for "su"
  1. Configure kernel
  • make menuconfig
  • Enable devtmpfs, necessary for SystemD
    • Global build settings / Kernel build options /
      • Enables devtmpfs support CONFIG_DEVTMPFS=y
      • Automatically mounts devtmpfs on /dev CONFIG_DEVTMPFS_MOUNT=y
  • Enable NVMe support
    • Kernel modules / Block devices: kmod-nvme / M or *
    • Kernel modules / Hardware Monitoring Support / M or *
  • Enable NFSv4 support:
    • Kernel modules / Filesystems / Network File Systems:
      • NFS filesystem client support (kmod-fs-nfs)
      • NFS4 filesystem client support (kmod-fs-nfs-v4)
    • Fine tuning NFSv4 support: kernel_menuconfig
      • File systems / Network File Systems
        <M>   NFS client support
        < >     NFS client support for NFS version 2
        <M>     NFS client support for NFS version 3
        [ ]       NFS client support for the NFSv3 ACL protocol extension
        <M>     NFS client support for NFS version 4
        [ ]     Provide swap over NFS support
        [*]   NFS client support for NFSv4.1
        [*]     NFS client support for NFSv4.2
        (kernel.org) NFSv4.1 Implementation ID Domain (NEW)
        [*]     NFSv4.1 client support for migration
        [ ]   Use the legacy NFS DNS resolver (NEW)
        [ ]   NFS: Disable NFS UDP protocol support
        [*]   NFS: Enable support for the NFSv4.2 READ_PLUS operation
        <M>   NFS server support
        [ ]     NFS server support for NFS version 2 (DEPRECATED)
        [ ]     NFS server support for the NFSv3 ACL protocol extension
        [*]     NFS server support for NFS version 4
        [*]   NFSv4.1 server support for pNFS block layouts
        [*]   NFSv4.1 server support for pNFS SCSI layouts
        [*]   NFSv4.1 server support for pNFS Flex File layouts
        [*]   NFSv4.2 inter server
        
  1. Update config: make defconfig
  2. Build toolchain
    • Patch cmake
    • If running gnu++20 (GCC version 16), either
      • patch GCC errors or
      • fix them when they occur
    • make toolchain/compile V=sc
  3. Build firmware: make package/firmware/linux-firmware/compile V=sc
  4. Build image: make target/linux/compile -j1 V=sc
  5. Build modules: make package/kernel/linux/compile -j1 V=sc
    • build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/packages/ipkg-aarch64_cortex-a53/
  6. Build out-of-tree firmware and modules: make package/kernel/as21xxx/compile -j1 V=sc

Patch CMake

Error:

FAILED: cmake
staging_dir/host/bin/g++ ...
/usr/bin/ld: cmake.o: in function `cmake::CreateGlobalGenerator(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
cmake.cxx:(.text+0xcebd): undefined reference to `cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake*)'
/usr/bin/ld: cmake.o: in function `cmake::AppendGlobalGeneratorsDocumentation(std::vector<cmDocumentationEntry, std::allocator<cmDocumentationEntry> >&)':
cmake.cxx:(.text+0xde76): undefined reference to `cmGlobalGhsMultiGenerator::GetDocumentation()'
/usr/bin/ld: cmake.o: in function `cmGlobalGeneratorSimpleFactory<cmGlobalGhsMultiGenerator>::GetDocumentation() const':
cmake.cxx:(.text._ZNK30cmGlobalGeneratorSimpleFactoryI25cmGlobalGhsMultiGeneratorE16GetDocumentationEv[_ZNK30cmGlobalGeneratorSimpleFactoryI25cmGlobalGhsMultiGeneratorE16GetDocumentationEv]+0x17): undefined reference to `cmGlobalGhsMultiGenerator::GetDocumentation()'
/usr/bin/ld: cmake.o: in function `cmGlobalGeneratorSimpleFactory<cmGlobalGhsMultiGenerator>::CreateGlobalGenerator(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, cmake*) const':
cmake.cxx:(.text._ZNK30cmGlobalGeneratorSimpleFactoryI25cmGlobalGhsMultiGeneratorE21CreateGlobalGeneratorERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbP5cmake[_ZNK30cmGlobalGeneratorSimpleFactoryI25cmGlobalGhsMultiGeneratorE21CreateGlobalGeneratorERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEbP5cmake]+0xd6): undefined reference to `cmGlobalGhsMultiGenerator::cmGlobalGhsMultiGenerator(cmake*)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Remedy: tools/cmake/patches/170-kitware-disable-devirtualization.patch

--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -129,7 +129,7 @@
-#endif
 
 // NOTE: the __linux__ macro is predefined on Android host too, but
 // main CMakeLists.txt filters out this generator by host name.
-#if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
-#  include "cmGlobalGhsMultiGenerator.h"
-#endif
+#  if (defined(__linux__) && !defined(__ANDROID__)) || defined(_WIN32)
+#    include "cmGlobalGhsMultiGenerator.h"
+#  endif
+#endif

If access to the cmake.cxx source file, test that the patch works: patch --dry-run build_dir/host/cmake-3.30.5/Source/cmake.cxx -p1 < tools-cmake\ 170-kitware-disable-devirtualization.patch

Fix GCC error

To cumbersome to create patches; fix when they appear:

  • error: no matching function for call to 'S2C(const char8_t):

    • Remedy: sed -i 's/u8"/"/g' build_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/gcc-13.3.0/libcody/*.cc build_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/gcc-13.3.0/libcody/*.hh
  • "locale_facets.h" errors:

    • Remedy: sed -i '1i #ifdef __cplusplus\n#include <locale>\n#include <memory>\n#include <string>\n#endif' build_dir/toolchain-aarch64_cortex-a53_gcc-13.3.0_musl/gcc-13.3.0/gcc/system.h

Clean kernel compilation

  1. Remove the kernel source tree and compiled objects
  • make target/linux/clean
  1. Remove the packaged .ipk kernel modules and their staging files
  • make package/kernel/linux/clean

The toolchain, host tools, and non‑kernel packages should remain.

Error

depmod -a 6.6.93
depmod: WARNING: could not open modules.order at /lib/modules/6.6.93: No such file or directory
depmod: WARNING: could not open modules.builtin at /lib/modules/6.6.93: No such file or directory
depmod: WARNING: could not open modules.builtin.modinfo at /lib/modules/6.6.93: No such file or directory

depmod: ERROR: Invalid modules.builtin line: 8250.ko

depmod: ERROR: Invalid modules.builtin line: 8250_base.ko

depmod: ERROR: Invalid modules.builtin line: 8250_fsl.ko

depmod: ERROR: Invalid modules.builtin line: 8250_mtk.ko

depmod: ERROR: Invalid modules.builtin line: 8250_of.ko

depmod: ERROR: Invalid modules.builtin line: 8021q.ko

Remedy:

  • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/modules.builtin /mnt/lib/modules/6.6.93/
  • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/modules.builtin.modinfo /mnt/lib/modules/6.6.93/
  • cp build_dir/target-aarch64_cortex-a53_musl/linux-mediatek_filogic/linux-6.6.93/modules.order /mnt/lib/modules/6.6.93/

Network

RJ45 Interface Name Description Property=OF_FULLNAME=
- eth0 Internal link to MT7530. /soc/ethernet@15100000/mac@0
- mxl_lan4@eth2 None Disabled in DTB
- eth2 Internal link to MxL86252C /soc/ethernet@15100000/mac@2
- lan3@eth0 Internal 1G SWITCH /soc/switch@15020000/ports/port@3
1 mxl_lan0@eth2 2.5G LAN RJ45 /soc/ethernet@15100000/mdio-bus/switch@16/ports/port@0
2 mxl_lan1@eth2 2.5G LAN RJ45 /soc/ethernet@15100000/mdio-bus/switch@16/ports/port@1
3 mxl_lan2@eth2 2.5G LAN RJ45 /soc/ethernet@15100000/mdio-bus/switch@16/ports/port@2
4 mxl_lan3@eth2 2.5G LAN RJ45 /soc/ethernet@15100000/mdio-bus/switch@16/ports/port@3
5 lan0@eth0 1G User Port /soc/switch@15020000/ports/port@0
6 mxl_lan5@eth2 10G LAN RJ45 /soc/ethernet@15100000/mdio-bus/switch@16/ports/port@6
7 eth1 10G WAN RJ45 soc/ethernet@15100000/mac@1

Query property name:

  • udevadm info -q property -p /sys/class/net/<interface>

Basic template:

# /etc/systemd/network/20-lanN.link
[Match]
Property=OF_FULLNAME=...

[Link]
Name=lanN
Description=...
MACAddressPolicy=random

System update

[Todo]

UART

An ordinary USB-C cable should suffice:

Clone this wiki locally