aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel-defaults.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: fix regression for kernels < 5.10Sebastian Kemper2021-05-251-2/+7
| | | | | | | | | | | | | | | | | | | | This fixes a regression introduced with commit 5ed1e5140a80558ab47fd70410ae3242bed5becf ("build: build kernel image before building modules/packages"). Before this commit the make target would always include "modules", resulting in a MODPOST and a complete Module.symvers file. Since this commit a MODPOST of the kernel modules is not guaranteed for kernels < 5.10. This results in some broken SDKs in which external packages that depend on exported symbols from kernel modules fail to compile. Adding "modules" back to the calls to the CompileImage defines fixes the regression. For kernels > 5.10 this is not needed, but it doesn't cause any harm either. Tested with kernels 5.4.x and 5.10.x. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
* kernel-defaults: fix external kernel build when user_headers is missingMatt Merhar2021-05-231-1/+3
| | | | | | | Use an 'if' so the absence of $(LINUX_DIR)/user_headers doesn't make the line evaluate to false and cause the build to fail. Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
* build: introduce $(MKHASH)Leonardo Mörlein2021-05-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, it was assumed that mkhash is in the PATH. While this was fine for the normal build workflow, this led to some issues if make TOPDIR="$(pwd)" -C "$pkgdir" compile was called manually. In most of the cases, I just saw warnings like this: make: Entering directory '/home/.../package/gluon-status-page' bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found bash: line 1: mkhash: command not found [...] While these were only warnings and the package still compiled sucessfully, I also observed that some package even fail to build because of this. After applying this commit, the variable $(MKHASH) is introduced. This variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the correct path. Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
* build: use numeric uid/gid on cpio callsFelix Fietkau2021-03-031-1/+1
| | | | | | | There are systems that don't have the 'root' group, so don't rely on host specific user/group names Signed-off-by: Felix Fietkau <nbd@nbd.name>
* treewide: fix spelling 'seperate' -> 'separate'Daniel Golle2021-02-281-3/+3
| | | | | | | This popular spelling mistake was also introduced by myself lately. Fix it everywhere. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* include: use cpio from staging dirDavid Bauer2021-02-281-1/+1
| | | | | | | As we built our own CPIO now, use this version instead of whatever the host may or may not provide. Signed-off-by: David Bauer <mail@david-bauer.net>
* image: allow building FIT and uImage with ramdiskDaniel Golle2021-02-241-0/+26
| | | | | | | | | | | | | Instead of embedding the initrd cpio archive into the kernel, allow for having an external ramdisk added to the FIT or uImage. This is useful to overcome kernel size limitations present in many stock bootloaders, as the ramdisk is then loaded seperately and doesn't add to the kernel size. Hence we can have larger ramdisks to host ie. installers with all binaries to flash included (or a web-based firmware selector). In terms of performance and total size the differences are neglectible. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* build: fix build with CONFIG_STRIP_KERNEL_EXPORTSFelix Fietkau2021-02-171-3/+3
| | | | | | Only use symtab.h on the final kernel link Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: make zstd initramfs selectableFelix Fietkau2021-02-161-1/+1
| | | | | | fix typo in kernel initramfs zstd compression option Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: build kernel image before building modules/packagesFelix Fietkau2021-02-161-3/+3
| | | | | | | This is needed for linux 5.10, where modules.builtin is generated from vmlinux.o 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>
* kernel-defaults: Manage the enabling/disabling of ZSTDFlorian Fainelli2021-01-091-0/+1
| | | | | | | | Linux 5.9 introduces support for ZSTD ramdisk and initrd compression, make sure we enable/disable the relevant options when building an initramfs enabled kernel. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* kernel-defaults: Delete external source tree user_headersFlorian Fainelli2021-01-091-0/+1
| | | | | | | | | | When we use an external kernel tree which may not have been fully cleaned, there may be user_headers left which do not match the target architecture, leading to build failures for packages that do an explicit inclusion of user_headers (such as iproute2 or iptables). Make sure we delete them while preparing the directory. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* build: make testing kernel decompression more portableFelix Fietkau2020-12-051-1/+1
| | | | | | | On non-GNU systems, zcat often does not handle gzip decompression. Use gzip -dc like the regular unpack command Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel-defaults: ensure SOURCE_DATE_EPOCH on /initPaul Spooren2019-10-021-0/+1
| | | | | | | | | | This is a follow up of 8cb13f4e6d which sets the right timestamp for the /init file in initramfs. The previous patch doesn't cover it as the files appear to come from a later step during compilation. CC: Alexander Couzens <lynxis@fe80.eu> Signed-off-by: Paul Spooren <mail@aparcar.org>
* kernel: fix downloading rcX releasesRafał Miłecki2018-12-031-2/+8
| | | | | | | | 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>
* config: don't define the same symbol twiceKoen Vandeputte2018-01-171-1/+0
| | | | | | | | | | | | | | | | | In commit fce35bce0f6e ("config: support new symbol intro'd in kernel 4.12") I forgot to remove the initial debug test line. This clearly is wrong as the same symbol is defined conditionally in the line below as it should be. I looked over it as I just checked if the symbol was present now upon testing it. Fixes: fce35bce0f6e ("config: support new symbol intro'd in kernel 4.12") Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* config: support new symbol intro'd in kernel 4.12Koen Vandeputte2018-01-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbol CONFIG_INITRAMFS_FORCE allows to ignore the value passed by the bootloader. By default, all symbols containing INITRAMFS are wiped from the final config and then re-added conditionally. Add support for this symbol, as the build will stop otherwise questioning the user about this option: * Restart config... * * * General setup * Cross-compiler tool prefix (CROSS_COMPILE) [] Compile also drivers which will not load (COMPILE_TEST) [N/y/?] n ... Initial RAM filesystem and RAM disk (initramfs/initrd) support (BLK_DEV_INITRD) [Y/n/?] y Initramfs source file(s) (INITRAMFS_SOURCE) [] Ignore the initramfs passed by the bootloader (INITRAMFS_FORCE) [N/y/?] (NEW) Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
* build: move definition of KBUILD_BUILD_TIMESTAMP to include/kernel.mkAlexander Couzens2017-06-171-6/+0
| | | | | | | 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-29/+4
| | | | | | | | 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>
* include: Do not alter KERNELRELEASE for external/git kernelsFlorian Fainelli2017-05-251-1/+6
| | | | | | | | | In case we use external and/or git cloned kernels, let the kernel determine the appropriate KERNELRELEASE. We cannot used LINUX_UNAME_VERSION because that one gets determined at a later time, when the kernel is already built proper. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* Revert "kernel: prevent addition of scm marker to localversion"Florian Fainelli2017-05-251-4/+0
| | | | | | | | | | This reverts commit 0df2c6563a3537ed21b28a9fb6874bf2718afd05 since it gets in the way of identifying properly which kernel we are running. This is particularly important if LEDE is using external kernels/git cloned kernels. We want to make sure we only load modules from that specific kernel. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* kernel: move initramfs's init script out of base-filesRafał Miłecki2017-04-041-1/+1
| | | | | | | | Keeping it in base-files was resulting in adding it to the base-files package. This file is meant to be included manually for initramfs images only. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
* kernel: do not try to copy vmlinux out of arch/$(ARCH)/bootFelix Fietkau2017-03-221-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: speed up build system by getting rid of redundant workFelix Fietkau2017-03-161-1/+3
| | | | | | | | | KERNELRELEASE contains a $(shell) call which is evaluated over and over again. The call to checksyscalls.sh is unnecessary for LEDE and also takes a few seconds to complete. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use mkhash to replace various quirky md5sum/openssl callsFelix Fietkau2017-01-051-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/kernel: Switch to git download methodFlorian Fainelli2016-12-041-10/+1
| | | | | | | | | Utilize the existing git download logic from include/download.mk and migrate the kernel download over to it. This avoids repeatedly cloning kernel sources after a make target/linux/clean for instance. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> [fix build error]
* kernel: add STAGING_DIR_HOST/lib to host library search pathFelix Fietkau2016-09-291-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use perl instead of GNU date for KBUILD_BUILD_TIMESTAMPFelix Fietkau2016-08-231-1/+7
| | | | | | Fixes warning on non-Linux systems Signed-off-by: Felix Fietkau <nbd@nbd.name>
* kernel: prevent adding custom string to localversionJosua Mayer2016-08-181-0/+1
| | | | | | | | | When the kernel build picks up a localversion file in the source tree, that string is unconditionally appended to LOCALVERSION and affects the uname string. Make sure to delete any such file. Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
* kernel: prevent addition of scm marker to localversionJosua Mayer2016-08-181-0/+4
| | | | | | | | | When building the kernel from a git repository, the kernel build appends either a + or a short commit hash to localversion. This behaviour can be prevented by passing the empty LOCALVERSION variable to make. Signed-off-by: Josua Mayer <josua.mayer97@gmail.com>
* kernel: check SOURCE_DATE_EPOCH before setting KBUILD_BUILD_TIMESTAMPJonas Gorski2016-08-131-1/+1
| | | | | | Make sure SOURCE_DATE_EPOCH actually contains something. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* kernel: allow reproducable buildsJonas Gorski2016-08-131-0/+2
| | | | | | | | | | | | Similar how we fix the file times in the filesystems, fix the build time of the kernel, and make the build number static. This should allow the kernel build to be reproducable when combined with setting the KERNEL_BUILD_USER and _DOMAIN in case of different machines. The reproducability only applies to non-initramfs kernels, those still require additional changes. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* kernel: make the kernel build auto-clean the build dir like package buildsFelix Fietkau2016-08-051-1/+1
| | | | | | 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>
* kernel: Revert "kernel: set root on NFS when enabled"Florian Fainelli2016-02-111-13/+0
| | | | | | | | | | This reverts r48591, users needing NFS root will know how to configure their platform and kernel command-line appropriately. Reported-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 48689
* kernel: enable CONFIG_KALLSYMS_UNCOMPRESSED=yFelix Fietkau2016-02-081-1/+1
| | | | | | | | | It was enabled ages ago when it was added. It still saves about 10k after LZMA, so let's enable it again. Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48680
* kernel: set root on NFS when enabledFlorian Fainelli2016-02-011-0/+13
| | | | | | | | | Replace the configured root device with a NFS root device and automatic IP configuration for booting over NFS. Signed-off-by: Florian Fainelli <florian@openwrt.org> SVN-Revision: 48591
* include/kernel: add custom USER/DOMAIN config optionsFelix Fietkau2016-01-281-0/+2
| | | | | | | | | | | | | | | These allow the generated kernel's build metadata to be defined explicitly. This metadata is reported, eg, at boot time and in `uname -a` on running systems. If the variables aren't configured, the current build system username and hostname are used as normal. The motivation for this option is to achive reproducible (bit-for-bit identical) kernel builds of official openwrt releases. Signed-off-by: bryan newbold <bnewbold@robocracy.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48541
* build: skip rebuild of kernel images if the source did not changeFelix Fietkau2016-01-061-7/+9
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48145
* build: suppress unnecessary kernel config rewrites to speed up buildFelix Fietkau2016-01-061-5/+10
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 48143
* build: Allow kernel modules to set build ID debug symbolFelix Fietkau2015-10-301-1/+2
| | | | | | | | | | | | | | | | | | | | This change adds support for specifying a build ID for kernel modules. This is done by setting PKG_BUILD_ID to a hexadecimal string, which will then be passed to the kernel linker. In addition, when this flag is set, the build ID debug symbol (.note.gnu.build-id) will not be stripped from the kernel module. This symbol is exported in sysfs by the kernel (if the kernel is compiled with CONFIG_KALLSYMS) and so can be used to uniquely identify a version of a kernel module in a running kernel. This is useful for keeping track of different versions of a module when doing experiments and development. Modules that specify the build ID will be ~100 bytes larger (depending on the length of the build ID specified). There is no size difference for kernel modules that do not set this variable. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> SVN-Revision: 47290
* config: add an option to enable KPROBEJohn Crispin2015-04-011-1/+0
| | | | | | Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org> SVN-Revision: 45212
* build: remove obsolete references to cris and avr32Felix Fietkau2015-03-241-5/+0
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 44965
* include: pass kernel version when generating kconfig overridesJo-Philipp Wich2015-01-291-2/+2
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44189
* kernel: allow specifying kernel images to be copied separately from kernel ↵Felix Fietkau2014-12-111-3/+4
| | | | | | | | make command line Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 43619
* build: remove useless quote stripping for KERNELNAME, add fallback for it in ↵Felix Fietkau2014-10-051-9/+4
| | | | | | | | the kernel build command line Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42781
* build: make sure modules are modposted after initramfs image is builtFelix Fietkau2014-10-051-2/+2
| | | | | | | | | | | | | | Otherwise the modpost steps for individual modules that are compiled manually (using make package/<name_of_module>/install) will give warning of missing symbols when that module depends other modules. This is caused by the Module.symvers file not containing any symbols anymore of external modules when the initramfs image is built without specifically giving the modules target. Signed-off-by: Tjalling Hattink <t.hattink@fugro.nl> SVN-Revision: 42773
* target/linux/*/image/Makefile: eliminate more LINUX_DIR usersJohn Crispin2014-07-211-0/+1
| | | | | | Signed-off-by: John Crispin <blogic@openwrt.org> SVN-Revision: 41792
* include: Allow git kernel branch selectionJohn Crispin2014-06-021-0/+4
| | | | | | | | | This allows the selection of a specific branch in the menuconfig when using a kernel downloaded from GIT. Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com> SVN-Revision: 40946