Skip to content
Snippets Groups Projects
Commit c9f90c3e authored by David Bauer's avatar David Bauer Committed by David Bauer
Browse files

build: add class-packages for targets without devices

When adding device classes, targets without devices such as x86 were not
handled. As site and feature packages are included on such a per-device
decision, x86 images ended up without most packages.

Include a class setting for a target and include the class-packages
target-wide when this setting is configured.

Fixes 9c523650 ("build: introduce device classes")
parent 17db337d
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,7 @@ files["package/**/luasrc/lib/gluon/ebtables/*"] = {
files["targets/*"] = {
read_globals = {
"class",
"config",
"defaults",
"device",
......
......@@ -31,12 +31,21 @@ END_MAKE
]], lib.escape(image)))
end
lib.include('generic')
for pkg in string.gmatch(extra_packages, '%S+') do
lib.packages {pkg}
local function handle_target_pkgs(pkgs)
local packages = string.gmatch(pkgs, '%S+')
for pkg in packages do
lib.packages {pkg}
end
end
lib.include('generic')
handle_target_pkgs(extra_packages)
lib.include(target)
if lib.target_class ~= nil then
handle_target_pkgs(class_packages[lib.target_class])
end
lib.check_devices()
......
......@@ -23,6 +23,7 @@ assert(env.GLUON_DEPRECATED)
M.site_code = assert(assert(dofile('scripts/site_config.lua')('site.conf')).site_code)
M.target_packages = {}
M.target_class = nil
M.configs = {}
M.devices = {}
M.images = {}
......@@ -153,6 +154,10 @@ function F.config(...)
M.configs[string.format(...)] = 2
end
function F.class(target_class)
M.target_class = target_class
end
function F.packages(pkgs)
for _, pkg in ipairs(pkgs) do
table.insert(M.target_packages, pkg)
......
config 'CONFIG_VDI_IMAGES=y'
config 'CONFIG_VMDK_IMAGES=y'
class 'standard'
packages {
'kmod-3c59x',
'kmod-8139cp',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment