Buildroot package for nfs root#2191
Conversation
|
Quick note for testing. I did find a reliable way to tag/identify individual cameras without solely referencing the MAC address. bootp_vci (option 60) can be set in the uboot env which will get sent during the initial DHCP request. This can be a useful key when deciding which kernel/rootfs to serve to the device. |
…nel ip autoconf is dhcp. Use static mac_pton helper for older linux kernel support.
…' into br-package-nfs-root
|
Sorry for the regression failure! That copy rule slipped through. Fixes
All gated CI regressions should pass now.
Any feedback would be appreciated once it passes CI tests. |
widgetii
left a comment
There was a problem hiding this comment.
This is the package-based redesign that came out of the #2168 discussion — replacing the per-vendor MAC-driver patches with an opt-in package — and it executes that direction well: one ipconfig.c patch at the early-network layer, fully opt-in via BR2_PACKAGE_OPENIPC_NFS_ROOT, attached through Buildroot's linux-kernel-extension infra. The added NFS RO/RW overlay init, DNS/NTP/hostname, SSH-key persistence to u-boot env, timezone derivation, and the make_nfsroot helper round it out nicely.
CI: green as of 1266d36 — 103 checks pass, CI Gate success. Worth noting the earlier 28-board build failure was real (not the wireguard/squashfs tarball drift from #2168): the pre-fix LINUX_PRE_BUILD_HOOKS += OPENIPC_NFS_ROOT_SYNC_ETHADDR_SOURCE ran the openipc_ethaddr.c cp on every board → cp: ... drivers/net/ethernet/openipc_ethaddr.c: No such file or directory on boards that don't enable the package / old kernels. Moving it into the Kconfig-gated extension PREPARE_KERNEL hook fixed it, and the green matrix empirically confirms the no-op-when-disabled property. 👍 Also verified DT-MAC-wins holds by construction (eth_platform_get_mac_address() checks DT/ACPI before the arch_get_platform_mac_address() fallback).
A few things before merge:
1. repack gate only sees the cmdline var, not the fragment. The top Makefile does include $(CONFIG) (board defconfig) and never sources the merged .config, so ifeq ($(BR2_PACKAGE_OPENIPC_NFS_ROOT),y) in repack is only true when the var is passed on the make line (which make_nfsroot does). But the description also advertises enabling via general/openipc.fragment — that path leaves the gate false, so a plain make BOARD=… runs the normal NOR repack and CHECK_SIZE fails on the missing rootfs.squashfs. The kernel-side gating is fine (it reads .config); only the repack gate has this gap. Either source the var from .config in the Makefile, or document make_nfsroot as the only supported enable path.
2. S40network never brings up lo on the NFS-root path. The is_nfs_root branch returns after "leaving eth0/lo as configured by kernel", but kernel ip-autoconfig brings up eth0, not loopback. Base S40network always runs ifup lo. Anything binding 127.0.0.1 will break — please ifup lo explicitly on the NFS path.
3. overlay/init duplicates general/overlay/init. The flash-overlay branch is copied verbatim with an elif … nfs branch appended; late-overlay rsync replaces the base /init, so it works but the two will drift. Consider making the NFS branch additive or factoring the shared logic. (Also a couple of trailing-whitespace lines in the new init.)
4. ether_addr_copy(dev->dev_addr, mac) and dev_addr const-ness. net_device.dev_addr became const in Linux 5.17 (writes must go via eth_hw_addr_set()). CI passing means current targets are < 5.17, so this is fine today — just a flag for whoever bumps the neo kernel later.
Minor: the default_mac sentinel correctly matches the 00:00:23:34:45:66 overlay fallback and the ether_addr_equal form addresses the earlier #2168 nit 👍; the s|…| sed password substitution escapes / & \ but not the | delimiter (safe since crypt/base64 hashes can't contain |, but worth a comment); and consider noting the baked-in default 12345 root password as not-for-production in the Kconfig help.
Lastly — could you drop the two boot logs into the PR description: one with ethaddr= on the cmdline showing the resulting ip link MAC, and one showing the DT MAC winning with no ethaddr=? That lets reviewers confirm both paths without rebuilding the matrix.
|
1. repack not seeing fragment definitions. 2. S40network never brings up lo on the NFS-root path. 3. overlay/init duplicates general/overlay/init. 4. ether_addr_copy(dev->dev_addr, mac) and dev_addr const-ness. 5. Password hash substitution and defaults. Log files |
Kernel NFS root package
Changes
Testing
Compile
Notes
bootargs_override.log
boot_dtb_wins.log