mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-12 10:31:51 +00:00
Download the right image based on FS and EFI
This commit is contained in:
parent
257bf7fce8
commit
11f868ed12
2 changed files with 14 additions and 1 deletions
|
@ -552,6 +552,12 @@ function get_rootfs()
|
|||
return rootfs
|
||||
end
|
||||
|
||||
function get_efi()
|
||||
local efi = {}
|
||||
efi['efi_enabled'] = nixio.fs.access("/sys/firmware/efi")
|
||||
return efi
|
||||
end
|
||||
|
||||
function get_ip(interface)
|
||||
local ut = require "luci.util"
|
||||
local dump = require("luci.util").ubus("network.interface.%s" % interface, "status", {})
|
||||
|
@ -1627,6 +1633,11 @@ local methods = {
|
|||
return get_rootfs()
|
||||
end
|
||||
},
|
||||
getefi = {
|
||||
call = function()
|
||||
return get_efi()
|
||||
end
|
||||
},
|
||||
status = {
|
||||
call = function()
|
||||
return interfaces_status()
|
||||
|
|
|
@ -65,7 +65,8 @@ function setup() {
|
|||
ubus_call("system", "board", {}, "release");
|
||||
ubus_call("system", "board", {}, "board_name");
|
||||
ubus_call("system", "info", {}, "memory");
|
||||
ubus_call("openmptcprouter", "rootfs", {}, "format");
|
||||
ubus_call("openmptcprouter", "getrootfs", {}, "format");
|
||||
ubus_call("openmptcprouter", "getefi", {}, "efi_enabled");
|
||||
uci_get({
|
||||
"config": "sysupgrade",
|
||||
"section": "server",
|
||||
|
@ -231,6 +232,7 @@ function upgrade_request() {
|
|||
request_dict.target = data.release.target
|
||||
request_dict.profile = data.board_name
|
||||
request_dict.rootfs = data.format
|
||||
request_dict.efi = data.efi_enabled
|
||||
|
||||
if (data.edit_packages == true) {
|
||||
request_dict.packages = $("#edit_packages").value.split("\n")
|
||||
|
|
Loading…
Reference in a new issue