1
1
#! /bin/bash
2
2
3
- version=2.0.13
3
+ version=2.0.14
4
4
5
5
# auto run grub-install if grub detected
6
6
grub_auto=1
@@ -200,7 +200,7 @@ unmount_list()
200
200
fi
201
201
for dir in $1
202
202
do
203
- qecho " unmounting: $dir "
203
+ qecho " unmounting $dir "
204
204
if ! umount $dir
205
205
then
206
206
qecho " Failed to unmount: $dir "
663
663
echo " Cannot find script $setup_command for setup arg \" $1 \" ."
664
664
usage_error=1
665
665
fi
666
- setup_args=" $setup_args $1 "
666
+ if [ " $setup_args " == " " ]
667
+ then
668
+ setup_args=" $1 "
669
+ else
670
+ setup_args=" $setup_args $1 "
671
+ fi
667
672
;;
668
673
-e|--edit-fstab)
669
674
shift
@@ -1176,10 +1181,17 @@ Use -U for unattended even if initializing.
1176
1181
image_to_sector=${src_start_sector[$image_to_part]}
1177
1182
count=$(( image_to_sector / 2 / 1024 + 4 )) # in MiB blocks for dd bs=1M
1178
1183
1179
- printf " \nImaging past the start of $msg partition $image_to_part .\n"
1184
+ printf " \nInitializing\n"
1185
+ printf " Imaging past the start of $msg partition $image_to_part .\n"
1180
1186
sync
1181
- echo " => dd if=/dev/$src_disk of=/dev/$dst_disk bs=1M count=$count ..."
1182
- dd if=/dev/$src_disk of=/dev/$dst_disk bs=1M count=$count
1187
+ printf " => dd if=/dev/$src_disk of=/dev/$dst_disk bs=1M count=$count ..."
1188
+ dd if=/dev/$src_disk of=/dev/$dst_disk bs=1M count=$count & > /tmp/$PGM -output
1189
+ if [ " $? " != 0 ]
1190
+ then
1191
+ printf " \n dd failed. See /tmp/$PGM -output.\n"
1192
+ printf " Try running $PGM again.\n\n"
1193
+ exit 1
1194
+ fi
1183
1195
echo " "
1184
1196
sync
1185
1197
sleep 1
@@ -1203,16 +1215,16 @@ Use -U for unattended even if initializing.
1203
1215
for (( x = 0 ; x < 3 ; ++ x))
1204
1216
do
1205
1217
sleep $(( x + 1 ))
1206
- sfdisk --force /dev/$dst_disk & > /tmp/$PGM -fail <<< " $sfd1"
1218
+ sfdisk --force /dev/$dst_disk & > /tmp/$PGM -output <<< " $sfd1"
1207
1219
if [ " $? " == 0 ]
1208
1220
then
1209
1221
break
1210
1222
fi
1211
1223
if (( x == 2 ))
1212
1224
then
1213
1225
printf " \n====$PGM \n==orig:\n%s\n\n==edited:\n%s\n" \
1214
- " $sfd0 " " $sfd1 " >> /tmp/$PGM -fail
1215
- printf " \n Resize failed. See /tmp/$PGM -fail .\n"
1226
+ " $sfd0 " " $sfd1 " >> /tmp/$PGM -output
1227
+ printf " \n Resize failed. See /tmp/$PGM -output .\n"
1216
1228
printf " Try running $PGM again.\n\n"
1217
1229
1218
1230
# Don't let dst disk keep source disk ID. Can lead to remounts.
1432
1444
unmount_list=" $dst_dir $unmount_list "
1433
1445
fi
1434
1446
done
1435
-
1447
+ echo " "
1436
1448
1437
1449
# Fix PARTUUID or device name references in cmdline.txt and fstab
1438
1450
#
0 commit comments