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.
This commit is contained in:
2026-01-31 10:55:57 +01:00
parent d7d0098a5c
commit 95f543b4f4
4 changed files with 13 additions and 8 deletions

View File

@@ -74,7 +74,7 @@ Located in `initramfs/` directory, passed to `mkinitramfs` with `-d` flag:
**http/boot.ipxe** - iPXE script that: **http/boot.ipxe** - iPXE script that:
- Loads kernel from `http://192.168.100.1:8800/vmlinuz` - Loads kernel from `http://192.168.100.1:8800/vmlinuz`
- Loads initramfs from `http://192.168.100.1:8800/initrd-netboot.img` - 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 - 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. **IMPORTANT:** The HTTP server IP (192.168.100.1:8800) is hardcoded in boot.ipxe. Update this if the boot server changes.

View File

@@ -105,9 +105,7 @@ apt-get install -y \
less \ less \
rsync \ rsync \
git \ git \
squashfs-tools \ squashfs-tools
wget \
curl
# Clean up # Clean up
apt-get clean apt-get clean

View File

@@ -11,7 +11,7 @@ TMPFS_MOUNT=/mnt
netboot_top() netboot_top()
{ {
if [ "${netboot_top_used}" != "yes" ]; then 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 run_scripts /scripts/netboot-top
[ "$quiet" != "y" ] && log_end_msg [ "$quiet" != "y" ] && log_end_msg
fi fi
@@ -21,7 +21,7 @@ netboot_top()
netboot_premount() netboot_premount()
{ {
if [ "${netboot_premount_used}" != "yes" ]; then 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 run_scripts /scripts/netboot-premount
[ "$quiet" != "y" ] && log_end_msg [ "$quiet" != "y" ] && log_end_msg
fi fi
@@ -31,7 +31,7 @@ netboot_premount()
netboot_bottom() netboot_bottom()
{ {
if [ "${netboot_premount_used}" = "yes" ] || [ "${netboot_top_used}" = "yes" ]; then 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 run_scripts /scripts/netboot-bottom
[ "$quiet" != "y" ] && log_end_msg [ "$quiet" != "y" ] && log_end_msg
fi fi

View File

@@ -127,7 +127,7 @@ else
fi fi
# Check required binaries # 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 if [ -f "$TMPDIR/initramfs/main/usr/bin/$binary" ]; then
success "$binary binary present" success "$binary binary present"
else else
@@ -135,6 +135,13 @@ for binary in wget curl unsquashfs awk; do
fi fi
done 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 if [ -f "$TMPDIR/initramfs/main/usr/sbin/switch_root" ]; then
success "switch_root binary present" success "switch_root binary present"
else else