Repository navigation
init_storage: refuse -f on an image in use - #88
Merged
Merged
Conversation
init_storage.sh -f deleted the storage image whatever held it. A guest started by st.sh kept writing to the unlinked file, so everything it wrote was lost when it exited, and the next st.sh booted the new, empty image. A mount or a loop device left by mount.sh kept the old partitions in the same way. Before deleting, -f now refuses when a process has the image open, when filesystem/work/p1 or p2 is mounted, or when a loop device is attached to it, and says which. The platform is read from local.conf then site.conf, as st.sh does, so both scripts name the same image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
init_storage.sh -fdeleted the image while a QEMU guest had it open (the guest kept writing to the unlinked inode, lost on exit) or while it was mounted / on a loop device.-fnow refuses, before therm, when a process holds the image open (/proc/*/fd, which catches the guest whatever its cwd), whenfilesystem/work/p1orp2is a mountpoint, or whenlosetup --associatedlists a device, and names the culprit. The platform is now read from local.conf then site.conf like st.sh. Checked on a real tree with a 64M image: a process named qemu-system-aarch64 holding it throughfilesystem/sdcard.img.virt64(plus a second reader) was listed and refused, alosetup-attached device was refused, a FAT image mounted onwork/p1was refused; the image stayed every time, and an idle image passes the check.dash -nclean; shellcheck reports only the existing SC2164.