diff --git a/package/gluon-autoupdater/Makefile b/package/gluon-autoupdater/Makefile index a885a0d0..3e555a0b 100644 --- a/package/gluon-autoupdater/Makefile +++ b/package/gluon-autoupdater/Makefile @@ -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 diff --git a/package/gluon-autoupdater/files/usr/sbin/autoupdater b/package/gluon-autoupdater/files/usr/sbin/autoupdater index cd61eb49..0919f5ff 100755 --- a/package/gluon-autoupdater/files/usr/sbin/autoupdater +++ b/package/gluon-autoupdater/files/usr/sbin/autoupdater @@ -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 diff --git a/package/gluon-setup-mode/Makefile b/package/gluon-setup-mode/Makefile index e8d4fe52..9fda3d9a 100644 --- a/package/gluon-setup-mode/Makefile +++ b/package/gluon-setup-mode/Makefile @@ -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 diff --git a/package/gluon-setup-mode/files/lib/gluon/upgrade/setup-mode/invariant/011-setup-ifname b/package/gluon-setup-mode/files/lib/gluon/upgrade/setup-mode/invariant/011-setup-ifname index f9f33a70..29757cdd 100755 --- a/package/gluon-setup-mode/files/lib/gluon/upgrade/setup-mode/invariant/011-setup-ifname +++ b/package/gluon-setup-mode/files/lib/gluon/upgrade/setup-mode/invariant/011-setup-ifname @@ -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 diff --git a/package/gluon-status-page/Makefile b/package/gluon-status-page/Makefile index d0e9d488..db7cc7bd 100644 --- a/package/gluon-status-page/Makefile +++ b/package/gluon-status-page/Makefile @@ -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 diff --git a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status index 636a7aa7..e25d460f 100755 --- a/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status +++ b/package/gluon-status-page/files/lib/gluon/status-page/www/cgi-bin/status @@ -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 "
" -echo "Model: $(get_model | escape_html)" +echo "Model: $model" | escape_html echo "Firmware release: $(cat /lib/gluon/release | escape_html)" echo