1
0
mirror of https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git synced 2023-10-10 13:37:40 +02:00

Umount all partitions before repartition

This commit is contained in:
Jan Schneider 2018-03-01 17:51:55 +01:00
parent d0e6b549b1
commit 3f1ade345b

View File

@ -743,8 +743,16 @@ proc ::rmupdate::move_userfs_to_device {target_device {sync_data 0} {repartition
} }
if {$target_partition_device == ""} { if {$target_partition_device == ""} {
array set partitions [get_partitions $target_device]
set keys [array names partitions]
set partition_number 0 set partition_number 0
if {$repartition == 1} { if {$repartition == 1} {
foreach key $keys {
regexp {^(.+)::([^:]+)$} $key match id opt
if {$opt == "partition_device"} {
catch { exec /bin/umount $partitions($key) }
}
}
set exitcode [catch { set exitcode [catch {
exec /usr/sbin/parted --script ${target_device} \ exec /usr/sbin/parted --script ${target_device} \
mklabel msdos \ mklabel msdos \
@ -755,8 +763,6 @@ proc ::rmupdate::move_userfs_to_device {target_device {sync_data 0} {repartition
} }
set partition_number 1 set partition_number 1
} else { } else {
array set partitions [get_partitions $target_device]
set keys [array names partitions]
foreach key $keys { foreach key $keys {
regexp {^(.+)::([^:]+)$} $key match id opt regexp {^(.+)::([^:]+)$} $key match id opt
if {$opt == "filesystem_label"} { if {$opt == "filesystem_label"} {