From 134975793191673bbe6ea8cfb0392eadec96aa9e Mon Sep 17 00:00:00 2001 From: Stan Grishin Date: Thu, 27 Apr 2023 23:08:22 +0000 Subject: [PATCH] luci-app-advanced-reboot: add support for Linksys and Xiaomi devices and misc fixes Fixes: * change maintainer's email address * add rpcd reload to uci-defaults script * add better messaging with link to README when device isn't detected as dual-firmware Add support for: * linksys-ea8100v2 * linksys-whw01v1 * xiaomi-ax3600 * xiaomi-ax9000 Signed-off-by: Stan Grishin --- applications/luci-app-advanced-reboot/Makefile | 2 +- .../resources/view/system/advanced_reboot.js | 11 ++++++++++- .../root/etc/uci-defaults/40_luci-advanced-reboot | 3 +-- .../root/usr/libexec/rpcd/luci.advanced_reboot | 2 +- .../advanced-reboot/devices/linksys-ea7500v2.json | 1 - .../advanced-reboot/devices/linksys-ea8100v2.json | 14 ++++++++++++++ .../advanced-reboot/devices/linksys-whw01v1.json | 14 ++++++++++++++ .../advanced-reboot/devices/xiaomi-ax3600.json | 14 ++++++++++++++ .../advanced-reboot/devices/xiaomi-ax9000.json | 14 ++++++++++++++ 9 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea8100v2.json create mode 100644 applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-whw01v1.json create mode 100644 applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax3600.json create mode 100644 applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax9000.json diff --git a/applications/luci-app-advanced-reboot/Makefile b/applications/luci-app-advanced-reboot/Makefile index 114d1cd859..adee08a63a 100644 --- a/applications/luci-app-advanced-reboot/Makefile +++ b/applications/luci-app-advanced-reboot/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Stan Grishin -PKG_VERSION:=1.0.1-3 +PKG_VERSION:=1.0.1-8 LUCI_TITLE:=Advanced Linksys Reboot Web UI LUCI_URL:=https://docs.openwrt.melmac.net/luci-app-advanced-reboot/ diff --git a/applications/luci-app-advanced-reboot/htdocs/luci-static/resources/view/system/advanced_reboot.js b/applications/luci-app-advanced-reboot/htdocs/luci-static/resources/view/system/advanced_reboot.js index 482b8e2e91..3fdf6c18ec 100644 --- a/applications/luci-app-advanced-reboot/htdocs/luci-static/resources/view/system/advanced_reboot.js +++ b/applications/luci-app-advanced-reboot/htdocs/luci-static/resources/view/system/advanced_reboot.js @@ -5,6 +5,11 @@ 'require uci'; 'require fs'; +var pkg = { + get Name() { return 'luci-app-advanced-reboot'; }, + get URL() { return 'https://docs.openwrt.melmac.net/' + pkg.Name + '/'; } +}; + return view.extend({ translateTable: { NO_BOARD_NAME : function(args) { return _('Unable to find Device Board Name.')}, @@ -213,9 +218,13 @@ return view.extend({ body.appendChild(partitions_table); } else { body.appendChild(E('p', { 'class' : 'alert-message warning'}, - device_info.rom_board_name ? _("Warning: Device (%s) is unknown or isn't a dual-partition device!").format(device_info.rom_board_name) + device_info.rom_board_name ? _("Warning: Device (%s) is unknown or isn't a dual-firmware device!" + "%s" + + "If you are seeing this on an OpenWrt dual-firmware supported device," + "%s" + "please refer to " + + "%sHow to add a new device section of the README%s.").format(device_info.rom_board_name, "

", "
", + "", "" ) : _('Warning: Unable to obtain device information!') )); + } body.appendChild(E('hr')); diff --git a/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot b/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot index 8e457adce8..b42fa5859f 100644 --- a/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot +++ b/applications/luci-app-advanced-reboot/root/etc/uci-defaults/40_luci-advanced-reboot @@ -1,5 +1,4 @@ #!/bin/sh - -/etc/init.d/rpcd reload rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache; +[ -x /etc/init.d/rpcd ] && /etc/init.d/rpcd reload exit 0 diff --git a/applications/luci-app-advanced-reboot/root/usr/libexec/rpcd/luci.advanced_reboot b/applications/luci-app-advanced-reboot/root/usr/libexec/rpcd/luci.advanced_reboot index 7ec52a3097..b92459a7b3 100755 --- a/applications/luci-app-advanced-reboot/root/usr/libexec/rpcd/luci.advanced_reboot +++ b/applications/luci-app-advanced-reboot/root/usr/libexec/rpcd/luci.advanced_reboot @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright 2017-2020 Stan Grishin (stangri@melmac.net) +# Copyright 2017-2020 Stan Grishin (stangri@melmac.ca) # shellcheck disable=SC2039,SC1091,SC3043,SC3057,SC3060 readonly devices_dir="/usr/share/advanced-reboot/devices/" diff --git a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea7500v2.json b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea7500v2.json index 03a18be684..b061c65865 100644 --- a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea7500v2.json +++ b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea7500v2.json @@ -12,4 +12,3 @@ "bootEnv2Partition1Value": "run nandboot", "bootEnv2Partition2Value": "run altnandboot" } - diff --git a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea8100v2.json b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea8100v2.json new file mode 100644 index 0000000000..d62843cc1b --- /dev/null +++ b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-ea8100v2.json @@ -0,0 +1,14 @@ +{ + "vendorName": "Linksys", + "deviceName": "EA8100v2", + "boardNames": [ "linksys,ea8100-v2" ], + "partition1MTD": "mtd5", + "partition2MTD": "mtd7", + "labelOffset": 32, + "bootEnv1": "boot_part", + "bootEnv1Partition1Value": 1, + "bootEnv1Partition2Value": 2, + "bootEnv2": null, + "bootEnv2Partition1Value": null, + "bootEnv2Partition2Value": null +} diff --git a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-whw01v1.json b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-whw01v1.json new file mode 100644 index 0000000000..82238f3548 --- /dev/null +++ b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/linksys-whw01v1.json @@ -0,0 +1,14 @@ +{ + "vendorName": "Linksys", + "deviceName": "WHW01 V1 (Velop)", + "boardNames": [ "linksys,whw01" ], + "partition1MTD": "mtd9", + "partition2MTD": "mtd11", + "labelOffset": 192, + "bootEnv1": "boot_part", + "bootEnv1Partition1Value": 1, + "bootEnv1Partition2Value": 2, + "bootEnv2": null, + "bootEnv2Partition1Value": null, + "bootEnv2Partition2Value": null +} diff --git a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax3600.json b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax3600.json new file mode 100644 index 0000000000..618911326a --- /dev/null +++ b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax3600.json @@ -0,0 +1,14 @@ +{ + "vendorName": "Xiaomi", + "deviceName": "AX3600", + "boardNames": [ "xiaomi,ax3600" ], + "partition1MTD": "mtd12", + "partition2MTD": "mtd13", + "labelOffset": 266432, + "bootEnv1": "flag_boot_rootfs", + "bootEnv1Partition1Value": 0, + "bootEnv1Partition2Value": 1, + "bootEnv2": "flag_last_success", + "bootEnv2Partition1Value": 0, + "bootEnv2Partition2Value": 1 +} diff --git a/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax9000.json b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax9000.json new file mode 100644 index 0000000000..09435b84f2 --- /dev/null +++ b/applications/luci-app-advanced-reboot/root/usr/share/advanced-reboot/devices/xiaomi-ax9000.json @@ -0,0 +1,14 @@ +{ + "vendorName": "Xiaomi", + "deviceName": "AX9000", + "boardNames": [ "xiaomi,ax9000" ], + "partition1MTD": "mtd20", + "partition2MTD": "mtd21", + "labelOffset": 266432, + "bootEnv1": "flag_boot_rootfs", + "bootEnv1Partition1Value": 0, + "bootEnv1Partition2Value": 1, + "bootEnv2": "flag_last_success", + "bootEnv2Partition1Value": 0, + "bootEnv2Partition2Value": 1 +} -- 2.30.2