Compile OpenWrt for OXNAS with glibc and soft float disabled

Hey guys,

after almost 10 years and a new device (Medion Life P89XXX, OXNAS STG-212 - the old one had RAM broken) i'm trying to compile a newer version of OpenWRT with glibc, preferred hard float for using with Oracle Java. Cross compiling on desktop with WSL Ubuntu 22, following all the OpenWRT guides setting it up the right way.
As LAN connection isn't working with stock OpenWRT v22.03.x for now, i ran into https://github.com/openwrt/openwrt/issues/8908 trying to compile v21.02.x. It's unclear to me, if this has already been fixed now, so i tried compiling v19.07.x and getting:

/home/openwrt/staging_dir/toolchain-arm_mpcore_gcc-7.5.0_glibc_eabi/include/features.h:381:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
cc1: all warnings being treated as errors
make[6]: *** [Makefile:58: build/context.o] Error 1
make[6]: Leaving directory '/home/openwrt/build_dir/target-arm_mpcore_glibc_eabi/olsrd-0.9.7/lib/pud/nmealib'
make[5]: *** [Makefile:162: nmealib] Error 2
make[5]: Leaving directory '/home/openwrt/build_dir/target-arm_mpcore_glibc_eabi/olsrd-0.9.7/lib/pud'
make[4]: *** [Makefile:241: libs] Error 2
make[4]: Leaving directory '/home/openwrt/build_dir/target-arm_mpcore_glibc_eabi/olsrd-0.9.7'
make[3]: *** [Makefile:297: /home/openwrt/build_dir/target-arm_mpcore_glibc_eabi/olsrd-0.9.7/.built] Error 2
make[3]: Leaving directory '/home/openwrt/feeds/routing/olsrd'
time: package/feeds/routing/olsrd/compile#15.07#4.45#22.85
make[2]: *** [package/Makefile:113: package/feeds/routing/olsrd/compile] Error 2
make[2]: Leaving directory '/home/openwrt'
make[1]: *** [package/Makefile:107: /home/openwrt/staging_dir/target-arm_mpcore_glibc_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/openwrt'
make: *** [/home/openwrt/include/toplevel.mk:227: world] Error 2

I know it must be possible, as i managed to compile Barrier Braker and Chaos Calmer back in the days with glibc and Java support (running soft float back then). Any help and hints much appreciated! THX:slight_smile:

The OX820 doesn't have any hard float unit, so that won't work.
What is the problem with LAN connection? I can probably help you resolve that, it works fine on my OX820 hardware (Shuttle KD20 with ICPlus PHY)

Hey Daniel,

thanks for getting back to me. I always thought that

root@debian:~# cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 5 (v6l)
BogoMIPS        : 339.14
Features        : half thumb fastmult edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb02
CPU revision    : 5

was compatible running hflt, at least that's what google-ing around was saying. Then i should go sflt again...

With the latest releases from at least v22.02 ongoing the device doesn't get any network connection (no matter if static or dhcp), as already mentioned in https://openwrt.org/toh/medion/md86587#important_notes. I can confirm, testing with some initramfs releases. About the note of having memory issues with some of the last builds, i can't commend yet - just revived an new device for the last days. :wink:

Also with building soft float and IGNORE_ERRORS=1 i'm not getting any further, when trying to compile v21.02.6

make[1]: *** [package/Makefile:110: /home/alex/openwrt/staging_dir/target-arm_mpcore_glibc_eabi/stamp/.package_compile] Error 2
make[1]: Leaving directory '/home/alex/openwrt'
make: *** [/home/alex/openwrt/include/toplevel.mk:230: world] Error 2

:sob:

Trying to build v22.03.5 i'm not getting any further. In make menuconfig "global build settings" > "preferred standard C++ library" is missing completely, so i can't select building against "libstdc++". And it's breaking again anyways:

make[3]: *** [Makefile:731: /home/alex/v22.03.5/bin/targets/oxnas/ox820-glibc/packages/libtsan0_11.2.0-4_arm_mpcore.ipk] Error 1
make[2]: *** [package/Makefile:116: package/libs/toolchain/compile] Error 1
make[1]: *** [package/Makefile:110: /home/alex/v22.03.5/staging_dir/target-arm_mpcore_glibc_eabi/stamp/.package_compile] Error 2
make: *** [/home/alex/v22.03.5/include/toplevel.mk:230: world] Error

btw. 19.07.9 is building "just fine", besides some packages.

Oh, I was not aware of this problem. The Medion device I had back them had a RTL8211E Gigabit Ethernet PHY connected via RGMII. Please share your bootlog captured via the serial port when starting initramfs, so we can see first of all of MDIO is working and the RealTek PHY is being detected. Also output of ethtool eth0 would be interesting.

Sure, here we go (v22.03.4):

$ bootm 64000000
## Booting image at 64000000 ...
   Image Name:   ARM OpenWrt Linux-5.10.176
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    7697557 Bytes =  7.3 MB
   Load Address: 60008000
   Entry Point:  60008000
   Verifying Checksum ... OK
OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.176 (builder@buildhost) (arm-openwrt-linux-muslgnueabi-gcc (OpenWrt GCC 11.2.0 r20123-38ccc47687) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 SMP Sun Apr 9 12:27:46 2023
[    0.000000] CPU: ARMv6-compatible processor [410fb025] revision 5 (ARMv7), cr=00c5787d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: MitraStar Technology Corp. STG-212
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] cma: Reserved 64 MiB at 0x64000000
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000060000000-0x0000000067ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000060000000-0x0000000067ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000060000000-0x0000000067ffffff]
[    0.000000] percpu: Embedded 15 pages/cpu s30668 r8192 d22580 u61440
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: earlyprintk console=ttyS0,115200
[    0.000000] Bootloader command line (ignored): console=ttyS0,115200 elevator=cfq mac_adr=0x00,0x30,0xe0,0x00,0x00,0x01 mem=128M poweroutage=yes
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 46760K/131072K available (6144K kernel code, 589K rwdata, 856K rodata, 9216K init, 225K bss, 18776K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=2.
[    0.000000]  Tracing variant of Tasks RCU enabled.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] FPGA IRQ chip 0 "interrupt-controller" @ (ptrval), 32 irqs, parent IRQ: 24
[    0.000023] sched_clock: 24 bits at 390kHz, resolution 2560ns, wraps every 21474835200ns
[    0.000074] clocksource: oxnas_rps_clocksource_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 19112603332 ns
[    0.000097] timer_oxnas_rps: Registered clocksource rate 390625Hz
[    0.000125] timer_oxnas_rps: Registered clock event rate 6250000Hz prescaler 0 period 62500
[    0.000289] GIC: PPI13 is secure or misconfigured
[    0.000353] GIC: PPI13 is secure or misconfigured
[    0.000555] Calibrating delay loop... 298.59 BogoMIPS (lpj=1492992)
[    0.070333] pid_max: default: 32768 minimum: 301
[    0.070645] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.070681] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.072145] CPU: Testing write buffer coherency: ok
[    0.074693] Setting up static identity map for 0x60100000 - 0x6010005c
[    0.075043] rcu: Hierarchical SRCU implementation.
[    0.075553] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.076034] smp: Bringing up secondary CPUs ...
[    0.077360] GIC: PPI13 is secure or misconfigured
[    0.140715] smp: Brought up 1 node, 2 CPUs
[    0.140756] SMP: Total of 2 processors activated (598.42 BogoMIPS).
[    0.146478] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.146524] futex hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.153428] pinctrl core: initialized pinctrl subsystem
[    0.155077] NET: Registered protocol family 16
[    0.159137] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.161881] thermal_sys: Registered thermal governor 'step_wise'
[    0.162403] cpuidle: using governor menu
[    0.162493] No ATAGs?
[    0.190609] pps_core: LinuxPPS API ver. 1 registered
[    0.190638] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.190681] PTP clock support registered
[    0.192202] clocksource: Switched to clocksource oxnas_rps_clocksource_timer
[    0.193937] NET: Registered protocol family 2
[    0.194257] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.195392] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.195514] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.195558] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.195599] TCP: Hash tables configured (established 1024 bind 1024)
[    0.195776] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.195840] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.196323] NET: Registered protocol family 1
[    0.196398] PCI: CLS 0 bytes, default 32
[    0.487262] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.497126] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.498145] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 250)
[    0.501527] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.506040] printk: console [ttyS0] disabled
[    0.506222] 44200000.serial: ttyS0 at MMIO 0x44200000 (irq = 63, base_baud = 390625) is a 16550A
[    0.993843] printk: console [ttyS0] enabled
[    1.016803] brd: module loaded
[    1.031557] loop: module loaded
[    1.102461] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    1.108800] nand: Hynix H27U1G8F2BTR-BC
[    1.112721] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.120284] Scanning device for bad blocks
[    1.128947] Bad eraseblock 54 at 0x0000006c0000
[    1.194982] Bad eraseblock 802 at 0x000006440000
[    1.204625] Bad eraseblock 863 at 0x000006be0000
[    1.222499] 5 fixed-partitions partitions found on MTD device 41000000.nand-controller
[    1.230387] Creating 5 MTD partitions on "41000000.nand-controller":
[    1.236764] 0x000000000000-0x000000040000 : "stage1"
[    1.242969] 0x000000040000-0x0000003c0000 : "u-boot"
[    1.248954] 0x0000003c0000-0x000000440000 : "u-boot-env"
[    1.255216] 0x000000440000-0x000000e00000 : "kernel"
[    1.261132] 0x000000e00000-0x000008000000 : "ubi"
[    1.274959] oxnas-dwmac 40400000.ethernet: IRQ eth_lpi not found
[    1.281121] oxnas-dwmac 40400000.ethernet: PTP uses main clock
[    1.287040] oxnas-dwmac 40400000.ethernet: no reset control found
[    1.362685] oxnas-dwmac 40400000.ethernet: User ID: 0x12, Synopsys ID: 0x35
[    1.369640] oxnas-dwmac 40400000.ethernet:   DWMAC1000
[    1.374768] oxnas-dwmac 40400000.ethernet: DMA HW capability register supported
[    1.382059] oxnas-dwmac 40400000.ethernet: RX Checksum Offload Engine supported
[    1.389373] oxnas-dwmac 40400000.ethernet: COE Type 2
[    1.394434] oxnas-dwmac 40400000.ethernet: TX Checksum insertion supported
[    1.401277] oxnas-dwmac 40400000.ethernet: Wake-Up On Lan supported
[    1.407669] oxnas-dwmac 40400000.ethernet: Enhanced/Alternate descriptors
[    1.414479] oxnas-dwmac 40400000.ethernet: Enabled extended descriptors
[    1.421068] oxnas-dwmac 40400000.ethernet: Ring mode enabled
[    1.426769] oxnas-dwmac 40400000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    1.434641] oxnas-dwmac 40400000.ethernet: device MAC address 92:35:db:3b:90:cc
[    1.478197] RTL8211E Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:00, irq=POLL)
[    1.490736] RTL8211E Gigabit Ethernet stmmac-0:03: attached PHY driver [RTL8211E Gigabit Ethernet] (mii_bus:phy_addr=stmmac-0:03, irq=POLL)
[    1.507061] ledtrig-cpu: registered to indicate activity on CPUs
[    1.513290] hid: raw HID events driver (C) Jiri Kosina
[    1.519992] NET: Registered protocol family 10
[    1.526781] Segment Routing with IPv6
[    1.530565] NET: Registered protocol family 17
[    1.535178] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.548142] 8021q: 802.1Q VLAN Support v1.8
[    1.559764] UBI: auto-attach mtd4
[    1.563194] ubi0: attaching mtd4
[    1.698575] ubi0: scanning is finished
[    1.712704] ubi0: attached mtd4 (name "ubi", size 114 MiB)
[    1.718184] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[    1.725091] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[    1.731768] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[    1.738560] ubi0: good PEBs: 910, bad PEBs: 2, corrupted PEBs: 0
[    1.744573] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128
[    1.751767] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1170219428
[    1.760883] ubi0: available PEBs: 0, total reserved PEBs: 910, PEBs reserved for bad PEB handling: 18
[    1.770183] ubi0: background thread "ubi_bgt0d" started, PID 60
[    1.771852] block ubiblock0_0: created from ubi0:0(rootfs)
[    1.781647] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    1.802411] Freeing unused kernel memory: 9216K
[    1.807237] Run /init as init process
[    2.574771] init: Console is alive
[    2.592775] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    2.600944] Button Hotplug driver version 0.4.1
[    2.607720] input: keys as /devices/platform/keys/input/input0
[    2.614402] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    2.630054] init: - preinit -
[    2.968535] random: jshn: uninitialized urandom read (4 bytes read)
[    3.027653] random: jshn: uninitialized urandom read (4 bytes read)
[    3.068582] random: jshn: uninitialized urandom read (4 bytes read)
[    3.105871] oxnas-dwmac 40400000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211E Gigabit Ethernet] (irq=POLL)
[    3.118310] oxnas-dwmac 40400000.ethernet eth0: No Safety Features support found
[    3.125813] oxnas-dwmac 40400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[    3.134469] oxnas-dwmac 40400000.ethernet eth0: registered PTP clock
[    3.143267] oxnas-dwmac 40400000.ethernet eth0: configuring for phy/rgmii link mode
[    3.154001] oxnas-dwmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[    3.162478] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    7.373667] oxnas-dwmac 40400000.ethernet eth0: Link is Down
[    7.391820] procd: - early -
[    7.999080] procd: - ubus -
[    8.016929] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.052766] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.059970] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.073024] procd: - init -
Please press Enter to activate this console.
[    8.768852] urngd: v1.0.2 started.
[    8.952578] random: crng init done
[    8.956014] random: 16 urandom warning(s) missed due to ratelimiting
[    9.020884] kmodloader: loading kernel modules from /etc/modules.d/*
[    9.066421] xt_time: kernel timezone is -0000
[    9.097889] kmodloader: done loading kernel modules from /etc/modules.d/*
[   31.389573] oxnas-dwmac 40400000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211E Gigabit Ethernet] (irq=POLL)
[   31.416174] oxnas-dwmac 40400000.ethernet eth0: No Safety Features support found
[   31.423787] oxnas-dwmac 40400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   31.432609] oxnas-dwmac 40400000.ethernet eth0: registered PTP clock
[   31.439004] oxnas-dwmac 40400000.ethernet eth0: configuring for phy/rgmii link mode
[   31.464194] br-lan: port 1(eth0) entered blocking state
[   31.469427] br-lan: port 1(eth0) entered disabled state
[   31.475246] device eth0 entered promiscuous mode
[   34.553950] oxnas-dwmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[   34.564899] br-lan: port 1(eth0) entered blocking state
[   34.570135] br-lan: port 1(eth0) entered forwarding state
[   34.580938] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

After booting with broken network it's also dead when rebooting OpenWRT from NAND or just trying to TFTP in uboot. Now i first have to get it back... Also ethtool isn't included in OpenWRT and cannot be downloaded (of course). USB isn't available too... so i first have to see, how to get TFTP back and install ethtool.ipk from internal disk.

Edit: for getting network back again i have to remove serial connection!

initramfs doesn't seem to find internal disk... at least lsblk doesn't show it!? so how to get ethtool working? for now network status of v22.03.4 (initramfs)

root@OpenWrt:/# uci set network.lan.proto=static
root@OpenWrt:/# uci set network.lan.ipaddr=192.168.0.10
root@OpenWrt:/# uci set network.lan.netmask=255.255.255.0
root@OpenWrt:/# uci commit
root@OpenWrt:/# service network restart
[  146.353543] br-lan: port 1(eth0) entered disabled state
[  146.360806] device eth0 left promiscuous mode
[  146.365521] br-lan: port 1(eth0) entered disabled state
[  146.393111] oxnas-dwmac 40400000.ethernet eth0: Link is Down
root@OpenWrt:/# [  148.017011] oxnas-dwmac 40400000.ethernet eth0: PHY [stmmac-0:00] driver [RTL8211E Gigabit Ethernet] (irq=POLL)
[  148.047198] oxnas-dwmac 40400000.ethernet eth0: No Safety Features support found
[  148.054722] oxnas-dwmac 40400000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[  148.063603] oxnas-dwmac 40400000.ethernet eth0: registered PTP clock
[  148.070064] oxnas-dwmac 40400000.ethernet eth0: configuring for phy/rgmii link mode
[  148.088942] br-lan: port 1(eth0) entered blocking state
[  148.094330] br-lan: port 1(eth0) entered disabled state
[  148.100085] device eth0 entered promiscuous mode
[  151.192993] oxnas-dwmac 40400000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[  151.201280] br-lan: port 1(eth0) entered blocking state
[  151.206581] br-lan: port 1(eth0) entered forwarding state
[  151.214609] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr DE:70:E7:80:4A:15
          inet addr:192.168.0.10  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::dc70:e7ff:fe80:4a15/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:153 errors:0 dropped:22 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:34654 (33.8 KiB)  TX bytes:746 (746.0 B)

eth0      Link encap:Ethernet  HWaddr DE:70:E7:80:4A:15
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:869 errors:0 dropped:8 overruns:0 frame:0
          TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:137451 (134.2 KiB)  TX bytes:15380 (15.0 KiB)
          Interrupt:58 Base address:0x8000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:124 errors:0 dropped:0 overruns:0 frame:0
          TX packets:124 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10168 (9.9 KiB)  TX bytes:10168 (9.9 KiB)

root@OpenWrt:/# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
^C
--- 192.168.0.1 ping statistics ---
20 packets transmitted, 0 packets received, 100% packet loss

Probably the kernel module for the SATA driver has not been included in your build. Make sure kmod-ata-oxnas-sata is selected (either in menuconfig or making sure that CONFIG_PACKAGE_kmod-ata-oxnas-sata=y is set in .config).

Oh that's odd. I suppose you have only that one USB-to-serial adapter to try, because it might be worth trying with something else (imho preferably genuine FTDI adapter)

Make sure the package ethtool or ethtool-full is included in your build.

hopefully it gets build at all. as already mentioned, compiling with glibc fails since 21.x - will try "standard setup" later today, just for tracking the network issues. it won't help me in getting java running for minimserver, which relies on glibc with libstdc++ as far as i remember and tested on "stock" openwrt images.

starting my freshly build v22.03.5 initramfs fails for now:

[   23.376885] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   23.385146] kmodloader: done loading kernel modules from /etc/modules.d/*
REBOOT
[   30.608655] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[   30.614440] reboot: Restarting system

when booting from NAND hdd is recognized, so i'm going to try to install ethtool and it's dependencies from disk.

root@OpenWrt:~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Half 1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 0
        Transceiver: external
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: ug
        Wake-on: d
        Current message level: 0x0000003f (63)
                               drv probe link timer ifdown ifup
        Link detected: yes
root@OpenWrt:~# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd4b:d237:57ff::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.0.10'
        option netmask '255.255.255.0'
        option dns '192.168.0.1'
        option gateway '192.168.0.1'

config interface 'lan6'
        option device 'br-lan'
        option proto 'dhcpv6'
root@OpenWrt:~# ping 192.168.0.10
PING 192.168.0.10 (192.168.0.10): 56 data bytes
64 bytes from 192.168.0.10: seq=0 ttl=64 time=0.378 ms
64 bytes from 192.168.0.10: seq=1 ttl=64 time=0.337 ms
64 bytes from 192.168.0.10: seq=2 ttl=64 time=0.333 ms
64 bytes from 192.168.0.10: seq=3 ttl=64 time=0.435 ms
--- 192.168.0.10 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.333/0.370/0.435 ms
root@OpenWrt:~# ping 192.168.0.1
PING 192.168.0.1 (192.168.0.1): 56 data bytes
--- 192.168.0.1 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss

Just for the record: when having SATA driver integrated into the image and booting from initramfs, it's crashing on boot. Written directly to NAND, same build is loading kernel modules from /etc/modules.d/* and starting as expected! That also explains, why all "stock" initramfs images don't come with integrated SATA driver.

Are you still with me or am i to impatient? :wink:

Sorry I was traveling and then busy with moving from one place to another. Still not completely arrived, but I'll try to help you as good as a can.

This very much looks like reboot is triggered by button hotplug, and that's odd.

ethtool output looks good, also PHY is detected properly, so it's also very odd that Ethernet stopped working while it is still working fine on my Shuttle KD20 ox820 based device.

May not help much but also consider that in order to do what you want to do there is no need to build everything from source. If the official release build works for you, you can run Debian for armv6 inside a container to have Java support (I've done this on my oxnas device and Debian running OpenJDK). You can use lxc or OpenWrt's uxc runtime.

For sure there are way more important things than a 12 year old electronic device! :wink: I hope you had a great time travelling.

Let me know if i can add anything solving the current broken network situation.

Thanks, will give it a try. Next step i wanted to take was adding Debian by configuring CHROOT. Not sure if this may work out well. Of course i could just start Debian from HDD by using the package from Doozan forum. From now on it's just fiddling around to fulfill my knowledge a bit. Just ordered a used Fujitsu Q556/2 mini for small buckets out of ebay, which should satisfy my needs as a daily driver.