Commit 210d97c5 authored by Matthias Schiffer's avatar Matthias Schiffer

Switch to OpenWrt 18.06 branch

parent fcd5f183
*~ *~
/lede /openwrt
/output /output
/site /site
/tmp /tmp
......
The code of Project Gluon may be distributed under the following terms, unless The code of Project Gluon may be distributed under the following terms, unless
noted otherwise in individual files or subtrees. noted otherwise in individual files or subtrees.
Copyright (c) 2013-2017, Project Gluon Copyright (c) 2013-2018, Project Gluon
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -25,10 +25,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ...@@ -25,10 +25,11 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
LEDE and OpenWrt are licensed under the terms of the GNU General Public License OpenWrt is licensed under the terms of the GNU General Public License Version 2,
Version 2, which can be found at lede/LICENSE after the lede repository has been which can be found at openwrt/LICENSE after the OpenWrt repository has been
obtained. This applies to the following repositories: obtained. This applies to the following repositories:
* lede
* openwrt
* packages/openwrt * packages/openwrt
* packages/routing * packages/routing
* packages/luci * packages/luci
...@@ -67,13 +67,13 @@ define GluonTarget ...@@ -67,13 +67,13 @@ define GluonTarget
gluon_target := $(1)$$(if $(2),-$(2)) gluon_target := $(1)$$(if $(2),-$(2))
GLUON_TARGETS += $$(gluon_target) GLUON_TARGETS += $$(gluon_target)
GLUON_TARGET_$$(gluon_target)_BOARD := $(1) GLUON_TARGET_$$(gluon_target)_BOARD := $(1)
GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(if $(3),$(3),$(2)) GLUON_TARGET_$$(gluon_target)_SUBTARGET := $(2)
endef endef
include targets/targets.mk include targets/targets.mk
LEDEMAKE = $(MAKE) -C lede OPENWRTMAKE = $(MAKE) -C openwrt
BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD) BOARD := $(GLUON_TARGET_$(GLUON_TARGET)_BOARD)
SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET) SUBTARGET := $(GLUON_TARGET_$(GLUON_TARGET)_SUBTARGET)
...@@ -86,15 +86,15 @@ GLUON_CONFIG_VARS := \ ...@@ -86,15 +86,15 @@ GLUON_CONFIG_VARS := \
BOARD='$(BOARD)' \ BOARD='$(BOARD)' \
SUBTARGET='$(SUBTARGET)' SUBTARGET='$(SUBTARGET)'
LEDE_TARGET := $(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)) OPENWRT_TARGET := $(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
export LEDE_TARGET export OPENWRT_TARGET
CheckTarget := [ '$(LEDE_TARGET)' ] \ CheckTarget := [ '$(OPENWRT_TARGET)' ] \
|| (echo 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:'; $(foreach target,$(GLUON_TARGETS),echo ' * $(target)';) false) || (echo 'Please set GLUON_TARGET to a valid target. Gluon supports the following targets:'; $(foreach target,$(GLUON_TARGETS),echo ' * $(target)';) false)
CheckExternal := test -d lede || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false) CheckExternal := test -d openwrt || (echo 'You don'"'"'t seem to have obtained the external repositories needed by Gluon; please call `make update` first!'; false)
define CheckSite define CheckSite
@GLUON_SITEDIR='$(GLUON_SITEDIR)' GLUON_SITE_CONFIG='$(1).conf' $(LUA) scripts/site_config.lua \ @GLUON_SITEDIR='$(GLUON_SITEDIR)' GLUON_SITE_CONFIG='$(1).conf' $(LUA) scripts/site_config.lua \
...@@ -126,21 +126,21 @@ config: FORCE ...@@ -126,21 +126,21 @@ config: FORCE
@$(GLUON_CONFIG_VARS) \ @$(GLUON_CONFIG_VARS) \
scripts/target_config.sh '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' \ scripts/target_config.sh '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' \
> lede/.config > openwrt/.config
+@$(LEDEMAKE) defconfig +@$(OPENWRTMAKE) defconfig
@$(GLUON_CONFIG_VARS) \ @$(GLUON_CONFIG_VARS) \
scripts/target_config_check.sh '$(GLUON_TARGET)' '$(GLUON_PACKAGES)' scripts/target_config_check.sh '$(GLUON_TARGET)' '$(GLUON_PACKAGES)'
LUA := lede/staging_dir/hostpkg/bin/lua LUA := openwrt/staging_dir/hostpkg/bin/lua
$(LUA): $(LUA):
@$(CheckExternal) @$(CheckExternal)
+@[ -e lede/.config ] || $(LEDEMAKE) defconfig +@[ -e openwrt/.config ] || $(OPENWRTMAKE) defconfig
+@$(LEDEMAKE) tools/install +@$(OPENWRTMAKE) tools/install
+@$(LEDEMAKE) package/lua/host/install +@$(OPENWRTMAKE) package/lua/host/compile
prepare-target: config $(LUA) ; prepare-target: config $(LUA) ;
...@@ -148,15 +148,15 @@ all: prepare-target ...@@ -148,15 +148,15 @@ all: prepare-target
$(foreach conf,site $(patsubst $(GLUON_SITEDIR)/%.conf,%,$(wildcard $(GLUON_SITEDIR)/domains/*.conf)),$(call CheckSite,$(conf))) $(foreach conf,site $(patsubst $(GLUON_SITEDIR)/%.conf,%,$(wildcard $(GLUON_SITEDIR)/domains/*.conf)),$(call CheckSite,$(conf)))
@scripts/clean_output.sh @scripts/clean_output.sh
+@$(LEDEMAKE) +@$(OPENWRTMAKE)
@GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/copy_output.sh '$(GLUON_TARGET)' @GLUON_SITEDIR='$(GLUON_SITEDIR)' scripts/copy_output.sh '$(GLUON_TARGET)'
clean download: config clean download: config
+@$(LEDEMAKE) $@ +@$(OPENWRTMAKE) $@
dirclean: FORCE dirclean: FORCE
+@[ -e lede/.config ] || $(LEDEMAKE) defconfig +@[ -e openwrt/.config ] || $(OPENWRTMAKE) defconfig
+@$(LEDEMAKE) dirclean +@$(OPENWRTMAKE) dirclean
@rm -rf $(GLUON_TMPDIR) $(GLUON_OUTPUTDIR) @rm -rf $(GLUON_TMPDIR) $(GLUON_OUTPUTDIR)
manifest: $(LUA) FORCE manifest: $(LUA) FORCE
......
...@@ -14,7 +14,7 @@ is a requirement. ...@@ -14,7 +14,7 @@ is a requirement.
Adding profiles Adding profiles
--------------- ---------------
The vast majority of devices with ath9k WLAN is based on the ar71xx target of LEDE. The vast majority of devices with ath9k WLAN is based on the ar71xx target of OpenWrt.
If the hardware you want to add support for is ar71xx, adding a new profile If the hardware you want to add support for is ar71xx, adding a new profile
is sufficient. is sufficient.
...@@ -35,9 +35,9 @@ While porting Gluon to a new device, it might happen that the profile name is un ...@@ -35,9 +35,9 @@ While porting Gluon to a new device, it might happen that the profile name is un
known. Best practise is to generate an image first by using an arbitrary value known. Best practise is to generate an image first by using an arbitrary value
and then executing the lua command on the device and use its output from then on. and then executing the lua command on the device and use its output from then on.
The second parameter defines the name of the image files generated by LEDE. Usually, The second parameter defines the name of the image files generated by OpenWrt. Usually,
it is also the LEDE profile name; for devices that still use the old image build it is also the OpenWrt profile name; for devices that still use the old image build
code, a third parameter with the LEDE profile name can be passed. The profile names code, a third parameter with the OpenWrt profile name can be passed. The profile names
can be found in the image Makefiles in ``lede/target/linux/<target>/image/Makefile``. can be found in the image Makefiles in ``lede/target/linux/<target>/image/Makefile``.
Examples:: Examples::
...@@ -49,7 +49,7 @@ Suffixes and extensions ...@@ -49,7 +49,7 @@ Suffixes and extensions
''''''''''''''''''''''' '''''''''''''''''''''''
By default, image files are expected to have the extension ``.bin``. In addition, By default, image files are expected to have the extension ``.bin``. In addition,
the images generated by LEDE have a suffix before the extension that defaults to the images generated by OpenWrt have a suffix before the extension that defaults to
``-squashfs-factory`` and ``-squashfs-sysupgrade``. ``-squashfs-factory`` and ``-squashfs-sysupgrade``.
This can be changed using the ``factory`` and ``sysupgrade`` commands, either at This can be changed using the ``factory`` and ``sysupgrade`` commands, either at
...@@ -66,14 +66,14 @@ are given, this signals that no factory (or sysupgrade) image exists. ...@@ -66,14 +66,14 @@ are given, this signals that no factory (or sysupgrade) image exists.
Aliases Aliases
''''''' '''''''
Sometimes multiple models use the same LEDE images. In this case, the ``alias`` Sometimes multiple models use the same OpenWrt images. In this case, the ``alias``
command can be used to create symlinks and additional entries in the autoupdater command can be used to create symlinks and additional entries in the autoupdater
manifest for the alternative models. manifest for the alternative models.
Standalone images Standalone images
''''''''''''''''' '''''''''''''''''
On targets without *per-device rootfs* support in LEDE, the commands described above On targets without *per-device rootfs* support in OpenWrt, the commands described above
can't be used. Instead, ``factory_image`` and ``sysupgrade_image`` are used:: can't be used. Instead, ``factory_image`` and ``sysupgrade_image`` are used::
factory_image PROFILE IMAGE .EXT factory_image PROFILE IMAGE .EXT
...@@ -81,14 +81,14 @@ can't be used. Instead, ``factory_image`` and ``sysupgrade_image`` are used:: ...@@ -81,14 +81,14 @@ can't be used. Instead, ``factory_image`` and ``sysupgrade_image`` are used::
Again, the profile name must match the value printed by the aforementioned Lua Again, the profile name must match the value printed by the aforementioned Lua
command. The image name must match the part between the target name and the extension command. The image name must match the part between the target name and the extension
as generated by LEDE and is to be omitted when no such part exists. as generated by OpenWrt and is to be omitted when no such part exists.
Packages Packages
'''''''' ''''''''
The ``packages`` command takes an arbitrary number of arguments. Each argument The ``packages`` command takes an arbitrary number of arguments. Each argument
defines an additional package to include in the images in addition to the default defines an additional package to include in the images in addition to the default
package sets defined by LEDE. When a package name is prefixed by a minus sign, the package sets defined by OpenWrt. When a package name is prefixed by a minus sign, the
packages are excluded instead. packages are excluded instead.
The ``packages`` command may be used at the top of a target definition to modify The ``packages`` command may be used at the top of a target definition to modify
...@@ -99,7 +99,7 @@ target supports *per-default rootfs*). ...@@ -99,7 +99,7 @@ target supports *per-default rootfs*).
Configuration Configuration
''''''''''''' '''''''''''''
The ``config`` command allows to add arbitary target-specific LEDE configuration The ``config`` command allows to add arbitary target-specific OpenWrt configuration
to be emitted to ``.config``. to be emitted to ``.config``.
Notes Notes
...@@ -109,7 +109,7 @@ On devices with multiple WLAN adapters, care must also be taken that the primary ...@@ -109,7 +109,7 @@ On devices with multiple WLAN adapters, care must also be taken that the primary
configured correctly. ``/lib/gluon/core/sysconfig/primary_mac`` should contain the MAC address which configured correctly. ``/lib/gluon/core/sysconfig/primary_mac`` should contain the MAC address which
can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/010-primary-mac`` can be found on a label on most hardware; if it does not, ``/lib/gluon/upgrade/010-primary-mac``
in ``gluon-core`` might need a fix. (There have also been cases in which the address was incorrect in ``gluon-core`` might need a fix. (There have also been cases in which the address was incorrect
even on devices with only one WLAN adapter, in these cases a LEDE bug was the cause). even on devices with only one WLAN adapter, in these cases a OpenWrt bug was the cause).
Adding support for new hardware targets Adding support for new hardware targets
...@@ -137,8 +137,8 @@ Build system support ...@@ -137,8 +137,8 @@ Build system support
A definition for the new target must be created under ``targets``, and it must be added A definition for the new target must be created under ``targets``, and it must be added
to ``targets/targets.mk``. The ``GluonTarget`` macro takes one to three arguments: to ``targets/targets.mk``. The ``GluonTarget`` macro takes one to three arguments:
the target name, the Gluon subtarget name (if the target has subtargets), and the the target name, the Gluon subtarget name (if the target has subtargets), and the
LEDE subtarget name (if it differs from the Gluon subtarget). The third argument OpenWrt subtarget name (if it differs from the Gluon subtarget). The third argument
can be used to define multiple Gluon targets with different configuration for the can be used to define multiple Gluon targets with different configuration for the
same LEDE target, like it is done for the ``ar71xx-tiny`` target. same OpenWrt target, like it is done for the ``ar71xx-tiny`` target.
After this, is should be sufficient to call ``make GLUON_TARGET=<target>`` to build the images for the new target. After this, is should be sufficient to call ``make GLUON_TARGET=<target>`` to build the images for the new target.
...@@ -58,7 +58,7 @@ script in the ``contrib`` directory: ...@@ -58,7 +58,7 @@ script in the ``contrib`` directory:
The same command can be run again to update the template. The same command can be run again to update the template.
In addition, the Makefile must be adjusted. Instead of LEDE's default *package.mk*, In addition, the Makefile must be adjusted. Instead of OpenWrt's default *package.mk*,
the Gluon version (``../gluon.mk`` for core packages) must be used. The i18n files must be installed the Gluon version (``../gluon.mk`` for core packages) must be used. The i18n files must be installed
and PKG_CONFIG_DEPENDS must be added:: and PKG_CONFIG_DEPENDS must be added::
......
...@@ -19,7 +19,7 @@ GLUON_FEATURES := \ ...@@ -19,7 +19,7 @@ GLUON_FEATURES := \
web-wizard web-wizard
## GLUON_SITE_PACKAGES ## GLUON_SITE_PACKAGES
# Specify additional Gluon/LEDE packages to include here; # Specify additional Gluon/OpenWrt packages to include here;
# A minus sign may be prepended to remove a packages from the # A minus sign may be prepended to remove a packages from the
# selection that would be enabled by default or due to the # selection that would be enabled by default or due to the
# chosen feature flags # chosen feature flags
......
...@@ -94,7 +94,7 @@ You should generally reserve 5GB of disk space and additionally about 10GB for e ...@@ -94,7 +94,7 @@ You should generally reserve 5GB of disk space and additionally about 10GB for e
The built images can be found in the directory `output/images`. Of these, the `factory` The built images can be found in the directory `output/images`. Of these, the `factory`
images are to be used when flashing from the original firmware a device came with, images are to be used when flashing from the original firmware a device came with,
and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt/LEDE-based and `sysupgrade` is to upgrade from other versions of Gluon or any other OpenWrt-based
system. system.
**Note:** The images for some models are identical; to save disk space, symlinks are generated instead **Note:** The images for some models are identical; to save disk space, symlinks are generated instead
...@@ -122,12 +122,12 @@ will clean the entire tree, so the toolchain will be rebuilt as well, which will ...@@ -122,12 +122,12 @@ will clean the entire tree, so the toolchain will be rebuilt as well, which will
opkg repositories opkg repositories
----------------- -----------------
Gluon is mostly compatible with LEDE, so the normal LEDE package repositories Gluon is mostly compatible with OpenWrt, so the normal OpenWrt package repositories
can be used for Gluon as well. can be used for Gluon as well.
This is not true for kernel modules; the Gluon kernel is incompatible with the This is not true for kernel modules; the Gluon kernel is incompatible with the
kernel of the default LEDE images. Therefore, Gluon will not only generate images, kernel of the default OpenWrt images. Therefore, Gluon will not only generate images,
but also an opkg repository containing all core packages provided by LEDE, but also an opkg repository containing all core packages provided by OpenWrt,
including modules for the kernel of the generated images. including modules for the kernel of the generated images.
Signing keys Signing keys
...@@ -136,11 +136,11 @@ Signing keys ...@@ -136,11 +136,11 @@ Signing keys
Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys Gluon does not support HTTPS for downloading packages; fortunately, opkg deploys
public-key cryptography to ensure package integrity. public-key cryptography to ensure package integrity.
The Gluon images will contain public keys from two sources: the official LEDE keyring The Gluon images will contain public keys from two sources: the official OpenWrt keyring
(to allow installing userspace packages) and a Gluon-specific key (which is used (to allow installing userspace packages) and a Gluon-specific key (which is used
to sign the generated package repository). to sign the generated package repository).
LEDE will handle the generation and handling of the keys itself. OpenWrt will handle the generation and handling of the keys itself.
When making firmware releases based on Gluon, it might make sense to store When making firmware releases based on Gluon, it might make sense to store
the keypair, so updating the module repository later is possible. the keypair, so updating the module repository later is possible.
......
...@@ -67,8 +67,8 @@ opkg \: optional ...@@ -67,8 +67,8 @@ opkg \: optional
There are two optional fields in the ``opkg`` section: There are two optional fields in the ``opkg`` section:
- ``lede`` overrides the default LEDE repository URL. The default URL would - ``openwrt`` overrides the default OpenWrt repository URL. The default URL would
correspond to ``http://downloads.lede-project.org/snapshots/packages/%A`` correspond to ``http://downloads.openwrt.org/snapshots/packages/%A``
and usually doesn't need to be changed when nodes are expected to have IPv6 and usually doesn't need to be changed when nodes are expected to have IPv6
internet connectivity. internet connectivity.
- ``extra`` specifies a table of additional repositories (with arbitrary keys) - ``extra`` specifies a table of additional repositories (with arbitrary keys)
...@@ -76,7 +76,7 @@ opkg \: optional ...@@ -76,7 +76,7 @@ opkg \: optional
:: ::
opkg = { opkg = {
lede = 'http://opkg.services.ffac/lede/snapshots/packages/%A', openwrt = 'http://opkg.services.ffac/openwrt/snapshots/packages/%A',
extra = { extra = {
gluon = 'http://opkg.services.ffac/modules/gluon-%GS-%GR/%S', gluon = 'http://opkg.services.ffac/modules/gluon-%GS-%GR/%S',
}, },
...@@ -84,8 +84,8 @@ opkg \: optional ...@@ -84,8 +84,8 @@ opkg \: optional
There are various patterns which can be used in the URLs: There are various patterns which can be used in the URLs:
- ``%n`` is replaced by the LEDE version codename - ``%d`` is replaced by the OpenWrt distribution name ("openwrt")
- ``%v`` is replaced by the LEDE version number (e.g. "17.01") - ``%v`` is replaced by the OpenWrt version number (e.g. "17.01")
- ``%S`` is replaced by the target board (e.g. "ar71xx/generic") - ``%S`` is replaced by the target board (e.g. "ar71xx/generic")
- ``%A`` is replaced by the target architecture (e.g. "mips_24kc") - ``%A`` is replaced by the target architecture (e.g. "mips_24kc")
- ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``) - ``%GS`` is replaced by the Gluon site code (as specified in ``site.conf``)
......
GLUON_FEEDS='openwrt gluon routing luci' GLUON_FEEDS='packages routing luci gluon'
LEDE_REPO=https://git.openwrt.org/openwrt/openwrt.git OPENWRT_REPO=https://git.openwrt.org/openwrt/openwrt.git
LEDE_BRANCH=lede-17.01 OPENWRT_BRANCH=openwrt-18.06
LEDE_COMMIT=b6a1f43075f96b0028e33ed1af1fe31068791d24 OPENWRT_COMMIT=b84a07b3803bd39d0a1eb1b040718a023b8f7971
PACKAGES_OPENWRT_REPO=https://github.com/openwrt/packages.git PACKAGES_PACKAGES_REPO=https://github.com/openwrt/packages.git
PACKAGES_OPENWRT_BRANCH=lede-17.01 PACKAGES_PACKAGES_BRANCH=openwrt-18.06
PACKAGES_OPENWRT_COMMIT=338690b2f79e2c7090be4e9adbb19b452c9e3c36 PACKAGES_PACKAGES_COMMIT=05b9aceb00725b69220defaaad11f24b63731ac3
PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=be2c35785994e443d895225c7240474a46f64f5e
PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git PACKAGES_ROUTING_REPO=https://github.com/openwrt-routing/packages.git
PACKAGES_ROUTING_BRANCH=openwrt-18.06 PACKAGES_ROUTING_BRANCH=openwrt-18.06
PACKAGES_ROUTING_COMMIT=1b9d1c419f0ecefda51922a7845ab2183d6acd76 PACKAGES_ROUTING_COMMIT=1b9d1c419f0ecefda51922a7845ab2183d6acd76
PACKAGES_LUCI_REPO=https://github.com/openwrt/luci.git PACKAGES_LUCI_REPO=https://github.com/openwrt/luci.git
PACKAGES_LUCI_BRANCH=lede-17.01 PACKAGES_LUCI_BRANCH=openwrt-18.06
PACKAGES_LUCI_COMMIT=1f014bd2180b364bec4c3f6457f72a0621884f9a PACKAGES_LUCI_COMMIT=4ba85e3d82b684262c570e38a72d2dc3bb712a13
PACKAGES_GLUON_REPO=https://github.com/freifunk-gluon/packages.git
PACKAGES_GLUON_COMMIT=be2c35785994e443d895225c7240474a46f64f5e
# LEDE doesn't have a nice way to set the list of feeds in
# /etc/opkg/distfeeds.conf, so we use this overlay file (which is included by
# the opkg package Makefile though LEDE's IncludeOverlay mechanism).
# The following definitions make /etc/opkg/distfeeds.conf match the one included
# in official LEDE builds (by default, FEEDS_DISABLED contains the original list
# of feeds (which are unused by Gluon), and FEEDS_ENABLED our own feed list).
FEEDS_ENABLED := $(FEEDS_DISABLED)
FEEDS_DISABLED :=
...@@ -23,7 +23,7 @@ end ...@@ -23,7 +23,7 @@ end
need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$') need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
need_string({'opkg', 'lede'}, false) need_string({'opkg', 'openwrt'}, false)
need_table({'opkg', 'extra'}, function(extra_repo) need_table({'opkg', 'extra'}, function(extra_repo)
need_alphanumeric_key(extra_repo) need_alphanumeric_key(extra_repo)
need_string(extra_repo) need_string(extra_repo)
......
...@@ -14,8 +14,8 @@ local util = require 'gluon.util' ...@@ -14,8 +14,8 @@ local util = require 'gluon.util'
local subst = {} local subst = {}
local f = io.popen('. /etc/openwrt_release; echo "$DISTRIB_CODENAME"; echo "$DISTRIB_RELEASE"; echo "$DISTRIB_TARGET"; echo "$DISTRIB_ARCH"') local f = io.popen('. /etc/os-release; echo "$ID"; echo "$VERSION_ID"; echo "$LEDE_BOARD"; echo "$LEDE_ARCH"')
subst['%%n'] = f:read() subst['%%d'] = f:read()
subst['%%v'] = f:read():gsub('-SNAPSHOT', '') subst['%%v'] = f:read():gsub('-SNAPSHOT', '')
subst['%%S'] = f:read() subst['%%S'] = f:read()
subst['%%A'] = f:read() subst['%%A'] = f:read()
...@@ -25,7 +25,7 @@ subst['%%GS'] = site.site_code() ...@@ -25,7 +25,7 @@ subst['%%GS'] = site.site_code()
subst['%%GV'] = util.trim(fs.readfile('/lib/gluon/gluon-version')) subst['%%GV'] = util.trim(fs.readfile('/lib/gluon/gluon-version'))
subst['%%GR'] = util.trim(fs.readfile('/lib/gluon/release')) subst['%%GR'] = util.trim(fs.readfile('/lib/gluon/release'))
local prefix = subst['%%n'] .. '_' local prefix = subst['%%d'] .. '_'
local function replace_patterns(url) local function replace_patterns(url)
...@@ -37,7 +37,7 @@ local function replace_patterns(url) ...@@ -37,7 +37,7 @@ local function replace_patterns(url)
end end
local lede = site.opkg.lede() local openwrt = site.opkg.openwrt()
local extra = site.opkg.extra({}) local extra = site.opkg.extra({})
...@@ -52,8 +52,8 @@ for _, line in ipairs(distfeeds) do ...@@ -52,8 +52,8 @@ for _, line in ipairs(distfeeds) do
local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s') local name = line:match('^src/gz%s' .. prefix .. '(%S+)%s')
if name == 'core' then if name == 'core' then
f:write('# ' .. line .. '\n') f:write('# ' .. line .. '\n')
elseif name and lede then elseif name and openwrt then
f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(lede), name)) f:write(string.format('src/gz %s %s/%s\n', prefix .. name, replace_patterns(openwrt), name))
else else
f:write(line .. '\n') f:write(line .. '\n')
end end
......
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Sat, 14 Jan 2017 18:13:14 +0100
Subject: build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
$(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most
places; it is still used as destination for host files in Build/InstallDev.
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
diff --git a/Makefile b/Makefile
index b220dfd3c56a11f3e27d70e3d6e58cc6448abd2f..c1a7285c83df310e987eaef8376500d2b614eafb 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ clean: FORCE
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
dirclean: clean
- rm -rf $(STAGING_DIR_HOST) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
+ rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
rm -rf $(TMP_DIR)
ifndef DUMP_TARGET_DB
diff --git a/include/autotools.mk b/include/autotools.mk
index c6aa47e0bef311697b4def7a7183d1ac59dcf599..7bd400ab36d052b39fcb76a66873c8673eb189a0 100644
--- a/include/autotools.mk
+++ b/include/autotools.mk
@@ -75,7 +75,7 @@ define autoreconf_target
$(strip $(call autoreconf, \
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
- $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
+ $(STAGING_DIR)/host/share/aclocal $(STAGING_DIR_HOSTPKG)/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
endef
define patch_libtool_target
diff --git a/include/cmake.mk b/include/cmake.mk
index 5a403cbf41e2bbd6bdb843492639a01aff8cf75b..900dae1d4afc6007f8ac04179dd7f0922a07d4fa 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -34,7 +34,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
-CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOST)
+CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
define Build/Configure/Default
diff --git a/include/host-build.mk b/include/host-build.mk
index 5fcec7ebf48361100d29c5925beaae4f36d5ac7b..485f09a6b71b881692b5ee575927397259bbac24 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -126,7 +126,7 @@ ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),)
endif
define Host/Exports/Default
- $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
+ $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
diff --git a/include/package.mk b/include/package.mk
index e9989ab13ec81a8751ee7245639ee0b82b9a87b2..7f77c4e99b1e9b79503963c497c4c87d7af9d71a 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -130,7 +130,7 @@ ifdef USE_SOURCE_DIR
endif
define Build/Exports/Default
- $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
+ $(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
$(1) : export PATH=$$(TARGET_PATH_PKG)
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
diff --git a/rules.mk b/rules.mk
index 5710a84fe7ad24e45acb2ef62ee29eab37e8de06..b678e9bea5bc146a3c515d93003415cd21882068 100644
--- a/rules.mk
+++ b/rules.mk
@@ -147,9 +147,9 @@ STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD)
BUILD_LOG_DIR:=$(TOPDIR)/logs
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
-BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR)/host,$(BUILD_DIR_BASE)/host)
+BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host)
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
-STAGING_DIR_HOSTPKG:=$(STAGING_DIR)/host
+STAGING_DIR_HOSTPKG:=$(TOPDIR)/staging_dir/hostpkg
TARGET_PATH:=$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))
@@ -208,7 +208,7 @@ ifndef DUMP
endif
endif
endif
-TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(TARGET_PATH)
+TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(STAGING_DIR_HOSTPKG)/bin:$(TARGET_PATH)
ifeq ($(CONFIG_SOFT_FLOAT),y)
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
@@ -234,9 +234,9 @@ export PKG_CONFIG
HOSTCC:=gcc
HOSTCXX:=g++
-HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR)/host/include)
+HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include)
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
-HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR)/host/lib)
+HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
TARGET_AR:=$(TARGET_CROSS)gcc-ar
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Thu, 19 Jan 2017 00:03:32 +0100
</