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

scripts: target_config_lib: prepend target default package list from openwrt/tmp/.targetinfo

Device-specific package additions could generate `CONFIG_PACKAGE_...=m`
lines, which would override `CONFIG_PACKAGE_...=y` lines inserted by
OpenWrt for default packages (as Gluon did not know about these default
packages). This resulted in the unintended removal of such packages from
other devices that did not contain the same package in their device
package lists.

Avoid this issue by explicitly adding OpenWrt's target default package
list to the front of Gluon's target package list.
parent ca219527
No related branches found
No related tags found
No related merge requests found
......@@ -181,6 +181,7 @@ config: $(LUA) FORCE
$(call CheckSite,$(conf)); \
)
$(OPENWRTMAKE) prepare-tmpinfo
$(GLUON_ENV) $(LUA) scripts/target_config.lua > openwrt/.config
$(OPENWRTMAKE) defconfig
$(GLUON_ENV) $(LUA) scripts/target_config_check.lua
......
......@@ -154,12 +154,31 @@ local function handle_target_pkgs(pkgs)
end
end
local function get_default_pkgs()
local targetinfo_target = string.gsub(openwrt_config_target, '_', '/')
local target_matches = false
for line in io.lines('openwrt/tmp/.targetinfo') do
local target_match = string.match(line, '^Target: (.+)$')
if target_match then
target_matches = (target_match == targetinfo_target)
end
local default_packages_match = string.match(line, '^Default%-Packages: (.+)$')
if target_matches and default_packages_match then
return split(default_packages_match)
end
end
io.stderr:write('Error: unable to get default packages for OpenWrt target ', targetinfo_target, '\n')
os.exit(1)
end
lib.include('generic')
lib.include(target)
lib.check_devices()
handle_target_pkgs(lib.target_packages)
handle_target_pkgs(concat_list(get_default_pkgs(), lib.target_packages))
for _, dev in ipairs(lib.devices) do
local device_pkgs = {}
......
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