Skip to content

Commit 94b2bcc

Browse files
Add fixup_root_partition() function
This adds some consistency with fixup_boot_partition, making code easier to read, and removes duplication of the list of files to update (currently only fstab).
1 parent a26aaff commit 94b2bcc

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

rpi-clone

+11-2
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,15 @@ fixup_cmdline_txt()
681681
fi
682682
}
683683

684+
fixup_root_partition()
685+
{
686+
partition=$1
687+
src_mount=$2
688+
dst_mount=$3
689+
690+
fixup_device_references_in_file "${partition}" "${dst_mount}" /etc/fstab
691+
}
692+
684693
fixup_device_references_in_file() {
685694
partition=$1
686695
dst_mount=$2
@@ -1828,7 +1837,7 @@ do
18281837

18291838
# This partition *might* be a boot or root partition, so try fixups for both
18301839
fixup_boot_partition "partition $p " "${clone_src}" "${clone}"
1831-
fixup_device_references_in_file "partition $p " "${clone}" /etc/fstab
1840+
fixup_root_partition "partition $p " "${clone_src}" "${clone}"
18321841

18331842
unmount_list "$unmount_list"
18341843
fi
@@ -1870,7 +1879,7 @@ done
18701879
qecho ""
18711880

18721881
fixup_boot_partition /boot /boot "${clone}/boot"
1873-
fixup_device_references_in_file "" "${clone}" /etc/fstab
1882+
fixup_root_partition "" / "${clone}"
18741883

18751884
rm -f $clone/etc/udev/rules.d/70-persistent-net.rules
18761885

0 commit comments

Comments
 (0)