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 340 additions and 327 deletions
#!/bin/bash --norc
set -e
shopt -s nullglob
nodefault() {
# We define a function instead of a variable, as variables could
# be predefined in the environment (in theory)
eval "gluon_feature_nodefault_$1() {
:
}"
}
packages() {
:
}
for f in package/features packages/*/features; do
. "$f"
done
# Shell variables can't contain minus signs, so we escape them
# using underscores (and also escape underscores to avoid mapping
# multiple inputs to the same output)
sanitize() {
local v="$1"
v="${v//_/_1}"
v="${v//-/_2}"
echo -n "$v"
}
vars=
for feature in $1; do
if [ "$(type -t gluon_feature_nodefault_${feature})" != 'function' ]; then
echo "gluon-${feature}"
fi
vars="$vars $(sanitize "$feature")=1"
done
nodefault() {
:
}
packages() {
local cond="$(sanitize "$1")"
shift
# We only allow variable names, parentheses and the operators: & | !
if [ "$(expr match "$cond" '.*[^A-Za-z0-9_()&|! ].*')" -gt 0 ]; then
exit 1
fi
# Let will return false when the result of the passed expression is 0,
# so we always add 1. This way false is only returned for syntax errors.
local ret="$(env -i $vars bash --norc -ec "let _result_='1+($cond)'; echo -n \"\$_result_\"" 2>/dev/null)"
case "$ret" in
2)
for pkg in "$@"; do
echo "$pkg"
done
;;
1)
;;
*)
exit 1
esac
}
for f in package/features packages/*/features; do
. "$f"
done
#!/bin/bash
#!/usr/bin/env bash
set -e
......@@ -11,7 +11,7 @@ rm -rf openwrt/feeds
rm -rf openwrt/package/feeds
(
echo 'src-link gluon_base ../../package'
echo "$GLUON_BASE_FEEDS"
for feed in $FEEDS; do
echo "src-link $feed ../../packages/$feed"
done
......
#!/bin/sh
check_command() {
which "$1" >/dev/null 2>&1
command -v "$1" >/dev/null
}
if check_command gnustat; then
......
local lib = dofile('scripts/target_lib.lua')
local env = lib.env
assert(env.GLUON_IMAGEDIR)
local target = arg[1]
lib.include(target)
local function strip(s)
return string.gsub(s, '\n$', '')
end
local function generate_line(model, dir, filename, filesize)
local exists = pcall(lib.exec, {'test', '-e', dir..'/'..filename})
if not exists then
return
end
local file256sum = strip(lib.exec_capture {'scripts/sha256sum.sh', dir..'/'..filename})
io.stdout:write(string.format('%s %s %s %s %s\n', model, env.GLUON_RELEASE, file256sum, filesize, filename))
end
local function generate(image)
local dir, filename = image:dest_name(image.image)
local exists = pcall(lib.exec, {'test', '-e', dir..'/'..filename})
if not exists then
return
end
local filesize = strip(lib.exec_capture {'scripts/filesize.sh', dir..'/'..filename})
generate_line(image.image, dir, filename, filesize)
for _, alias in ipairs(image.aliases) do
local aliasdir, aliasname = image:dest_name(alias)
generate_line(alias, aliasdir, aliasname, filesize)
end
for _, alias in ipairs(image.manifest_aliases) do
generate_line(alias, dir, filename, filesize)
end
end
for _, images in pairs(lib.images) do
for _, image in ipairs(images) do
if image.subdir == 'sysupgrade' then
generate(image)
end
end
end
#!/usr/bin/env bash
set -e
[ "$GLUON_IMAGEDIR" -a "$GLUON_RELEASE" -a "$GLUON_SITEDIR" -a "$GLUON_TARGETSDIR" ] || exit 1
default_sysupgrade_ext='.bin'
output=
aliases=
manifest_aliases=
sysupgrade_ext=
SITE_CODE="$(scripts/site.sh site_code)"
get_filename() {
local name="$1"
echo -n "gluon-${SITE_CODE}-${GLUON_RELEASE}-${name}-sysupgrade${sysupgrade_ext}"
}
get_filepath() {
local filename="$1"
echo -n "${GLUON_IMAGEDIR}/sysupgrade/${filename}"
}
generate_line() {
local model="$1"
local filename="$2"
local filesize="$3"
local filepath="$(get_filepath "$filename")"
[ -e "$filepath" ] || return 0
local file256sum="$(scripts/sha256sum.sh "$filepath")"
local file512sum="$(scripts/sha512sum.sh "$filepath")"
echo "$model $GLUON_RELEASE $file256sum $filesize $filename"
echo "$model $GLUON_RELEASE $file256sum $filename"
echo "$model $GLUON_RELEASE $file512sum $filename"
}
generate() {
[ "${output}" ] || return 0
[ "$sysupgrade_ext" ] || return 0
local filename="$(get_filename "$output")"
local filepath="$(get_filepath "$filename")"
[ -e "$filepath" ] || return 0
local filesize="$(scripts/filesize.sh "$filepath")"
generate_line "$output" "$filename" "$filesize"
for alias in $aliases; do
generate_line "$alias" "$(get_filename "$alias")" "$filesize"
done
for alias in $manifest_aliases; do
generate_line "$alias" "$filename" "$filesize"
done
}
. scripts/common.inc.sh
device() {
generate
output="$1"
aliases=
manifest_aliases=
sysupgrade_ext="$default_sysupgrade_ext"
}
sysupgrade_image() {
generate
output="$1"
aliases=
manifest_aliases=
if [ "$3" ]; then
sysupgrade_ext="$3"
else
sysupgrade_ext="$2"
fi
}
alias() {
aliases="$aliases $1"
}
manifest_alias() {
manifest_aliases="$manifest_aliases $1"
}
sysupgrade() {
if [ "$2" ]; then
sysupgrade_ext="$2"
else
sysupgrade_ext="$1"
fi
if [ -z "$output" ]; then
default_sysupgrade_ext="$sysupgrade_ext"
fi
}
. "${GLUON_TARGETSDIR}/$1"; generate
#!/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)
local error_msg = string.format(
'incorrect use of %s(): list of %s expected as argument',
element_type, element_type)
assert(type(element_list) == 'table', error_msg)
-- We depend on the fact both feature and package
-- are already initialized as empty tables
for _, element in ipairs(element_list) do
assert(type(element) == 'string', error_msg)
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(): boolean argument expected')
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(): list of device names expected as argument')
for _, device_name in ipairs(device_names) do
assert(
type(device_name) == 'string',
'incorrect use of device(): list of device names expected as argument')
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(): target name expected as first argument')
if target ~= env.BOARD then
return false
end
if subtarget then
assert(
type(subtarget) == 'string',
'incorrect use of target(): subtarget name expected as first argument')
if subtarget ~= env.SUBTARGET then
return false
end
end
return true
end
function funcs.device_class(class)
assert(
type(class) == 'string',
'incorrect use of device_class(): class name expected as first argument')
return dev.options.class == class
end
function funcs.include(path)
assert(
type(path) == 'string',
'incorrect use of include(): path expected as first argument')
if string.sub(path, 1, 1) ~= '/' then
assert(
string.find(path, '/') == nil,
'incorrect use of include(): including files from subdirectories is unsupported')
path = env.GLUON_SITEDIR .. '/' .. path
end
local f = assert(loadfile(path))
setfenv(f, funcs)
return f()
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
#!/bin/sh
set -e
luacheck package scripts targets
#!/bin/sh
set -e
is_scriptfile() {
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
is_scriptfile "$file" || continue
echo "Checking $file"
shellcheck -f gcc "$file"
done
find package -type f | while read -r file; do
if is_scriptfile "$file"; then
echo "Checking $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 "$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
FEEDS="$(echo $GLUON_FEEDS $GLUON_SITE_FEEDS | tr ' ' '\n')"
# shellcheck disable=SC2086
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
[ "$GLUON_TMPDIR" -a "$GLUON_PATCHESDIR" ] || exit 1
[ "$GLUON_TMPDIR" ] && [ "$GLUON_PATCHESDIR" ] || exit 1
. scripts/modules.sh
......
#!/bin/sh
check_command() {
which "$1" >/dev/null 2>&1
command -v "$1" >/dev/null 2>&1
}
if check_command sha256sum; then
......@@ -15,6 +15,7 @@ else
exit 1
fi
# shellcheck disable=SC2181
[ "$?" -eq 0 ] || exit 1
echo "$ret" | awk '{ print $1 }'
#!/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