Check in MountImage task if /etc/fstab is present
authorNikos Skalkotos <skalkoto@grnet.gr>
Wed, 5 Feb 2014 15:39:26 +0000 (17:39 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Wed, 5 Feb 2014 16:25:57 +0000 (18:25 +0200)
Add an extra check to determine if the user gave the correct
ROOT_PARTITION property

snf-image-helper/tasks/30MountImage.in

index cd693c4..c8f330b 100644 (file)
@@ -40,8 +40,8 @@ fi
 rootdev="${SNF_IMAGE_DEV}${SNF_IMAGE_PROPERTY_ROOT_PARTITION}"
 
 if [ ! -b "$rootdev" ]; then
-    log_error "Root partition device:\`$rootdev' is not a block device. " \
-        "Please check if the value for image property \`ROOT_PARTITION' " \
+    log_error "Root partition device:\`$rootdev' is not a block device." \
+        "Please check if the value for image property \`ROOT_PARTITION'" \
         "(=$SNF_IMAGE_PROPERTY_ROOT_PARTITION) is valid."
 fi
 
@@ -68,6 +68,12 @@ if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "windows" ]; then
     exit 0
 fi
 
+if [ ! -f "$SNF_IMAGE_TARGET/etc/fstab" ]; then
+    log_error "\`/etc/fstab' is missing from the root partition." \
+        "Please check if the value for image property \`ROOT_PARTITION'" \
+        "(=$SNF_IMAGE_PROPERTY_ROOT_PARTITION) is valid."
+fi
+
 mount_all "$SNF_IMAGE_PROPERTY_OSFAMILY" "$SNF_IMAGE_DEV" "$SNF_IMAGE_TARGET"
 
 exit 0