-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GPT header rework - Refacto 2 #234
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #234 +/- ##
==========================================
+ Coverage 94.23% 94.27% +0.03%
==========================================
Files 16 16
Lines 3330 3353 +23
==========================================
+ Hits 3138 3161 +23
Misses 123 123
Partials 69 69
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
521e13e
to
a87480a
Compare
4f38b3e
to
4f6540b
Compare
a87480a
to
6050bf9
Compare
Signed-off-by: Paul Mars <paul.mars@canonical.com>
We previously sutracted several time some of other structure size/offset. So make sure we get it right. Name a couple of magic numbers. Signed-off-by: Paul Mars <paul.mars@canonical.com>
…eRootfsSize Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Split this function in easier to understand bits. Make sure the size declared in the gadget YAML is respected. Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
If the calculated rootfs size is bigger than the requested image size, do not return an error but print a warning. This is consistent with other places where the image-size flag cannot be respected. Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
2adb98d
to
46f65b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general. I just have some questions re: the size vs min-size. What will happen in case where min-size is not defined for the rootfs, but someone sets say size: 1G
but then the rootfs itself will be 2G? Should we handle the case of printing out a warning/error for users, that the rootfs size they provided is too small to hold the rootfs (similarly to the image-size case)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per our discussion, all good! Let's move to the next PR ;)
Refactoring of
calculateRootfsSize()
and introducing a dedicated function to know if we are dealing with a "rootfs structure" (seeisRootfsStructure()
).I also added as a bonus the up-to-date configuration of mkfs for oracular and removed the one for mantic.