Commit Graph

496 Commits

Author SHA1 Message Date
Paul Spooren
0bc6a69776 treewide: unify OpenWrt hosted source via @OPENWRT
Multiple sources are hosted on OpenWrts source server only. The source
URLs to point to the server vary based on different epochs in OpenWrts
history.

Replace all by @OPENWRT which is an "empty" mirror, therefore using the
fallback servers sources.cdn.openwrt.org and sources.openwrt.org.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-02-08 12:11:32 +08:00
AmadeusGhost
80d3967771 kernel: rollback 4.9 to 4.9.255
"4.9.256" completely broken the compilation.
2021-02-07 21:36:19 +08:00
CN_SZTL
77a136fc74
kernel: bump to 4.9.256, 4.14.219, 4.19.173
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-02-07 02:20:09 +08:00
Paul Spooren
430f572960 build: use SPDX license tags
The license folder is a core part of OpenWrt and all GPL-2.0 licensed.
Use SPDX license tags to allow machines to check licenses.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[rebase, keep some Copyright lines, sharpen commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-02-06 12:07:10 +08:00
Adrian Schmutzler
75697c9c12
treewide: provide global default for SUPPORTED_DEVICES
The majority of our targets provide a default value for the variable
SUPPORTED_DEVICES, which is used in images to check against the
compatible on a running device:

  SUPPORTED_DEVICES := $(subst _,$(comma),$(1))

At the moment, this is implemented in the Device/Default block of
the individual targets or even subtargets. However, since we
standardized device names and compatible in the recent past, almost
all targets are following the same scheme now:

  device/image name:  vendor_model
  compatible:         vendor,model

The equal redundant definitions are a symptom of this process.

Consequently, this patch moves the definition to image.mk making it
a global default. For the few targets not using the scheme above,
SUPPORTED_DEVICES will be defined to a different value in
Device/Default anyway, overwriting the default. In other words:
This change is supposed to be cosmetic.

This can be used as a global measure to get the current compatible
with: $(firstword $(SUPPORTED_DEVICES))
(Though this is not precisely an achievement of this commit.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-29 22:47:58 +08:00
Adrian Schmutzler
5a2cbf522c
base-files: remove execute bit and shebang from functions.sh
/lib/functions.sh was executable for no obvious reason and its
execute property was even checked in package-ipkg.mk just to
source it afterwards.

Remove the execute bit and shebang as this is clearly a library.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-29 22:36:08 +08:00
CN_SZTL
61d995d4c3
kernel: bump 4.19 to 4.19.171
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-29 03:28:54 +08:00
CN_SZTL
b01af9983b
kernel: bump to 4.9.253, 4.14.217, 4.19.170
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-24 02:47:59 +08:00
CN_SZTL
cba1985b07
kernel: bump to 4.9.252, 4.14.216, 4.19.169
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-23 21:36:40 +08:00
CN_SZTL
a560911888
kernel: bump to 4.9.250, 4.14.214, 4.19.166
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-10 00:12:43 +08:00
CN_SZTL
5193287842
kernel: bump 4.19 to 4.19.165
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2021-01-07 13:52:47 +08:00
Sven Wegener
eeb1b68ebb
build: use ccache -C for cleaning the cache
This keeps the configuration, like the size of the cache, and the
statistics intact. Move the removal of the cache directory to the
distclean target, but only delete the .ccache directory inside of our
build tree, as we should not mess with a user-configured external ccache
directory this destructively.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2021-01-07 09:57:24 +08:00
Kevin Darbyshire-Bryant
1146051a20 build: drop clang wrapper
clang's gcc emulation does the right thing with -print-file-name now,
drop the wrapper

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-01-06 17:28:08 +08:00
Petr Štetiar
1ba328bf73 build: replace which with Bash command built-in
`which` utility is not shipped by default for example on recent Arch
Linux and then any steps relying on its presence fails, like for example
following Python3 prereq build check:

 $ python3 --version
 Python 3.9.1

 $ make
 /bin/sh: line 1: which: command not found
 /bin/sh: line 1: which: command not found
 /bin/sh: line 1: which: command not found
 ...
 Checking 'python3'... failed.
 ...

Fix this by switching to Bash builtin `command` which should provide
same functionality.

Fixes: FS#3525
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-01-05 17:18:46 +08:00
Sven Wegener
c83f7ff51b
build: drop ccache variables from specific targets
With commit 2ca084cc ("build: improve ccache support") these variables
are being set globally and we don't need them for specific targets.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
2021-01-02 12:08:22 +08:00
Roman Yeryomin
d0b8cc7732
build: improve ccache support
Set CCACHE_DIR to $(TOPDIR)/.ccache and CCACHE_BASEDIR to $(TOPDIR).
This allows to do clean and dirclean. Cache hit rate for test build
after dirclean is ~65%.
If CCACHE is enabled stats are printed out at the end of building process.
CCACHE_DIR config variable allows to override default, which could be useful
when sharing cache with many builds.
cacheclean make target allows to clean the cache.

Changes from v1:
- remove ccache directory using CCACHE_DIR variable
- remove ccache leftovers from sdk and toolchain make files
- introduce CONFIG_CCACHE_DIR variable
- introduce cacheclean make target

Signed-off-by: Roman Yeryomin <roman@advem.lv>
2021-01-02 12:08:17 +08:00
Rui Salvaterra
84d6e2884a
kernel-build: fix STRIP_KERNEL_EXPORTS for 64-bit kernels
While parsing the nm output, we need to account for the fact that 64-bit kernels
have 64-bit wide addresses. While at it, replace the grep | sed combo with a
single awk invocation and a stronger regex.

Fixes: 2ef0acc5fc "kernel-build: fix
STRIP_KERNEL_EXPORTS for recent kernels"

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-01-02 12:01:41 +08:00
Paul Spooren
edf785406d
build/prereq: merge ifndef IB block together
Multiple prereq checks are only required within the build system but not
for the ImageBuilder. These checks are excluded by using ifndef IB.

This commit merges the three ifndef IB blocks together.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2021-01-02 11:56:30 +08:00
CN_SZTL
74969cab15
kernel: bump to 4.9.249, 4.14.213, 4.19.164
Remove upstreamed:
 - generic/pending-4.14/499-mtd-parser-cmdline-Fix-parsing-of-part-names-with-co.patch
 - generic/pending-4.9/499-mtd-parser-cmdline-Fix-parsing-of-part-names-with-co.patch
 - ipq806x/patches-4.14/0071-2-PCI-qcom-Fixed-IPQ806x-PCIE-reset-changes.patch
 - ipq806x/patches-4.19/0071-2-PCI-qcom-Fixed-IPQ806x-PCIE-reset-changes.patch

Resolve conflicted:
 - generic/pending-4.19/611-netfilter_match_bypass_default_table.patch
 - ipq40xx/patches-4.19/995-ipq40xx-unlock-cpu-frequency.patch

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-12-31 20:59:32 +08:00
Hirokazu MORIKAWA
4ec538d951 include/cmake.mk: Fix the bug in ccache support
Fix the bug in ccache support due to this change.
bfc433efd4

The new cmake uses this for the wrapper.
https://cmake.org/cmake/help/v3.19/prop_tgt/LANG_COMPILER_LAUNCHER.html

Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
2020-12-22 11:38:53 +08:00
CN_SZTL
07c5ef44a4
kernel: bump to 4.9.248, 4.14.212, 4.19.163
Remove upstreamed:
 - target/linux/generic/backport-4.14/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch
 - target/linux/generic/backport-4.19/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch
 - target/linux/generic/backport-4.9/315-v5.10-usbnet-ipeth-fix-connectivity-with-ios-14.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-12-19 21:11:50 +08:00
Paul Spooren
0be03639d9
build/json: add filesystem information
Some images are created using different filesystems, most popular
squashfs and ext4. To allow downstream projects to distinguesh between
those, add the `filesystem` information to created json files.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-12-19 18:04:46 +08:00
Rosen Penev
3afdd9e89f libcxx[abi]: remove
This is a neat project, but offers no benefit to OpenWrt. The initial
reason for it was to be a replacement for libstdcpp as it is smaller
and lacks compatibility for C++98. Unfortunately, compiling several
packages with it results in larger ipk sizes.

While not a member of the packages feed, this will be moved to
packages-abandoned to keep it somewhere.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-12-12 11:33:11 +08:00
John Beckett
264f85cc4c build: find_md5 list with mod time and sorted
It was observed that the MD5 would not change after source files had been
modified, looking deeper into the build process it was discovered that
find_md5 build function makes a list of the files being built and then
passes the list to a summing utility on stdin.  The resultant MD5 is of
the file list, not the contents of the files.

The MD5 would change if the ordering of the list changed, or items were
removed or deleted.

The proposed fix is to add the modification time after the filename and
then sort the list to prevent find returning files in a different order
falsely re-triggering a rebuild. The MD5 will now change when a file is
modified or files are added/removed from the list.

Using 'T@' to show time in epoch for timezone independent behaviour.

Signed-off-by: John Beckett <john.beckett@net2edge.com>
2020-12-08 11:39:50 +08:00
Stijn Tintel
ff03f2a749 build: require rsync
It seems to be required to build toolchain/kernel-headers.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2020-12-08 11:39:28 +08:00
Paul Spooren
5c696f8af4 build: reduce cleanup binary calls in rootfs.mk
Both `find` and `rm` only need to be called once for folders and files.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-12-08 11:31:45 +08:00
CN_SZTL
6c69b7539e
kernel: bump to kernel 4.9.247, 4.14.210, 4.19.161
Resolve conflicted:
 - generic/pending-4.14/607-tcp_bbr-adapt-cwnd-based-on-ack-aggregation-estimation.patch
 - layerscape/patches-4.14/804-i2c-support-layerscape.patch
 - ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-12-06 00:24:09 +08:00
Petr Štetiar
3e8036c939
cmake.mk,rules.mk: fix host builds using CMake and ccache
Commit f98878e4c1 ("cmake.mk: set C/CXX compiler for host builds as
well") has introduced regression as it didn't taken usage of ccache into
the account so fix it by handling ccache use cases as well.

In order to get this working we need to export HOSTCXX_NOCACHE in
rules.mk as well.

Fixes: f98878e4c1 ("cmake.mk: set C/CXX compiler for host builds as well")
Reported-by: Ansuel Smith <ansuelsmth@gmail.com>
Tested-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-29 00:06:10 +08:00
Rosen Penev
5ca68ef6a1
cmake.mk: set C/CXX compiler for host builds as well
Without this, cmake will use whatever CC/CXX is set to, which could be
clang. In that case, at least libjson-c/host will fail to compile.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-29 00:04:46 +08:00
CN_SZTL
53abfa009a
Revert "cmake.mk: set C/CXX compiler for host builds as well"
This reverts commit 929a4e94d0.
2020-11-28 21:09:07 +08:00
Karel Kočí
9fa5fb7409
include/subdir: on build failure always print error
It is impossible to locate package that failed the build just from log
once more build is run in parallel (that is more than one make job). The
only way is to scout log files for failed package going back trough log.

This change makes it so error is printed for package that failed every
time.

Signed-off-by: Karel Kočí <karel.koci@nic.cz>
2020-11-28 19:14:22 +08:00
Rosen Penev
929a4e94d0
cmake.mk: set C/CXX compiler for host builds as well
Without this, cmake will use whatever CC/CXX is set to, which could be
clang. In that case, at least libjson-c/host will fail to compile.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-28 19:09:17 +08:00
Petr Štetiar
603d5f21ab
download: handle possibly invalid local tarballs
Currently it's assumed, that already downloaded tarballs are always
fine, so no checksum checking is performed and the tarball is used even
if it might be corrupted.

From now on, we're going to always check the downloaded tarballs before
considering them valid.

Steps to reproduce:

 1. Remove cached tarball

   rm dl/libubox-2020-08-06-9e52171d.tar.xz

 2. Download valid tarball again

   make package/libubox/download

 3. Invalidate the tarball

   sed -i 's/PKG_MIRROR_HASH:=../PKG_MIRROR_HASH:=ff/' package/libs/libubox/Makefile

 4. Now compile with corrupt tarball source

   make package/libubox/{clean,compile}

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-28 19:08:14 +08:00
Paul Spooren
ae3d18100d
build: use mkhash for IPK metadata checksums
When setting the option IPK_FILES_CHECKSUMS the build system stores
checksums of all package file as metadata. In combination with pkg_check
this allows to see if a package is broken, e.g. caused by bad flash.

To create those checksums the tool `sha256sum` were used while the rest
of OpenWrt uses `mkhash`, a small & fast implementation of sha256. As
the build system does not check the existence of `sha256sum` and the
stderr output is moved to /dev/null, a situation where the option is
enabled but no actual checksum are created may occur.

Instead of adding `sha256sum` as a requirement, this replaces it with
`mkhash sha256` and adapts the `sed` pipe command to fit spacing.

CC: Xu Wang <xwang1498@gmx.com>
CC: Michal Hrusecky <Michal@Hrusecky.net>

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-28 19:07:01 +08:00
Rosen Penev
ad1a726f12
prereq-build: add python 3.9 support
Fixes unmet dependency issue.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-28 18:29:36 +08:00
CN_SZTL
fa802da558
kernel: bump to 4.9.244, 4.14.207, 4.19.158
Resolve conflicted:
 - ath79/patches-4.19/910-unaligned_access_hacks.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-11-21 21:15:35 +08:00
Felix Fietkau
3f1de692a3
build: support cmake verbose for host builds
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-21 17:42:22 +08:00
Felix Fietkau
de36f67e72
build: detect broken make version on macOS
Apple ships a broken make version with the Xcode command line tools.
Homebrew installs make as gmake by default in order to not collide with
Apple's version.
Exit with an error if the broken one is used accidentally

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-21 17:41:47 +08:00
Felix Fietkau
f073c03ff1
build: try to find getopt in macOS homebrew's standard location
It is not symlinked to /usr/local/bin by default

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-21 17:41:28 +08:00
Paul Spooren
b7db313bc8
build: store SOURCE_DATE_EPOCH in JSON info files
The source date epoch is the only reproducible date close to the actual
build date. It can be used for tooling like the firmware wizard to show
the image age.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-14 23:34:48 +08:00
Paul Spooren
d871bcd6d5
build: store default/device packages in JSON
With this commit the `profiles.json` contain both the target specific
`default_packages` as well as the device specific `device_packages` as a
array of strings.

This information is required for downstream projects like the various
web-based interactive firmware generators.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-11-14 23:30:40 +08:00
Paul Spooren
f20e414b79
build: refactor JSON info files to profiles.json
JSON info files contain machine readable information of built profiles
and resulting images. These files were added in commit 881ed09ee6
("build: create JSON files containing image info").

They are useful for firmware wizards and script checking for
reproducibility.

Currently all JSON files are stored next to the built images, resulting
in up to 168 individual files for the ath79/generic target.

This patch refactors the JSON creation to store individual per image
(not per profile) files in $(BUILD_DIR)/json_info_files and create an
single overview file called `profiles.json` in the target directory.

Storing per image files and not per profile solves the problem of
parallel file writes. If a profiles sysupgrade and factory image are
finished at the same time both processes would write to the same JSON
file, resulting in randomly broken outputs.

Some target like x86/64 do not use the image code yet, resulting in
missing JSON files. If no JSON info files were created, no
`profiles.json` files is created as it would be empty anyway.

As before, this creation is enabled by default only if `BUILDBOT` is set.

Tested via buildroot & ImageBuilder on ath79/generic, imx6 and x86/64.

Signed-off-by: Paul Spooren <mail@aparcar.org>
[json_info_files dir handling in Make, if case refactoring]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-11-14 23:29:53 +08:00
CN_SZTL
5184fe54e8
kernel: bump to 4.9.243, 4.14.206, 4.19.157
Resolve conflicted:
 - generic/backport-4.19/714-v5.3-net-sfp-Stop-SFP-polling-and-interrupt-handling-duri.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-11-14 17:43:10 +08:00
Felix Fietkau
68f5817924
build: filter out more autogenerated kernel config options
Define wildcard patterns for filtering in target/linux/generic/config-filter
Preparation for supporting newer kernels

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-11-14 13:52:03 +08:00
CN_SZTL
488fa50d9f
kernel: bump 4.19 to 4.19.155
Resolve conflicted:
 - bcm27xx/950-0609-xhci-add-quirk-for-host-controllers-that-don-t-updat.patch
 - bcm53xx/180-usb-xhci-add-support-for-performing-fake-doorbell.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-11-08 03:24:12 +08:00
CN_SZTL
013dae6201
kernel: bump 4.14 to 4.14.204
Resovle conflicted:
 - layerscape/708-mc-bus-support-layerscape.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-11-08 02:26:20 +08:00
Paul Spooren
a038e48bbe build: FeedSourcesAppend add kmod feed to snapshot
Nightly snapshot builds of OpenWrt change their kernels versions
frequently and lose thereby compatibility to kmods from the upstream
target specific packages feed.

To allow opkg to install packages over multiple days a kmod archive is
offered at $target/$subtarget/kmods/$kernelversion and added as a feed
to created snapshot images via a buildbot step[1].

Instead of using a buildstep add the kmod feed directly via
FeedSourcesAppend to be included in the ImageBuilder repositories.conf
as well. This is conditionally only done for SNAPSHOT builds and when
running as BUILDBOT. Releases are unaffected as they don't include
kernel version changes and local builds may use different kernel
versions or magics than available upstream.

This commit allows in a future step to ship ImageBuilders without a
locally stored kmod archive.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-10-31 10:23:48 +08:00
CN_SZTL
e0aceee93a
kernel: bump to 4.14.203, 4.19.154
Resolve conflicted:
 - 210-dwc2_defaults.patch

Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-10-31 01:29:00 +08:00
CN_SZTL
acb3981c38
kernel: bump 4.9 to 4.9.241
Refreshed all patches.

Signed-off-by: CN_SZTL <cnsztl@project-openwrt.eu.org>
2020-10-29 23:07:32 +08:00
Petr Štetiar
c8360aeaf3 Revert "target: select procd-{ujail,seccomp} if !SMALL_FLASH"
This reverts commit 6a56a6eb30 as several
users have reported unbootable systems.

Suggested-by: Roman Kuzmitskii <damex.pp@icloud.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-10-23 11:20:10 +08:00