From 95f543b4f4d8734cf55f45f8cc464cc6728b4d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B8rn=20Lindahl?= Date: Sat, 31 Jan 2026 10:55:57 +0100 Subject: [PATCH] Fix PAL review findings: documentation accuracy and code quality - Update CLAUDE.md with complete kernel parameters including boot=netboot - Remove duplicate wget/curl package declarations in build-image.sh - Check unsquashfs in both /usr/bin and /usr/sbin in verify-image.sh - Use consistent $quiet variable expansion in netboot hook functions All issues identified in zen-opus pre-commit review are now resolved. --- CLAUDE.md | 2 +- build-image.sh | 4 +--- initramfs/scripts/netboot | 6 +++--- verify-image.sh | 9 ++++++++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bc4ae57..8537895 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -74,7 +74,7 @@ Located in `initramfs/` directory, passed to `mkinitramfs` with `-d` flag: **http/boot.ipxe** - iPXE script that: - Loads kernel from `http://192.168.100.1:8800/vmlinuz` - Loads initramfs from `http://192.168.100.1:8800/initrd-netboot.img` -- Sets kernel args: `root=http://192.168.100.1:8800/filesystem.squashfs rootfstype=squashfs overlayroot=tmpfs ip=dhcp console=ttyS0,115200` +- Sets kernel args: `boot=netboot root=http://192.168.100.1:8800/filesystem.squashfs rootfstype=squashfs overlayroot=tmpfs ip=dhcp console=tty0 console=ttyS0,115200 earlyprintk=serial,ttyS0,115200 loglevel=7` - Boots the kernel **IMPORTANT:** The HTTP server IP (192.168.100.1:8800) is hardcoded in boot.ipxe. Update this if the boot server changes. diff --git a/build-image.sh b/build-image.sh index 27ffdd7..5c6fbb2 100755 --- a/build-image.sh +++ b/build-image.sh @@ -105,9 +105,7 @@ apt-get install -y \ less \ rsync \ git \ - squashfs-tools \ - wget \ - curl + squashfs-tools # Clean up apt-get clean diff --git a/initramfs/scripts/netboot b/initramfs/scripts/netboot index 12ba559..aea0870 100755 --- a/initramfs/scripts/netboot +++ b/initramfs/scripts/netboot @@ -11,7 +11,7 @@ TMPFS_MOUNT=/mnt netboot_top() { if [ "${netboot_top_used}" != "yes" ]; then - [ "${quiet?}" != "y" ] && log_begin_msg "Running /scripts/netboot-top" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/netboot-top" run_scripts /scripts/netboot-top [ "$quiet" != "y" ] && log_end_msg fi @@ -21,7 +21,7 @@ netboot_top() netboot_premount() { if [ "${netboot_premount_used}" != "yes" ]; then - [ "${quiet?}" != "y" ] && log_begin_msg "Running /scripts/netboot-premount" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/netboot-premount" run_scripts /scripts/netboot-premount [ "$quiet" != "y" ] && log_end_msg fi @@ -31,7 +31,7 @@ netboot_premount() netboot_bottom() { if [ "${netboot_premount_used}" = "yes" ] || [ "${netboot_top_used}" = "yes" ]; then - [ "${quiet?}" != "y" ] && log_begin_msg "Running /scripts/netboot-bottom" + [ "$quiet" != "y" ] && log_begin_msg "Running /scripts/netboot-bottom" run_scripts /scripts/netboot-bottom [ "$quiet" != "y" ] && log_end_msg fi diff --git a/verify-image.sh b/verify-image.sh index 7b1f9eb..d99ec20 100755 --- a/verify-image.sh +++ b/verify-image.sh @@ -127,7 +127,7 @@ else fi # Check required binaries -for binary in wget curl unsquashfs awk; do +for binary in wget curl awk; do if [ -f "$TMPDIR/initramfs/main/usr/bin/$binary" ]; then success "$binary binary present" else @@ -135,6 +135,13 @@ for binary in wget curl unsquashfs awk; do fi done +# Check unsquashfs in both possible locations +if [ -f "$TMPDIR/initramfs/main/usr/bin/unsquashfs" ] || [ -f "$TMPDIR/initramfs/main/usr/sbin/unsquashfs" ]; then + success "unsquashfs binary present" +else + error "unsquashfs binary missing from initramfs" +fi + if [ -f "$TMPDIR/initramfs/main/usr/sbin/switch_root" ]; then success "switch_root binary present" else