Merge branch 'feature-docs-rearrangement' into develop
[snf-image] / snf-image-helper / tasks / 30MountImage.in
index c8d088a..a62c136 100644 (file)
@@ -45,7 +45,14 @@ if [ ! -b "$rootdev" ]; then
         "(=$SNF_IMAGE_PROPERTY_ROOT_PARTITION) is valid."
 fi
 
-mount "$rootdev" "$SNF_IMAGE_TARGET" -o rw
+if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" = "freebsd" ]; then
+    if ! $DUMPFS_UFS "$rootdev" &> /dev/null; then
+        log_error "For FreeBSD images only UFS root partitions are supported."
+    fi
+    $MOUNT -t ufs -o ufstype=ufs2,rw "$rootdev" "$SNF_IMAGE_TARGET"
+else
+    $MOUNT -o rw "$rootdev" "$SNF_IMAGE_TARGET"
+fi
 
 if [ "$SNF_IMAGE_PROPERTY_OSFAMILY" != "linux" ]; then
     exit 0
@@ -73,7 +80,7 @@ while read line; do
 
     # I'm in doupt. Sould I mount the filesystems with the mount options
     # found in the image's /etc/fstab or not?
-    mount "${entry[1]}" "${SNF_IMAGE_TARGET}${entry[0]}" # -o "${entry[2]}"
+    $MOUNT "${entry[1]}" "${SNF_IMAGE_TARGET}${entry[0]}" # -o "${entry[2]}"
 
 done <<< "$fstab"