aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: use -nostdinc and -isystem in NOSTDINC_FLAGS for out-of-tree kernel ↵Felix Fietkau2021-03-181-0/+3
| | | | | | | | modules This resolves issues uncovered by musl updates Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use SPDX license tagsPaul Spooren2021-02-051-5/+2
| | | | | | | | | 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>
* build: create $(PKG_SYMVERS_DIR) if non-existentSebastian Kemper2020-11-191-0/+1
| | | | | | | | | | | | | Commit 5d76065 moved the creation of the symvers directory to include/kernel-build.mk. This is fine when building from scratch. But when unpacking an SDK the directory doesn't exist and because the kernel won't be built (again) this directory will not be created by the build system, causing build failure if make tries to copy files into it. This moves the creation of the symvers directory back into include/kernel.mk so that the directory is created in any case. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
* build: pass KBUILD_EXTRA_SYMBOLS with symvers files for kernel module packagesFelix Fietkau2020-11-131-10/+2
| | | | | | | This replaces the previous (deprecated) method of collecting symvers data in $(PKG_BUILD_DIR)/Module.symvers, which does not work on newer kernels Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: move symvers files to kernel build dirFelix Fietkau2020-04-091-4/+6
| | | | | | | | | | The symvers files of older kernel versions are incompatible with the ones from 5.4, so changing the kernel version without running make clean was causing build failures in kernel module packages. Fix this by moving the directory, ensuring that symvers files get thrown away with a kernel version change Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: Add KBUILD_HOSTLDLIBSHauke Mehrtens2020-01-261-0/+1
| | | | | | | | | | In Linux kernel commit 8377bd2b9ee1 ("kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS") HOST_LOADLIBES was renamed to KBUILD_HOSTLDLIBS. This patch adapts the OpenWrt kernel build to this new variable. Without this change the kernel host tools would not link against the libraries found in the staging directory. Signed-off-by: Hauke Mehrtens <hauke.mehrtens@intel.com>
* kernel.mk: add KCFLAGS to make kmods reproduciblePaul Spooren2019-10-091-0/+1
| | | | | | | | | | | | Some kmods (gpio-hotplug, wireguard) store the build path in the compiled files and therefore make it harder to rebuild the official binaries. As the same "iremap" function is used as for other binaries, the change is compatible with gcc7 and 8. Tested with both gcc7 and gcc8 resulting in build path independent reproducible builds. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: force disable stack validation during kernel build on non-linux systemsFelix Fietkau2019-10-021-1/+2
| | | | | | | | | | | The check for libelf in the kernel build is not enough, because the code that uses libelf for stack validation is completely non-portable, as it tries to include asm/types.h and relies on kernel types in user space. Until this is fixed properly, the only solution is to disable this on any non Linux build host Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: include BUILD_VARIANT in PKG_BUILD_DIRJeffery To2019-08-051-1/+1
| | | | | | | | | | | This changes the default PKG_BUILD_DIR to take BUILD_VARIANT into account (if set), so that packages do not need to manually override PKG_BUILD_DIR just to handle variants. This also updates most base packages with variants to use the updated default PKG_BUILD_DIR. Signed-off-by: Jeffery To <jeffery.to@gmail.com>
* build: skip kernel stack validation when building on macOSFelix Fietkau2019-07-031-0/+4
| | | | | | | | | | Since we switched to 4.19, the kernel build checks for libelf to decide if it should build tools for stack validation. On macOS, this check fails during target/compile, but succeeds during package build (because of the pkg-config path picking up target libraries). Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix external module symbol collection if build_dir is a symlinkRoman Yeryomin2019-06-061-1/+4
| | | | | | | | | | | | | | | | e26ffb31dfa30d498b963a86d231835e3af7d3df fixed only embedded modules symbol collection. If we are building external modules, like broadcom-wl or lantiq dsl stuff then modules which do EXPORT_SYMBOL have unresolved paths in Module.symvers and external module which depend on other external modules will have empty dependencies, leading to broken module loading. This was discussed on IRC with Jonas some time ago. Fix this by handling both resolved and unresolved paths. Fixes: e26ffb31dfa3 ("build: fix module symbol collection if build_dir is a symlink") Signed-off-by: Roman Yeryomin <roman@advem.lv> [jonas.gorski@gmail.com: add appropriate fixes tag] Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* include/kernel: sort autoload modules list to fix reproducible buildsAlexander Couzens2019-02-281-1/+1
| | | | | | | | When autoloading more than one modules per packages, /etc/modules.d/$module depends on the file system ordering. To test this: use disorderfs on the build_dir and build kmod-sched. Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* build: fix build dependency of kmod .ipk with version filtered filesYousong Zhou2018-12-181-1/+1
| | | | | | | | | We need to use resolved file list as prerequisites for repacking kmod .ipk files. Note that currently version_filter uses a Makefile macro KERNEL_PATCHVER that should be available at ipk building time. Reported-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* kernel: fix downloading rcX releasesRafał Miłecki2018-12-031-2/+9
| | | | | | | | They are no longer stored in the "testing" subdirectory and are not available as .tar.xz archives. If -rc is detected download it from the git.kernel.org and use .tar.gz. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* build: remove obsolete -rc kernel testing rewritesChristian Lamparter2018-10-201-2/+1
| | | | | | | | | The -rcX "testing" kernels are no longer hosted on cdn.kernel.org file servers directly in a "testing" directory. Therefore the logic that tested for "-rc" can be removed. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* build: insert blank line after KernelPackage template to allow chaining ↵Felix Fietkau2018-10-061-0/+1
| | | | | | calls to it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix kernel headers install for umlFelix Fietkau2018-09-291-1/+1
| | | | | | The kernel headers makefile needs to override LINUX_KARCH Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/kernel.mk: build kmod packages with empty FILESMatthias Schiffer2018-04-121-4/+2
| | | | | | | | | | | kmod packages without FILES did not have an install step defined, leading to no package being built. This affected netfilter/iptables packages, which filter out builtin modules from FILES. Not building a package that it is selected in .config is problematic, as the generated empty package may be necessary to satisfy dependencies. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* kernel: include: remove last .0 from kernel versions againHauke Mehrtens2017-12-161-1/+1
| | | | | | | | Kernel 4.14 has the version number 4.14 and not 4.14.0. This was different in some older Linux kernel versions, This change makes it possible to use kernel 4.14 without any minor version. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* build: fix module symbol collection if build_dir is a symlinkJonas Gorski2017-11-071-1/+1
| | | | | | | | | | | | If PKG_BUILD_DIR contains symlinks, the generated Module.symvers will contain the resolved paths, not the virtual path with the symlink name. This breaks the filter for the module's own symbols, so to fix this ensure we also grep for the resolved path. Reported-by: Roman Yeryomin <roman@advem.lv> Tested-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* include: kernel.mk: simplify module autoloadingJo-Philipp Wich2017-11-071-51/+21
| | | | | | | | | | | | | | | | | | Let the generic postinstall script invoke "kmodloader" when the just installed package contains any /etc/module.d/ entries. This allows us to skip the explicit "insert_module()" calls in the package postinstall. Due to the removed insert_module calls we do not need to assemble a complete list of modules per package anymore, which allows for vast simplification of the package generation code. While we're at it, also support specifying default parameters for modules using either the MODPARAM or MODPARAM.modulename variables in KernelPackage. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: actually fix the creation of PKG_INFO_DIRJonas Gorski2017-10-281-1/+1
| | | | | | | | The creation was accidentally moved to the wrong hook, fix it by moving it to the pre hook. Fixes: e5e5c3f5fd38 ("build: ensure PKG_INFO_DIR exists before trying to use it") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* build: ensure PKG_INFO_DIR exists before trying to use itJonas Gorski2017-10-281-0/+1
| | | | | | | | | | | PKG_INFO_DIR is only created at the finish step of the first package build, but kernel modules now use it at the start. Doing a parallel build could cause a kernel module to be the first package, breaking the build. Fix this by ensuring the directory exists. Fixes: 2e496876c60c ("kernel: collect module symvers for external modules") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* kernel: collect module symvers for external modulesJonas Gorski2017-10-271-0/+27
| | | | | | | | | | | | | | | | | | | | | | | Collect module symvers for all external modules to make them available for modpost. This fixes dependencies for most external modules. Example: Before: root@LEDE:/# modinfo mt76 module: /lib/modules/4.4.74/mt76.ko license: Dual BSD/GPL depends: After: root@LEDE:/# modinfo mt76 module: /lib/modules/4.4.74/mt76.ko license: Dual BSD/GPL depends: mac80211,cfg80211 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* include: Silence external kernel version checksFlorian Fainelli2017-10-241-1/+1
| | | | | | | | | | | | | | During the initial configuration phases, we have not set-up the kernel source directory, which would lead to such messages: cat: /local/users/fainelli/openwrt/trunk/build_dir/target-x86_64_musl/linux-uml/linux-4.9.58/include/config/kernel.release: No such file or directory Just silence it, since it does not create a functional problem. Fixes: 8e0e0e7d8bfb ("include: Determine MODULES_DIR correctly for external/git kernels") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* kernel: fixup KARCH for powerpc64 buildsFlorian Larysch2017-10-241-0/+2
| | | | | | | The kernel calls both ppc64 and ppc32 "powerpc", so we need to fixup LINUX_KARCH when building with ARCH=powerpc64. Signed-off-by: Florian Larysch <fl@n621.de>
* Revert "kernel: do not try to probe builtin modules on empty kmod package ↵Jo-Philipp Wich2017-07-211-2/+0
| | | | | | | | | | | install" This change currently causes some issues with loading out of tree kernel modules so revert that commit for now. Reverts commit 34c01e68b5d6b06ce3794ef0e2b06e81ec3ce8ca. Fixes FS#919. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* kernel: do not try to probe builtin modules on empty kmod package installJonas Gorski2017-07-201-0/+2
| | | | | | | | | | | | Builtin modules are always present, and trying to load them will cause modprobe to spew errors when installing the empty kmod packages. Fix this by never generating any postinst module install instructions for builtin modules. Fixes #842. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* build: Fix not altering KERNELRELEASE for external kernelHauke Mehrtens2017-06-191-2/+1
| | | | | | | | | | | | When an external kernel tree is used the version should not get modified by the LEDE build scripts. This was added by Florian some time ago. The commit 0aed054becb21439 ("build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS variables and move to kernel.mk") breaks this feature introduced in b6746a6ffb73 ("include: Do not alter KERNELRELEASE for external/git kernels"). Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* build: move definition of KBUILD_BUILD_TIMESTAMP to include/kernel.mkAlexander Couzens2017-06-171-0/+6
| | | | | | | Fixes: 0aed054bec (build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS variables and move to kernel.mk) Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
* build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS variables and move to kernel.mkFelix Fietkau2017-06-071-0/+29
| | | | | | | | This allows packages to use kernel make options without the forced -C $(LINUX_DIR). It also makes it more clear that it to be called from kernel module packages directly. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix kmod package build on non-GNU systemsFelix Fietkau2017-05-291-1/+1
| | | | | | | BSD paste requires a filename argument, and it accepts - to use stdin as intended. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix possible issue with kmod package having multiple AutoLoad'sYousong Zhou2017-05-271-9/+12
| | | | | | | | | | | This commit contains the following changes - Use local shell var where appliable - The $(sort $$$$$$$$mods) call will have no expected effect - Avoid EEXIST when creating symlinks in /etc/modules-boot.d/ - Avoid duplicate arguments for insert_modules() in postinst-pkg Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* include: Determine MODULES_DIR correctly for external/git kernelsFlorian Fainelli2017-05-251-3/+5
| | | | | | | | | | | | | | When using external or git cloned kernels, any kind of modifications will alter KERNELRELEASE. LEDE still tries to stage modules in lib/modules/$(LINUX_UNAME_VERSION) and LINUX_UNAME_VERSION is based on KERNEL_PATCHVER (indirectly) so this does not work, and we lose all kinds of automatic modules loading. To remedy that, just cat $(LINUX_DIR)/include/config/kernel.release which is late enough the kernel has prepared this file, and is correctly tracking changes done throughout the kernel. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* kernel: allow subtarget specific KernelPackageStijn Tintel2017-01-041-0/+2
| | | | | | | | | Add a call to KernelPackage/$(1)/$(BOARD)/$(SUBTARGET) to the KernelPackage macro. This allows to add kernel packages for x86/64, without breaking x86. It's not possible to do this with BOARD, as BOARD=x86 for x86_64. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
* build: implement make check and make package/X/checkFelix Fietkau2016-12-171-1/+8
| | | | | | | | | | | | | | | | This is intended to be used for a wide array of package sanity checks. The first check that is implemented is for the hash of downloaded files. It checks: - Missing hash - Use of SHA256 instead of MD5 - dl/<file> hash not matching hash in makefile - deprecated MD5SUM variable The deprecated MD5SUM variable check is skipped for feeds/ until OpenWrt is updated as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: make the kernel build auto-clean the build dir like package buildsFelix Fietkau2016-08-051-2/+2
| | | | | | Previous behavior can be restored by using QUILT=1 on target/prepare Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: split scripts/metadata.pl into target-metadata.pl and package-metadata.plFelix Fietkau2016-06-071-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include: fix nonshared flag handlingJo-Philipp Wich2016-04-151-1/+2
| | | | | | | Fix nonshared flag handling to properly deal with source packages defining both kmod and non-kmod ipks. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include/kernel.mk: flag kmod packages as nonshared by defaultJo-Philipp Wich2016-04-061-0/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include: remove now unused PACKAGE_SUBDIR variableJo-Philipp Wich2016-04-131-1/+0
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* include/kernel: sort module lists for reproducibilityFelix Fietkau2016-01-281-2/+2
| | | | | | | | | | | This is to get reproducible builds of, eg, the kmod-sched ipkg. Locale preferences can change build order, but the locale is already been defined for the entire build process, so it doesn't need to be specified here. Signed-off-by: bryan newbold <bnewbold@robocracy.org> SVN-Revision: 48540
* include: restrict separate kmod repo handling to base packagesJo-Philipp Wich2016-01-241-1/+1
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48479
* include: group kmod ipk files into a "kernel" subdirectoryJo-Philipp Wich2016-01-241-0/+1
| | | | | | | | | | This is useful to just use the kmods from an official build while supplying base packages from a custom feed or the other way around; for just overriding the kmods with a local repo while using official repos for the rest. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 48475
* build: remove SDK special case for kernel module packagesFelix Fietkau2016-01-111-1/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48207
* linux: add support of Synopsys ARC770-based boardsFelix Fietkau2015-11-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces support of new boards with ARC cores. [1] Synopsys SDP board This is a new-generation development board from Synopsys that consists of base-board and CPU tile-board (which might have a real ASIC or FPGA with CPU image). It sports a lot of DesignWare peripherals like GMAC, USB, SPI, I2C etc and is intended to be used for early development of ARC-based products. [2] nSIM This is a virtual board implemented in Synopsys proprietary software simulator (even though available for free for open source community). This board has only serial port as a peripheral and so it is meant to be used for runtime testing which is especially useful during bring-up of new tools and platforms. What's also important ARC cores are very configurable so there're many variations of options like cache sizes, their line lengths, additional hardware blocks like multipliers, dividers etc. And this board could be used to make sure built software still runs on different HW configurations. Cc: Felix Fietkau <nbd@openwrt.org> Cc: Jo-Philipp Wich <jow@openwrt.org> Cc: Jonas Gorski <jogo@openwrt.org> Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> SVN-Revision: 47589
* include/kernel.mk - better search for ARCHFelix Fietkau2015-11-021-5/+5
| | | | | | | | | | | | | | | | | If "findstring" is used without leading and trailing spaces unexpected matches may happen. For example consider ARC=arc then "findstring $(ARCH)" will report a false match with "aarch64". But "findstring $ARCH " (note trailing space) will correctly skip matches for both "aarch64" and "aarch64_be". This patch is built-tested against NetGear WNDR3800. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Felix Fietkau <nbd@openwrt.org> Cc: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 47359
* kernel: assume modules.builtin is always presentJonas Gorski2015-07-051-9/+5
| | | | | | | | | | | | | We do not support old kernel versions not generating modules.builtin anymore, so assume it will always be present and check for modules to be built in first. This prevents old modules being packages up after changing the kernel config to include them in the kernel without cleaning the kernel tree. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 46182
* modules: fix postinst generation for kernel modulesJohn Crispin2015-04-101-6/+6
| | | | | | | | | Fixes ticket #19352. Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 45367
* include/kernel.mk: add KernelPackage/conffiles macroNicolas Thill2015-04-021-0/+6
| | | | | | Signed-off-by: Nicolas Thill <nico@openwrt.org> SVN-Revision: 45245