Detect ext4 based on their superblock magic - #113
Merged
Conversation
mschwan-phytec
force-pushed
the
wip-ext4-auto-detect
branch
2 times, most recently
from
July 16, 2026 10:00
6cff296 to
466eea5
Compare
mschwan-phytec
marked this pull request as ready for review
July 16, 2026 10:01
landerweit-phytec
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Just one question below.
Add a helper function to check a file, whether it is an ext4 image. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Detect ext4 images not only based on their filename, but also based on whether they contain an actual ext4 filesystem. This is especially needed, as sometimes ext4 images do not have a reliable filename suffix to search for. The only reliable way is to check for the superblock magic. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Add a unit test for pu_is_ext234_image and check different files. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Allow writing arbitrary binaries to partitions with filesystem specified as null and where the input is not an ext4 image. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
When mounting or unmounting fails, print the return and status codes for better debugging of the error. Signed-off-by: Martin Schwan <m.schwan@phytec.de>
mschwan-phytec
force-pushed
the
wip-ext4-auto-detect
branch
from
July 16, 2026 13:28
466eea5 to
a5228aa
Compare
landerweit-phytec
approved these changes
Jul 16, 2026
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.
Add a helper function to check a file, whether it is an ext4 image.
Detect ext4 images not only based on their filename, but also based on whether they contain an actual ext4 filesystem. This is especially needed, as sometimes ext4 images do not have a reliable filename suffix to search for. The only reliable way is to check for the superblock magic.
Add a unit test for pu_is_ext4_image and check different files.
Depends on #112