Commit 08df82b3 authored by Julian Schuh's avatar Julian Schuh
Browse files

initial commit

parents
include $(TOPDIR)/rules.mk
PKG_NAME:=ffda-update-stabilizer
PKG_VERSION:=2019.1
PKG_RELEASE:=1
include $(TOPDIR)/../package/gluon.mk
define Package/ffda-update-stabilizer
TITLE:=Migrate devices that were added since the last major release to the stable branch.
DEPENDS:=+gluon-core
endef
define Package/ffda-update-stabilizer/description
Device support is primarily added to the master branch. When a new stable version
hits we would like those devices to automatically migrate to a stable release, as
soon as one is available. Therefore this package migrates the autoupdater branch
for a certain list of devices.
endef
$(eval $(call BuildPackageGluon,ffda-update-stabilizer))
need_string_array(in_site({'update_stabilizer', 'from_branches'}))
need_string(in_site({'update_stabilizer', 'to_branch'}))
need_string_array(in_site({'update_stabilizer', 'models'}))
#!/usr/bin/lua
local site = require 'gluon.site'
local uci = require('simple-uci').cursor()
local platform_info = require('platform_info')
function Set (list)
local set = {}
for _, l in ipairs(list) do set[l] = true end
return set
end
local from_branches = Set(site.update_stabilizer.from_branches())
if not from_branches[uci:get('autoupdater', 'settings', 'branch')] then
return
end
local update_branch = false
-- These routers were introduced since the last major
-- release, so if you wanted to use them you had to
-- use an experimental image.
local new_models = Set(site.update_stabilizer.models())
if new_models[platform_info.get_image_name()] then
update_branch = true
print('[+] device was introduced after latest stable release')
end
if update_branch then
local to_branch = site.update_stabilizer.to_branch()
uci:set('autoupdater', 'settings', 'branch', to_branch)
uci:save('autoupdater')
print('[+] autoupdater branch set to ' .. to_branch)
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment