Skip to content
Snippets Groups Projects
Verified Commit d2eac317 authored by Karel Koci's avatar Karel Koci :metal:
Browse files

lists: generalize lists for all boards

Make lists general. Board specific packages are handled by lua not m4
that meanst that we have same lists for all boards and specific sections
are ignored/skipped depending on model variable.
parent 7a986a0d
No related merge requests found
......@@ -397,7 +397,7 @@ gen_lists() {
_report "Generating package lists for updater"
[ -n "${TARGET_BOARD}" ] || _die "You need to specify target board!"
mkdir -p bin/packages/lists
"${SRC_DIR}"/helpers/generate_userlists.sh --model "${TARGET_BOARD}" --branch "${PUBLISH_BRANCH}" --src "${SRC_DIR}/lists" bin/packages/lists
"${SRC_DIR}"/helpers/generate_userlists.sh --branch "${PUBLISH_BRANCH}" --src "${SRC_DIR}/lists" bin/packages/lists
}
build_help=" Builds everything"
......
#!/bin/sh
set -e
MINIMAL=false
LISTS_DIR=
OUTPUT_PATH=
FALLBACK=
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
......@@ -13,30 +13,21 @@ while [ $# -gt 0 ]; do
echo "Options:"
echo " --help, -h"
echo " Prints this help text."
echo " --model (turris|omnia|mox)"
echo " Target Turris model."
echo " --branch BRANCH"
echo " Target branch for which this userlist is generated."
echo " --minimal"
echo " Generate userlists for minimal branch. (This adds nightly as a fallback branch)"
echo " --minimal BRANCH"
echo " Generate userlists for minimal branch. (This adds BRANCH as a fallback branch)"
echo " --src PATH"
echo " Source directory with list to process"
exit
;;
--model)
shift
[ "$1" != "turris" -a "$1" != "omnia" -a "$1" != "mox" ] && {
echo "Unknown model: $1" >&2
exit 1
}
BOARD="$1"
;;
--branch)
shift
BRANCH="$1"
;;
--minimal)
MINIMAL=true
shift
FALLBACK="$1"
;;
--src)
shift
......@@ -58,10 +49,6 @@ done
echo "You have to specify output path." >&2
exit 1
}
[ -z "$BOARD" ] && {
echo "Missing --model option." >&2
exit 1
}
[ -z "$BRANCH" ] && {
echo "Missing --branch option." >&2
exit 1
......@@ -77,8 +64,8 @@ done
mkdir -p $OUTPUT_PATH
M4ARGS="--include=$LISTS_DIR -D _INCLUDE_=$LISTS_DIR/ -D _BRANCH_=$BRANCH -D _BOARD_=$BOARD"
$MINIMAL && M4ARGS="$M4ARGS -D _BRANCH_FALLBACK_=nightly"
M4ARGS="--include=$LISTS_DIR -D _INCLUDE_=$LISTS_DIR/ -D _BRANCH_=$BRANCH"
[ -z "$FALLBACK" ] || M4ARGS="$M4ARGS -D _BRANCH_FALLBACK_=$FALLBACK"
for f in $(find "$LISTS_DIR" -name '*.lua.m4'); do
m4 $M4ARGS $f > "$OUTPUT_PATH/$(basename "$f" | sed s/\.m4$//)"
......
......@@ -18,7 +18,13 @@ Install("base-files", "busybox", { critical = true })
Package("kernel", { reboot = "delayed" })
Package("kmod-mac80211", { reboot = "delayed" })
forInstallCritical(kmod,file2args(kmod.list))
forInstallCritical(kmod,file2args(kmod-_BOARD_.list))
if model:match("[Mm][Oo][Xx]") then
forInstallCritical(kmod,file2args(kmod-mox.list))
elseif model:match("[Oo]mnia") then
forInstallCritical(kmod,file2args(kmod-omnia.list))
elseif model:match("^[Tt]urris$") then
forInstallCritical(kmod,file2args(kmod-turris.list))
end
Install("fstools", { critical = true })
if model and model:match("[Tt]urris") then
Install("turris-support", { critical = true })
......
......@@ -6,11 +6,22 @@ divert(-1)
pushdef(`SUBDIRS',`subdirs = {"base", "core" esyscmd(`awk "/src-git/{printf \", \\\"%s\\\"\", \$'`2}" feeds.conf')}')
divert(0)dnl
local board
if model:match("[Mm][Oo][Xx]") then
board = "mox"
elseif model:match("[Oo]mnia") then
board = "omnia"
elseif model:match("^[Tt]urris$") then
board = "turris"
else
DIE("Unsupported Turris model: " .. tostring(model))
end
dnl
if version_match and version_match(self_version, ">=60.0.1") then
dnl
dnl Basic turris repository
Repository("turris", "https://repo.turris.cz/_BOARD_`'ifdef(`_BRANCH_',-_BRANCH_)/packages", {
Repository("turris", "https://repo.turris.cz/" .. board .. "ifdef(`_BRANCH_',-_BRANCH_)/packages", {
SUBDIRS
})
dnl
......@@ -18,7 +29,7 @@ dnl Fallback turris repository for not complete branches
dnl In testing branches we are compiling just a minimal set of packages to allow
dnl updater to use all packages we are adding nightly as fallback reposutory.
ifdef(`_BRANCH_FALLBACK_',
` Repository("turris-fallback", "https://repo.turris.cz/_BOARD_-_BRANCH_FALLBACK_/packages", {
` Repository("turris-fallback", "https://repo.turris.cz/" .. board .. "-_BRANCH_FALLBACK_/packages", {
SUBDIRS,
priority = 40,
ignore = {"missing"}
......@@ -28,11 +39,11 @@ dnl
dnl Repeat the same (this time without comments for api.turris.cz for backward
dnl compatibility.
else
Repository("turris", "https://api.turris.cz/openwrt-repo/_BOARD_`'ifdef(`_BRANCH_',-_BRANCH_)/packages", {
Repository("turris", "https://api.turris.cz/openwrt-repo/" .. board .. "ifdef(`_BRANCH_',-_BRANCH_)/packages", {
SUBDIRS
})
ifdef(`_BRANCH_FALLBACK_',
` Repository("turris-fallback", "https://api.turris.cz/openwrt-repo/_BOARD_-_BRANCH_FALLBACK_/packages", {
` Repository("turris-fallback", "https://api.turris.cz/openwrt-repo/" .. board .. "-_BRANCH_FALLBACK_/packages", {
SUBDIRS,
priority = 40,
ignore = {"missing"}
......
divert(-1)
# We require the _BOARD_ variable to be defined so let's check
ifdef(`_BOARD_',,`errprint(`_BOARD_ have to be defied when gerating new userlist. For example pass argument -D _BOARD_=turris to m4.')m4exit(`1')')
# Also we use the _BRANCH_ variable, but if it isn't defined than it means deploy
# and if defined as deploy then we undefine it.
# We use the _BRANCH_ variable, but if it isn't defined than it means deploy and
# if defined as deploy then we undefine it.
ifelse(_BRANCH_,deploy,`undefine(`_BRANCH_')',)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment