Skip to content

Commit 2393977

Browse files
iavclaude
andcommitted
feat(extensions): add netboot extension for TFTP+NFS diskless boot
ROOTFS_TYPE=nfs alone only gives a hybrid image: kernel+DTB still live on local storage, only / comes over NFS. The netboot extension takes it further: kernel, DTB, optional uInitrd and a PXE/extlinux config are staged under output/images/<version>-netboot-tftp/ ready to drop into a TFTP root, and a matching NFS rootfs tree/archive is produced from the same build. The target then needs nothing but DHCP+TFTP+NFS to boot. extensions/netboot/netboot.sh hooks: - extension_prepare_config: force ROOTFS_TYPE=nfs, validate vars, compute defaults for NETBOOT_TFTP_PREFIX / NETBOOT_NFS_PATH (shared by LINUXFAMILY/BOARD/BRANCH/RELEASE, or per-host when NETBOOT_HOSTNAME is set), normalize NETBOOT_CLIENT_MAC. - custom_kernel_config: enable ROOT_NFS, NFS_FS, NFS_V3, IP_PNP, IP_PNP_DHCP so root=/dev/nfs ip=dhcp works without initrd. - post_customize_image: drop armbian-resize-filesystem.service (meaningless on NFS root) and /root/.not_logged_in_yet (the armbian-firstlogin whiptail wizard blocks bring-up when there is no interactive console). armbian-firstrun.service stays — it only regenerates SSH host keys. - host_pre_docker_launch: bind-mount ROOTFS_EXPORT_DIR into the build container when it lives outside ${SRC}, so the single-step builder-as-NFS-server workflow works the same in and out of Docker. - pre_umount_final_image: assemble the TFTP tree (Image/zImage, dtb/, uInitrd), write pxelinux.cfg/{default.example | 01-<mac>} with the right FDT/FDTDIR line, and expose a netboot_artifacts_ready hook for userpatches that deploy to a real server. lib/functions/image/rootfs-to-image.sh: - ROOTFS_COMPRESSION: gzip (default) | zstd | none. Produces .tar.gz/.tar.zst or skips the archive entirely. - ROOTFS_EXPORT_DIR: when set, additionally rsync the rootfs tree into that directory. Combined with ROOTFS_COMPRESSION=none on an NFS- server build host this turns netboot deployment into a single build step with no tar/unpack/transport phase. - ROOTFS_ARCHIVE_PATH is exported so downstream hooks (netboot_artifacts_ready) can reference the produced archive. No PXE config is written when NETBOOT_SERVER is empty: nfsroot= keeps ${serverip} literal so U-Boot expands it at `pxe boot` from DHCP siaddr. Intentionally no console= in APPEND — hardcoding a baud breaks boards like helios64 (1500000); the kernel picks up the console from DTB /chosen/stdout-path, earlycon keeps early output. Validated end-to-end on helios64 (Armbian 26.05 edge/resolute): both tree-workflow (ROOTFS_COMPRESSION=none + ROOTFS_EXPORT_DIR) and archive-workflow builds boot cleanly over TFTP+NFS to a login prompt with no whiptail wizard and no resize2fs errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f017e3 commit 2393977

3 files changed

Lines changed: 818 additions & 6 deletions

File tree

0 commit comments

Comments
 (0)