Skip to content

Commit 63e4fbf

Browse files
committed
fixup! docs(netboot): add full netboot setup guide
1 parent 2ea80d0 commit 63e4fbf

1 file changed

Lines changed: 34 additions & 15 deletions

File tree

extensions/netboot/README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,28 +272,44 @@ When the machine building the image is also the NFS server for the
272272
target, you can skip the archive entirely: build straight into the
273273
export directory.
274274

275+
One-time setup: if the builder is also the NFS server and you want
276+
exports to live directly under `/srv/netboot/rootfs/`, symlink
277+
`${SRC}/output/netboot-export` to that root:
278+
279+
```sh
280+
ln -s /srv/netboot/rootfs ${SRC}/output/netboot-export
281+
```
282+
283+
Then the `ROOTFS_EXPORT_DIR` values below resolve straight into the
284+
NFS tree. Without the symlink everything still works, just the
285+
artefacts sit under `${SRC}/output/netboot-export/` and you rsync them
286+
out later.
287+
275288
```sh
276289
./compile.sh build \
277-
BOARD=helios64 BRANCH=edge RELEASE=resolute \
290+
BOARD=helios64 BRANCH=edge RELEASE=trixie \
278291
BUILD_MINIMAL=yes \
279292
ROOTFS_TYPE=nfs-root \
280293
NETBOOT_SERVER=192.168.1.125 \
281294
NETBOOT_HOSTNAME=helios64-a \
282295
NETBOOT_CLIENT_MAC=aa:bb:cc:dd:ee:ff \
283296
ROOTFS_COMPRESSION=none \
284-
ROOTFS_EXPORT_DIR=/srv/netboot/rootfs/hosts/helios64-a
297+
ROOTFS_EXPORT_DIR=hosts/helios64-a
285298
```
286299

287300
What happens:
288301

289302
- `ROOTFS_COMPRESSION=none` skips the tar/gzip step. No `*.tar.gz`
290303
appears under `output/images/`.
291-
- `ROOTFS_EXPORT_DIR` is populated via `rsync -aHWh`, preserving
292-
permissions, xattrs, hardlinks.
293-
- Because the path is outside `${SRC}`, the extension bind-mounts it
294-
into the build container via
295-
`host_pre_docker_launch__netboot_mount_export_dir` — the same build
296-
command works on bare-metal and in Docker.
304+
- `ROOTFS_EXPORT_DIR=hosts/helios64-a` expands to
305+
`${SRC}/output/netboot-export/hosts/helios64-a` on the host side;
306+
`rsync -aHWh` populates it with the rootfs tree (permissions,
307+
xattrs, hardlinks preserved).
308+
- In Docker builds the extension bind-mounts that host path onto a
309+
fixed container target (`/armbian/netboot-export`) and points
310+
`ROOTFS_EXPORT_DIR` there, so rsync inside the container can never
311+
escape the netboot-export subtree. Same build command works in
312+
native builds — just no docker hop.
297313
- `pre_umount_final_image__900_collect_netboot_artifacts` still
298314
produces the TFTP tree at
299315
`${FINALDEST}/<version>-netboot-tftp/armbian/<family>/<board>/<branch>-<release>/`
@@ -409,7 +425,7 @@ the image a unique set of SSH host keys per boot.
409425

410426
## End-to-end example: helios64
411427

412-
Target: Helios64 (`rockchip64/helios64`, `edge`/`resolute`,
428+
Target: Helios64 (`rockchip64/helios64`, `edge`/`trixie`,
413429
`ttyS2@1500000`). Builder and NFS server are the same Linux host at
414430
`192.168.1.125`, reachable as `m1`. DHCP is OpenWRT at `192.168.1.1`.
415431

@@ -446,22 +462,25 @@ ssh root@192.168.1.1 \
446462
### 3. Build (single-step, builder = NFS server)
447463

448464
```sh
465+
# One-time on the builder (already the NFS server here):
466+
ln -s /srv/netboot/rootfs ${SRC}/output/netboot-export
467+
449468
./compile.sh build \
450-
BOARD=helios64 BRANCH=edge RELEASE=resolute \
469+
BOARD=helios64 BRANCH=edge RELEASE=trixie \
451470
BUILD_MINIMAL=yes \
452471
ROOTFS_TYPE=nfs-root \
453472
NETBOOT_SERVER=192.168.1.125 \
454473
ROOTFS_COMPRESSION=none \
455-
ROOTFS_EXPORT_DIR=/srv/netboot/rootfs/shared/rockchip64/helios64/edge-resolute
474+
ROOTFS_EXPORT_DIR=shared/rockchip64/helios64/edge-trixie
456475
```
457476

458477
### 4. Drop the TFTP tree into place
459478

460479
```sh
461480
rsync -a output/images/*-netboot-tftp/ /srv/netboot/tftp/
462481
# -> /srv/netboot/tftp/pxelinux.cfg/default.example
463-
# -> /srv/netboot/tftp/armbian/rockchip64/helios64/edge-resolute/Image
464-
# -> /srv/netboot/tftp/armbian/rockchip64/helios64/edge-resolute/dtb/rockchip/...
482+
# -> /srv/netboot/tftp/armbian/rockchip64/helios64/edge-trixie/Image
483+
# -> /srv/netboot/tftp/armbian/rockchip64/helios64/edge-trixie/dtb/rockchip/...
465484
mv /srv/netboot/tftp/pxelinux.cfg/default.example \
466485
/srv/netboot/tftp/pxelinux.cfg/default
467486
```
@@ -485,8 +504,8 @@ Scanning bootdev 'ethernet@fe300000.bootdev':
485504
Retrieving file: pxelinux.cfg/<hex-ip>
486505
Retrieving file: pxelinux.cfg/default
487506
Config file 'pxelinux.cfg/default' found
488-
Retrieving file: armbian/rockchip64/helios64/edge-resolute/Image
489-
Retrieving file: armbian/rockchip64/helios64/edge-resolute/dtb/rockchip/rk3399-kobol-helios64.dtb
507+
Retrieving file: armbian/rockchip64/helios64/edge-trixie/Image
508+
Retrieving file: armbian/rockchip64/helios64/edge-trixie/dtb/rockchip/rk3399-kobol-helios64.dtb
490509
append: root=/dev/nfs nfsroot=192.168.1.125:/srv/netboot/rootfs/shared/...,tcp,v3 ip=dhcp rw rootwait earlycon loglevel=7 panic=10
491510
Starting kernel ...
492511
...

0 commit comments

Comments
 (0)