mkfs.patch
| mkfs.new 2011-08-24 14:54:50.619803003 +0200 | ||
|---|---|---|
| 38 | 38 |
SIZE=$2 |
| 39 | 39 |
ID=$3 |
| 40 | 40 | |
| 41 |
case $FSTYPE in |
|
| 42 |
"ext2"|"ext3"|"ext4"|"ntfs" ) OPTS="-F";; |
|
| 43 |
"reiserfs" ) OPTS="-f -q";; |
|
| 44 |
"jfs" ) OPTS="-q";; |
|
| 45 |
esac |
|
| 46 |
|
|
| 47 |
|
|
| 48 | ||
| 41 | 49 |
DST=`generate_image_path` |
| 42 | 50 | |
| 43 | 51 |
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \
|
| 44 | 52 |
"Could not create image $DST" |
| 45 |
exec_and_log "$MKFS -t $FSTYPE -F $DST" \
|
|
| 53 |
exec_and_log "$MKFS -t $FSTYPE $OPTS $DST" \
|
|
| 46 | 54 |
"Unable to create filesystem $FSTYPE in $DST" |
| 55 | ||
| 47 | 56 |
exec_and_log "chmod 0660 $DST" |
| 48 | 57 | |
| 49 | 58 |
echo "$DST" |