scripts: implement parsing of "EXTRA_PACKAGES"

This will just build packages, without adding them into an image.
This commit is contained in:
Sven Roederer 2020-03-01 21:55:40 +01:00 committed by Sven Roederer
parent 8e318a4d42
commit ef947b4a51
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@ return function(funcs)
local target = arg[1]
local default_packages = arg[2]
local extra_packages = arg[3]
local openwrt_config_target
if env.SUBTARGET ~= '' then
@ -47,6 +48,11 @@ END_MAKE
lib.packages {'-opkg'}
end
io.stderr:write(string.format("target_config_lib.lua: calling starting loop extra_packages\n"))
for pkg in string.gmatch(extra_packages, '%S+') do
lib.e_packages {pkg}
end
local default_pkgs = ''
for _, pkg in ipairs(lib.target_packages) do
@ -87,5 +93,11 @@ END_MAKE
end
end
local extra_pkgs = ''
for _, pkg in ipairs(lib.extra_packages) do
extra_pkgs = extra_pkgs .. ' ' .. pkg
funcs.config_package(lib.config_m, pkg, "m")
end
return lib
end

View File

@ -28,6 +28,7 @@ assert(env.GLUON_DEPRECATED)
M.site_code = assert(assert(dofile('scripts/site_config.lua')('site.conf')).site_code)
M.target_packages = {}
M.extra_packages = {}
M.configs = {}
M.devices = {}
M.images = {}
@ -168,6 +169,13 @@ function F.packages(pkgs)
table.insert(M.target_packages, pkg)
end
end
function F.e_packages(pkgs)
for _, pkg in ipairs(pkgs) do
io.stderr:write("target_lib.lua:extra_packages# " .. pkg .. "\n")
table.insert(M.extra_packages, pkg)
end
end
M.packages = F.packages
function F.device(image, name, options)