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

Use repartition update_script

This commit is contained in:
Jan Schneider 2018-04-27 00:50:36 +02:00
parent d82002633c
commit 53e25f2ebd

View File

@ -1256,6 +1256,7 @@ proc ::rmupdate::delete_firmware_image {version} {
proc ::rmupdate::install_firmware {{download_url ""} {version ""} {lang ""} {reboot 1} {keep_download 0} {dryrun 0}} { proc ::rmupdate::install_firmware {{download_url ""} {version ""} {lang ""} {reboot 1} {keep_download 0} {dryrun 0}} {
variable language variable language
variable addon_dir
if {[regexp {^([a-z]][a-z])} $lang match l]} { if {[regexp {^([a-z]][a-z])} $lang match l]} {
set language [string tolower $l] set language [string tolower $l]
} }
@ -1284,7 +1285,7 @@ proc ::rmupdate::install_firmware {{download_url ""} {version ""} {lang ""} {reb
set firmware_image [download_firmware $download_url $version] set firmware_image [download_firmware $download_url $version]
} }
get_system_device set sys_dev [get_system_device]
set use_recovery [is_recoveryfs_available] set use_recovery [is_recoveryfs_available]
if {$use_recovery && $version != ""} { if {$use_recovery && $version != ""} {
@ -1297,11 +1298,6 @@ proc ::rmupdate::install_firmware {{download_url ""} {version ""} {lang ""} {reb
# Use recovery system firmware update feature # Use recovery system firmware update feature
write_install_log "Using recovery system to update firmware." write_install_log "Using recovery system to update firmware."
set tmp_dir "/usr/local/tmp" set tmp_dir "/usr/local/tmp"
set update_script "${tmp_dir}/update_script"
if {!$dryrun} {
# Relabel rootfs1 to rootfs
catch { exec tune2fs -L rootfs [get_partition_device [get_system_device] 2] }
}
catch { file mkdir $tmp_dir } catch { file mkdir $tmp_dir }
catch { file delete "${tmp_dir}/new_firmware.img" } catch { file delete "${tmp_dir}/new_firmware.img" }
catch { file delete /usr/local/.firmwareUpdate } catch { file delete /usr/local/.firmwareUpdate }
@ -1312,6 +1308,10 @@ proc ::rmupdate::install_firmware {{download_url ""} {version ""} {lang ""} {reb
file copy -force $firmware_image "${tmp_dir}/new_firmware.img" file copy -force $firmware_image "${tmp_dir}/new_firmware.img"
} }
catch { exec ln -sf $tmp_dir /usr/local/.firmwareUpdate } catch { exec ln -sf $tmp_dir /usr/local/.firmwareUpdate }
if { [get_filesystem_label $sys_dev 3] == "rootfs2" } {
file copy "${addon_dir}/update_script_repartition" "${tmp_dir}/update_script"
file attributes "${tmp_dir}/update_script" -permissions 0755
}
set reboot 1 set reboot 1
} }
} else { } else {