Skip to content
Snippets Groups Projects
Unverified Commit 7279c401 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

build: target_lib: allow to specify multiple factory_ext values

By passing a table instead of a single string, multiple different
extensions can be specified, each refering to a separate image file
generated by OpenWrt.

This is not supported for sysupgrade (as there can only be a single
image in the format expected by OpenWrt).
parent 8c386719
No related branches found
No related tags found
No related merge requests found
...@@ -202,6 +202,14 @@ function F.packages(pkgs) ...@@ -202,6 +202,14 @@ function F.packages(pkgs)
end end
M.packages = F.packages M.packages = F.packages
local function as_table(v)
if type(v) == 'table' then
return v
else
return {v}
end
end
function F.device(image, name, options) function F.device(image, name, options)
options = merge(default_options, options) options = merge(default_options, options)
...@@ -233,15 +241,17 @@ function F.device(image, name, options) ...@@ -233,15 +241,17 @@ function F.device(image, name, options)
end end
if options.factory then if options.factory then
add_image { for _, ext in ipairs(as_table(options.factory_ext)) do
image = image, add_image {
name = name, image = image,
subdir = 'factory', name = name,
in_suffix = options.factory, subdir = 'factory',
out_suffix = '', in_suffix = options.factory,
extension = options.factory_ext, out_suffix = '',
aliases = options.aliases, extension = ext,
} aliases = options.aliases,
}
end
end end
for _, extra_image in ipairs(options.extra_images) do for _, extra_image in ipairs(options.extra_images) do
add_image { add_image {
......
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