Remove all uses of gluon.model and model.sh

This commit is contained in:
Matthias Schiffer 2014-07-09 20:10:21 +02:00
parent 9a892e7948
commit 9c53b705d5
6 changed files with 19 additions and 22 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,6 +1,6 @@
#!/bin/sh
. /lib/gluon/functions/model.sh
model="$(lua -e 'print(require("platform_info").get_model())')"
escape_html() {
sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g; s/"/\&quot;/g; s/'"'"'/\&#39;/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