-
Notifications
You must be signed in to change notification settings - Fork 54
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
RHEL 9: Filesystem customizations for edge-raw-image #255
Conversation
having the following error:
with blueprint:
|
00b7f2c
to
34a8fa8
Compare
blueprint for customization:
|
I found the issue. It's a tricky detail with the way the partition table is described internally. Volume group partitions are sizeable containers, they need to have a size defined. But it seems we don't do this in our static partition tables, so the volume group's partition starts off as 0 bytes and is then grown to fill the space of the required total image size. This worked fine so far, but once the logical volume sizes add up to more than the image size, we run out of space. The proper solution here is to have logic which resizes the volume group partition to fit the logical volumes it contains and also have it calculate the size of those LVs when needed. It would basically be the same logic we have for the partition table as a whole: the vg has a "desired size", if the sum of lv sizes inside it is bigger than that desired size we grow it, if it's not then it's set to that size. I'll get a fix (and some tests) done asap. |
34a8fa8
to
dc3549c
Compare
Interesting details, can we pre-calculate the space required and create the VG accordingly, and then grow rootlv to fit the remaining space in image.disk_space. |
@achilleas-k @thozza So the the PR will be waiting for another PR, any feedback on policy and how its applied? |
yeah that's the plan. I'm working on that today. |
Fix for the filesystem size calculation is here #293 |
dc3549c
to
a12698b
Compare
a12698b
to
2733adf
Compare
2733adf
to
d6a28df
Compare
1814442
to
e325e46
Compare
e325e46
to
53a6d61
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.
Thanks for your work. I added a few comments inline.
On a general note, I'm not a big fan of merging the policies in the way you implemented it. I admit that this is probably a bit of a personal preference, but I feel like the merging makes the code more complex. In addition, the destination of the merge function is modified in-place and can override parts of the source policy (which is not needed AFAICT and it is also not explicitly documented and not covered by the unit test).
My preference would be to not touch the default path policy and how it is checked. Then in the checkOptions()
function, you could simply do something like this after the default policy check:
...
err := blueprint.CheckMountpointsPolicy(mountpoints, pathpolicy.MountpointPolicies)
if err != nil {
return warnings, err
}
if t.rpmOstree {
err := blueprint.CheckMountpointsPolicy(mountpoints, pathpolicy.OstreeMountpointPolicies)
if err != nil {
return warnings, err
}
}
...
This way, the ostree mountpoint policy would be really just an add-on to the default polisy and very few new code and logic would need to be added.
I agree with all of this. Much simpler and avoids any implicit behaviour when merging. Let's do it this way. |
53a6d61
to
aa43332
Compare
e96fb7f
to
8e5c411
Compare
I am up for enabling it for edge-ami too , but I would defer to the teams decision on this which I will update shortly. |
8e5c411
to
921e4f8
Compare
Looking into the broader epic that I am working,we need support for : |
f2cf7c4
to
a6c7031
Compare
Ostree specific filesystem policy to prevent users form accidentally creating custom filesystems that can ovewrite the systems filesystem. Signed-off-by: Sayan Paul <[email protected]>
Filesystem customizations is enabled for edge-raw-image, edge-ami,edge-vsphere,simplified-installer relevent testing config is added to run in CI Signed-off-by: Sayan Paul <[email protected]>
rhel only supports uefi, thus enforcing it. Signed-off-by: Sayan Paul <[email protected]>
a6c7031
to
da406f8
Compare
rebased and commit message updated |
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.
LGTM. A couple of comments for follow-up stuff.
Created new issues from my comments for follow-up. |
Extend the ostree filesystem customizations test case according to osbuild#255 (comment) Signed-off-by: Tomáš Hozza <[email protected]>
Extend the ostree filesystem customizations test case according to osbuild#255 (comment) Signed-off-by: Tomáš Hozza <[email protected]>
This PR enables File system customization for edge-raw-image.