@@ -22,6 +22,7 @@ PGM=`basename $0`
22
22
setup_command=" $PGM -setup"
23
23
24
24
rsync_options=" --force -rltWDEHXAgoptx"
25
+ rsync_options_fat=" --force -rltWDEHXAptx"
25
26
26
27
if [ ` id -u` != 0 ]
27
28
then
@@ -285,14 +286,22 @@ mount_partition()
285
286
286
287
rsync_file_system ()
287
288
{
288
- src_dir=" $1 "
289
- dst_dir=" $2 "
289
+ part_num=" $1 "
290
+ src_dir=" $2 "
291
+ dst_dir=" $3 "
290
292
291
- qprintf " => rsync $1 $2 $3 ..."
293
+ qprintf " => rsync $1 $2 $3 $4 ..."
294
+
295
+ effective_options=${rsync_options}
296
+ fstype=${src_fs_type[part_num]}
297
+ if [[ " $fstype " == * " fat" * ]]
298
+ then
299
+ effective_options=${rsync_options_fat}
300
+ fi
292
301
293
302
if [ " $3 " == " with-root-excludes" ]
294
303
then
295
- rsync $rsync_options --delete \
304
+ rsync $effective_options --delete \
296
305
$exclude_useropt \
297
306
$exclude_swapfile \
298
307
--exclude ' .gvfs' \
@@ -306,7 +315,7 @@ rsync_file_system()
306
315
$src_dir \
307
316
$dst_dir
308
317
else
309
- rsync $rsync_options --delete \
318
+ rsync $effective_options --delete \
310
319
$exclude_useropt \
311
320
--exclude ' .gvfs' \
312
321
--exclude ' lost\+found/*' \
1681
1690
mount_partition ${src_device[p]} $clone_src " "
1682
1691
mount_partition $dst_dev $clone " $clone_src "
1683
1692
unmount_list=" $clone_src $clone "
1684
- rsync_file_system " ${clone_src} /" " ${clone} " " "
1693
+ rsync_file_system " ${p} " " ${clone_src} /" " ${clone} " " "
1694
+
1685
1695
unmount_list " $unmount_list "
1686
1696
fi
1687
1697
done
1699
1709
mount_partition $dst_root_dev $clone " "
1700
1710
unmount_list=" $clone "
1701
1711
1702
- rsync_file_system " //" " $clone " " with-root-excludes"
1712
+ rsync_file_system " $root_part_num " " //" " $clone " " with-root-excludes"
1703
1713
1704
1714
for (( p = 1 ; p <= n_src_parts; p++ ))
1705
1715
do
1725
1735
fi
1726
1736
1727
1737
mount_partition " $dst_dev " " $dst_dir " " $unmount_list "
1728
- rsync_file_system " ${src_mounted_dir[p]} /" " ${dst_dir} " " "
1738
+ rsync_file_system " ${p} " " ${ src_mounted_dir[p]} /" " ${dst_dir} " " "
1729
1739
unmount_list=" $dst_dir $unmount_list "
1730
1740
fi
1731
1741
done
0 commit comments