Skip to content

Commit

Permalink
actions/image-partition: check if the filesystem is mountable
Browse files Browse the repository at this point in the history
If the filesystem type is 'none', it results in the below error.
==== image-partition ====
Action `image-partition` failed at stage Run, error: root mount failed: no such device
Warning: Failed to get unmount /boot/efi: no such file or directory
Unmount failure can cause images being incomplete!
Powering off.

Report an error message if filesystem type is 'none' and exit.

Fixes: #234

Signed-off-by: Vignesh Raman <[email protected]>
  • Loading branch information
vigneshraman authored and sjoerdsimons committed Dec 31, 2023
1 parent 94d0610 commit b214c9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions actions/image_partition_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ func (i *ImagePartitionAction) Verify(context *debos.DebosContext) error {
if m.part == nil {
return fmt.Errorf("Couldn't find partition for %s", m.Mountpoint)
}

if strings.ToLower(m.part.FS) == "none" {
return fmt.Errorf("Cannot mount %s: filesystem not present", m.Mountpoint)
}
}

// Calculate the size based on the unit (binary or decimal)
Expand Down

0 comments on commit b214c9a

Please sign in to comment.