luci-app-advanced-reboot: backport devices support (#67)

This commit is contained in:
AmadeusGhost 2021-06-22 11:18:15 +08:00 committed by GitHub
parent b1a5082196
commit 21346607a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 809 additions and 335 deletions

View File

@ -3,7 +3,7 @@
include $(TOPDIR)/rules.mk
PKG_LICENSE:=GPL-3.0+
PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>
LUCI_TITLE:=Advanced Linksys Reboot Web UI
@ -13,7 +13,7 @@ LUCI_DESCRIPTION:=Provides Web UI (found under System/Advanced Reboot) to reboot
LUCI_DEPENDS:=+luci-mod-admin-full
LUCI_PKGARCH:=all
PKG_RELEASE:=42
PKG_RELEASE:=54
include ../../luci.mk

View File

@ -22,11 +22,11 @@ Currently supported dual-partition devices include:
- Linksys WRT32X
- ZyXEL NBG6817
If you're interested in having your device supported, please post in [OpenWrt Forum Support Thread](https://forum.openwrt.org/t/web-ui-to-reboot-to-another-partition-dual-partition-routers/3423).
If your device is not in the list above, however it is a [dual-firmware device](https://openwrt.org/tag/dual_firmware?do=showtag&tag=dual_firmware) and you're interested in having your device supported, please post in [OpenWrt Forum Support Thread](https://forum.openwrt.org/t/web-ui-to-reboot-to-another-partition-dual-partition-routers/3423).
## Screenshot (luci-app-advanced-reboot)
![screenshot](https://raw.githubusercontent.com/stangri/openwrt_packages/master/screenshots/luci-app-advanced-reboot/screenshot01.png "screenshot")
![screenshot](https://docs.openwrt.melmac.net/luci-app-advanced-reboot/screenshots/screenshot02.png "screenshot")
## How to install
@ -37,13 +37,42 @@ opkg update
opkg install luci-app-advanced-reboot
```
If the ```luci-app-advanced-reboot``` package is not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to [add a custom repo to your router](https://github.com/stangri/openwrt_packages/blob/master/README.md#on-your-router) first.
If the ```luci-app-advanced-reboot``` package is not found in the official feed/repo for your version of OpenWrt/LEDE Project, you will need to add a custom repo to your router following instructions on [GitHub](https://github.com/stangri/openwrt_packages/blob/master/README.md#on-your-router)/[jsDelivr](https://cdn.jsdelivr.net/gh/stangri/openwrt_packages@master/README.md#on-your-router) first.
## Notes/Known Issues
- When you reboot to a different partition, your current settings (WiFi SSID/password, etc.) will not apply to a different partition. Different partitions might have completely different settings and even firmware.
- If you reboot to a partition which doesn't allow you to switch boot partitions (like stock vendor firmware), you might not be able to boot back to OpenWrt unless you reflash it, losing all the settings.
- Some devices allow you to trigger reboot to an alternative partition by interrupting boot 3 times in a row (by resetting/switching off the device or pulling power). As these methods might be different for different devices, do your own homework.
- Newer versions of this package try to mount alternative partition on compatible NAND routers in order to retrieve detailed firmware information. When that happens, it is normal to have messages similar to the below in the system log:
```sh
Tue Nov 19 15:45:03 2019 user.notice luci-app-advanced-reboot: attempting to mount alternative partition (mtd6)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.673826] ubi2: attaching mtd6
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.876698] ubi2: scanning is finished
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.885267] ubi2: attached mtd6 (name "rootfs1", size 74 MiB)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.891063] ubi2: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.898011] ubi2: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.904878] ubi2: VID header offset: 2048 (aligned 2048), data offset: 4096
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.911928] ubi2: good PEBs: 592, bad PEBs: 0, corrupted PEBs: 0
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.917962] ubi2: user volume: 2, internal volumes: 1, max. volumes count: 128
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.925252] ubi2: max/mean erase counter: 48/32, WL threshold: 4096, image sequence number: 1659081076
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.934623] ubi2: available PEBs: 0, total reserved PEBs: 592, PEBs reserved for bad PEB handling: 40
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.944346] ubi2: background thread "ubi_bgt2d" started, PID 26780
Tue Nov 19 15:45:03 2019 kern.info kernel: [30392.952596] block ubiblock2_0: created from ubi2:0 (rootfs)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30392.964083] UBIFS (ubi2:1): background thread "ubifs_bgt2_1" started, PID 26787
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.009298] UBIFS (ubi2:1): UBIFS: mounted UBI device 2, volume 1, name "rootfs_data"
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.017185] UBIFS (ubi2:1): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.027213] UBIFS (ubi2:1): FS size: 61075456 bytes (58 MiB, 481 LEBs), journal size 3047424 bytes (2 MiB, 24 LEBs)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.037733] UBIFS (ubi2:1): reserved for root: 2884744 bytes (2817 KiB)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.044389] UBIFS (ubi2:1): media format: w4/r0 (latest is w5/r0), UUID 76F0C52C-6197-4E00-B306-747262B06545, small LPT model
Tue Nov 19 15:45:03 2019 user.notice luci-app-advanced-reboot: attempting to unmount alternative partition (mtd6)
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.132743] UBIFS (ubi2:1): un-mount UBI device 2
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.137481] UBIFS (ubi2:1): background thread "ubifs_bgt2_1" stops
Tue Nov 19 15:45:03 2019 kern.info kernel: [30393.390961] block ubiblock2_0: released
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.396576] ubi2: detaching mtd6
Tue Nov 19 15:45:03 2019 kern.notice kernel: [30393.400117] ubi2: mtd6 is detached
```
## Thanks

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA9500",
boardName = "linksys-panamera",
partition1MTD = "mtd3",
partition2MTD = "mtd6",
labelOffset = 28,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "E4200v2/EA4500",
boardNames = { "linksys-viper", "linksys,viper" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "E4200v2",
boardNames = { "linksys-e4200v2", "linksys,e4200v2" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,15 @@
return {
vendorName = "Linksys",
deviceName = "EA3500",
boardNames = { "linksys-audi", "linksys,audi" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA4500",
boardNames = { "linksys-e4500", "linksys,e4500" },
partition1MTD = "mtd3",
partition2MTD = "mtd5",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA6350v3",
boardNames = { "linksys-ea6350v3", "linksys,ea6350v3" },
partition1MTD = "mtd10",
partition2MTD = "mtd12",
labelOffset = 192,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA7300v1",
boardName = "linksys,ea7300-v1",
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA7300v2",
boardName = "linksys,ea7300-v2",
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA8300",
boardNames = { "linksys-ea8300", "linksys,ea8300" },
partition1MTD = "mtd10",
partition2MTD = "mtd12",
labelOffset = 192,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "EA8500",
boardNames = { "linksys-ea8500", "linksys,ea8500" },
partition1MTD = "mtd13",
partition2MTD = "mtd15",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "MR8300",
boardNames = { "linksys-mr8300", "linksys,mr8300" },
partition1MTD = "mtd10",
partition2MTD = "mtd12",
labelOffset = 192,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT1200AC",
boardNames = { "linksys-caiman", "linksys,caiman", "linksys,wrt1200ac" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT1900ACv1",
boardNames = { "linksys-mamba", "linksys,mamba", "linksys,wrt1900ac-v1" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT1900ACS",
boardNames = { "linksys-shelby", "linksys,shelby", "linksys,wrt1900acs" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT1900ACv2",
boardNames = { "linksys-cobra", "linksys,cobra", "linksys,wrt1900ac-v2" },
partition1MTD = "mtd4",
partition2MTD = "mtd6",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT3200ACM",
boardNames = { "linksys-rango", "linksys,rango", "linksys,wrt3200acm" },
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = 32,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "Linksys",
deviceName = "WRT32X",
boardNames = { "linksys-venom", "linksys,venom", "linksys,wrt32x" },
partition1MTD = "mtd5",
partition2MTD = "mtd7",
labelOffset = nil,
bootEnv1 = "boot_part",
bootEnv1Partition1Value = 1,
bootEnv1Partition2Value = 2,
bootEnv2 = "bootcmd",
bootEnv2Partition1Value = "run nandboot",
bootEnv2Partition2Value = "run altnandboot"
}

View File

@ -0,0 +1,14 @@
return {
vendorName = "ZyXEL",
deviceName = "NBG6817",
boardNames = { "nbg6817" },
partition1MTD = "mmcblk0p4",
partition2MTD = "mmcblk0p7",
labelOffset = 32,
bootEnv1 = nil,
bootEnv1Partition1Value = 255,
bootEnv1Partition2Value = 1,
bootEnv2 = nil,
bootEnv2Partition1Value = nil,
bootEnv2Partition2Value = nil
}

View File

@ -1,205 +1,303 @@
-- Copyright 2017-2018 Stan Grishin <stangri@melmac.net>
-- Copyright 2017-2020 Stan Grishin <stangri@melmac.net>
-- Licensed to the public under the Apache License 2.0.
module("luci.controller.advanced_reboot", package.seeall)
devices = {
-- deviceName, boardName, partition1, partition2, offset, envVar1, envVar1Value1, envVar1Value2, envVar2, envVar2Value1, envVar2Value2
{"Linksys EA3500", "linksys-audi", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys E4200v2/EA4500", "linksys-viper", "mtd3", "mtd5", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys EA6350v3", "linksys-ea6350v3", "mtd10", "mtd12", 192, "boot_part", 1, 2},
{"Linksys EA8300", "linksys-ea8300", "mtd10", "mtd12", 192, "boot_part", 1, 2},
{"Linksys EA8500", "ea8500", "mtd13", "mtd15", 32, "boot_part", 1, 2},
-- {"Linksys EA9500", "linksys-panamera", "mtd3", "mtd6", 28, "boot_part", 1, 2},
{"Linksys WRT1200AC", "linksys-caiman", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys WRT1900AC", "linksys-mamba", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys WRT1900ACv2", "linksys-cobra", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys WRT1900ACS", "linksys-shelby", "mtd4", "mtd6", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys WRT3200ACM", "linksys-rango", "mtd5", "mtd7", 32, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"Linksys WRT32X", "linksys-venom", "mtd5", "mtd7", nil, "boot_part", 1, 2, "bootcmd", "run nandboot", "run altnandboot"},
{"ZyXEL NBG6817","nbg6817","mmcblk0p4","mmcblk0p7", 32, nil, 255, 1}
}
local util = require "luci.util"
local fs = require "nixio.fs"
local sys = require "luci.sys"
local http = require "luci.http"
local dispatcher = require "luci.dispatcher"
local i18n = require "luci.i18n"
local ltemplate = require "luci.template"
local ip = require "luci.ip"
local http = require "luci.http"
local sys = require "luci.sys"
local dispatcher = require "luci.dispatcher"
local uci = require "luci.model.uci".cursor()
local packageName = "advanced-reboot"
local devices_dir = "/usr/lib/lua/luci/" .. packageName .. "/devices/"
errorMessage = nil
rom_board_name = luci.util.trim(luci.sys.exec("cat /tmp/sysinfo/board_name"))
for i=1, #devices do
device_board_name = devices[i][2]:gsub('%p','')
if rom_board_name and rom_board_name:gsub('%p',''):match(device_board_name) then
device_name = devices[i][1]
partition_one_mtd = devices[i][3] or nil
partition_two_mtd = devices[i][4] or nil
partition_skip = devices[i][5] or nil
boot_envvar1 = devices[i][6] or nil
boot_envvar1_partition_one = tonumber(devices[i][7]) or nil
boot_envvar1_partition_two = tonumber(devices[i][8]) or nil
boot_envvar2 = devices[i][9] or nil
boot_envvar2_partition_one = devices[i][10] or nil
boot_envvar2_partition_two = devices[i][11] or nil
if partition_one_mtd and partition_skip then
partition_one_label = luci.util.trim(luci.sys.exec("dd if=/dev/" .. partition_one_mtd .. " bs=1 skip=" .. partition_skip .. " count=128" .. " 2>/dev/null"))
n, partition_one_version = string.match(partition_one_label, '(Linux)-([%d|.]+)')
end
if partition_two_mtd and partition_skip then
partition_two_label = luci.util.trim(luci.sys.exec("dd if=/dev/" .. partition_two_mtd .. " bs=1 skip=" .. partition_skip .. " count=128" .. " 2>/dev/null"))
n, partition_two_version = string.match(partition_two_label, '(Linux)-([%d|.]+)')
end
if partition_one_label and string.find(partition_one_label, "LEDE") then partition_one_os = "LEDE" end
if partition_one_label and string.find(partition_one_label, "OpenWrt") then partition_one_os = "OpenWrt" end
if partition_one_label and string.find(partition_one_label, "Linksys") then partition_one_os = "Linksys" end
if partition_two_label and string.find(partition_two_label, "LEDE") then partition_two_os = "LEDE" end
if partition_two_label and string.find(partition_two_label, "OpenWrt") then partition_two_os = "OpenWrt" end
if partition_two_label and string.find(partition_two_label, "Linksys") then partition_two_os = "Linksys" end
if device_name and device_name == "ZyXEL NBG6817" then
if not partition_one_os then partition_one_os = "ZyXEL" end
if not partition_two_os then partition_two_os = "ZyXEL" end
end
if device_name and device_name == "Linksys WRT32X" then
if not partition_one_os then partition_one_os = "Unknown/Compressed" end
if not partition_two_os then partition_two_os = "Unknown/Compressed" end
end
if not partition_one_os then partition_one_os = "Unknown" end
if not partition_two_os then partition_two_os = "Unknown" end
if partition_one_os and partition_one_version then partition_one_os = partition_one_os .. " (Linux " .. partition_one_version .. ")" end
if partition_two_os and partition_two_version then partition_two_os = partition_two_os .. " (Linux " .. partition_two_version .. ")" end
function logger(t)
util.exec("logger -t " .. packageName .. " '" .. tostring(t) .. "'")
end
if device_name and device_name == "ZyXEL NBG6817" then
if not zyxelFlagPartition then zyxelFlagPartition = luci.util.trim(luci.sys.exec("source /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end
if not zyxelFlagPartition then
errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to find Dual Boot Flag Partition." .. " ")
luci.util.perror(luci.i18n.translate("Unable to find Dual Boot Flag Partition."))
else
current_partition = tonumber(luci.sys.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'"))
end
else
if nixio.fs.access("/usr/sbin/fw_printenv") and nixio.fs.access("/usr/sbin/fw_setenv") then
current_partition = tonumber(luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar1)))
end
end
other_partition = current_partition == boot_envvar1_partition_two and boot_envvar1_partition_one or boot_envvar1_partition_two
end
function is_alt_mountable(p1_mtd, p2_mtd)
if p1_mtd:sub(1,3) == "mtd" and
p2_mtd:sub(1,3) == "mtd" and
fs.access("/usr/sbin/ubiattach") and
fs.access("/usr/sbin/ubiblock") and
fs.access("/bin/mount") then
return true
else
return false
end
end
function get_partition_os_info(op_ubi)
local cp_info, op_info
if fs.access("/etc/os-release") then
cp_info = util.trim(util.exec('. /etc/os-release && echo "$PRETTY_NAME"'))
if cp_info:find("SNAPSHOT") then
cp_info = util.trim(util.exec('. /etc/os-release && echo "$OPENWRT_RELEASE"'))
end
end
logger(i18n.translatef("attempting to mount alternative partition (mtd%s)", tostring(op_ubi)))
alt_partition_unmount(op_ubi)
alt_partition_mount(op_ubi)
if fs.access("/alt/rom/etc/os-release") then
op_info = util.trim(util.exec('. /alt/rom/etc/os-release && echo "$PRETTY_NAME"'))
if op_info:find("SNAPSHOT") then
op_info = util.trim(util.exec('. /alt/rom/etc/os-release && echo "$OPENWRT_RELEASE"'))
end
end
logger(i18n.translatef("attempting to unmount alternative partition (mtd%s)", tostring(op_ubi)))
alt_partition_unmount(op_ubi)
return cp_info, op_info
end
function alt_partition_mount(op_ubi)
local ubi_dev
util.exec('for i in rom overlay firmware; do [ ! -d "$i" ] && mkdir -p "/alt/${i}"; done')
ubi_dev = tostring(util.exec("ubiattach -m " .. tostring(op_ubi)))
_, _, ubi_dev = ubi_dev:find("UBI device number (%d+)")
if not ubi_dev then
util.exec("ubidetach -m " .. tostring(op_ubi))
return
end
util.exec("ubiblock --create /dev/ubi" .. ubi_dev .. "_0")
util.exec("mount -t squashfs -o ro /dev/ubiblock" .. ubi_dev .. "_0 /alt/rom")
util.exec("mount -t ubifs /dev/ubi" .. ubi_dev .. "_1 /alt/overlay")
-- util.exec("mount -t overlay overlay -o noatime,lowerdir=/alt/rom,upperdir=/alt/overlay/upper,workdir=/alt/overlay/work /alt/firmware")
end
function alt_partition_unmount(op_ubi)
local i
local mtdCount = tonumber(util.exec("ubinfo | grep 'Present UBI devices' | grep -c ','"))
mtdCount = mtdCount and mtdCount + 1 or 10
-- util.exec("[ -d /alt/firmware ] && umount /alt/firmware")
util.exec("[ -d /alt/overlay ] && umount /alt/overlay")
util.exec("[ -d /alt/rom ] && umount /alt/rom")
for i = 0, mtdCount do
if not fs.access("/sys/devices/virtual/ubi/ubi" .. tostring(i) .. "/mtd_num") then break end
ubi_mtd = tonumber(util.trim(util.exec("cat /sys/devices/virtual/ubi/ubi" .. i .. "/mtd_num")))
if ubi_mtd and ubi_mtd == op_ubi then
util.exec("ubiblock --remove /dev/ubi" .. tostring(i) .. "_0")
util.exec("ubidetach -m " .. tostring(op_ubi))
util.exec('rm -rf /alt')
end
end
end
function obtain_device_info()
local p, boardName, n, p1_label, p1_version, p2_label, p2_version, p1_os, p2_os
local errorMessage, current_partition
local op_ubi, cp_info, op_info, zyxelFlagPartition
local romBoardName = util.trim(util.exec("cat /tmp/sysinfo/board_name"))
for filename in fs.dir(devices_dir) do
local p_func = loadfile(devices_dir .. filename)
setfenv(p_func, { _ = i18n.translate })
p = p_func()
if p.boardName then
boardName = p.boardName:gsub('%p','')
end
if p.boardNames then
for i, v in pairs(p.boardNames) do
boardName = v:gsub('%p','')
if romBoardName and romBoardName:gsub('%p',''):match(boardName) then break end
end
end
if romBoardName and romBoardName:gsub('%p',''):match(boardName) then
if p.labelOffset then
if p.partition1MTD then
p1_label = util.trim(util.exec("dd if=/dev/" .. p.partition1MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
n, p1_version = p1_label:match('(Linux)-([%d|.]+)')
end
if p.partition2MTD then
p2_label = util.trim(util.exec("dd if=/dev/" .. p.partition2MTD .. " bs=1 skip=" .. p.labelOffset .. " count=128" .. " 2>/dev/null"))
n, p2_version = p2_label:match('(Linux)-([%d|.]+)')
end
if p1_label and p1_label:find("LEDE") then p1_os = "LEDE" end
if p1_label and p1_label:find("OpenWrt") then p1_os = "OpenWrt" end
if p1_label and p.vendorName and p1_label:find(p.vendorName) then p1_os = p.vendorName end
if p2_label and p2_label:find("LEDE") then p2_os = "LEDE" end
if p2_label and p2_label:find("OpenWrt") then p2_os = "OpenWrt" end
if p2_label and p.vendorName and p2_label:find(p.vendorName) then p2_os = p.vendorName end
if not p1_os then p1_os = p.vendorName .. "/" .. i18n.translate("Unknown") end
if not p2_os then p2_os = p.vendorName .. "/" .. i18n.translate("Unknown") end
if p1_os and p1_version then p1_os = p1_os .. " (Linux " .. p1_version .. ")" end
if p2_os and p2_version then p2_os = p2_os .. " (Linux " .. p2_version .. ")" end
else
p1_os = p.vendorName .. "/" .. i18n.translate("Unknown") .. " (" .. i18n.translate("Compressed") .. ")"
p2_os = p.vendorName .. "/" .. i18n.translate("Unknown") .. " (" .. i18n.translate("Compressed") .. ")"
end
if p.bootEnv1 then
if fs.access("/usr/sbin/fw_printenv") and fs.access("/usr/sbin/fw_setenv") then
current_partition = tonumber(util.trim(util.exec("fw_printenv -n " .. p.bootEnv1)))
end
else
if not zyxelFlagPartition then zyxelFlagPartition = util.trim(util.exec(". /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end
if zyxelFlagPartition then
current_partition = tonumber(util.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'"))
else
errorMessage = errorMessage or i18n.translate("Unable to find Dual Boot Flag Partition.")
util.perror(i18n.translate("Unable to find Dual Boot Flag Partition."))
end
end
if is_alt_mountable(p.partition1MTD, p.partition2MTD) then
if current_partition == p.bootEnv1Partition1Value then
op_ubi = tonumber(p.partition2MTD:sub(4)) + 1
else
op_ubi = tonumber(p.partition1MTD:sub(4)) + 1
end
local cp_info, op_info = get_partition_os_info(op_ubi)
if current_partition == p.bootEnv1Partition1Value then
p1_os = cp_info or p1_os
p2_os = op_info or p2_os
else
p1_os = op_info or p1_os
p2_os = cp_info or p2_os
end
end
return romBoardName, p.vendorName .. " " .. p.deviceName, p.bootEnv1, p.bootEnv1Partition1Value, p1_os, p.bootEnv1Partition2Value, p2_os, p.bootEnv2, p.bootEnv2Partition1Value, p.bootEnv2Partition1Value, current_partition
end
end
return romBoardName, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil
end
function index()
entry({"admin", "system", "advanced_reboot"}, template("advanced_reboot/advanced_reboot"), _("Advanced Reboot"), 90)
entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot"))
entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot"))
entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff"))
entry({"admin", "system", "advanced_reboot"}, call("action_template"), _("Advanced Reboot"), 90)
entry({"admin", "system", "advanced_reboot", "reboot"}, post("action_reboot"))
entry({"admin", "system", "advanced_reboot", "alternative_reboot"}, post("action_altreboot"))
entry({"admin", "system", "advanced_reboot", "power_off"}, post("action_poweroff"))
end
function action_template()
local romBoardName, device_name, bev1, bev1p1, p1_os, bev1p2, p2_os, bev2, bev2p1, bev2p2, current_partition = obtain_device_info()
ltemplate.render("advanced_reboot/advanced_reboot",{
romBoardName=romBoardName,
device_name=device_name,
bev1p1=bev1p1,
p1_os=p1_os,
bev1p2=bev1p2,
p2_os=p2_os,
current_partition=current_partition,
errorMessage=errorMessage})
end
function action_reboot()
local uci = require "luci.model.uci".cursor()
local ip = uci:get("network", "lan", "ipaddr")
luci.template.render("admin_system/applyreboot", {
title = luci.i18n.translate("Rebooting..."),
msg = luci.i18n.translate("The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = luci.ip.new(type(ip) == "string" and ip or "192.168.1.1") or "192.168.1.1"
})
luci.sys.reboot()
ltemplate.render("advanced_reboot/applyreboot", {
title = i18n.translate("Rebooting..."),
msg = i18n.translate("The system is rebooting now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = ip.new(util.imatch(uci:get("network", "lan", "ipaddr"))() or "192.168.1.1")
})
sys.reboot()
end
function action_altreboot()
local uci = require "luci.model.uci".cursor()
local zyxelFlagPartition, zyxelBootFlag, zyxelNewBootFlag, errorCode, curEnvSetting, newEnvSetting
errorMessage = nil
errorCode = 0
if luci.http.formvalue("cancel") then
luci.http.redirect(luci.dispatcher.build_url('admin/system/advanced_reboot'))
return
end
local step = tonumber(luci.http.formvalue("step") or 1)
if step == 1 then
if device_name and nixio.fs.access("/usr/sbin/fw_printenv") and nixio.fs.access("/usr/sbin/fw_setenv") then
luci.template.render("advanced_reboot/alternative_reboot",{})
else
luci.template.render("advanced_reboot/advanced_reboot",{errorMessage = luci.i18n.translate("No access to fw_printenv or fw_printenv!")})
end
elseif step == 2 then
if boot_envvar1 or boot_envvar2 then -- Linksys devices
if boot_envvar1 then
curEnvSetting = tonumber(luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar1)))
if not curEnvSetting then
errorMessage = errorMessage .. luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar1 .. ". "
luci.util.perror(luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar1 .. ".")
else
newEnvSetting = curEnvSetting == boot_envvar1_partition_one and boot_envvar1_partition_two or boot_envvar1_partition_one
errorCode = luci.sys.call("/usr/sbin/fw_setenv " .. boot_envvar1 .. " " .. newEnvSetting)
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar1 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". "
luci.util.perror(luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar1 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ".")
end
end
end
if boot_envvar2 then
curEnvSetting = luci.util.trim(luci.sys.exec("/usr/sbin/fw_printenv -n " .. boot_envvar2))
if not curEnvSetting then
errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar2 .. ". "
luci.util.perror(luci.i18n.translate("Unable to obtain firmware environment variable") .. ": " .. boot_envvar2 .. ".")
else
newEnvSetting = curEnvSetting == boot_envvar2_partition_one and boot_envvar2_partition_two or boot_envvar2_partition_one
errorCode = luci.sys.call("/usr/sbin/fw_setenv " .. boot_envvar2 .. " '" .. newEnvSetting .. "'")
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar2 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ". "
luci.util.perror(luci.i18n.translate("Unable to set firmware environment variable") .. ": " .. boot_envvar2 .. " " .. luci.i18n.translate("to") .. " " .. newEnvSetting .. ".")
end
end
end
else -- NetGear device
if not zyxelFlagPartition then zyxelFlagPartition = luci.util.trim(luci.sys.exec("source /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end
if not zyxelFlagPartition then
errorMessage = errorMessage .. luci.i18n.translate("Unable to find Dual Boot Flag Partition." .. " ")
luci.util.perror(luci.i18n.translate("Unable to find Dual Boot Flag Partition."))
else
zyxelBootFlag = tonumber(luci.sys.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'"))
zyxelNewBootFlag = zyxelBootFlag and zyxelBootFlag == 1 and "\\xff" or "\\x01"
if zyxelNewBootFlag then
errorCode = luci.sys.call("printf \"" .. zyxelNewBootFlag .. "\" >" .. zyxelFlagPartition )
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. luci.i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ". "
luci.util.perror(luci.i18n.translate("Unable to set Dual Boot Flag Partition entry for partition") .. ": " .. zyxelFlagPartition .. ".")
end
end
end
end
if not errorMessage then
luci.template.render("admin_system/applyreboot", {
title = luci.i18n.translate("Rebooting..."),
msg = luci.i18n.translate("The system is rebooting to an alternative partition now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1"
})
luci.sys.reboot()
else
luci.template.render("advanced_reboot/advanced_reboot",{
rom_board_name=rom_board_name,
device_name=device_name,
boot_envvar1_partition_one=boot_envvar1_partition_one,
partition_one_os=partition_one_os,
boot_envvar1_partition_two=boot_envvar1_partition_two,
partition_two_os=partition_two_os,
current_partition=current_partition,
errorMessage = errorMessage})
end
end
local romBoardName, device_name, bev1, bev1p1, p1_os, bev1p2, p2_os, bev2, bev2p1, bev2p2, current_partition = obtain_device_info()
local zyxelFlagPartition, zyxelBootFlag, zyxelNewBootFlag, errorCode, curEnvSetting, newEnvSetting
errorMessage = nil
errorCode = 0
if http.formvalue("cancel") then
http.redirect(dispatcher.build_url('admin/system/advanced_reboot'))
return
end
local step = tonumber(http.formvalue("step") or 1)
if step == 1 then
if fs.access("/usr/sbin/fw_printenv") and fs.access("/usr/sbin/fw_setenv") then
ltemplate.render("advanced_reboot/alternative_reboot",{})
else
ltemplate.render("advanced_reboot/advanced_reboot",{errorMessage = i18n.translate("No access to fw_printenv or fw_printenv!")})
end
elseif step == 2 then
if bev1 or bev2 then -- Linksys devices
if bev1 then
curEnvSetting = tonumber(util.trim(util.exec("fw_printenv -n " .. bev1)))
if not curEnvSetting then
errorMessage = errorMessage .. i18n.translatef("Unable to obtain firmware environment variable: %s.", bev1)
util.perror(i18n.translatef("Unable to obtain firmware environment variable: %s.", bev1))
else
newEnvSetting = curEnvSetting == bev1p1 and bev1p2 or bev1p1
errorCode = sys.call("fw_setenv " .. bev1 .. " " .. newEnvSetting)
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. i18n.translatef("Unable to set firmware environment variable: %s to %s.", bev1, newEnvSetting)
util.perror(i18n.translatef("Unable to set firmware environment variable: %s to %s.", bev1, newEnvSetting))
end
end
end
if bev2 then
curEnvSetting = util.trim(util.exec("fw_printenv -n " .. bev2))
if not curEnvSetting then
errorMessage = errorMessage or "" .. i18n.translatef("Unable to obtain firmware environment variable: %s.", bev2)
util.perror(i18n.translatef("Unable to obtain firmware environment variable: %s.", bev2))
else
newEnvSetting = curEnvSetting == bev2p1 and bev2p2 or bev2p1
errorCode = sys.call("fw_setenv " .. bev2 .. " '" .. newEnvSetting .. "'")
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. i18n.translatef("Unable to set firmware environment variable: %s to %s.", bev2, newEnvSetting)
util.perror(i18n.translatef("Unable to set firmware environment variable: %s to %s.", bev2, newEnvSetting))
end
end
end
else -- NetGear device
if not zyxelFlagPartition then zyxelFlagPartition = util.trim(util.exec(". /lib/functions.sh; find_mtd_part 0:DUAL_FLAG")) end
if not zyxelFlagPartition then
errorMessage = errorMessage .. i18n.translate("Unable to find Dual Boot Flag Partition." .. " ")
util.perror(i18n.translate("Unable to find Dual Boot Flag Partition."))
else
zyxelBootFlag = tonumber(util.exec("dd if=" .. zyxelFlagPartition .. " bs=1 count=1 2>/dev/null | hexdump -n 1 -e '1/1 \"%d\"'"))
zyxelNewBootFlag = zyxelBootFlag and zyxelBootFlag == 1 and "\\xff" or "\\x01"
if zyxelNewBootFlag then
errorCode = sys.call("printf \"" .. zyxelNewBootFlag .. "\" >" .. zyxelFlagPartition )
if errorCode ~= 0 then
errorMessage = errorMessage or "" .. i18n.translatef("Unable to set Dual Boot Flag Partition entry for partition: %s.", zyxelFlagPartition)
util.perror(i18n.translatef("Unable to set Dual Boot Flag Partition entry for partition: %s.", zyxelFlagPartition))
end
end
end
end
if not errorMessage then
ltemplate.render("advanced_reboot/applyreboot", {
title = i18n.translate("Rebooting..."),
msg = i18n.translate("The system is rebooting to an alternative partition now.<br /> DO NOT POWER OFF THE DEVICE!<br /> Wait a few minutes before you try to reconnect. It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = ip.new(util.imatch(uci:get("network", "lan", "ipaddr"))() or "192.168.1.1")
})
sys.reboot()
else
ltemplate.render("advanced_reboot/advanced_reboot",{
romBoardName=romBoardName,
device_name=device_name,
bev1p1=bev1p1,
p1_os=p1_os,
bev1p2=bev1p2,
p2_os=p2_os,
current_partition=current_partition,
errorMessage = errorMessage})
end
end
end
function action_poweroff()
local uci = require "luci.model.uci".cursor()
if luci.http.formvalue("cancel") then
luci.http.redirect(luci.dispatcher.build_url('admin/system/advanced_reboot'))
return
end
local step = tonumber(luci.http.formvalue("step") or 1)
if step == 1 then
if nixio.fs.access("/sbin/poweroff") then
luci.template.render("advanced_reboot/power_off",{})
else
luci.template.render("advanced_reboot/advanced_reboot",{})
end
elseif step == 2 then
luci.template.render("admin_system/applyreboot", {
title = luci.i18n.translate("Shutting down..."),
msg = luci.i18n.translate("The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = luci.ip.new(uci:get("network", "lan", "ipaddr")) or "192.168.1.1"
})
luci.sys.call("/sbin/poweroff")
end
if http.formvalue("cancel") then
http.redirect(dispatcher.build_url('admin/system/advanced_reboot'))
return
end
local step = tonumber(http.formvalue("step") or 1)
if step == 1 then
if fs.access("/sbin/poweroff") then
ltemplate.render("advanced_reboot/power_off",{})
else
ltemplate.render("advanced_reboot/advanced_reboot",{})
end
elseif step == 2 then
ltemplate.render("advanced_reboot/applyreboot", {
title = i18n.translate("Shutting down..."),
msg = i18n.translate("The system is shutting down now.<br /> DO NOT POWER OFF THE DEVICE!<br /> It might be necessary to renew the address of your computer to reach the device again, depending on your settings."),
addr = ip.new(util.imatch(uci:get("network", "lan", "ipaddr"))() or "192.168.1.1")
})
sys.call("/sbin/poweroff")
end
end

View File

@ -1,7 +1,7 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008-2015 Jo-Philipp Wich <jow@openwrt.org>
Copyright 2017-2018 Stan Grishin <stangri@melmac.net>
Copyright 2017-2020 Stan Grishin <stangri@melmac.net>
Licensed to the public under the Apache License 2.0.
-%>
@ -20,70 +20,70 @@
<%- if device_name then -%>
<fieldset class="cbi-section">
<legend><%=device_name%><%: Partitions%></legend>
<table class="table cbi-section-table" id="partitions">
<tr class="tr cbi-section-table-titles">
<th class="th cbi-section-table-cell"><%:Partition%></th>
<th class="th cbi-section-table-cell"><%:Status%></th>
<th class="th cbi-section-table-cell"><%:Firmware/OS (Kernel)%></th>
<th class="th cbi-section-table-cell"><%:Action%></th>
</tr>
<tr class="tr cbi-section-table-row">
<td class="td">
<%=string.format("%X", boot_envvar1_partition_one)%>
</td>
<td class="td">
<%- if boot_envvar1_partition_one == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%>
</td>
<td class="td">
<%=partition_one_os%>
</td>
<td class="td">
<%- if boot_envvar1_partition_one == current_partition then -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" />
</form>
<%- else -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" />
</form>
<%- end -%>
</td>
</tr>
<tr class="tr cbi-section-table-row">
<td class="td">
<%=string.format("%X", boot_envvar1_partition_two)%>
</td>
<td class="td">
<%- if boot_envvar1_partition_two == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%>
</td>
<td class="td">
<%=partition_two_os%>
</td>
<td class="td">
<%- if boot_envvar1_partition_two == current_partition then -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" />
</form>
<%- else -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" />
</form>
<%- end -%>
</td>
</tr>
</table>
<legend><%=device_name%><%: Partitions%></legend>
<div class="table cbi-section-table" id="partitions">
<div class="tr cbi-section-table-titles">
<div class="th cbi-section-table-cell"><%:Partition%></div>
<div class="th cbi-section-table-cell"><%:Status%></div>
<div class="th cbi-section-table-cell"><%:Firmware%></div>
<div class="th cbi-section-table-cell"><%:Reboot%></div>
</div>
<div class="tr cbi-section-table-row cbi-rowstyle-<%- if bev1p1 == current_partition then -%><%=1%><%- else -%><%=2%><%- end -%>">
<div class="td">
<%=string.format("%X", bev1p1)%>
</div>
<div class="td">
<%- if bev1p1 == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%>
</div>
<div class="td">
<%=p1_os%>
</div>
<div class="td">
<%- if bev1p1 == current_partition then -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" />
</form>
<%- else -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" />
</form>
<%- end -%>
</div>
</div>
<div class="tr cbi-section-table-row cbi-rowstyle-<%- if bev1p2 == current_partition then -%><%=1%><%- else -%><%=2%><%- end -%>">
<div class="td">
<%=string.format("%X", bev1p2)%>
</div>
<div class="td">
<%- if bev1p2 == current_partition then -%><%:Current%><%- else -%><%:Alternative%><%- end -%>
</div>
<div class="td">
<%=p2_os%>
</div>
<div class="td">
<%- if bev1p2 == current_partition then -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="reboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to current partition%>" />
</form>
<%- else -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/alternative_reboot')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="altreboot-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Reboot to alternative partition...%>" />
</form>
<%- end -%>
</div>
</div>
</div>
</fieldset>
<%- else -%>
<%- if rom_board_name then -%>
<p class="alert-message warning"><%=pcdata(translatef("Warning: Device (%s) is unknown or isn't a dual-partition device!", rom_board_name))%></p>
<%- else -%>
<p class="alert-message warning"><%=pcdata(translatef("Warning: Unable to obtain device information!"))%></p>
<%- end -%>
<%- if rom_board_name then -%>
<p class="alert-message warning"><%=pcdata(translatef("Warning: Device (%s) is unknown or isn't a dual-partition device!", rom_board_name))%></p>
<%- else -%>
<p class="alert-message warning"><%=pcdata(translatef("Warning: Unable to obtain device information!"))%></p>
<%- end -%>
<%- end -%>
<hr />
@ -91,10 +91,10 @@
<%- if nixio.fs.access("/sbin/poweroff") then -%>
<form method="post" action="<%=url('admin/system/advanced_reboot/power_off')%>">
<input type="hidden" name="token" value="<%=token%>" />
<input id="poweroff-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Perform power off...%>" />
<input id="poweroff-button" type="submit" class="cbi-button cbi-button-apply important" value="<%:Perform power off...%>" />
</form>
<%- else -%>
<p class="alert-message warning"><%:Warning: This system does not support powering off!%></p>
<p class="alert-message warning"><%:Warning: This system does not support powering off!%></p>
<%- end -%>
<%+footer%>

View File

@ -10,10 +10,10 @@
<h2 name="content"><%:Reboot Device to an Alternative Partition%> - <%:Confirm%></h2>
<p>
<%_ WARNING: An alternative partition might have its own settings and completely different firmware.<br /><br />
As your network configuration and WiFi SSID/password on alternative partition might be different,
you might have to adjust your computer settings to be able to access your device once it reboots.<br /><br />
Please also be aware that alternative partition firmware might not provide an easy way to switch active partition
and boot back to the currently active partition.<br /><br />
As your network configuration and WiFi SSID/password on alternative partition might be different,
you might have to adjust your computer settings to be able to access your device once it reboots.<br /><br />
Please also be aware that alternative partition firmware might not provide an easy way to switch active partition
and boot back to the currently active partition.<br /><br />
Click "Proceed" below to reboot device to an alternative partition. %>
</p>

View File

@ -0,0 +1,53 @@
<%#
Copyright 2008 Steven Barth <steven@midlink.org>
Copyright 2008 Jo-Philipp Wich <jow@openwrt.org>
Licensed to the public under the Apache License 2.0.
-%>
<html>
<head>
<title><%=luci.sys.hostname()%> - <%= title or translate("Rebooting...") %></title>
<link rel="stylesheet" type="text/css" media="screen" href="<%=media%>/cascade.css?v=git-19.271.68204-f8775ee" />
<script type="text/javascript" src="<%=resource%>/xhr.js?v=git-19.271.68204-f8775ee"></script>
<script type="text/javascript">//<![CDATA[
var interval = window.setInterval(function() {
var img = new Image();
var target = ('https:' == document.location.protocol ? 'https://' : 'http://') + <%=addr and "'%s'" % addr or "window.location.host"%>;
img.onload = function() {
window.clearInterval(interval);
window.location.replace(target);
};
img.src = target + '<%=resource%>/icons/loading.gif?' + Math.random();
}, 5000);
//]]></script>
</head>
<body>
<header>
<div class="fill">
<div class="container">
<p class="brand"><%=luci.sys.hostname() or "?"%></p>
</div>
</div>
</header>
&#160;
<div class="main">
<div id="maincontainer">
<div id="maincontent" class="container">
<h2 name="content" id="applyreboot-container" ><%:System%> - <%= title or translate("Rebooting...") %></h2>
<div class="cbi-section" id="applyreboot-section">
<div>
<%= msg or translate("Changes applied.") %>
</div>
<div>
<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:middle" />
<%:Waiting for changes to be applied...%>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -1,16 +1,17 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"PO-Revision-Date: 2020-11-29 22:23+0000\n"
"Last-Translator: Franco Castillo <castillofrancodamian@gmail.com>\n"
"Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsadvanced-reboot/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.4-dev\n"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29
msgid "Action"
@ -67,7 +68,7 @@ msgstr "Realizar apagado..."
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10
msgid "Power Off Device"
msgstr "Apagar dispositivo..."
msgstr "Apagar dispositivo"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:25
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:21
@ -81,7 +82,7 @@ msgstr "Reinicie el dispositivo a una partición alternativa"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:50
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:74
msgid "Reboot to alternative partition..."
msgstr "Reiniciar a partición alternativa ..."
msgstr "Reiniciar a la partición alternativa ..."
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:45
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:69
@ -177,7 +178,7 @@ msgid ""
msgstr ""
"ADVERTENCIA: Una partición alternativa puede tener su propia configuración y "
"un firmware completamente diferente.<br /><br /> Como la configuración de su "
"red y el SSID/contraseña WiFi en la partición alternativa pueden ser "
"red y el SSID/contraseña Wi-Fi en la partición alternativa pueden ser "
"diferentes, es posible que tenga que ajustar la configuración de su "
"computadora para poder para acceder a su dispositivo una vez que se reinicie."
"<br /><br /> También tenga en cuenta que un firmware de partición "

View File

@ -1,17 +1,18 @@
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Project-Id-Version: LuCI: advanced-reboot\n"
"POT-Creation-Date: 2017-11-30 15:20+0300\n"
"PO-Revision-Date: 2018-01-05 19:53+0300\n"
"Language-Team: http://cyber-place.ru\n"
"MIME-Version: 1.0\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.8.7.1\n"
"Last-Translator: Vladimir aka sunny <picfun@ya.ru>\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"PO-Revision-Date: 2020-11-22 15:35+0000\n"
"Last-Translator: Max Smolik <makcum15@gmail.com>\n"
"Language-Team: Russian <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsadvanced-reboot/ru/>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.4-dev\n"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29
msgid "Action"
@ -30,7 +31,7 @@ msgstr "Альтернатива"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:24
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:20
msgid "Cancel"
msgstr "Отменить"
msgstr "Отмена"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10
@ -96,7 +97,7 @@ msgstr "Перезагрузка..."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:197
msgid "Shutting down..."
msgstr "Отключается..."
msgstr "Выключение..."
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:27
msgid "Status"
@ -109,10 +110,10 @@ msgid ""
"address of your computer to reach the device again, depending on your "
"settings."
msgstr ""
"Система перезагружается сейчас.<br /> НЕ ОТКЛЮЧАЙТЕ ПИТАНИЕ УСТРОЙСТВА!<br /"
"> Подождите несколько минут, прежде чем попытаться установить соединение "
"снова. Возможно, потребуется обновить адрес компьютера для повторного "
"доступа к устройству в зависимости от ваших настроек."
"Система перезагружается.<br /> НЕ ВЫКЛЮЧАЙТЕ УСТРОЙСТВО!<br /> Подождите "
"несколько минут, прежде чем попытаться установить соединение снова. "
"Возможно, потребуется обновить адрес компьютера для повторного доступа к "
"устройству в зависимости от настроек."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:164
msgid ""
@ -121,10 +122,10 @@ msgid ""
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
"Система перезагружается на альтернативный раздел сейчас.<br /> НЕ ОТКЛЮЧАЙТЕ "
"ПИТАНИЕ УСТРОЙСТВА!<br /> Подождите несколько минут, прежде чем попытаться "
"установить соединение снова. Возможно, потребуется обновить адрес компьютера "
"для повторного доступа к устройству в зависимости от ваших настроек."
"Система перезагружается на альтернативный раздел.<br /> НЕ ВЫКЛЮЧАЙТЕ "
"УСТРОЙСТВО!<br /> Подождите несколько минут и попробуйте переустановить "
"соединение. В зависимости от настроек может потребоваться обновить адрес "
"компьютера для доступа к устройству."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:198
msgid ""
@ -132,9 +133,9 @@ msgid ""
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
"Система сейчас отключается.<br /> НЕ ОТКЛЮЧАЙТЕ ПИТАНИЕ УСТРОЙСТВА!<br /> "
"Возможно, потребуется обновить адрес компьютера для повторного доступа к "
"устройству в зависимости от настроек."
"Система завершает работу.<br /> НЕ ВЫКЛЮЧАЙТЕ УСТРОЙСТВО!<br /> Возможно, "
"потребуется обновить адрес компьютера для повторного доступа к устройству в "
"зависимости от настроек."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:67
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:68
@ -196,11 +197,12 @@ msgstr ""
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83
msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!"
msgstr ""
"Внимание: Устройство (%s) не известно или не имеет двойной раздел памяти!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:14
msgid "Warning: There are unsaved changes that will get lost on reboot!"
msgstr ""
"Внимание: Есть несохраненные изменения, которые будут потеряны при "
"Внимание: Есть не сохраненные изменения, которые будут потеряны при "
"перезагрузке!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:97
@ -209,7 +211,7 @@ msgstr "Внимание: Эта система не поддерживает о
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85
msgid "Warning: Unable to obtain device information!"
msgstr ""
msgstr "Внимание: Невозможно получить информацию об устройстве!"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:125
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:126
@ -218,8 +220,8 @@ msgstr ""
msgid "to"
msgstr ""
#~ msgid "Alternative reboot cancelled."
#~ msgstr "Альтернативная перезагрузка отменена."
msgid "Alternative reboot cancelled."
msgstr "Альтернативная перезагрузка отменена."
#~ msgid "Warning: This system does not have two partitions!"
#~ msgstr "Внимание: Эта система не имеет двух разделов!"
msgid "Warning: This system does not have two partitions!"
msgstr "Внимание: Эта система не имеет двух разделов!"

View File

@ -1,5 +1,14 @@
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8\n"
msgstr ""
"PO-Revision-Date: 2020-08-20 15:36+0000\n"
"Last-Translator: Luna Jernberg <droidbittin@gmail.com>\n"
"Language-Team: Swedish <https://hosted.weblate.org/projects/openwrt/"
"luciapplicationsadvanced-reboot/sv/>\n"
"Language: sv\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.2.1-dev\n"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29
msgid "Action"
@ -32,7 +41,7 @@ msgstr "Nuvarande"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:18
msgid "ERROR:"
msgstr ""
msgstr "FEL:"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:28
msgid "Firmware/OS (Kernel)"
@ -40,7 +49,7 @@ msgstr "Inre mjukvara/OS (Kärna)"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:112
msgid "No access to fw_printenv or fw_printenv!"
msgstr ""
msgstr "Ingen åtkomst till fw_printenv eller fw_printenv! "
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:26
msgid "Partition"
@ -97,6 +106,9 @@ msgid ""
"address of your computer to reach the device again, depending on your "
"settings."
msgstr ""
"Systemet startar om nu. <br /> STÄNG INTE AV ENHETEN!<br /> Vänta ett par "
"minuter innan du försöker ansluta. Du kan behöva förnya adressen på din "
"dator för att nå enheten igen, beroende på inställningarna."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:164
msgid ""
@ -105,6 +117,10 @@ msgid ""
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
"Systemet startar om till en alternativ partition nu.<br />STÄNG INTE AV "
"ENHETEN!<br /> Vänta ett par minuter innan du försöker ansluta. Du kan "
"behöva förnya adressen på din dator för att nå enheten igen, beroende på "
"inställningarna. "
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:198
msgid ""
@ -121,7 +137,7 @@ msgstr ""
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:147
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:148
msgid "Unable to find Dual Boot Flag Partition."
msgstr ""
msgstr "Det gick inte att hitta Dual Boot Flag Partition."
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:119
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:120
@ -153,6 +169,15 @@ msgid ""
"back to the currently active partition.<br /><br /> Click \"Proceed\" below "
"to reboot device to an alternative partition."
msgstr ""
"VARNING: En alternativ partition kan ha sina egna inställningar och helt "
"annan firmware.<br /> <br />Eftersom din nätverkskonfiguration och WiFi "
"SSID / lösenord på alternativ partition kan vara annorlunda, kan du behöva "
"justera dina datorinställningar för att kunna nå din enhet igen efter "
"omstart.\n"
"<br /> <br /> Tänk också på att en alternativ partition firmware kanske inte "
"är ett enkelt sätt att växla aktiv partition och starta tillbaka till den "
"aktiva partitionen. <br /> <br / > Klicka på \"Fortsätt\" nedan för att "
"starta om enheten till en alternativ partition."
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:12
msgid ""
@ -167,6 +192,8 @@ msgstr ""
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83
msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!"
msgstr ""
"Varning: Enheten (% s) är okänd eller är inte en enhet med dubbla "
"partitioner!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:14
msgid "Warning: There are unsaved changes that will get lost on reboot!"
@ -179,7 +206,7 @@ msgstr "Varning: Det här systemet har inte stöd för avstängning!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85
msgid "Warning: Unable to obtain device information!"
msgstr ""
msgstr "Varning: Det går inte att få information om enheten!"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:125
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:126
@ -188,5 +215,5 @@ msgstr ""
msgid "to"
msgstr ""
#~ msgid "Warning: This system does not have two partitions!"
#~ msgstr "Varning: Det här systemet har inte två partitioner!"
msgid "Warning: This system does not have two partitions!"
msgstr "Varning: Det här systemet har inte två partitioner!"

View File

@ -1,15 +1,20 @@
#
# Yangfl <mmyangfl@gmail.com>, 2018.
# Zheng Qian <sotux82@gmail.com>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"PO-Revision-Date: 2020-11-18 13:28+0000\n"
"Last-Translator: SunSpring <yearnsun@gmail.com>\n"
"Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsadvanced-reboot/zh_Hans/>\n"
"Language: zh_Hans\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Last-Translator: Yangfl <mmyangfl@gmail.com>\n"
"Language-Team: <debian-l10n-chinese@lists.debian.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"PO-Revision-Date: 2018-08-07 20:31+0800\n"
"X-Generator: Gtranslator 2.91.7\n"
"X-Generator: Weblate 4.4-dev\n"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29
msgid "Action"

View File

@ -3,13 +3,15 @@
#
msgid ""
msgstr ""
"PO-Revision-Date: 2020-12-28 18:20+0000\n"
"Last-Translator: operator <omniplay@hotmail.com>\n"
"Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/"
"openwrt/luciapplicationsadvanced-reboot/zh_Hant/>\n"
"Language: zh_Hant\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Last-Translator: Yangfl <mmyangfl@gmail.com>\n"
"Language-Team: <debian-l10n-chinese@lists.debian.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"PO-Revision-Date: 2018-08-07 20:31+0800\n"
"X-Generator: Gtranslator 2.91.7\n"
"X-Generator: Weblate 4.4.1-dev\n"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:29
msgid "Action"
@ -18,7 +20,7 @@ msgstr "動作"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:82
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:10
msgid "Advanced Reboot"
msgstr "階重啟"
msgstr "階重啟"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60
@ -38,7 +40,7 @@ msgstr "確認"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:36
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:60
msgid "Current"
msgstr "前"
msgstr "前"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:18
msgid "ERROR:"
@ -58,7 +60,7 @@ msgstr "分割槽"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:23
msgid "Partitions"
msgstr "分割"
msgstr "分割"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:94
msgid "Perform power off..."
@ -66,7 +68,7 @@ msgstr "執行關機…"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:10
msgid "Power Off Device"
msgstr "裝置關機"
msgstr "關閉裝置"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:25
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:21
@ -75,17 +77,17 @@ msgstr "繼續"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/alternative_reboot.htm:10
msgid "Reboot Device to an Alternative Partition"
msgstr "將裝置重啟至備用分割槽"
msgstr "重啟至備用分割區"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:50
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:74
msgid "Reboot to alternative partition..."
msgstr "重啟到備用分割…"
msgstr "重啟到備用分割…"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:45
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:69
msgid "Reboot to current partition"
msgstr "重啟到當前分割"
msgstr "重啟到當前分割"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:91
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:163
@ -107,8 +109,8 @@ msgid ""
"address of your computer to reach the device again, depending on your "
"settings."
msgstr ""
"系統正在重啟。<br />切勿關閉電源! DO NOT POWER OFF THE DEVICE!<br />等待數分"
"鍾後即可嘗試重新連線到路由。您可能需要更改計算機的 IP 位址以重新連線。"
"系統正在重啟。<br />切勿關閉電源!<br />等待數分鍾後即可嘗試重新連線。您可能"
"需要更改電腦的 IP 位址以重新連線。"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:164
msgid ""
@ -117,9 +119,8 @@ msgid ""
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
"系統現在正在重啟到備用分割槽。<br />切勿關閉電源! DO NOT POWER OFF THE "
"DEVICE!<br />等待數分鐘後即可嘗試重新連線到路由。您可能需要更改計算機的 IP 地"
"址以重新連線。"
"系統現在正在重啟到備用分割槽。<br />切勿關閉電源! <br />等待數分鐘後即可嘗試"
"重新連線。您可能需要更改電腦的 IP 地址以重新連線。"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:198
msgid ""
@ -127,8 +128,8 @@ msgid ""
"might be necessary to renew the address of your computer to reach the device "
"again, depending on your settings."
msgstr ""
"系統現在正在關機。<br />切勿關閉電源! DO NOT POWER OFF THE DEVICE!<br />等待"
"數分鐘後即可嘗試重新連線到路由。您可能需要更改計算機的 IP 位址以重新連線。"
"系統現在正在關機。<br />切勿關閉電源! <br />等待數分鐘後即可嘗試重新連線。您"
"可能需要更改電腦的 IP 位址以重新連線。"
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:67
#: applications/luci-app-advanced-reboot/luasrc/controller/advanced_reboot.lua:68
@ -170,8 +171,8 @@ msgstr ""
"警告:備用分割槽的設定和韌體可能與當前完全不同。<br /><br />由於備用分割槽上"
"的網路配置和 WiFi SSID/密碼可能不同,在裝置重啟後,您可能需要調整計算機設定才"
"能訪問您的裝置。<br /><br />請注意,備用分割槽韌體可能無法提供切換活動分割槽"
"和引導回當前活動分割槽的簡便方法。<br /><br />點選下方“繼續”,使裝置重啟至備"
"用分割槽。"
"和引導回當前活動分割槽的簡便方法。<br /><br />點選下方「繼續」,使裝置重啟至"
"備用分割區。"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/power_off.htm:12
msgid ""
@ -179,20 +180,20 @@ msgid ""
"support power off.<br /><br /> Click \"Proceed\" below to power off your "
"device."
msgstr ""
"警告:對於不支援關機的裝置,關機可能會導致重新啟動。<br /><br />點選下方繼"
"續,使裝置關機。"
"警告:對於不支援關機的裝置,關機可能會導致重新啟動。<br /><br />點選下方繼"
"續,使裝置關機。"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:83
msgid "Warning: Device (%s) is unknown or isn't a dual-partition device!"
msgstr "警告:裝置(%s未知或不是雙分割裝置!"
msgstr "警告:裝置(%s未知或不是雙分割裝置!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:14
msgid "Warning: There are unsaved changes that will get lost on reboot!"
msgstr "警告:未儲存的更改會在重啟時失!"
msgstr "警告:未儲存的更改會在重啟時失!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:97
msgid "Warning: This system does not support powering off!"
msgstr "警告:此統不支援關閉電源!"
msgstr "警告:此統不支援關閉電源!"
#: applications/luci-app-advanced-reboot/luasrc/view/advanced_reboot/advanced_reboot.htm:85
msgid "Warning: Unable to obtain device information!"

View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -rf /var/luci-modulecache/; rm -f /var/luci-indexcache;
exit 0