Try to execute FS check program from internal overlay#12
Draft
msvamp wants to merge 1 commit into
Draft
Conversation
When extroot is mounted using config in internal overlay, it is very likely that the fsck program is also installed on the same filesystem. So we will try to execute it from the overlay if it is present, else fallback to previous behaviour of finding it on rootfs mounted on /. Signed-off-by: Manas Sambhus <manas.sambhus+github@gmail.com>
dangowrt
reviewed
Jun 2, 2026
| const char *fatfsck = "/usr/sbin/fsck.fat"; | ||
| const char *btrfsck = "/usr/bin/btrfsck"; | ||
| const char *ntfsck = "/usr/bin/ntfsfix"; | ||
| const char *ckfs; |
Member
There was a problem hiding this comment.
Why rename this variable?
Other than that it looks all reasonable to me.
Author
There was a problem hiding this comment.
Hey, thanks for reviewing!
I haven't exactly renamed the variable, ckfs still contains the path to the final fsck program, I just changed its type to char[64].
I would have to either change the variable here in lines L777-785 or use a different variable on L791-818, I chose the former approach.
Author
|
Sorry about leaving this PR in draft status, I didn't get a chance to actually build and test my changes and forgot about it later. |
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.
Currently, on most default OpenWrt builds, if anyone follows the documentation at https://openwrt.org/docs/guide-user/additional-software/extroot_configuration and installs the filesystem packages on the internal overlay, then their extroot filesystem is never checked at boot:
This is because the current logic tries to find the fsck program in
/but during boot, the internal overlay is mounted at/tmp/overlay. So with this change, I try to first find the fsck program inside/tmp/overlayand execute it from there (by appending/usr/libto LD_LIBRARY_PATH as it might be needed by the fsck program), else fallback to finding it on/(the current behaviour)