-
Notifications
You must be signed in to change notification settings - Fork 164
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
Before writing to partition check for sufficient space on partition #3276
Before writing to partition check for sufficient space on partition #3276
Conversation
zedi-pramodh
commented
Jun 10, 2023
- Get the size of the image using contenttree status
- Get the size of the partition using zboot
- If partition size is < image size, error out
- Fixed zboot API to be more portable
1. Get the size of the image using contenttree status 2. Get the size of the partition using zboot 3. If partition size is < image size, error out 4. Fixed zboot API to be more portable Signed-off-by: Pramodh Pallapothu <pramodh@zededa.com>
Tried to upgrade to image of size 321MB dev.log.2224562291:{"severity":"info","source":"zedagent","iid":"1865","content":"{"error":"doBaseOsActivate: Image size 336605184 bytes greater than partition size 314572800 bytes","error-time":"2023-06-10T03:02:30.384830099Z","file":"/pillar/types/zedagenttypes.go:136","func":"github.com/lf-edge/eve/pkg/pillar/types.BaseOsStatus.LogModify","level":"info","log_event_type":"log","msg":"BaseOs status modify","obj_key":"baseos_status-v7.4.0-master-private-1212-g92de24282-kubevirt-amd64","obj_name":"v7.4.0-master-private-1212-g92de24282-kubevirt-amd64","obj_type":"baseos_status","pid":1865,"source":"zedagent","state":"LOADED","time":"2023-06-10T03:02:30.386236254Z"}\n","msgid":3412,"timestamp":{"seconds":1686366150,"nanos":386236254},"filename":"/pillar/types/zedagenttypes.go:136","function":"github.com/lf-edge/eve/pkg/pillar/types.BaseOsStatus.LogModify"} On the controllerALERTS |
|
||
if cts.State == types.LOADED { | ||
partSize := zboot.GetPartitionSizeInBytes(status.PartitionLabel) | ||
imageSize := cts.MaxDownloadSize |
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.
Don't we have an actual size which could be smaller than MaxDownloadSize?
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.
MaxDownloadSize seems to be the size of image sent from the controller in the content tree config. zedagent is parsing that value from the config. To me that seems to be the actual size of the image. Let me know if that is not correct.
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.
Kick off tests