Updated prep_disks to make labels of xfs and swap partitions
[bootimage-initfs.git] / etc / cloner3 / prep_disks.sh
index 5ff589d..7d5dd01 100755 (executable)
@@ -404,8 +404,14 @@ do
                                        fi
                                ;;
                        xfs)
-                                       /usr/bin/mkfs.xfs -f ${FS_DEVICE} \
-                                               >> /tmp/stdout.log 2>> /tmp/stderr.log
+                                       CMD="/usr/bin/mkfs.xfs -f ${FS_DEVICE}"
+                                       if [ "${FS_LABEL}" != "" ]
+                                       then    
+                                               CMD="/usr/bin/mkfs.xfs -f ${FS_DEVICE} -L ${FS_LABEL}"
+                                       fi
+       
+
+                                       $CMD >> /tmp/stdout.log 2>> /tmp/stderr.log
                                        if [ "$?" = "0" ]
                                        then
                                                ok_msg
@@ -428,8 +434,13 @@ do
                                        fi
                                ;;
                        swap)
-                                       /usr/bin/mkswap -f ${FS_DEVICE} \
-                                               >> /tmp/stdout.log 2>> /tmp/stderr.log
+                                       CMD="/usr/bin/mkswap -f ${FS_DEVICE}"
+                                       if [ "${FS_LABEL}" != "" ]
+                                       then    
+                                               CMD="/usr/bin/mkswap -f ${FS_DEVICE} -L ${FS_LABEL}"
+                                       fi
+       
+                                       $CMD >> /tmp/stdout.log 2>> /tmp/stderr.log
                                        if [ "$?" = "0" ]
                                        then
                                                ok_msg