Remove all uses of gluon.model and model.sh
This commit is contained in:
parent
9a892e7948
commit
9c53b705d5
@ -11,7 +11,7 @@ include $(GLUONDIR)/include/package.mk
|
||||
define Package/gluon-autoupdater
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
DEPENDS:=+gluon-core +gluon-cron +opkg +ecdsautils +!BUSYBOX_CONFIG_SHA512SUM:coreutils-sha512sum
|
||||
DEPENDS:=+gluon-core +gluon-cron +lua-platform-info +opkg +ecdsautils +!BUSYBOX_CONFIG_SHA512SUM:coreutils-sha512sum
|
||||
TITLE:=Automatically update firmware
|
||||
endef
|
||||
|
||||
|
@ -165,8 +165,7 @@ autoupdate() {
|
||||
|
||||
trap 'echo Signal ignored.' INT TERM PIPE
|
||||
|
||||
. /lib/gluon/functions/model.sh
|
||||
my_model="$(get_model | tr '[A-Z]' '[a-z]' | sed -r 's/[^a-z0-9]+/-/g;s/-$//')"
|
||||
my_model="$(lua -e 'print(require("platform_info").get_image_name())')"
|
||||
|
||||
if [ ! -f "$VERSION_FILE" ]; then
|
||||
echo "Couldn't determine firmware version!" >&2
|
||||
|
@ -14,7 +14,7 @@ define Package/gluon-setup-mode
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
TITLE:=Setup mode
|
||||
DEPENDS:=+uhttpd +dnsmasq +ip
|
||||
DEPENDS:=+gluon-core +lua-platform-info +uhttpd +dnsmasq +ip
|
||||
endef
|
||||
|
||||
define Package/gluon-setup-mode/description
|
||||
|
@ -1,20 +1,18 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/lua
|
||||
|
||||
. /lib/gluon/functions/sysconfig.sh
|
||||
. /lib/gluon/functions/model.sh
|
||||
local platform_info = require 'platform_info'
|
||||
local sysconfig = require 'gluon.sysconfig'
|
||||
|
||||
|
||||
sysconfig_isset setup_ifname && exit 0
|
||||
if sysconfig.setup_ifname then
|
||||
os.exit(0)
|
||||
end
|
||||
|
||||
if platform_info.get_board_name() == 'nanostation-m' then
|
||||
sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.wan_ifname or sysconfig.lan_ifname
|
||||
else
|
||||
sysconfig.setup_ifname = sysconfig.config_ifname or sysconfig.lan_ifname or sysconfig.wan_ifname
|
||||
end
|
||||
|
||||
case "$(get_board_name)" in
|
||||
nanostation-m)
|
||||
sysconfig_set setup_ifname "$(sysconfig config_ifname || sysconfig wan_ifname || sysconfig lan_ifname)"
|
||||
;;
|
||||
*)
|
||||
sysconfig_set setup_ifname "$(sysconfig config_ifname || sysconfig lan_ifname || sysconfig wan_ifname)"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Remove the old sysconfig setting
|
||||
sysconfig_unset config_ifname
|
||||
-- Remove the old sysconfig setting
|
||||
sysconfig.config_ifname = nil
|
||||
|
@ -12,7 +12,7 @@ define Package/gluon-status-page
|
||||
SECTION:=gluon
|
||||
CATEGORY:=Gluon
|
||||
TITLE:=Adds a status page showing information about the node.
|
||||
DEPENDS:=+gluon-core +uhttpd
|
||||
DEPENDS:=+gluon-core +lua-platform-info +uhttpd
|
||||
endef
|
||||
|
||||
define Package/gluon-status-page/description
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/gluon/functions/model.sh
|
||||
model="$(lua -e 'print(require("platform_info").get_model())')"
|
||||
|
||||
escape_html() {
|
||||
sed 's/&/\&/g; s/</\</g; s/>/\>/g; s/"/\"/g; s/'"'"'/\'/g'
|
||||
@ -27,7 +27,7 @@ echo "<h1>$(cat /proc/sys/kernel/hostname)</h1>"
|
||||
|
||||
echo "<pre>"
|
||||
|
||||
echo "Model: $(get_model | escape_html)"
|
||||
echo "Model: $model" | escape_html
|
||||
echo "Firmware release: $(cat /lib/gluon/release | escape_html)"
|
||||
echo
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user