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

Nonabsolute lists

This creates lists that can be included in to each other. This is done
by hack that original script calling one of these lists passes base URI
to access sources and that is later reused. This is how relative URI
should work in future but it is not completed now so we can overcome it
this way and have almost same support.

This also means that we no longer have to specify target branch for
lists because it no longer matters.

Fallback branch is for now dropped because we are not doing small build
at the moment. We should in future return to them but they will be
implemented differently then fallback branch is.

This also does some base list cleanup.
parent 1f17a405
Branches
Tags
No related merge requests found
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
set -e set -e
output_path= output_path=
fallback=
sign_key= sign_key=
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
...@@ -28,24 +27,12 @@ while [ $# -gt 0 ]; do ...@@ -28,24 +27,12 @@ while [ $# -gt 0 ]; do
echo "Options:" echo "Options:"
echo " --help, -h" echo " --help, -h"
echo " Prints this help text." echo " Prints this help text."
echo " --branch BRANCH"
echo " Target branch for which these lists are generated."
echo " --minimal BRANCH"
echo " Generate lists for minimal branch. (This adds BRANCH as a fallback branch)"
echo " --sign KEY" echo " --sign KEY"
echo " Sign lists with given KEY and usign utility" echo " Sign lists with given KEY and usign utility"
echo " --debug" echo " --debug"
echo " Run this script in debug mode" echo " Run this script in debug mode"
exit exit
;; ;;
--branch)
shift
branch="$1"
;;
--minimal)
shift
fallback="$1"
;;
--sign) --sign)
shift shift
sign_key="$1" sign_key="$1"
...@@ -66,10 +53,6 @@ while [ $# -gt 0 ]; do ...@@ -66,10 +53,6 @@ while [ $# -gt 0 ]; do
done done
[ -n "$output_path" ] || output_path="generated_lists" [ -n "$output_path" ] || output_path="generated_lists"
[ -n "$branch" ] || {
echo "Missing --branch option." >&2
exit 1
}
tb="$(dirname "$(readlink -f "$0")")" tb="$(dirname "$(readlink -f "$0")")"
[ -d "$tb/lists" -a -f "$tb/feeds.conf" ] || { [ -d "$tb/lists" -a -f "$tb/feeds.conf" ] || {
echo "This script has to be in same direstory as feeds.conf and lists directory." >&2 echo "This script has to be in same direstory as feeds.conf and lists directory." >&2
...@@ -83,8 +66,7 @@ mkdir -p "$output_path" ...@@ -83,8 +66,7 @@ mkdir -p "$output_path"
"$tb/helpers/turris-version.sh" version > "$output_path/turris-version" "$tb/helpers/turris-version.sh" version > "$output_path/turris-version"
( cd "$tb" && git rev-parse HEAD > "$output_path/git-hash" ) ( cd "$tb" && git rev-parse HEAD > "$output_path/git-hash" )
m4args=( "--include=$tb/lists" "-D_INCLUDE_=$tb/lists/" "-D_FEEDS_=$tb/feeds.conf" "-D_BRANCH_=$branch" ) m4args=( "--include=$tb/lists" "-D_INCLUDE_=$tb/lists/" "-D_FEEDS_=$tb/feeds.conf" )
[ -z "$fallback" ] || m4args+=( "-D _BRANCH_FALLBACK_=$fallback" )
for f in "$tb"/lists/*.lua.m4; do for f in "$tb"/lists/*.lua.m4; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
......
include(utils.m4)dnl Include utility macros include(utils.m4)dnl Include utility macros
include(repository.m4)dnl Include Repository command include(repository.m4)dnl Include Repository command
----------------------------------------------------------------------------------
-- Updater itself -- Updater itself
Install('updater-ng', 'updater-ng-supervisor', { critical = true }) Install('updater-ng', 'updater-ng-supervisor', { critical = true })
Package('updater-ng', { replan = 'finished' }) Package('updater-ng', { replan = 'finished' })
...@@ -26,12 +28,14 @@ if model:match("[Oo]mnia") then ...@@ -26,12 +28,14 @@ if model:match("[Oo]mnia") then
Install("omnia-support", "btrfs-progs", { critical = true }) Install("omnia-support", "btrfs-progs", { critical = true })
elseif model:match("[Mm][Oo][Xx]") then elseif model:match("[Mm][Oo][Xx]") then
Install("mox-support", { critical = true }) Install("mox-support", { critical = true })
Install("zram-swap", { priority = 40 })
end end
Install("dns-resolver", { critical = true }) Install("dns-resolver", { critical = true })
-- OpenWRT minimum -- OpenWRT minimum
Install("procd", "ubus", "uci", "netifd", "firewall", { critical = true}) Install("procd", "ubus", "uci", "netifd", "firewall", { critical = true})
Install("ebtables", "odhcpd", "odhcp6c", "rpcd", "opkg", "wget", { priority = 40 }) Install("ebtables", "odhcpd", "odhcp6c", "rpcd", { priority = 40 })
Install("opkg", "libustream-openssl", { priority = 40 })
if model:match("^[Tt]urris$") then if model:match("^[Tt]urris$") then
Install("swconfig", { critical = true }) Install("swconfig", { critical = true })
end end
...@@ -80,8 +84,6 @@ if for_l10n then ...@@ -80,8 +84,6 @@ if for_l10n then
end end
if model:match("[Oo]mnia") then if model:match("[Oo]mnia") then
Install("rainbow-omnia", "sfpswitch", { priority = 40 }) Install("rainbow-omnia", "sfpswitch", { priority = 40 })
elseif model:match("^[Mm][Oo][Xx]$") then
Install("zram-swap", "kmod-gpio-button-hotplug", "kmod-mwifiex-sdio", "kmod-ledtrig-heartbeat", { priority = 40 })
elseif model:match("^[Tt]urris$") then elseif model:match("^[Tt]urris$") then
Install("rainbow", { priority = 40 }) Install("rainbow", { priority = 40 })
end end
......
include(base-min.lua.m4) include(utils.m4)dnl Include utility macros
include(repository.m4)dnl Include Repository command
Script(repo_base_uri .. "/lists/base-min.lua")
_FEATURE_GUARD_ _FEATURE_GUARD_
include(luci.lua.m4) Script(repo_base_uri .. "/lists/luci.lua")
include(foris.lua) Script(repo_base_uri .. "/lists/foris.lua")
include(terminal-apps.lua) Script(repo_base_uri .. "/lists/terminal-apps.lua")
-- IPv6 -- IPv6
Install("ds-lite", "6in4", "6rd", "6to4", { priority = 40 }) Install("ds-lite", "6in4", "6rd", "6to4", { priority = 40 })
......
include(utils.m4)dnl Include utility macros
_FEATURE_GUARD_ _FEATURE_GUARD_
Install("foris", "foris-diagnostics-plugin", "turris-webapps", "lighttpd-https-cert", { priority = 40 }) Install("foris", "foris-diagnostics-plugin", "turris-webapps", "lighttpd-https-cert", { priority = 40 })
......
# Real time clock
rtc-ds1307 rtc-ds1307
# Button and led on A module
gpio-button-hotplug
ledtrig-heartbeat
# SDIO Wi-Fi
mwlwifi mwlwifi
mwifiex-sdio mwifiex-sdio
-- Luci include(utils.m4)dnl Include utility macros
_FEATURE_GUARD_
Install("luci", "luci-lighttpd", { priority = 40 }) Install("luci", "luci-lighttpd", { priority = 40 })
forInstall(luci,base,proto-ipv6,proto-ppp,app-commands) forInstall(luci,base,proto-ipv6,proto-ppp,app-commands)
_LUCI_I18N_(base, commands) _LUCI_I18N_(base, commands)
_END_FEATURE_GUARD_
include(utils.m4)dnl Include utility macros
divert(-1)
# This is definition of subrepositories
pushdef(`SUBDIRS',`subdirs = {"base", "core" esyscmd(`awk "/^src-git/{printf \", \\\"%s\\\"\", \$'`2}" '_FEEDS_)}')
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 Basic turris repository
Repository("turris", repo_base_uri .. "/packages/" .. board, {
SUBDIRS
})
dnl
divert(-1)
# Now just clean up after our self
popdef(`SUBDIRS')
divert(0)dnl
dnl This is magic generating Repository command dnl This is common repository include
dnl We expect this to be include in base.lua just after utils.m4 dnl It guards it against multiple inclusion in subscripts.
divert(-1) if not repo_base_uri then
-- For backward compatibility we set base uri to HBS to update to updater version with repo_base_uri
# This is definition of subrepositories repo_base_uri = "https://repo.turris.cz/hbs"
pushdef(`SUBDIRS',`subdirs = {"base", "core" esyscmd(`awk "/^src-git/{printf \", \\\"%s\\\"\", \$'`2}" '_FEEDS_)}') Export('repo_base_uri')
end
divert(0)dnl if not turris_repo_included then
local board Script(repo_base_uri .. "/lists/repository.lua")
if model:match("[Mm][Oo][Xx]") then turris_repo_included = true
board = "mox" Export('turris_repo_included')
elseif model:match("[Oo]mnia") then
board = "omnia"
elseif model:match("^[Tt]urris$") then
board = "turris"
else
DIE("Unsupported Turris model: " .. tostring(model))
end end
dnl
dnl Basic turris repository
Repository("turris", "https://repo.turris.cz/_BRANCH_/packages/" .. board, {
SUBDIRS
})
dnl
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/_BRANCH_FALLBACK_/packages/" .. board, {
SUBDIRS,
priority = 40,
ignore = {"missing"}
})
')dnl
dnl
divert(-1)
# Now just clean up after our self
popdef(`SUBDIRS')
divert(0)dnl
-- Terminal tools
Install("bash", "coreutils", "diffutils", "htop", "curl", "vim-full", "terminfo", "psmisc", "procps-ng-top", "procps-ng-ps", "tcpdump", { priority = 40 })
include(utils.m4)dnl Include utility macros
_FEATURE_GUARD_
Install("bash", "terminfo", "vim-full", { priority = 40 })
Install("coreutils", "diffutils", { priority = 40 })
Install("htop", "psmisc", "procps-ng-top", "procps-ng-ps", { priority = 40 })
Install("curl", "tcpdump", { priority = 40 })
_END_FEATURE_GUARD_
divert(-1) divert(-1)
# 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_')',)
# Transform lines in file to comma separated arguments # Transform lines in file to comma separated arguments
# Usage: file2args(`FILE') # Usage: file2args(`FILE')
define(`file2args',`syscmd(test -f _INCLUDE_`'$1)ifelse(sysval,0,,`errprint(File $1 is missing!)m4exit(`1')')dnl define(`file2args',`syscmd(test -f _INCLUDE_`'$1)ifelse(sysval,0,,`errprint(File $1 is missing!)m4exit(`1')')dnl
......
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