Repository navigation
os/v3/puppy: a written stick grows its data partition to the medium on first boot - #3301
Conversation
…n first boot (engine#3287) A dd-written stick kept the image's 8 GB 1BIT-DATA partition, which the demo models alone nearly fill (v2026.47: 64 GB stick, 8 GB /data). os/mini grows at prepare time; the Puppy image is written and booted, and its data partition is also the boot medium (SFS set + save layer), mounted before init. So 05onboard-data now runs /usr/local/sbin/1bit-grow-data after mounting /data: the online grow cloud images use (backup GPT relocated, entry rewritten without a re-read, partx -u, resize2fs on the mounted ext4; the start sector never changes). It acts only on removable USB, on the last partition, with >= 1 GiB free, ext4 mounted at /data, and once (the /data/.grown marker); anything else is a printed reason and exit 0. tests/grow_data_test.sh proves it on a loop-device stick laid out like a written image, mounted while it grows: 1.5 -> 3.5 GiB, a 64 MB file byte- identical after, a second run a no-op, a non-USB disk untouched, e2fsck clean. (root + loop devices; 77 = skip.) Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍(Review updated until commit 7d58ba7)Here are some key observations to aid the review process:
✅ Resolved findingsos/v3/puppy/embed/usr/local/sbin/1bit-grow-data:64GPT Relocation Failure Tolerance The script attempts to relocate the backup GPT but only logs a failure without halting execution. If the relocation fails, the subsequent os/v3/puppy/embed/usr/local/sbin/1bit-grow-data:73-74Potential Data Loss on Resize Failure If |
tests_referenced refused an unregistered tests/grow_data_test.sh, which also failed pre_pr_checks_tree. The row needs root and loop devices; the CI container has neither, so it skips there and is baselined with that reason. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Persistent review updated to latest commit 7d58ba7 |
Part of #3287 ("The stick's data partition is not grown on first boot").
Problem. A dd-written stick keeps the image's 8 GB
1BIT-DATA: on v2026.47, a 64 GB stick had an 8 GB/datathat the two demo models nearly filled. os/mini grows at prepare time (prepare-stick.sh); the Puppy image is written and booted, and its data partition is also the boot medium (the SFS set and the save layer live on it), mounted before init runs.Change.
05onboard-dataruns the new/usr/local/sbin/1bit-grow-dataright after mounting/data. It is the online grow cloud images use (growpart): relocate the backup GPT to the end of the device (a dd'd image leaves it at the end of the image), rewrite the partition entry withsfdisk --no-reread, tell the kernel withpartx -u(BLKPG resize works on a mounted partition),resize2fsthe mounted ext4. The start sector never changes; nothing is unmounted.It acts only when all hold, otherwise prints why and exits 0 (an ungrown stick still works): removable USB disk (an installed disk is created full-size by
1bit-install), the last partition, ≥ 1 GiB free after it, ext4 mounted at/data, no/data/.grownmarker yet.Test.
tests/grow_data_test.sh(needs root + loop devices; exits 77 otherwise): a 4 GiB loop "stick" with a dd'd image's layout, partition mounted during the grow:Not yet run on a real stick boot: the appliance's
sfdisk/partx/resize2fsversions are still to be confirmed on the hardware.🤖 Generated with Claude Code