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

Implement userfs move

This commit is contained in:
Jan Schneider
2018-02-28 00:11:00 +01:00
parent 638b8ced7e
commit 469efb9ee1
3 changed files with 100 additions and 31 deletions

View File

@@ -54,9 +54,13 @@ proc process {} {
return [rmupdate::get_firmware_info]
} elseif {[lindex $path 1] == "get_system_info"} {
set system_type [rmupdate::get_rpi_version]
return "\{\"system_type\":\"${system_type}\"\}"
set uptime [exec /usr/bin/uptime]
return "\{\"system_type\":\"${system_type}\",\"uptime\":\"${uptime}\"\}"
} elseif {[lindex $path 1] == "get_partitions"} {
return [array_to_json [rmupdate::get_partitions]]
} elseif {[lindex $path 1] == "move_userfs_to_device"} {
regexp {\"target_device\"\s*:\s*\"([^\"]+)\"} $data match target_device
return [rmupdate::move_userfs_to_device $target_device 1 1]
} elseif {[lindex $path 1] == "system_reboot"} {
exec /sbin/reboot
return "\"reboot initiated\""