Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • autinerd/experimental-openwrt-24.10
  • experimental
  • feature/addMikrotikwAP
  • master
  • nrb/airmax-test
  • nrb/ar9344-reset-sequence
  • nrb/ex400-remove-wps
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2022.1.1-ffs
  • v2022.1.3-ffs
  • v2022.1.4-ffs
  • v2023.1-ffs
  • v2023.2-ffs
  • v2023.2.2-ffs
  • v2023.2.3-ffs
  • v2023.2.4-ffs
  • v2023.2.5-ffs
  • experimental-2022-09-24
  • experimental-2022-09-24-base
  • experimental-2023-03-11
  • experimental-2023-03-11-base
  • experimental-2023-03-12
  • experimental-2023-03-12-base
  • experimental-2023-03-16
  • experimental-2023-03-16-base
  • experimental-2023-03-20
  • experimental-2023-03-20-base
  • experimental-2023-03-23
  • experimental-2023-03-23-base
  • experimental-2023-03-25
  • experimental-2023-03-25-base
  • experimental-2023-03-26
  • experimental-2023-03-26-base
  • experimental-2023-03-30
  • experimental-2023-03-30-base
  • experimental-2023-03-31
  • experimental-2023-03-31-base
  • experimental-2023-04-01
  • experimental-2023-04-01-base
  • experimental-2023-04-08
  • experimental-2023-04-08-base
  • experimental-2023-04-10
  • experimental-2023-04-10-base
  • experimental-2023-04-13
  • experimental-2023-04-13-base
  • experimental-2023-04-15
  • experimental-2023-04-15-base
  • experimental-2023-04-16
  • experimental-2023-04-16-base
  • experimental-2023-04-18
  • experimental-2023-04-18-base
  • experimental-2023-04-20
  • experimental-2023-04-20-base
  • experimental-2023-04-26
  • experimental-2023-04-26-base
  • experimental-2023-04-28
  • experimental-2023-04-28-base
  • experimental-2023-04-30
  • experimental-2023-04-30-base
  • experimental-2023-05-02
  • experimental-2023-05-02-base
  • experimental-2023-05-03
  • experimental-2023-05-03-base
  • experimental-2023-05-12
  • experimental-2023-05-12-base
  • experimental-2023-05-21
  • experimental-2023-05-21-base
  • experimental-2023-05-25
  • experimental-2023-05-25-base
  • experimental-2023-07-02
  • experimental-2023-07-02-base
  • experimental-2023-07-04
  • experimental-2023-07-04-base
  • experimental-2023-07-12
  • experimental-2023-07-12-base
  • experimental-2023-07-16
  • experimental-2023-07-16-base
  • experimental-2023-08-04
  • experimental-2023-08-04-base
  • experimental-2023-08-10
  • experimental-2023-08-10-base
  • experimental-2023-09-08
  • experimental-2023-09-08-base
  • experimental-2023-09-09
  • experimental-2023-09-09-base
  • experimental-2023-09-10
  • experimental-2023-09-10-base
  • experimental-2023-09-11
  • experimental-2023-09-11-base
  • experimental-2023-09-12
  • experimental-2023-09-12-base
  • experimental-2023-09-13
  • experimental-2023-09-13-base
  • experimental-2023-09-15
  • experimental-2023-09-15-base
  • experimental-2023-09-16
  • experimental-2023-09-16-base
  • experimental-2023-09-18
  • experimental-2023-09-18-base
  • experimental-2023-09-20
  • experimental-2023-09-20-base
  • experimental-2023-09-27
  • experimental-2023-09-27-base
  • experimental-2023-09-28
  • experimental-2023-09-28-base
  • experimental-2023-09-29
  • experimental-2023-09-29-base
  • experimental-2023-10-02
  • experimental-2023-10-02-base
  • experimental-2023-10-13
  • experimental-2023-10-13-base
  • experimental-2023-10-14
  • experimental-2023-10-14-base
  • experimental-2023-10-16
  • experimental-2023-10-16-base
  • experimental-2023-10-23
  • experimental-2023-10-23-base
137 results

Target

Select target project
  • firmware/gluon
  • 0x4A6F/gluon
  • patrick/gluon
3 results
Select Git revision
  • 0x4A6F-master
  • 0x4A6F-rpi4
  • 2014.3.x
  • 2014.4.x
  • babel
  • experimental
  • hoodselector
  • master
  • nrb/gluon-master-cpe510
  • nrb/test-radv-filter
  • nrbffs/fastd-remove-delay
  • nrbffs/netgear-ex6120
  • radv-filterd
  • v2015.1.x
  • v2016.1.x
  • v2016.2.4-batmanbug
  • v2016.2.x
  • v2018.2.2-ffs
  • v2018.2.3-ffs
  • v2018.2.x
  • v2019.1-ffs
  • v2019.1.1-ffs
  • v2019.1.2-ffs
  • v2020.1-ffs
  • v2020.1.1-ffs
  • v2020.1.3-ffs
  • v2020.2-ffs
  • v2020.2.1-ffs
  • v2020.2.2-ffs
  • v2020.2.3-ffs
  • v2020.2.x
  • v2021.1-ffs
  • v2021.1.1-ffs
  • v2021.1.2-ffs
  • v2014.1
  • v2014.2
  • v2014.3
  • v2014.3.1
  • v2014.4
  • v2015.1
  • v2015.1.1
  • v2015.1.2
  • v2016.1
  • v2016.1.1
  • v2016.1.2
  • v2016.1.3
  • v2016.1.4
  • v2016.1.5
  • v2016.1.6
  • v2016.2
  • v2016.2.1
  • v2016.2.2
  • v2016.2.3
  • v2016.2.4
  • v2016.2.5
  • v2016.2.6
  • v2016.2.7
  • v2017.1
  • v2017.1.1
  • v2017.1.2
  • v2017.1.3
  • v2017.1.4
  • v2017.1.5
  • v2017.1.6
  • v2017.1.7
  • v2017.1.8
  • v2018.1
  • v2018.1.1
  • v2018.1.2
  • v2018.1.3
  • v2018.1.4
  • v2018.2
  • v2018.2-ffs0.1
  • v2018.2.1
  • v2018.2.1-ffs0.1
  • v2018.2.2-ffs0.1
  • v2018.2.3-ffs0.1
  • v2019.1-ffs0.1
  • v2019.1.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2020.1-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.2
  • v2020.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.3-ffs0.1
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.3
  • v2020.2.x-ffs0.1
  • v2021.1-ffs0.1
  • v2021.1.1-ffs0.1
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.4
  • v2021.1.2-ffs0.1
  • v2021.1.2-ffs0.2
98 results
Show changes
Showing
with 455 additions and 723 deletions
......@@ -20,11 +20,8 @@ local function generate_line(model, dir, filename, filesize)
end
local file256sum = strip(lib.exec_capture {'scripts/sha256sum.sh', dir..'/'..filename})
local file512sum = strip(lib.exec_capture {'scripts/sha512sum.sh', dir..'/'..filename})
io.stdout:write(string.format('%s %s %s %s %s\n', model, env.GLUON_RELEASE, file256sum, filesize, filename))
io.stdout:write(string.format('%s %s %s %s\n', model, env.GLUON_RELEASE, file256sum, filename))
io.stdout:write(string.format('%s %s %s %s\n', model, env.GLUON_RELEASE, file512sum, filename))
end
local function generate(image)
......
#!/bin/sh
if [ $# -ne 1 ]; then
echo >&2 "Usage: getversion.sh <directory>"
exit 1
fi
cd "$1" || exit 1
cat .scmversion 2>/dev/null && exit 0
git --git-dir=.git describe --tags --always --abbrev=7 --dirty=+ 2>/dev/null && exit 0
echo unknown
local M = {
customization_file = nil,
}
local function evaluate_device(env, dev)
local selections = {
features = {},
packages = {},
}
local funcs = {}
local device_overrides = {}
local function add_elements(element_type, element_list)
-- We depend on the fact both feature and package
-- are already initialized as empty tables
for _, element in ipairs(element_list) do
table.insert(selections[element_type], element)
end
end
local function add_override(ovr_key, ovr_value)
device_overrides[ovr_key] = ovr_value
end
function funcs.features(features)
add_elements('features', features)
end
function funcs.packages(packages)
add_elements('packages', packages)
end
function funcs.broken(broken)
assert(
type(broken) == 'boolean',
'Incorrect use of broken(): has to be a boolean value')
add_override('broken', broken)
end
function funcs.disable()
add_override('disabled', true)
end
function funcs.disable_factory()
add_override('disable_factory', true)
end
function funcs.device(device_names)
assert(
type(device_names) == 'table',
'Incorrect use of device(): pass a list of device names as argument')
for _, device_name in ipairs(device_names) do
if device_name == dev.image then
return true
end
end
return false
end
function funcs.target(target, subtarget)
assert(
type(target) == 'string',
'Incorrect use of target(): pass a target name as first argument')
if target ~= env.BOARD then
return false
end
if subtarget and subtarget ~= env.SUBTARGET then
return false
end
return true
end
function funcs.device_class(class)
return dev.options.class == class
end
-- Evaluate the feature definition files
setfenv(M.customization_file, funcs)
M.customization_file()
return {
selections = selections,
device_overrides = device_overrides,
}
end
function M.get_selections(dev)
local eval_result = evaluate_device(M.env, dev)
return eval_result.selections
end
function M.device_overrides(dev)
local eval_result = evaluate_device(M.env, dev)
return eval_result.device_overrides
end
function M.init(env)
local filename = env.GLUON_SITEDIR .. '/image-customization.lua'
M.env = env
M.customization_file = assert(loadfile(filename))
end
return M
#!/bin/sh
set -e
editorconfig-checker .github contrib docs package scripts targets tests ./*.* .luacheckrc .editorconfig
......@@ -3,7 +3,11 @@
set -e
is_scriptfile() {
echo "$1" | grep -qE '.*\.sh$' || head -n1 "$1" | grep -qE '^#.*(sh|bash)$'
echo "$1" | grep -q '\.sh$' || head -n1 "$1" | grep -qE '^#!(.*\<bash|/bin/sh)$'
}
is_initscript() {
head -n1 "$1" | grep -qxF '#!/bin/sh /etc/rc.common'
}
find contrib -type f | while read -r file; do
......@@ -14,15 +18,18 @@ find contrib -type f | while read -r file; do
done
find package -type f | while read -r file; do
is_scriptfile "$file" || continue
if is_scriptfile "$file"; then
echo "Checking $file"
shellcheck -f gcc -x -s sh -e SC2039,SC1091,SC2155,SC2034 "$file"
shellcheck -f gcc -x -s sh -e SC2039,SC3043,SC3037,SC3057 "$file"
elif is_initscript "$file"; then
echo "Checking $file (initscript)"
shellcheck -f gcc -x -s sh -e SC2034,SC2039,SC3043,SC3037,SC3057 "$file"
fi
done
find scripts -type f | while read -r file; do
is_scriptfile "$file" || continue
echo "Checking $file"
shellcheck -f gcc -x -e SC2154,SC1090,SC2181,SC2155,SC2148,SC2034,SC2148 "$file"
shellcheck -f gcc -x "$file"
done
#!/usr/bin/env bash
set -e
. scripts/modules.sh
GLUONDIR="$(pwd)"
if [ ! -d "$GLUONDIR/openwrt" ]; then
echo "You don't seem to have obtained the external repositories needed by Gluon; please call \`make update\` first!"
exit 1
fi
need_sync=false
for module in $GLUON_MODULES; do
echo "Checking module '$module'"
var=${module//\//_}
_remote_commit=${var^^}_COMMIT
commit_expected=${!_remote_commit}
prefix=invalid
cd "$GLUONDIR/$module" 2>/dev/null && prefix="$(git rev-parse --show-prefix 2>/dev/null)"
if [ "$prefix" ]; then
echo "*** No Git repository found at '$module'."
need_sync=true
continue
fi
commit_actual="$(git rev-parse heads/base 2>/dev/null)"
if [ -z "$commit_actual" ]; then
echo "*** No base branch found at '$module'."
need_sync=true
continue
fi
if [ "$commit_expected" != "$commit_actual" ]; then
echo "*** base branch at '$module' did not match module file (expected: ${commit_expected}, actual: ${commit_actual})"
need_sync=true
continue
fi
# Use git status instead of git diff -q, as the latter doesn't
# check for untracked files
if [ "$(git status --porcelain 2>/dev/null | wc -l)" -ne 0 ]; then
echo "*** Module '$module' has uncommitted changes:"
git status --short
fi
done
if $need_sync; then
echo
# shellcheck disable=SC2016
echo 'Run `make update` to sync dependencies.'
echo
fi
#!/bin/sh
# shellcheck source=./modules
. ./modules
[ ! -f "$GLUON_SITEDIR"/modules ] || . "$GLUON_SITEDIR"/modules
# shellcheck disable=SC2086
FEEDS="$(echo $GLUON_FEEDS $GLUON_SITE_FEEDS | tr ' ' '\n')"
FEEDS="$(echo $GLUON_SITE_FEEDS $GLUON_FEEDS | tr ' ' '\n')"
GLUON_MODULES=openwrt
......
#!/bin/bash
#!/usr/bin/env bash
# shellcheck enable=check-unassigned-uppercase
set -e
shopt -s nullglob
......
......@@ -15,6 +15,7 @@ else
exit 1
fi
# shellcheck disable=SC2181
[ "$?" -eq 0 ] || exit 1
echo "$ret" | awk '{ print $1 }'
#!/bin/sh
check_command() {
command -v "$1" >/dev/null 2>&1
}
if check_command sha512sum; then
ret="$(sha512sum "$@")"
elif check_command shasum; then
ret="$(shasum -a 512 "$@")"
elif check_command cksum; then
ret="$(cksum -q -a sha512 "$@")"
else
echo "$0: no suitable sha512sum implementation was found" >&2
exit 1
fi
[ "$?" -eq 0 ] || exit 1
echo "$ret" | awk '{ print $1 }'
......@@ -9,18 +9,26 @@ local function fail(msg)
io.stderr:write(' * ', msg, '\n')
end
local function match_config(f)
for line in io.lines('openwrt/.config') do
if f(line) then
local function match_config(expected, actual)
if expected == actual then
return true
end
if expected:gsub('=m$', '=y') == actual then
return true
end
return false
end
local function check_config(config)
return match_config(function(line) return line == config end)
for line in io.lines('openwrt/.config') do
if match_config(config, line) then
return true
end
end
return false
end
......
local lib = dofile('scripts/target_lib.lua')
local feature_lib = dofile('scripts/feature_lib.lua')
local image_customization_lib = dofile('scripts/image_customization_lib.lua')
local env = lib.env
local target = env.GLUON_TARGET
......@@ -14,6 +16,8 @@ else
openwrt_config_target = env.BOARD
end
-- Initialize image-customization
image_customization_lib.init(env)
-- Split a string into words
local function split(s)
......@@ -24,6 +28,8 @@ local function split(s)
return ret
end
local feeds = split(lib.exec_capture_raw('. scripts/modules.sh; echo "$FEEDS"'))
-- Strip leading '-' character
local function strip_neg(s)
if string.sub(s, 1, 1) == '-' then
......@@ -49,58 +55,62 @@ local function append_to_list(list, item, keep_neg)
return ret
end
local function compact_list(list, keep_neg)
local ret = {}
for _, el in ipairs(list) do
local function concat_list(a, b, keep_neg)
local ret = a
for _, el in ipairs(b) do
ret = append_to_list(ret, el, keep_neg)
end
return ret
end
local function site_vars(var)
return lib.exec_capture_raw(string.format(
[[
MAKEFLAGS= make print _GLUON_SITE_VARS_=%s --no-print-directory -s -f - <<'END_MAKE'
include $(GLUON_SITEDIR)/site.mk
print:
echo -n '$(_GLUON_SITE_VARS_)'
END_MAKE
]],
lib.escape(var)))
local function compact_list(list, keep_neg)
return concat_list({}, list, keep_neg)
end
local function site_packages(image)
return split(site_vars(string.format('$(GLUON_%s_SITE_PACKAGES)', image)))
local function file_exists(file)
local f = io.open(file)
if not f then
return false
end
f:close()
return true
end
-- TODO: Rewrite features.sh in Lua
local function feature_packages(features)
-- Ugly hack: Lua doesn't give us the return code of a popened
-- command, so we match on a special __ERROR__ marker
local pkgs = lib.exec_capture({'scripts/features.sh', features}, '|| echo __ERROR__')
assert(string.find(pkgs, '__ERROR__') == nil, 'Error while evaluating features')
return pkgs
local files = {'package/features'}
for _, feed in ipairs(feeds) do
local path = string.format('packages/%s/features', feed)
if file_exists(path) then
table.insert(files, path)
end
end
-- This involves running lots of processes to evaluate site.mk, so we
-- add a simple cache
local class_cache = {}
local function class_packages(class)
if class_cache[class] then
return class_cache[class]
return feature_lib.get_packages(files, features)
end
local features = site_vars(string.format('$(GLUON_FEATURES) $(GLUON_FEATURES_%s)', class))
features = table.concat(compact_list(split(features), false), ' ')
local function site_specific_packages(dev_info)
local site_selections
local site_packages
local feature_inherited_pkgs
local site_features
-- Get all enabled selections from image-customization.lua
site_selections = image_customization_lib.get_selections(dev_info)
-- First read enabled features from site
site_features = site_selections['features']
site_features = compact_list(site_features, false)
-- Create List from packages inherited from features
feature_inherited_pkgs = feature_packages(site_features)
local pkgs = feature_packages(features)
pkgs = pkgs .. ' ' .. site_vars(string.format('$(GLUON_SITE_PACKAGES) $(GLUON_SITE_PACKAGES_%s)', class))
-- Read list of packages from site
site_packages = site_selections['packages']
pkgs = compact_list(split(pkgs))
-- Concat feature-packages with site-packages
local pkgs = concat_list(feature_inherited_pkgs, site_packages)
class_cache[class] = pkgs
-- Negations for the resulting package-list are dealt with in the calling function
return pkgs
end
......@@ -108,6 +118,14 @@ local enabled_packages = {}
-- Arguments: package name and config value (true: y, nil: m, false: unset)
-- Ensures precedence of y > m > unset
local function config_package(pkg, v)
-- HACK: Handle virtual default packages
local subst = {
nftables = 'nftables-nojson'
}
if subst[pkg] then
pkg = subst[pkg]
end
if v == false then
if not enabled_packages[pkg] then
lib.try_config('PACKAGE_' .. pkg, false)
......@@ -131,23 +149,33 @@ local function handle_target_pkgs(pkgs)
end
end
local function get_default_pkgs()
local targetinfo_target = string.gsub(openwrt_config_target, '_', '/', 1)
local target_matches = false
for line in io.lines('openwrt/tmp/.targetinfo') do
local target_match = string.match(line, '^Target: (.+)$')
if target_match then
target_matches = (target_match == targetinfo_target)
end
local default_packages_match = string.match(line, '^Default%-Packages: (.+)$')
if target_matches and default_packages_match then
return split(default_packages_match)
end
end
io.stderr:write('Error: unable to get default packages for OpenWrt target ', targetinfo_target, '\n')
os.exit(1)
end
lib.include('generic')
lib.include(target)
lib.check_devices()
if not lib.opkg then
lib.config('SIGNED_PACKAGES', false)
lib.config('CLEAN_IPKG', true)
lib.packages {'-opkg'}
end
if #lib.devices > 0 then
handle_target_pkgs(lib.target_packages)
handle_target_pkgs(concat_list(get_default_pkgs(), lib.target_packages))
for _, dev in ipairs(lib.devices) do
local profile = dev.options.profile or dev.name
local device_pkgs = {}
local function handle_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do
......@@ -159,36 +187,18 @@ if #lib.devices > 0 then
end
handle_pkgs(lib.target_packages)
handle_pkgs(class_packages(dev.options.class))
handle_pkgs(dev.options.packages or {})
handle_pkgs(site_packages(dev.image))
handle_pkgs(site_specific_packages(dev))
local profile_config = string.format('%s_DEVICE_%s', openwrt_config_target, profile)
local profile_config = string.format('%s_DEVICE_%s', openwrt_config_target, dev.name)
lib.config(
'TARGET_DEVICE_' .. profile_config, true,
string.format("unable to enable device '%s'", profile)
string.format("unable to enable device '%s'", dev.name)
)
lib.config(
'TARGET_DEVICE_PACKAGES_' .. profile_config,
table.concat(device_pkgs, ' ')
)
end
else
-- x86 fallback: no devices
local target_pkgs = {}
local function handle_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do
target_pkgs = append_to_list(target_pkgs, pkg)
end
end
-- Just hardcode the class for device-less targets to 'standard'
-- - this is x86 only at the moment, and it will have devices
-- in OpenWrt 19.07 + 1 as well
handle_pkgs(lib.target_packages)
handle_pkgs(class_packages('standard'))
handle_target_pkgs(target_pkgs)
end
return lib
local image_customization_lib = dofile('scripts/image_customization_lib.lua')
-- Functions for use in targets/*
local F = {}
......@@ -21,16 +23,18 @@ assert(env.GLUON_RELEASE)
assert(env.GLUON_DEPRECATED)
M.site_code = assert(assert(dofile('scripts/site_config.lua')('site.conf')).site_code)
M.site_code = assert(
dofile('scripts/site_config.lua')('site.conf').site_code, 'site_code missing in site.conf'
)
M.target_packages = {}
M.configs = {}
M.devices = {}
M.images = {}
M.opkg = true
-- Initialize image-customization
image_customization_lib.init(env)
local default_options = {
profile = false,
factory = '-squashfs-factory',
factory_ext = '.bin',
sysupgrade = '-squashfs-sysupgrade',
......@@ -55,24 +59,43 @@ function F.istrue(v)
return (tonumber(v) or 0) > 0
end
local function want_device(dev, options)
if options.broken and not F.istrue(env.BROKEN) then
local function device_broken(device_info, overrides)
if F.istrue(env.BROKEN) then
return false
end
if options.deprecated and env.GLUON_DEPRECATED == '0' then
if overrides['broken'] ~= nil then
return overrides['broken'] == true
elseif device_info.options.broken then
return true
end
return false
end
if (env.GLUON_DEVICES or '') == '' then
return true
local function want_device(device_info)
local overrides = image_customization_lib.device_overrides(device_info)
-- Check if device is disabled via image-customization.lua in site
if overrides['disabled'] then
return false
end
unknown_devices[dev] = nil
return gluon_devices[dev]
if device_broken(device_info, overrides) then
return false
end
local full_deprecated = env.GLUON_DEPRECATED == 'full'
if device_info.options.deprecated and env.GLUON_DEPRECATED == '0' then
return false
end
if (env.GLUON_DEVICES or '') == '' then
return true
end
unknown_devices[device_info.image] = nil
return gluon_devices[device_info.image]
end
local function merge(a, b)
local ret = {}
......@@ -210,18 +233,33 @@ local function as_table(v)
end
end
function F.device(image, name, options)
options = merge(default_options, options)
local function disable_factory_image(device_info)
if device_info.options.deprecated and env.GLUON_DEPRECATED ~= 'full' then
return true
end
if not want_device(image, options) then
return
local overrides = image_customization_lib.device_overrides(device_info)
if overrides["disable_factory"] then
return true
end
table.insert(M.devices, {
return false
end
function F.device(image, name, options)
options = merge(default_options, options)
local device_info = {
image = image,
name = name,
options = options,
})
}
if not want_device(device_info) then
return
end
table.insert(M.devices, device_info)
if options.sysupgrade then
add_image {
......@@ -236,7 +274,7 @@ function F.device(image, name, options)
}
end
if options.deprecated and not full_deprecated then
if disable_factory_image(device_info) then
return
end
......@@ -266,51 +304,6 @@ function F.device(image, name, options)
end
end
function F.factory_image(image, name, ext, options)
options = merge(default_options, options)
if not want_device(image, options) then
return
end
if options.deprecated and not full_deprecated then
return
end
add_image {
image = image,
name = name,
subdir = 'factory',
in_suffix = '',
out_suffix = '',
extension = ext,
aliases = options.aliases,
}
end
function F.sysupgrade_image(image, name, ext, options)
options = merge(default_options, options)
if not want_device(image, options) then
return
end
add_image {
image = image,
name = name,
subdir = 'sysupgrade',
in_suffix = '',
out_suffix = '-sysupgrade',
extension = ext,
aliases = options.aliases,
manifest_aliases = options.manifest_aliases,
}
end
function F.no_opkg()
M.opkg = false
end
function F.defaults(options)
default_options = merge(default_options, options)
end
......
#!/bin/sh -e
make --no-print-directory list-targets BROKEN=1 | ./contrib/actions/generate-target-filters.py > .github/filters.yml
#!/usr/bin/env bash
# shellcheck enable=check-unassigned-uppercase
set -eo pipefail
# move to basedir, in case the script is not executed via `make update-modules`
cd "$(dirname "$0")/.." || exit 1
# shellcheck source=./modules
source ./modules
git diff --quiet ./modules || {
1>&2 echo "Your modules file is dirty, aborting."
exit 1
}
LOCAL_BRANCH=$(git branch --show-current)
[[ $LOCAL_BRANCH != *-updates ]] && LOCAL_BRANCH+=-updates
for MODULE in "OPENWRT" ${GLUON_FEEDS}; do
if [[ $MODULE != "OPENWRT" ]]; then
MODULE=PACKAGES_${MODULE^^}
fi
_REMOTE_URL=${MODULE}_REPO
_REMOTE_BRANCH=${MODULE}_BRANCH
_LOCAL_HEAD=${MODULE}_COMMIT
REMOTE_URL="${!_REMOTE_URL}"
REMOTE_BRANCH="${!_REMOTE_BRANCH}"
LOCAL_HEAD="${!_LOCAL_HEAD}"
# get default branch name if none is set
[ -z "${REMOTE_BRANCH}" ] && {
REMOTE_BRANCH=$(git ls-remote --symref "${REMOTE_URL}" HEAD | awk '/^ref:/ { sub(/refs\/heads\//, "", $2); print $2 }')
}
# fetch the commit id for the HEAD of the module
REMOTE_HEAD=$(git ls-remote "${REMOTE_URL}" "${REMOTE_BRANCH}" | awk '{ print $1 }')
# skip ahead if the commit id did not change
[ "$LOCAL_HEAD" == "$REMOTE_HEAD" ] && continue 1
# switch to local working branch, if we found changes
[ "$(git branch --show-current)" != "${LOCAL_BRANCH}" ] && {
git switch -c "${LOCAL_BRANCH}" || git switch "${LOCAL_BRANCH}"
}
CHECKOUT=$(mktemp -d)
# clone the target branch
git clone --bare "${REMOTE_URL}" --branch="${REMOTE_BRANCH}" "${CHECKOUT}"
# prepare the commit message
# shellcheck disable=SC2001
MODULE=$(echo "${MODULE,,}" | sed 's/packages_//')
TITLE="modules: update ${MODULE}"
MESSAGE="$(mktemp)"
{
echo "${TITLE}"
printf '\n\n'
git -C "${CHECKOUT}" log --oneline --no-decorate --no-merges "${LOCAL_HEAD}..${REMOTE_HEAD}" | cat
} > "$MESSAGE"
# modify modules file
sed -i "s/${LOCAL_HEAD}/${REMOTE_HEAD}/" ./modules
git add ./modules
git commit -F "${MESSAGE}"
# remove the checkout
rm -fr "${CHECKOUT}"
done
#!/bin/bash
#!/usr/bin/env bash
# shellcheck enable=check-unassigned-uppercase
set -e
shopt -s nullglob
......@@ -21,6 +22,7 @@ for module in $GLUON_MODULES; do
for commit in $(git rev-list --reverse --no-merges base..patched); do
(( ++n ))
mkdir -p "${GLUON_PATCHESDIR}/$module"
echo "Updating: $(git log --format=%s -n 1 "$commit")"
git -c core.abbrev=40 show --pretty=format:'From: %an <%ae>%nDate: %aD%nSubject: %B' --no-renames --binary "$commit" > "${GLUON_PATCHESDIR}/$module/$(printf '%04u' "$n")-$(git show -s --pretty=format:%f "$commit").patch"
done
done
#!/bin/bash
#!/usr/bin/env bash
set -e
......@@ -9,10 +9,14 @@ GLUONDIR="$(pwd)"
for module in $GLUON_MODULES; do
echo "--- Updating module '$module' ---"
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
eval 'repo=${'"${var}"'_REPO}'
eval 'branch=${'"${var}"'_BRANCH}'
eval 'commit=${'"${var}"'_COMMIT}'
var=${module//\//_}
_remote_url=${var^^}_REPO
_remote_branch=${var^^}_BRANCH
_remote_commit=${var^^}_COMMIT
repo=${!_remote_url}
branch=${!_remote_branch}
commit=${!_remote_commit}
mkdir -p "$GLUONDIR/$module"
cd "$GLUONDIR/$module"
......
config('GLUON_SPECIALIZE_KERNEL', true)
config('TARGET_SQUASHFS_BLOCK_SIZE', 64)
local ATH10K_PACKAGES = {
'kmod-ath10k',
'-kmod-ath10k-ct',
'-kmod-ath10k-ct-smallbuffers',
'ath10k-firmware-qca988x',
'-ath10k-firmware-qca988x-ct',
}
local ATH10K_PACKAGES_QCA9887 = {
'kmod-ath10k',
'-kmod-ath10k-ct',
'-kmod-ath10k-ct-smallbuffers',
'ath10k-firmware-qca9887',
'-ath10k-firmware-qca9887-ct',
}
local ATH10K_PACKAGES_QCA9888 = {
'kmod-ath10k',
'-kmod-ath10k-ct',
'-kmod-ath10k-ct-smallbuffers',
'ath10k-firmware-qca9888',
'-ath10k-firmware-qca9888-ct',
}
-- 8devices
device('8devices-carambola2-board', 'carambola2', {
factory = false,
})
-- ALFA NETWORK
device('alfa-network-ap121f', 'ap121f', {
factory = false,
class = 'tiny', -- 32M ath9k
})
-- Allnet
device('allnet-all0315n', 'all0315n', {
profile = 'ALL0315N',
factory = false,
})
-- AVM
device('avm-fritz-box-4020', 'fritz4020', {
factory = false,
})
device('avm-fritz-wlan-repeater-300e', 'fritz300e', {
factory = false,
})
device('avm-fritz-wlan-repeater-450e', 'fritz450e', {
factory = false,
})
-- Buffalo
device('buffalo-wzr-hp-g300nh', 'wzr-hp-g300nh', {
profile = 'WZRHPG300NH',
})
device('buffalo-wzr-hp-g300nh2', 'wzr-hp-g300nh2', {
profile = 'WZRHPG300NH2',
})
device('buffalo-wzr-hp-g450h', 'wzr-hp-g450h', {
profile = 'WZRHPG450H',
})
device('buffalo-wzr-hp-ag300h', 'wzr-hp-ag300h', {
profile = 'WZRHPAG300H',
sysupgrade = false,
})
device('buffalo-wzr-600dhp', 'wzr-600dhp', {
profile = 'WZR600DHP',
sysupgrade = false,
})
sysupgrade_image('buffalo-wzr-hp-ag300h-wzr-600dhp', 'wzr-hp-ag300h-squashfs-sysupgrade', '.bin')
-- D-Link
device('d-link-dap-1330-rev-a1', 'dap-1330-a1', {
factory_ext = '.img',
})
device('d-link-dir-505-rev-a1', 'dir-505-a1', {
profile = 'DIR505A1',
aliases = {'d-link-dir-505-rev-a2'},
})
device('d-link-dir-825-rev-b1', 'dir-825-b1', {
profile = 'DIR825B1',
factory = false,
class = 'tiny', -- Only 6M of usable Firmware space
})
-- GL.iNet
device('gl-inet-6408a-v1', 'gl-inet-6408A-v1')
device('gl-inet-6416a-v1', 'gl-inet-6416A-v1')
device('gl.inet-gl-ar150', 'gl-ar150', {
factory = false,
manifest_aliases = {'gl-ar150'},
})
device('gl.inet-gl-ar300m', 'gl-ar300m', {
factory = false,
manifest_aliases = {'gl-ar300m'},
})
device('gl.inet-gl-ar750', 'gl-ar750', {
factory = false,
manifest_aliases = {'gl-ar750'},
packages = ATH10K_PACKAGES_QCA9887,
})
-- Linksys by Cisco
device('linksys-wrt160nl', 'wrt160nl', {
profile = 'WRT160NL',
class = 'tiny', -- 32M ath9k
})
-- Meraki
device('meraki-mr12', 'mr12', {
factory = false,
aliases = {'meraki-mr62'},
broken = true, -- MAC address uniqueness issues
})
device('meraki-mr16', 'mr16', {
factory = false,
aliases = {'meraki-mr66'},
broken = true, -- MAC address uniqueness issues
})
-- Netgear
device('netgear-wndr3700', 'wndr3700', {
factory_ext = '.img',
})
device('netgear-wndr3700v2', 'wndr3700v2', {
factory_ext = '.img',
})
device('netgear-wndr3800', 'wndr3800', {
aliases = {'netgear-wndr3800chmychart'},
factory_ext = '.img',
})
device('netgear-wndrmacv2', 'wndrmacv2', {
factory_ext = '.img',
})
device('netgear-wndrmac', 'wndrmac', {
factory_ext = '.img',
broken = true, -- untested
})
-- BROKEN: Untested
device('netgear-wnr2200', 'wnr2200', {
profile = 'WNR2200',
factory_ext = '.img',
broken = true, -- untested
})
-- OCEDO
device('ocedo-koala', 'koala', {
factory = false,
packages = ATH10K_PACKAGES,
})
-- Onion
device('onion-omega', 'onion-omega', {
broken = true, -- no Ethernet
})
-- OpenMesh
device('openmesh-a60', 'a60', {
profile = 'A60',
aliases = {'openmesh-a40'},
packages = ATH10K_PACKAGES,
})
device('openmesh-mr1750', 'mr1750', {
profile = 'MR1750',
aliases = {'openmesh-mr1750v2'},
packages = ATH10K_PACKAGES,
})
device('openmesh-mr600', 'mr600', {
profile = 'MR600',
aliases = {'openmesh-mr600v2'},
})
device('openmesh-mr900', 'mr900', {
profile = 'MR900',
aliases = {'openmesh-mr900v2'},
})
device('openmesh-om2p', 'om2p', {
profile = 'OM2P',
aliases = {
'openmesh-om2pv2',
'openmesh-om2pv4',
'openmesh-om2p-hs',
'openmesh-om2p-hsv2',
'openmesh-om2p-hsv3',
'openmesh-om2p-hsv4',
'openmesh-om2p-lc',
},
})
device('openmesh-om5p', 'om5p', {
profile = 'OM5P',
aliases = {'openmesh-om5p-an'},
})
device('openmesh-om5p-ac', 'om5pac', {
profile = 'OM5PAC',
aliases = {'openmesh-om5p-acv2'},
packages = ATH10K_PACKAGES,
})
-- TP-Link
local tplink_region_suffix = ''
if (env.GLUON_REGION or '') ~= '' then
tplink_region_suffix = '-' .. env.GLUON_REGION
end
device('tp-link-cpe210-v1.0', 'cpe210-220-v1', {
aliases = {'tp-link-cpe210-v1.1', 'tp-link-cpe220-v1.1'},
})
device('tp-link-cpe210-v2.0', 'cpe210-v2')
device('tp-link-cpe210-v3.0', 'cpe210-v3')
device('tp-link-cpe510-v1.0', 'cpe510-520-v1', {
aliases = {'tp-link-cpe510-v1.1', 'tp-link-cpe520-v1.1'},
})
device('tp-link-wbs210-v1.20', 'wbs210-v1')
device('tp-link-wbs510-v1.20', 'wbs510-v1')
device('tp-link-tl-wr710n-v1', 'tl-wr710n-v1', {
class = 'tiny', -- 32M ath9k
packages = { 'zram-swap' },
})
device('tp-link-tl-wr710n-v2.1', 'tl-wr710n-v2.1', {
class = 'tiny', -- 32M ath9k
packages = { 'zram-swap' },
})
device('tp-link-tl-wr810n-v1', 'tl-wr810n-v1')
device('tp-link-tl-wr842n-nd-v1', 'tl-wr842n-v1', {
class = 'tiny', -- 32M ath9k
packages = { 'zram-swap' },
})
device('tp-link-tl-wr842n-nd-v2', 'tl-wr842n-v2', {
class = 'tiny', -- 32M ath9k
packages = { 'zram-swap' },
})
device('tp-link-tl-wr842n-nd-v3', 'tl-wr842n-v3')
device('tp-link-tl-wr1043n-nd-v1', 'tl-wr1043nd-v1', {
class = 'tiny', -- 32M ath9k
packages = { 'zram-swap' },
})
device('tp-link-tl-wr1043n-nd-v2', 'tl-wr1043nd-v2')
device('tp-link-tl-wr1043n-nd-v3', 'tl-wr1043nd-v3')
device('tp-link-tl-wr1043n-nd-v4', 'tl-wr1043nd-v4')
device('tp-link-tl-wr1043n-v5', 'tl-wr1043n-v5')
device('tp-link-tl-wdr3500-v1', 'tl-wdr3500-v1')
device('tp-link-tl-wdr3600-v1', 'tl-wdr3600-v1')
device('tp-link-tl-wdr4300-v1', 'tl-wdr4300-v1')
device('tp-link-tl-wr2543n-nd-v1', 'tl-wr2543-v1')
device('tp-link-archer-c5-v1', 'archer-c5-v1', {
packages = ATH10K_PACKAGES,
})
device('tp-link-archer-c7-v2', 'archer-c7-v2', {
packages = ATH10K_PACKAGES,
factory = '-squashfs-factory' .. tplink_region_suffix,
})
device('tp-link-archer-c7-v4', 'archer-c7-v4', {
packages = ATH10K_PACKAGES,
})
device('tp-link-archer-c7-v5', 'archer-c7-v5', {
packages = ATH10K_PACKAGES,
})
device('tp-link-archer-c25-v1', 'archer-c25-v1', {
packages = ATH10K_PACKAGES_QCA9887,
broken = true, -- OOM with 5GHz enabled in most environments
class = 'tiny', -- 64M ath9k + ath10k
})
device('tp-link-archer-c58-v1', 'archer-c58-v1', {
packages = ATH10K_PACKAGES_QCA9888,
broken = true, -- OOM with 5GHz enabled in most environments
class = 'tiny', -- 64M ath9k + ath10k
})
device('tp-link-archer-c59-v1', 'archer-c59-v1', {
packages = ATH10K_PACKAGES_QCA9888,
})
device('tp-link-archer-c60-v1', 'archer-c60-v1', {
packages = ATH10K_PACKAGES_QCA9888,
broken = true, -- OOM with 5GHz enabled in most environments
class = 'tiny', -- 64M ath9k + ath10k
})
device('tp-link-archer-c60-v2', 'archer-c60-v2', {
packages = ATH10K_PACKAGES_QCA9888,
broken = true, -- OOM with 5GHz enabled in most environments
class = 'tiny', -- 64M ath9k + ath10k
})
device('tp-link-re355', 're355-v1', {
packages = ATH10K_PACKAGES,
broken = true, -- OOM with 5GHz enabled in most environments if device is 64M RAM variant
class = 'tiny', -- Only 6M of usable Firmware space
})
device('tp-link-tl-wr902ac-v1', 'tl-wr902ac-v1', {
packages = ATH10K_PACKAGES_QCA9887,
broken = true, -- OOM due to insufficient RAM for ath10k expected
class = 'tiny', -- 64M ath9k + ath10k
})
device('tp-link-re450', 're450-v1', {
packages = ATH10K_PACKAGES,
class = 'tiny', -- Only 6M of usable Firmware space
})
-- Ubiquiti
device('ubiquiti-airgateway', 'ubnt-air-gateway', {
aliases = {'ubiquiti-airgateway-lr'},
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-airgateway-pro', 'ubnt-air-gateway-pro', {
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-airrouter', 'ubnt-airrouter', {
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-bullet-m', 'ubnt-bullet-m', {
aliases = {
'ubiquiti-nanostation-loco-m2',
'ubiquiti-nanostation-loco-m5',
'ubiquiti-bullet-m2',
'ubiquiti-bullet-m5',
'ubiquiti-picostation-m2',
},
packages = { 'zram-swap' },
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-rocket-m', 'ubnt-rocket-m', {
aliases = {
'ubiquiti-rocket-m2',
'ubiquiti-rocket-m5',
},
})
device('ubiquiti-nanostation-m', 'ubnt-nano-m', {
aliases = {
'ubiquiti-nanostation-m2',
'ubiquiti-nanostation-m5',
},
packages = { 'zram-swap' },
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-loco-m-xw', 'ubnt-loco-m-xw', {
aliases = {
'ubiquiti-nanostation-loco-m2-xw',
'ubiquiti-nanostation-loco-m5-xw',
-- 'ubiquiti-nanobeam-m5', -- untested
},
})
device('ubiquiti-nanostation-m-xw', 'ubnt-nano-m-xw', {
aliases = {
'ubiquiti-nanostation-m2-xw',
'ubiquiti-nanostation-m5-xw',
},
})
device('ubiquiti-rocket-m-xw', 'ubnt-rocket-m-xw', {
aliases = {
'ubiquiti-rocket-m2-xw',
'ubiquiti-rocket-m5-xw',
},
})
device('ubiquiti-rocket-m-ti', 'ubnt-rocket-m-ti', {
aliases = {
'ubiquiti-rocket-m2-ti',
'ubiquiti-rocket-m5-ti',
},
})
device('ubiquiti-unifi', 'ubnt-unifi', {
aliases = {
'ubiquiti-unifi-ap',
'ubiquiti-unifi-ap-lr',
},
})
device('ubiquiti-unifi-ap-pro', 'ubnt-uap-pro')
device('ubiquiti-unifiap-outdoor', 'ubnt-unifi-outdoor')
device('ubiquiti-unifiap-outdoor+', 'ubnt-unifi-outdoor-plus')
device('ubiquiti-ls-sr71', 'ubnt-ls-sr71', {
broken = true, -- untested
class = 'tiny', -- 32M ath9k
})
device('ubiquiti-unifi-ac-lite', 'ubnt-unifiac-lite', {
factory = false,
packages = ATH10K_PACKAGES,
aliases = {'ubiquiti-unifi-ac-lite-mesh'},
})
device('ubiquiti-unifi-ac-lr', 'ubnt-unifiac-lr', {
factory = false,
packages = ATH10K_PACKAGES,
})
device('ubiquiti-unifi-ac-pro', 'ubnt-unifiac-pro', {
factory = false,
packages = ATH10K_PACKAGES,
})
device('ubiquiti-unifi-ac-mesh', 'ubnt-unifiac-mesh', {
factory = false,
packages = ATH10K_PACKAGES,
})
device('ubiquiti-unifi-ac-mesh-pro', 'ubnt-unifiac-mesh-pro', {
factory = false,
packages = ATH10K_PACKAGES,
})
-- Western Digital
device('wd-my-net-n600', 'mynet-n600')
device('wd-my-net-n750', 'mynet-n750')
-- ZyXEL
device('zyxel-nbg6616', 'NBG6616', {
packages = ATH10K_PACKAGES,
})
config('GLUON_SPECIALIZE_KERNEL', true)
defaults {
factory = false,
}
device('mikrotik-rb-nor-flash-16M', 'rb-nor-flash-16M')
device('mikrotik-rb-nor-flash-16M-ac', 'rb-nor-flash-16M-ac')
device('mikrotik-nand-64m', 'nand-64m')
device('mikrotik-nand-large', 'nand-large')
device('mikrotik-nand-large-ac', 'nand-large-ac')
config('GLUON_SPECIALIZE_KERNEL', true)
local ATH10K_PACKAGES = {'kmod-ath10k', '-kmod-ath10k-ct', 'ath10k-firmware-qca988x', '-ath10k-firmware-qca988x-ct'}
defaults {
sysupgrade_ext = '.tar',
}
-- Aerohive
device('aerohive-hiveap-121', 'hiveap-121')
-- Netgear
device('netgear-wndr3700v4', 'wndr3700v4', {
profile = 'WNDR3700V4',
factory = '-ubi-factory',
factory_ext = '.img',
})
device('netgear-wndr4300', 'wndr4300', {
profile = 'WNDR4300V1',
factory = '-ubi-factory',
factory_ext = '.img',
})
-- ZyXEL
device('zyxel-nbg6716', 'nbg6716', {
profile = 'NBG6716',
packages = ATH10K_PACKAGES,
})