Skip to content

filesystem: refuse to mount over the extracted initrd - #86

Merged
daniel-rossier merged 1 commit into
mainfrom
fix/deploy-keep-initrd-edit
Dec 2, 2026
Merged

daniel-rossier merged 1 commit into
mainfrom
fix/deploy-keep-initrd-edit

Conversation

@daniel-rossier

Copy link
Copy Markdown
Contributor

A deploy run between mount.sh -i and umount.sh -i mounted the boot partition over the extracted initrd in filesystem/work/p1, and its unmount ran rm -rf on p1: the edit was gone and umount.sh -i found nothing to repack. __do_fs_mount now refuses a p1/p2 that is not mounted but has content (pointing to umount.sh -i when p1.fakeroot is there), and __do_main_umount removes only an empty mountpoint, with rmdir. Checked by running both functions out of the classes against a temp tree with stubbed sudo: the extracted tree with p1.fakeroot is refused with the umount.sh -i hint, the following cleanup keeps the edit and the filesystem/p1 link, a stray non-empty p1 gets the generic refusal, and an empty p2 is still removed. bitbake -p parses clean in infrabase-build:1.0.

mount.sh -i extracts initrd.cpio into filesystem/work/p1, the mountpoint
of the boot partition. A deploy run before umount.sh -i mounted p1 over
that tree, and its unmount then ran `rm -rf` on p1: the user's edit was
deleted, umount.sh -i found nothing to repack, and nothing said so.

__do_fs_mount now refuses a p1 or p2 that is not mounted but has
content, and names umount.sh -i when the initrd's fakeroot state sits
next to it. The unmount removes only an empty mountpoint, with rmdir,
and leaves a directory with content in place with a warning, since the
deploy's cleanup runs after a refused mount too.
@daniel-rossier
daniel-rossier merged commit d9fc2a2 into main Dec 2, 2026
2 checks passed
@daniel-rossier
daniel-rossier deleted the fix/deploy-keep-initrd-edit branch December 2, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant