From f45b5da0bd26b142a9af61075384b0c14fa35cbe Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Wed, 4 Mar 2020 23:40:08 +0100 Subject: [PATCH] scripts: add new script target_config_profile.lua MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this script creates a file $GLUON_TMPDIR/§TARGET with following syntax: > board1: "packages" > board2: "packages" > ... this list can be used to build the final images with the imagebuilder --- scripts/target_config_profile.lua | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 scripts/target_config_profile.lua diff --git a/scripts/target_config_profile.lua b/scripts/target_config_profile.lua new file mode 100755 index 00000000..2b708579 --- /dev/null +++ b/scripts/target_config_profile.lua @@ -0,0 +1,38 @@ +local funcs = {} + +function funcs.config_message(config, _, ...) +-- config(...) +end + +function funcs.config_package(config, pkg, value) +-- config('CONFIG_PACKAGE_%s=%s', pkg, value) +end + +local lib = dofile('scripts/target_config_lib.lua')(funcs) + + +local output = {} + +--for _,dev in pairs(lib.devices) do +-- io.stderr:write(string.format("target_config_profile.lua:device# %s\n", dev.name)) +-- table.insert(output, get_pkglist(dev)) +-- output[dev.name] = get_pkglist(dev) +--end +output = get_pkglist() +--table.sort(output) + +--io.stderr:write(string.format("target_config_profile.lua:final# %s\n", dev.name)) + pkglist = io.open(string.format("%s/%s-%s.packages", lib.env.GLUON_TMPDIR, lib.env.BOARD, lib.env.SUBTARGET), "w") +for _, dev in ipairs(output) do +-- io.stderr:write(string.format("target_config_profile.lua:final# %s\n", dev[1])) +-- for board, pkglist in pairs(dev) do +-- print('\t', board, pkglist) +-- end + io.stderr:write(string.format("target_config_profile.lua:final# device: '%s'; pkgs: '%s’\n", dev[1], dev[2])) +-- pkglist = io.open(string.format("%s/%s.packages", lib.env.GLUON_TMPDIR, dev[1]), "w") + pkglist:write(string.format("%s:%s\n", dev [1], dev[2])) + +end + pkglist:close() + +