From b214c9a466be0119e5fc78cdfbdc7103ebb4eee2 Mon Sep 17 00:00:00 2001 From: Vignesh Raman Date: Thu, 22 Jul 2021 14:32:07 +0530 Subject: [PATCH] actions/image-partition: check if the filesystem is mountable 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 --- actions/image_partition_action.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/actions/image_partition_action.go b/actions/image_partition_action.go index ea3d621..e2a81ff 100644 --- a/actions/image_partition_action.go +++ b/actions/image_partition_action.go @@ -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)