]> git.pld-linux.org Git - packages/convertfs.git/blob - convertfs-safety.patch
- tabs in preamble
[packages/convertfs.git] / convertfs-safety.patch
1 --- convertfs/contrib/convertfs.orig    2005-01-13 13:27:35.000000000 +0100
2 +++ convertfs/contrib/convertfs 2005-01-16 15:08:49.376275560 +0100
3 @@ -120,13 +120,23 @@
4  }
5  
6  error() {
7 +  echo "Trying to clean up" 1>&2
8    umount $loopdev 2>/dev/null
9    losetup -d $loopdev 2>/dev/null
10    umount $dev 2>/dev/null
11 -  rm -rf $tmp
12 +  rmdir $fs1root
13 +  rmdir $fs2root
14 +  rmdir $tmp
15    exit 1
16  }
17  
18 +for I in devclone devremap prepindex; do
19 +       if [ -z "$(which "$I")" ]; then
20 +               echo "Your it is not complete" 1>&2
21 +               exit 1
22 +       fi
23 +done
24 +
25  # device to convert
26  dev=$1
27  # filesystem to convert from
28 @@ -193,7 +203,7 @@
29  echo "== Creating clone of \`$from_fs_type' filesystem that's on \`$dev'. =="
30  umount $dev 2>/dev/null
31  mount -t $from_fs_type $dev $fs1root || error
32 -./devclone $dev $fsimage || error
33 +devclone $dev $fsimage || error
34  
35  echo "===== Creating destination \`$to_fs_type' filesystem. ====="
36  umount $loopdev 2>/dev/null
37 @@ -217,17 +227,17 @@
38  losetup -d $loopdev 2>/dev/null
39  
40  echo "=== Preparing info for block relocation ==="
41 -./prepindex $fsimage $fsindex $fssuper || error
42 +prepindex $fsimage $fsindex $fssuper || error
43  umount $dev || error
44  dd if=$fssuper of=$dev || exit
45  sync
46  
47  echo "============ Relocating blocks ============"
48 -./devremap $dev || exit
49 +devremap $dev || exit
50  
51  echo "=== Filesystem conversion accomplished! ==="
52  rm -rf $tmp
53  echo "NOTE: If you want to boot the new filesystem on \`$dev' you"
54  echo "      should edit \`/etc/fstab' and add something like this."
55 -echo "      $dev   /   $to_fs_type   defaults   1   1"
56 +echo "      $dev   /mountpoint   $to_fs_type   defaults   1   1"
57  
This page took 0.095581 seconds and 3 git commands to generate.