fs-mkfs.patch

Run dd before exit when $FSTYPE="save_as" - Laurent Grawet, 02/01/2013 07:39 PM

Download (1017 Bytes)

View differences:

src/datastore_mad/remotes/fs/mkfs 2013-02-01 19:22:09.924911746 +0100
65 65

  
66 66
DST=`generate_image_path`
67 67

  
68
# ------------ Image to save_as disk, no need to create a FS ------------
69

  
70
if [ "$FSTYPE" = "save_as" ]; then
71
    echo "$DST"
72
    exit 0
73
fi
74

  
75 68
# ------------ Create the image to the repository ------------
76 69

  
77
MKFS_CMD=`mkfs_command $DST $FSTYPE $SIZE`
78

  
79 70
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \
80 71
    "Could not create image $DST"
81
exec_and_log "$MKFS_CMD" \
82
    "Unable to create filesystem $FSTYPE in $DST"
72

  
73
# ------------ Create FS if image is not to save_as disk ------------
74

  
75
    if [ "$FSTYPE" != "save_as" ]; then
76
        MKFS_CMD=`mkfs_command $DST $FSTYPE $SIZE`
77

  
78
        exec_and_log "$MKFS_CMD" \
79
            "Unable to create filesystem $FSTYPE in $DST"
80
    fi
83 81

  
84 82
echo "$DST"