diff --git a/gluon/gluon-autoupdater/Makefile b/gluon/gluon-autoupdater/Makefile index 43d9beb..8d6ae75 100644 --- a/gluon/gluon-autoupdater/Makefile +++ b/gluon/gluon-autoupdater/Makefile @@ -1,8 +1,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gluon-autoupdater -PKG_VERSION:=0.3.2.99 -PKG_RELEASE:=0.1 +PKG_VERSION:=0.1 +PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk define Package/gluon-autoupdater SECTION:=gluon CATEGORY:=Gluon - DEPENDS:=+ecdsautils +gluon-cron +gluon-release + DEPENDS:=+ecdsautils +gluon-cron +gluon-release +gluon-location TITLE:=Automatically update firmware endef @@ -23,13 +23,13 @@ define Build/Configure endef define Build/Compile - $(GLUON_CONFIGURE) autoupdater.pl > $(PKG_BUILD_DIR)/autoupdater.sh + $(GLUON_CONFIGURE) invariant.pl > $(PKG_BUILD_DIR)/invariant.sh endef define Package/gluon-autoupdater/install $(CP) ./files/* $(1)/ - $(INSTALL_DIR) $(1)/lib/gluon/upgrade/autoupdater/initial - $(INSTALL_BIN) $(PKG_BUILD_DIR)/autoupdater.sh $(1)/lib/gluon/upgrade/autoupdater/initial/010-autoupdater + $(INSTALL_DIR) $(1)/lib/gluon/upgrade/autoupdater/invariant + $(INSTALL_BIN) $(PKG_BUILD_DIR)/invariant.sh $(1)/lib/gluon/upgrade/autoupdater/invariant/010-autoupdater endef $(eval $(call BuildPackage,gluon-autoupdater)) diff --git a/gluon/gluon-autoupdater/autoupdater.pl b/gluon/gluon-autoupdater/autoupdater.pl deleted file mode 100644 index 88bac9f..0000000 --- a/gluon/gluon-autoupdater/autoupdater.pl +++ /dev/null @@ -1,23 +0,0 @@ -my $cfg = $CONFIG->{autoupdater}; - -print <<'END'; -#/bin/sh - -uci -q batch < $PROBABILITY}" @@ -15,10 +17,9 @@ if test "a$1" != "a-f"; then fi fi -BASE=$(uci get autoupdater.default.url) -PUBKEYS=$(uci get autoupdater.default.pubkey) -GOOD_SIGNATURES=$(uci get autoupdater.default.good_signatures) -BRANCH=$(uci get autoupdater.default.branch) +BASE=$(uci get autoupdater.${BRANCH}.url) +PUBKEYS=$(uci get autoupdater.${BRANCH}.pubkey) +GOOD_SIGNATURES=$(uci get autoupdater.${BRANCH}.good_signatures) VERSION_FILE=/lib/gluon/release diff --git a/gluon/gluon-autoupdater/invariant.pl b/gluon/gluon-autoupdater/invariant.pl new file mode 100644 index 0000000..3184813 --- /dev/null +++ b/gluon/gluon-autoupdater/invariant.pl @@ -0,0 +1,44 @@ +my $cfg = $CONFIG->{autoupdater}; + +print <<'END'; +#/bin/sh + +uci -q get autoupdater.settings || { +uci -q batch <{$_}\n"; +} + +print <<'END'; +EOF +} + +uci -q batch <{branches}) { + my $branch = $cfg->{branches}->{$name}; + + print <{$_}\n"; + } + + for (@{$branch->{pubkeys}}) { + print "add_list autoupdater.$name.pubkey=$_\n"; + } +} + +print <