mirror of
https://github.com/j-a-n/raspberrymatic-addon-rmupdate.git
synced 2023-10-10 11:37:40 +00:00
Tinker board support
This commit is contained in:
@@ -108,6 +108,10 @@ proc ::rmupdate::get_rpi_version {} {
|
||||
set fp [open /proc/cpuinfo r]
|
||||
set data [read $fp]
|
||||
foreach d [split $data "\n"] {
|
||||
regexp {^Hardware\s*:\s*(\S+)} $d match hardware
|
||||
if { [info exists hardware] && $hardware == "Rockchip" } {
|
||||
return "tinkerboard"
|
||||
}
|
||||
regexp {^Revision\s*:\s*(\S+)\s*$} $d match revision
|
||||
if { [info exists revision] && [info exists revision_map($revision)] } {
|
||||
return $revision_map($revision)
|
||||
@@ -480,7 +484,11 @@ proc ::rmupdate::update_filesystems {image {dryrun 0}} {
|
||||
set new_root_partition 3
|
||||
}
|
||||
set part_uuid [get_part_uuid "${sys_dev}p${new_root_partition}"]
|
||||
update_cmdline "${mnt_s}/cmdline.txt" "PARTUUID=${part_uuid}"
|
||||
if { [get_rpi_version] == "tinkerboard" } {
|
||||
update_cmdline "${mnt_s}/extlinux/extlinux.conf" "PARTUUID=${part_uuid}"
|
||||
} else {
|
||||
update_cmdline "${mnt_s}/cmdline.txt" "PARTUUID=${part_uuid}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
rest("GET", "/get_system_info", null, function(data) {
|
||||
$("#system-info").empty();
|
||||
$("#system-info").append(
|
||||
$('<div class="sub header">').html(i18next.t('system_type', {'system_type': data.system_type})),
|
||||
$('<div class="sub header">').html(i18next.t('current_root_partiton', {'root_partition': data.root_partition}))
|
||||
);
|
||||
});
|
||||
@@ -332,6 +333,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
title: 'System update',
|
||||
system_info: 'System information',
|
||||
current_root_partiton: 'Current root partition: {{root_partition}}',
|
||||
system_type: 'System type: {{system_type}}',
|
||||
firmwares: 'Firmwares',
|
||||
current_installed_version: 'Current installed version',
|
||||
latest_available_version: 'Latest available version',
|
||||
@@ -367,6 +369,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
title: 'System-Aktualisierung',
|
||||
system_info: 'System-Informationen',
|
||||
current_root_partiton: 'Aktuelle Root-Partition: {{root_partition}}',
|
||||
system_type: 'System-Typ: {{system_type}}',
|
||||
firmwares: 'Firmwares',
|
||||
current_installed_version: 'Momentan installierte Version',
|
||||
latest_available_version: 'Aktuellste verfügbare Version',
|
||||
|
||||
@@ -35,8 +35,9 @@ proc process {} {
|
||||
} elseif {[lindex $path 1] == "get_firmware_info"} {
|
||||
return [rmupdate::get_firmware_info]
|
||||
} elseif {[lindex $path 1] == "get_system_info"} {
|
||||
set system_type [rmupdate::get_rpi_version]
|
||||
set root_partition [rmupdate::get_current_root_partition]
|
||||
return "\{\"root_partition\":${root_partition}\}"
|
||||
return "\{\"system_type\":\"${system_type}\",\"root_partition\":${root_partition}\}"
|
||||
} elseif {[lindex $path 1] == "get_addon_info"} {
|
||||
return [rmupdate::get_addon_info 1 1 1]
|
||||
} elseif {[lindex $path 1] == "start_install_firmware"} {
|
||||
|
||||
Reference in New Issue
Block a user