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).
This commit is contained in:
parent
8c386719eb
commit
7279c4017e
@ -202,6 +202,14 @@ function F.packages(pkgs)
|
||||
end
|
||||
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)
|
||||
options = merge(default_options, options)
|
||||
|
||||
@ -233,15 +241,17 @@ function F.device(image, name, options)
|
||||
end
|
||||
|
||||
if options.factory then
|
||||
add_image {
|
||||
image = image,
|
||||
name = name,
|
||||
subdir = 'factory',
|
||||
in_suffix = options.factory,
|
||||
out_suffix = '',
|
||||
extension = options.factory_ext,
|
||||
aliases = options.aliases,
|
||||
}
|
||||
for _, ext in ipairs(as_table(options.factory_ext)) do
|
||||
add_image {
|
||||
image = image,
|
||||
name = name,
|
||||
subdir = 'factory',
|
||||
in_suffix = options.factory,
|
||||
out_suffix = '',
|
||||
extension = ext,
|
||||
aliases = options.aliases,
|
||||
}
|
||||
end
|
||||
end
|
||||
for _, extra_image in ipairs(options.extra_images) do
|
||||
add_image {
|
||||
|
Loading…
Reference in New Issue
Block a user