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 696 additions and 717 deletions
#!/bin/sh
check_command() {
which "$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 }'
#!/bin/sh
export GLUON_SITE_CONFIG=site.conf
exec openwrt/staging_dir/hostpkg/bin/lua -e "print(assert(dofile('scripts/site_config.lua').$1))" 2>/dev/null
local site = os.getenv('GLUON_SITEDIR') .. '/'
local config = os.getenv('GLUON_SITE_CONFIG')
return function(config)
local function loader()
coroutine.yield('return ')
coroutine.yield(io.open(site..config):read('*a'))
......@@ -8,3 +8,4 @@ end
-- setfenv doesn't work with Lua 5.2 anymore, but we're using 5.1
return setfenv(assert(load(coroutine.wrap(loader), config)), {})()
end
site_packages() {
MAKEFLAGS= make print PROFILE="$1" --no-print-directory -s -f - <<'END_MAKE'
include $(GLUON_SITEDIR)/site.mk
print:
echo '$(GLUON_$(PROFILE)_SITE_PACKAGES)'
END_MAKE
}
. scripts/common.inc.sh
no_opkg() {
config '# CONFIG_SIGNED_PACKAGES is not set'
config 'CONFIG_CLEAN_IPKG=y'
packages '-opkg'
}
local lib = dofile('scripts/target_config_lib.lua')
for _, config in pairs(lib.configs) do
io.stdout:write(config:format(), '\n')
end
#!/usr/bin/env bash
set -e
[ "$OPENWRT_TARGET" -a "$GLUON_TARGETSDIR" ] || exit 1
target="$1"
packages=$2
output=
profile=
default_packages=
profile_packages=
OPENWRT_CONFIG_TARGET="${OPENWRT_TARGET//-/_}"
emit() {
[ "${output}" ] || return 0
want_device "${output}" || return 0
profile_packages="${profile_packages} $(site_packages "$output")"
for package in $profile_packages; do
[ "${package:0:1}" = '-' ] || echo "CONFIG_PACKAGE_${package}=m"
done
echo "CONFIG_TARGET_DEVICE_${OPENWRT_CONFIG_TARGET}_DEVICE_${profile}=y"
echo "CONFIG_TARGET_DEVICE_PACKAGES_${OPENWRT_CONFIG_TARGET}_DEVICE_${profile}=\"${profile_packages}\""
}
. scripts/target_config.inc.sh
config() {
echo "$1"
}
try_config() {
echo "$1"
}
device() {
emit
output="$1"
profile="$3"
if [ -z "$profile" ]; then
profile="$2"
fi
profile_packages="${default_packages}"
}
packages() {
if [ "${output}" ]; then
profile_packages="${profile_packages} $@"
else
default_packages="${default_packages} $@"
for package in "$@"; do
if [ "${package:0:1}" = '-' ]; then
echo "# CONFIG_PACKAGE_${package:1} is not set"
else
echo "CONFIG_PACKAGE_${package}=y"
fi
done
fi
}
# The sort will not only remove duplicate entries,
# but also magically make =y entries override =m ones
(
. "${GLUON_TARGETSDIR}/generic"
packages $packages
. "${GLUON_TARGETSDIR}/$target"
emit
) | sort -u
local errors = false
local function fail(msg)
if not errors then
errors = true
io.stderr:write('Configuration failed:', '\n')
end
io.stderr:write(' * ', msg, '\n')
end
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)
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_config_lib.lua')
for _, config in pairs(lib.configs) do
if config.required then
if not check_config(config:format()) then
fail(config.required)
end
end
end
if errors then
os.exit(1)
end
#!/usr/bin/env bash
set -e
[ "$OPENWRT_TARGET" -a "$GLUON_TARGETSDIR" ] || exit 1
target="$1"
packages=$2
output=
ret=0
OPENWRT_CONFIG_TARGET="${OPENWRT_TARGET//-/_}"
fail() {
local message="$1"
if [ $ret -eq 0 ]; then
ret=1
echo "Configuration failed:" >&2
fi
echo " * $message" >&2
}
check_config() {
grep -q "$1" openwrt/.config
}
check_package() {
local package="$1"
local value="$2"
if ! check_config "^CONFIG_PACKAGE_${package}=${value}"; then
fail "unable to enable package '${package}'"
fi
}
. scripts/target_config.inc.sh
config() {
local config="$1"
if ! check_config "^${config}\$"; then
fail "unable to set '${config}'"
fi
}
device() {
output="$1"
want_device "${output}" || return 0
local profile="$3"
if [ -z "$profile" ]; then
profile="$2"
fi
if ! check_config "CONFIG_TARGET_DEVICE_${OPENWRT_CONFIG_TARGET}_DEVICE_${profile}=y"; then
fail "unable to enable device '${profile}'"
fi
for package in $(site_packages "$output"); do
[ "${package:0:1}" = '-' ] || check_package "$package"
done
}
factory_image() {
output="$1"
want_device "${output}" || return 0
}
sysupgrade_image() {
output="$1"
want_device "${output}" || return 0
}
packages() {
if [ "${output}" ]; then
want_device "${output}" || return 0
for package in "$@"; do
[ "${package:0:1}" = '-' ] || check_package "$package"
done
else
for package in "$@"; do
[ "${package:0:1}" = '-' ] || check_package "$package" 'y'
done
fi
}
. "${GLUON_TARGETSDIR}/generic"
packages $packages
. "${GLUON_TARGETSDIR}/$target"
check_devices
exit $ret
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
assert(target)
assert(env.BOARD)
assert(env.SUBTARGET)
local openwrt_config_target
if env.SUBTARGET ~= '' then
openwrt_config_target = env.BOARD .. '_' .. env.SUBTARGET
else
openwrt_config_target = env.BOARD
end
-- Initialize image-customization
image_customization_lib.init(env)
-- Split a string into words
local function split(s)
local ret = {}
for w in string.gmatch(s, '%S+') do
table.insert(ret, w)
end
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
return string.sub(s, 2)
else
return s
end
end
-- Add an element to a list, removing duplicate entries and handling negative
-- elements prefixed with a '-'
local function append_to_list(list, item, keep_neg)
local match = strip_neg(item)
local ret = {}
for _, el in ipairs(list) do
if strip_neg(el) ~= match then
table.insert(ret, el)
end
end
if keep_neg ~= false or string.sub(item, 1, 1) ~= '-' then
table.insert(ret, item)
end
return ret
end
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 compact_list(list, keep_neg)
return concat_list({}, list, keep_neg)
end
local function file_exists(file)
local f = io.open(file)
if not f then
return false
end
f:close()
return true
end
local function feature_packages(features)
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
return feature_lib.get_packages(files, features)
end
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)
-- Read list of packages from site
site_packages = site_selections['packages']
-- Concat feature-packages with site-packages
local pkgs = concat_list(feature_inherited_pkgs, site_packages)
-- Negations for the resulting package-list are dealt with in the calling function
return pkgs
end
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)
end
return
end
if v == true or not enabled_packages[pkg] then
lib.config('PACKAGE_' .. pkg, v, string.format("unable to enable package '%s'", pkg))
enabled_packages[pkg] = true
end
end
local function handle_target_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do
if string.sub(pkg, 1, 1) == '-' then
config_package(string.sub(pkg, 2), false)
else
config_package(pkg, true)
end
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()
handle_target_pkgs(concat_list(get_default_pkgs(), lib.target_packages))
for _, dev in ipairs(lib.devices) do
local device_pkgs = {}
local function handle_pkgs(pkgs)
for _, pkg in ipairs(pkgs) do
if string.sub(pkg, 1, 1) ~= '-' then
config_package(pkg, nil)
end
device_pkgs = append_to_list(device_pkgs, pkg)
end
end
handle_pkgs(lib.target_packages)
handle_pkgs(dev.options.packages or {})
handle_pkgs(site_specific_packages(dev))
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'", dev.name)
)
lib.config(
'TARGET_DEVICE_PACKAGES_' .. profile_config,
table.concat(device_pkgs, ' ')
)
end
return lib
local image_customization_lib = dofile('scripts/image_customization_lib.lua')
-- Functions for use in targets/*
local F = {}
-- To be accessed by scripts using target_lib
local M = setmetatable({}, { __index = F })
local funcs = setmetatable({}, {
__index = function(_, k)
return F[k] or _G[k]
end,
})
local env = setmetatable({}, {
__index = function(_, k) return os.getenv(k) end
})
F.env = env
assert(env.GLUON_SITEDIR)
assert(env.GLUON_TARGETSDIR)
assert(env.GLUON_RELEASE)
assert(env.GLUON_DEPRECATED)
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 = {}
-- Initialize image-customization
image_customization_lib.init(env)
local default_options = {
factory = '-squashfs-factory',
factory_ext = '.bin',
sysupgrade = '-squashfs-sysupgrade',
sysupgrade_ext = '.bin',
extra_images = {},
aliases = {},
manifest_aliases = {},
packages = {},
class = 'standard',
deprecated = false,
broken = false,
}
local gluon_devices, unknown_devices = {}, {}
for dev in string.gmatch(env.GLUON_DEVICES or '', '%S+') do
gluon_devices[dev] = true
unknown_devices[dev] = true
end
function F.istrue(v)
return (tonumber(v) or 0) > 0
end
local function device_broken(device_info, overrides)
if F.istrue(env.BROKEN) then
return false
end
if overrides['broken'] ~= nil then
return overrides['broken'] == true
elseif device_info.options.broken then
return true
end
return false
end
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
if device_broken(device_info, overrides) then
return false
end
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 = {}
for k, v in pairs(a) do
ret[k] = v
end
for k, v in pairs(b or {}) do
assert(ret[k] ~= nil, string.format("unknown option '%s'", k))
ret[k] = v
end
return ret
end
-- Escapes a single argument to be used in a shell command
-- The argument is surrounded by single quotes, single quotes inside the
-- argument are replaced by '\''.
-- To allow using shell wildcards, zero bytes in the arguments are replaced
-- by unquoted asterisks.
function F.escape(s)
s = string.gsub(s, "'", "'\\''")
s = string.gsub(s, "%z", "'*'")
return "'" .. s .. "'"
end
local function escape_command(command, raw)
local ret = ''
if not raw then
ret = 'exec'
end
for _, arg in ipairs(command) do
ret = ret .. ' ' .. F.escape(arg)
end
if raw then
ret = ret .. ' ' .. raw
end
return ret
end
function F.exec_raw(command, may_fail)
local ret = os.execute(command)
assert((ret == 0) or may_fail)
return ret
end
function F.exec(command, may_fail, raw)
return F.exec_raw(escape_command(command, raw), may_fail)
end
function F.exec_capture_raw(command)
local f = io.popen(command)
assert(f)
local data = f:read('*a')
f:close()
return data
end
function F.exec_capture(command, raw)
return F.exec_capture_raw(escape_command(command, raw))
end
local image_mt = {
__index = {
dest_name = function(image, name, site, release)
return env.GLUON_IMAGEDIR..'/'..image.subdir,
'gluon-'..(site or M.site_code)..'-'..(release or env.GLUON_RELEASE)..'-'..name..image.out_suffix..image.extension
end,
},
}
local function add_image(image)
local device = image.image
M.images[device] = M.images[device] or {}
table.insert(M.images[device], setmetatable(image, image_mt))
end
local function format_config(k, v)
local format
if type(v) == 'string' then
format = '%s=%q'
elseif v == true then
format = '%s=y'
elseif v == nil then
format = '%s=m'
elseif v == false then
format = '# %s is not set'
else
format = '%s=%d'
end
return string.format(format, 'CONFIG_' .. k, v)
end
local config_mt = {
__index = {
format = function(config)
return format_config(config.key, config.value)
end,
}
}
local function do_config(k, v, required)
M.configs[k] = setmetatable({
key = k,
value = v,
required = required,
}, config_mt)
end
function F.try_config(k, v)
do_config(k, v)
end
function F.config(k, v, message)
if not message then
message = string.format("unable to set '%s'", format_config(k, v))
end
do_config(k, v, message)
end
function F.packages(pkgs)
for _, pkg in ipairs(pkgs) do
table.insert(M.target_packages, pkg)
end
end
M.packages = F.packages
local function as_table(v)
if type(v) == 'table' then
return v
else
return {v}
end
end
local function disable_factory_image(device_info)
if device_info.options.deprecated and env.GLUON_DEPRECATED ~= 'full' then
return true
end
local overrides = image_customization_lib.device_overrides(device_info)
if overrides["disable_factory"] then
return true
end
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 {
image = image,
name = name,
subdir = 'sysupgrade',
in_suffix = options.sysupgrade,
out_suffix = '-sysupgrade',
extension = options.sysupgrade_ext,
aliases = options.aliases,
manifest_aliases = options.manifest_aliases,
}
end
if disable_factory_image(device_info) then
return
end
if options.factory then
for _, ext in ipairs(as_table(options.factory_ext)) do
add_image {
image = image,
name = name,
subdir = 'factory',
in_suffix = options.factory,
out_suffix = '',
extension = ext,
aliases = options.aliases,
}
end
end
for _, extra_image in ipairs(options.extra_images) do
add_image {
image = image,
name = name,
subdir = 'other',
in_suffix = extra_image[1],
out_suffix = extra_image[2],
extension = extra_image[3],
aliases = options.aliases,
}
end
end
function F.defaults(options)
default_options = merge(default_options, options)
end
function F.include(name)
local f = assert(loadfile(env.GLUON_TARGETSDIR .. '/' .. name))
setfenv(f, funcs)
return f()
end
function M.check_devices()
local device_list = {}
for device in pairs(unknown_devices) do
table.insert(device_list, device)
end
if #device_list ~= 0 then
table.sort(device_list)
io.stderr:write('Error: unknown devices given: ', table.concat(device_list, ' '), '\n')
os.exit(1)
end
end
return M
#!/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
......@@ -13,14 +14,15 @@ GLUONDIR="$(pwd)"
for module in $GLUON_MODULES; do
echo "--- Updating patches for module '$module' ---"
rm -rf "${GLUON_PATCHESDIR}/$module"
rm -rf "${GLUON_PATCHESDIR:?}/$module"
cd "$GLUONDIR"/"$module"
n=0
for commit in $(git rev-list --reverse --no-merges base..patched); do
let n=n+1
(( ++n ))
mkdir -p "${GLUON_PATCHESDIR}/$module"
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"
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"
......@@ -20,6 +24,9 @@ for module in $GLUON_MODULES; do
if ! git branch -f base "$commit" 2>/dev/null; then
git fetch "$repo" "$branch"
git branch -f base "$commit"
git branch -f base "$commit" || {
echo "unable to find commit \"$commit\" on branch \"$branch\" in repo \"$repo\"." >&2
exit 1
}
fi
done
config 'CONFIG_GLUON_SPECIALIZE_KERNEL=y'
config 'CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=64'
ATH10K_PACKAGES=
ATH10K_PACKAGES_QCA9887=
if [ "$GLUON_WLAN_MESH" = 'ibss' ]; then
ATH10K_PACKAGES='-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca988x ath10k-firmware-qca988x-ct'
ATH10K_PACKAGES_QCA9887='-kmod-ath10k kmod-ath10k-ct -ath10k-firmware-qca9887 ath10k-firmware-qca9887-ct'
fi
# 8devices
device 8devices-carambola2-board carambola2
factory
# ALFA NETWORK
device alfa-network-ap121f ap121f
factory
device alfa-network-hornet-ub hornet-ub HORNETUB
alias alfa-network-ap121
alias alfa-network-ap121u
device alfa-network-tube2h tube2h-8M TUBE2H8M
device alfa-network-n2-n5 alfa-nx ALFANX
# Allnet
device allnet-all0315n all0315n ALL0315N
factory
# AVM
device avm-fritz-box-4020 fritz4020
factory
device avm-fritz-wlan-repeater-300e fritz300e
factory
device avm-fritz-wlan-repeater-450e fritz450e
factory
# Buffalo
device buffalo-wzr-hp-g300nh wzr-hp-g300nh WZRHPG300NH
device buffalo-wzr-hp-g300nh2 wzr-hp-g300nh2 WZRHPG300NH2
device buffalo-wzr-hp-g450h wzr-hp-g450h WZRHPG450H
device buffalo-wzr-hp-ag300h wzr-hp-ag300h WZRHPAG300H
sysupgrade
device buffalo-wzr-600dhp wzr-600dhp WZR600DHP
sysupgrade
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 .img
device d-link-dir-505-rev-a1 dir-505-a1 DIR505A1
alias d-link-dir-505-rev-a2
device d-link-dir-825-rev-b1 dir-825-b1 DIR825B1
factory
# GL Innovations
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
manifest_alias gl-ar150
factory
device gl.inet-gl-ar300m gl-ar300m
manifest_alias gl-ar300m
factory
device gl.inet-gl-ar750 gl-ar750
manifest_alias gl-ar750
packages $ATH10K_PACKAGES
factory
# Linksys by Cisco
device linksys-wrt160nl wrt160nl WRT160NL
# Meraki
if [ "$BROKEN" ]; then
device meraki-mr12 mr12 # BROKEN: MAC address uniqueness issues
alias meraki-mr62
factory
device meraki-mr16 mr16 # BROKEN: MAC address uniqueness issues
alias meraki-mr66
factory
fi
# Netgear
device netgear-wndr3700 wndr3700
factory .img
device netgear-wndr3700v2 wndr3700v2
factory .img
device netgear-wndr3800 wndr3800
factory .img
device netgear-wndrmacv2 wndrmacv2
factory .img
if [ "$BROKEN" ]; then
device netgear-wndrmac wndrmac # BROKEN: Untested
factory .img
device netgear-wnr2200 wnr2200 WNR2200 # BROKEN: Untested
factory .img
fi
# OCEDO
device ocedo-koala koala
factory
# Onion
device onion-omega onion-omega
# OpenMesh
device openmesh-a60 a60 A60
alias openmesh-a40
packages $ATH10K_PACKAGES
device openmesh-mr1750 mr1750 MR1750
alias openmesh-mr1750v2
packages $ATH10K_PACKAGES
device openmesh-mr600 mr600 MR600
alias openmesh-mr600v2
device openmesh-mr900 mr900 MR900
alias openmesh-mr900v2
device openmesh-om2p om2p OM2P
alias openmesh-om2pv2
alias openmesh-om2pv4
alias openmesh-om2p-hs
alias openmesh-om2p-hsv2
alias openmesh-om2p-hsv3
alias openmesh-om2p-hsv4
alias openmesh-om2p-lc
device openmesh-om5p om5p OM5P
alias openmesh-om5p-an
device openmesh-om5p-ac om5pac OM5PAC
alias openmesh-om5p-acv2
packages $ATH10K_PACKAGES
# TP-Link
device tp-link-cpe210-v1.0 cpe210-220-v1
alias tp-link-cpe210-v1.1
alias tp-link-cpe220-v1.1
device tp-link-cpe210-v2.0 cpe210-v2
device tp-link-cpe510-v1.0 cpe510-520-v1
alias tp-link-cpe510-v1.1
alias 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
device tp-link-tl-wr710n-v2.1 tl-wr710n-v2.1
device tp-link-tl-wr810n-v1 tl-wr810n-v1
device tp-link-tl-wr842n-nd-v1 tl-wr842n-v1
device tp-link-tl-wr842n-nd-v2 tl-wr842n-v2
device tp-link-tl-wr842n-nd-v3 tl-wr842n-v3
device tp-link-tl-wr1043n-nd-v1 tl-wr1043nd-v1
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${GLUON_REGION:+-${GLUON_REGION}} .bin
device tp-link-archer-c7-v4 archer-c7-v4
packages $ATH10K_PACKAGES
device tp-link-archer-c7-v5 archer-c7-v5
packages $ATH10K_PACKAGES
if [ "$BROKEN" ]; then
device tp-link-archer-c25-v1 archer-c25-v1 # BROKEN: OOM with 5GHz enabled in most environments
packages $ATH10K_PACKAGES_QCA9887
fi
if [ "$BROKEN" ]; then
device tp-link-archer-c58-v1 archer-c58-v1 # BROKEN: OOM with 5GHz enabled in most environments
fi
if [ "$BROKEN" ] || [ "$GLUON_WLAN_MESH" = '11s' ]; then
device tp-link-archer-c59-v1 archer-c59-v1 # BROKEN: IBSS meshing not working
fi
if [ "$BROKEN" ]; then
device tp-link-archer-c60-v1 archer-c60-v1 # BROKEN: OOM with 5GHz enabled in most environments
fi
if [ "$BROKEN" ]; then
device tp-link-re355 re355-v1 # BROKEN: OOM with 5GHz enabled in most environments if device is 64M RAM variant
fi
if [ "$BROKEN" ]; then
device tp-link-tl-wr902ac-v1 tl-wr902ac-v1 # BROKEN: OOM due to insufficient RAM for ath10k expected
fi
device tp-link-re450 re450-v1
packages $ATH10K_PACKAGES
# Ubiquiti
device ubiquiti-airgateway ubnt-air-gateway
alias ubiquiti-airgateway-lr
device ubiquiti-airgateway-pro ubnt-air-gateway-pro
device ubiquiti-airrouter ubnt-airrouter
device ubiquiti-bullet-m ubnt-bullet-m
alias ubiquiti-nanostation-loco-m2
alias ubiquiti-nanostation-loco-m5
alias ubiquiti-bullet-m2
alias ubiquiti-bullet-m5
alias ubiquiti-picostation-m2
device ubiquiti-rocket-m ubnt-rocket-m
alias ubiquiti-rocket-m2
alias ubiquiti-rocket-m5
device ubiquiti-nanostation-m ubnt-nano-m
alias ubiquiti-nanostation-m2
alias ubiquiti-nanostation-m5
device ubiquiti-loco-m-xw ubnt-loco-m-xw
alias ubiquiti-nanostation-loco-m2-xw
alias ubiquiti-nanostation-loco-m5-xw
if [ "$BROKEN" ]; then
alias ubiquiti-nanobeam-m5 # BROKEN: Untested
fi
device ubiquiti-nanostation-m-xw ubnt-nano-m-xw
alias ubiquiti-nanostation-m2-xw
alias ubiquiti-nanostation-m5-xw
device ubiquiti-rocket-m-xw ubnt-rocket-m-xw
alias ubiquiti-rocket-m2-xw
alias ubiquiti-rocket-m5-xw
device ubiquiti-rocket-m-ti ubnt-rocket-m-ti
alias ubiquiti-rocket-m2-ti
alias ubiquiti-rocket-m5-ti
device ubiquiti-unifi ubnt-unifi
alias ubiquiti-unifi-ap
alias 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
if [ "$BROKEN" ]; then
device ubiquiti-ls-sr71 ubnt-ls-sr71 # BROKEN: Untested
fi
device ubiquiti-unifi-ac-lite ubnt-unifiac-lite
alias ubiquiti-unifi-ac-lr
packages $ATH10K_PACKAGES
factory
device ubiquiti-unifi-ac-pro ubnt-unifiac-pro
packages $ATH10K_PACKAGES
factory
device ubiquiti-unifi-ac-mesh ubnt-unifiac-mesh
packages $ATH10K_PACKAGES
factory
device ubiquiti-unifi-ac-mesh-pro ubnt-unifiac-mesh-pro
packages $ATH10K_PACKAGES
factory
# 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 'CONFIG_GLUON_SPECIALIZE_KERNEL=y'
device mikrotik-rb-nor-flash-16M rb-nor-flash-16M
factory
device mikrotik-rb-nor-flash-16M-ac rb-nor-flash-16M-ac
factory
device mikrotik-nand-64m nand-64m
factory
device mikrotik-nand-large nand-large
factory
device mikrotik-nand-large-ac nand-large-ac
factory
config 'CONFIG_GLUON_SPECIALIZE_KERNEL=y'
factory -ubi-factory .img
sysupgrade -squashfs-sysupgrade .tar
# Netgear
device netgear-wndr3700v4 wndr3700v4 WNDR3700V4
device netgear-wndr4300 wndr4300 WNDR4300V1
# ZyXEL
device zyxel-nbg6716 nbg6716 NBG6716
packages $ATH10K_PACKAGES
factory -squashfs-factory .bin
config 'CONFIG_GLUON_SPECIALIZE_KERNEL=y'
no_opkg
packages '-uboot-envtools' '-kmod-usb-core' '-kmod-usb-ohci' '-kmod-usb2' '-kmod-usb-ledtrig-usbport'
# D-Link
device d-link-dir-615-rev-c1 dir-615-c1 DIR615C1
# TP-Link
device tp-link-tl-wa701n-nd-v1 tl-wa701nd-v1
device tp-link-tl-wa701n-nd-v2 tl-wa701nd-v2
device tp-link-tl-wa7210n-v2 tl-wa7210n-v2
device tp-link-tl-wa7510n-v1 tl-wa7510n-v1
device tp-link-tl-wr703n-v1 tl-wr703n-v1
device tp-link-tl-wr710n-v2 tl-wr710n-v2
device tp-link-tl-wr740n-nd-v1 tl-wr740n-v1
device tp-link-tl-wr740n-nd-v3 tl-wr740n-v3
device tp-link-tl-wr740n-nd-v4 tl-wr740n-v4
device tp-link-tl-wr740n-nd-v5 tl-wr740n-v5
device tp-link-tl-wr741n-nd-v1 tl-wr741nd-v1
device tp-link-tl-wr741n-nd-v2 tl-wr741nd-v2
device tp-link-tl-wr741n-nd-v4 tl-wr741nd-v4
device tp-link-tl-wr741n-nd-v5 tl-wr741nd-v5
device tp-link-tl-wr743n-nd-v1 tl-wr743nd-v1
device tp-link-tl-wr743n-nd-v2 tl-wr743nd-v2
device tp-link-tl-wa801n-nd-v1 tl-wa801nd-v1
device tp-link-tl-wa801n-nd-v2 tl-wa801nd-v2
device tp-link-tl-wa801n-nd-v3 tl-wa801nd-v3
if [ "$BROKEN" ]; then
device tp-link-tl-wr802n-v1 tl-wr802n-v1 # BROKEN: Untested
fi
device tp-link-tl-wr840n-v2 tl-wr840n-v2
device tp-link-tl-wr841n-nd-v3 tl-wr841-v3
device tp-link-tl-wr841n-nd-v5 tl-wr841-v5
device tp-link-tl-wr841n-nd-v7 tl-wr841-v7
device tp-link-tl-wr841n-nd-v8 tl-wr841-v8
device tp-link-tl-wr841n-nd-v9 tl-wr841-v9
device tp-link-tl-wr841n-nd-v10 tl-wr841-v10
device tp-link-tl-wr841n-nd-v11 tl-wr841-v11
factory -squashfs-factory${GLUON_REGION:+-${GLUON_REGION}} .bin
device tp-link-tl-wr841n-nd-v12 tl-wr841-v12
factory -squashfs-factory${GLUON_REGION:+-${GLUON_REGION}} .bin
device tp-link-tl-wr843n-nd-v1 tl-wr843nd-v1
device tp-link-tl-wr941n-nd-v2 tl-wr941nd-v2
device tp-link-tl-wr941n-nd-v3 tl-wr941nd-v3
device tp-link-tl-wr941n-nd-v4 tl-wr941nd-v4
alias tp-link-tl-wr940n-v1
device tp-link-tl-wr941n-nd-v5 tl-wr941nd-v5
alias tp-link-tl-wr940n-v2
device tp-link-tl-wr941n-nd-v6 tl-wr941nd-v6
alias tp-link-tl-wr940n-v3
device tp-link-tl-wr940n-v4 tl-wr940n-v4
alias tp-link-tl-wr940n-v5
factory -squashfs-factory${GLUON_REGION:+-${GLUON_REGION}} .bin
device tp-link-tl-wr940n-v6 tl-wr940n-v6
factory -squashfs-factory${GLUON_REGION:+-${GLUON_REGION}} .bin
device tp-link-tl-wa730re-v1 tl-wa730re-v1
device tp-link-tl-wa750re-v1 tl-wa750re-v1
device tp-link-tl-wa830re-v1 tl-wa830re-v1
device tp-link-tl-wa830re-v2 tl-wa830re-v2
device tp-link-tl-wa850re-v1 tl-wa850re-v1
device tp-link-tl-wa860re-v1 tl-wa860re-v1
device tp-link-tl-wa901n-nd-v1 tl-wa901nd-v1
device tp-link-tl-wa901n-nd-v2 tl-wa901nd-v2
device tp-link-tl-wa901n-nd-v3 tl-wa901nd-v3
device tp-link-tl-wa901n-nd-v4 tl-wa901nd-v4
device tp-link-tl-wa901n-nd-v5 tl-wa901nd-v5
device tp-link-tl-mr13u-v1 tl-mr13u-v1
device tp-link-tl-mr3020-v1 tl-mr3020-v1
device tp-link-tl-mr3040-v1 tl-mr3040-v1
device tp-link-tl-mr3040-v2 tl-mr3040-v2
device tp-link-tl-mr3220-v1 tl-mr3220-v1
device tp-link-tl-mr3220-v2 tl-mr3220-v2
device tp-link-tl-mr3420-v1 tl-mr3420-v1
device tp-link-tl-mr3420-v2 tl-mr3420-v2
include 'armsr.inc'
device('armsr-armv7', 'generic')
include 'armsr.inc'
device('armsr-armv8', 'generic')