Skip to content
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

Merged
merged 12 commits into from
Jul 24, 2024
Next Next commit
Use the system-data role to look for the rootfs structure
Signed-off-by: Paul Mars <paul.mars@canonical.com>
  • Loading branch information
upils committed Jul 17, 2024
commit 835d9f991b320b166985964c5c3a2d2f8991e619
4 changes: 2 additions & 2 deletions internal/statemachine/common_states.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (stateMachine *StateMachine) calculateRootfsSize() error {
func (stateMachine *StateMachine) findRootfsVolume() (*gadget.Volume, string) {
for volumeName, volume := range stateMachine.GadgetInfo.Volumes {
for _, structure := range volume.Structure {
if structure.Size == 0 {
if structure.Role == gadget.SystemData {
return volume, volumeName
}
}
Expand All @@ -207,7 +207,7 @@ func (stateMachine *StateMachine) alignToSectorSize(size quantity.Size) quantity
func (stateMachine *StateMachine) syncGadgetStructureRootfsSize() {
for _, volume := range stateMachine.GadgetInfo.Volumes {
for structIndex, structure := range volume.Structure {
if structure.Size == 0 {
if structure.Role == gadget.SystemData {
structure.Size = stateMachine.RootfsSize
}
volume.Structure[structIndex] = structure
Expand Down