aboutsummaryrefslogtreecommitdiff
path: root/linux/linux.mk
Commit message (Collapse)AuthorAgeFilesLines
* linux: rename config optionGravatar Yann E. MORIN2020-06-071-1/+1
| | | | | | | | | | | | | Commit a4eef9a3959 (linux: introduce BR2_KERNEL_DTB_KEEP_DIRNAME) introduced a new config option, but its name was not matching the naming-scheme of the other config options. Rename it. We don't need legacy handling, because that config option was added very recently and was never part of a release. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
* linux: introduce BR2_KERNEL_DTB_KEEP_DIRNAMEGravatar Michael Walle2020-06-061-4/+5
| | | | | | | | | | | | | | | | | In linux, newer architectures like ARM64 and RISC-V keep their device tree sources organized by subdirectories. When these device trees are installed by the kernel they will keep the directory names. But buildroot strips the prefixes when installing them into /boot or the images directory. Sometimes the bootloader references the device tree by name (e.g. u-boot has the environment variable 'fdtfile') which also includes the prefix directory. Make it possible to keep this prefix during installation, so we can be compatible with other distributions and make it easier for the user, because he doesn't have to change that environment variable. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
* Merge branch 'next'Gravatar Thomas Petazzoni2020-06-021-2/+0
|\ | | | | | | | | | | | | | | | | | | A few conflicts had to be resolved: - Version number and hash for mesa3d-headers/mesa3d - Patches added in qemu, and the qemu version number - The gnuconfig README.buildroot Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
| * package/linux-tools/perf: bear the kernel options mungingGravatar Yann E. MORIN2020-05-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | perf by itself is not a standalone package; instead, it is part of a bigger package, linux-tools. Even though perf is the only one to need kernel .config fixups, we still do it in a generic way, as it blends nicely in the existing variables, which all use a loop over all the tools. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* | linux: forcibly disable use of gcc pluginsGravatar Yann E. MORIN2020-05-311-0/+4
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The soon-to-be-released linux 5.7 has changed the way it detects the ability of gcc to use plugins, when it dropped support for gcc 4.7 or older [0]. To detect the ability to use gcc plugins, the kernel has to check whether the host gcc is capable enough to build them. When we call one of the configurator for the Linux kernel, we explicitly pass a value of HOSTCC=$(HOSTCC_NOCCACHE), because there might be a discrepancy between the ncurses headers and libraries as found by the Linux kconfig build [1] [2]. But then, when we build the kernel, we pass another value to use [3] HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)" which boils down to roughly: gcc -I.../host/include -L.../host/lib -Wl,-rpath,.../host/lib This is needed so that at build time, the kernel can build host tools that link with our openssl et al. So, the two HOSTCC we pass to the kernel may have different behaviours. For example, on a machine where gmp is missing in the system, it is available in $(O)/host/ when using an internal toolchain (and under a few other conditions). In that case, when configuring the kernel, it decides that the host compiler can't build plugins, so the dependencies of CONFIG_GCC_PLUGINS are not met, and that option is not present in the linux' .config file (neither as "=y" nor as "is not set"). But then, when we build the kernel, the host compiler suddenly becomes capable of building the plugins, and the internal syncconfig run by the kernel will notice that the dependencies of CONFIG_GCC_PLUGINS are now met, and that the user shall decide on its value. And this blocks a build on an interactive console (abbreviated): * Restart config... * GCC plugins GCC plugins (GCC_PLUGINS) [Y/n/?] (NEW) _ But most problematic is the behaviour when run in a shell that is not interactiove (e.g. a CI job or such) (abbreviated): * Restart config... * GCC plugins GCC plugins (GCC_PLUGINS) [Y/n/?] (NEW) Error in reading or end of file. Generate some entropy during boot and runtime (GCC_PLUGIN_LATENT_ENTROPY) [N/y/?] (NEW) Error in reading or end of file. Randomize layout of sensitive kernel structures (GCC_PLUGIN_RANDSTRUCT) [N/y/?] (NEW) Error in reading or end of file. * Memory initialization Initialize kernel stack variables at function entry > 1. no automatic initialization (weakest) (INIT_STACK_NONE) 2. zero-init structs marked for userspace (weak) (GCC_PLUGIN_STRUCTLEAK_USER) (NEW) 3. zero-init structs passed by reference (strong) (GCC_PLUGIN_STRUCTLEAK_BYREF) (NEW) 4. zero-init anything passed by reference (very strong) (GCC_PLUGIN_STRUCTLEAK_BYREF_ALL) (NEW) choice[1-4?]: Error in reading or end of file. Poison kernel stack before returning from syscalls (GCC_PLUGIN_STACKLEAK) [N/y/?] (NEW) Error in reading or end of file. Enable heap memory zeroing on allocation by default (INIT_ON_ALLOC_DEFAULT_ON) [N/y/?] n Enable heap memory zeroing on free by default (INIT_ON_FREE_DEFAULT_ON) [N/y/?] n The most obvious and simple solution would be to unconditionally disable gcc plugins altogether, in the KCONFIG_FIXUP hook. But that can't work either, because after applying the fixups, we call olddefconfig (or the likes) with the incapable HOSTCC, so the disabled option would be removed anyway, and we'd be back to square one. So, in addition to the above, we also forcibly hack the same call just before actually building the kernel. Note that the two are needed: the one in the fixups is needed for those that have a system that already allows building gcc plugins, and the second is needed in the other case, where the system does not allow it but would work with our additional headers and libs in $(O)/host/. The two ensure there is a very similar experience in the two situations. Forcibly disabling the use of gcc plugins is not a regression on our side: it has never been possible to do so so far. We're now making sure that can't work by accident. Reported-by: Ganesh <ganesh45in@gmail.com>, Reported-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Michael Walle <michael.walle@kontron.com> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Tested-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/libapparmor: bear the kernel options mungingGravatar Thomas Petazzoni2020-05-011-5/+0
| | | | Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/kernel-module-imx-gpu-viv: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-2/+0
| | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Gary Bisson <bisson.gary@gmail.com> Cc: Refik Tuzakli <tuzakli.refik@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/libselinux: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-8/+0
| | | | | | | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Cc: Matt Weber <matthew.weber@rockwellcollins.com> Cc: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com> Reviewed-by: Adam Duskett <aduskett@gmail.com> Tested-by: Adam Duskett <aduskett@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/wireguard-linux-compat: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-6/+0
| | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/xtables-addons: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-5/+0
| | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/iptables: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-5/+0
| | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/sunxi-mali-mainline-driver: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-3/+0
| | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Giulio Benetti <giulio.benetti@benettiengineering.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/smack: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-4/+0
| | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Eric Le Bihan <eric.le.bihan.dev@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/systemd: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-7/+0
| | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/pcm-tools: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-2/+0
| | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Carlos Santos <unixmania@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/ktap: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-5/+0
| | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Anders Darander <anders@chargestorm.se> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/intel-micro-code: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-3/+0
| | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Carlos Santos <unixmania@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/audit: bear the kernel options mungingGravatar Yann E. MORIN2020-05-011-3/+0
| | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Adam Duskett <aduskett@gmail.com> Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: allow packages to set kernel config optionsGravatar Yann E. MORIN2020-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the linux kernel will apply some fixups on its .config file, based on whether some packages are enabled or not. That list of conditional fixups is getting bigger and bigger with each new package that needs such fixups, culminating with the pending firewalld one [0]. Furthermore, these fixups are not accessible to packages in br2-external trees. Add a new per-package variable, that packages may set to the commands to run to fixup the kernel .config file, which is added at the end of the linux' own fixups. This opens the possibility to write things like; define FOO_LINUX_CONFIG_FIXUPS $(call KCONFIG_ENABLE_OPT,BLA) endef Of course, it also opens the way to run arbitrary commands in there, but any alternative that would be declarative only, such as a list of options to enable or disable (as an example): FOO_LINUX_CONFIG_FIXUPS = +BAR -FOO +BUZ="value" .. is not very nice either, and such lists fall flat when a value would have a space. For packages that we have in-tree, we can ensure they won't play foul with their _LINUX_CONFIG_FIXUPS. For packages in br2-external trees, there's nothing we can do; users already have the opportunity to hack into the linux configure process by providing LINUX_PRE_CONFIGURE_HOOKS or LINUX_POST_CONFIGURE_HOOKS anyway... .. which brings the question of why we don't use that to implement the per-package fixups. We don't, because _PRE or _POST_CONFIGURE_HOOKS are run after we run 'make oldconfig' to sanitise the mangled .config. [0] http://lists.busybox.net/pipermail/buildroot/2020-March/278683.html Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Adam Duskett <aduskett@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: don't specify .config to mungeGravatar Yann E. MORIN2020-05-011-74/+74
| | | | | | | Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: enable AppArmor-related options if neededGravatar Angelo Compagnucci2020-04-201-0/+5
| | | | | | | | | | | | | | | | | | Using AppArmor requires support in the kernel, so do for AppArmor what we did for SElinux, and enabled the necessary options. Note that a single LSM can be the default one, so as of today, SELinux wins, by virtue of being the last to be enabled. Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com> [yann.morin.1998@free.fr: - don't force DEFAULT_SECURITY_APPARMOR, it does not exist in all kernel versions - move closer to SELinux - split into its own patch, write a commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
* linux: do not install images in subdirectoriesGravatar Thomas Petazzoni2020-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux kernel image is typically found in arch/ARCH/boot/, which is why LINUX_IMAGE_PATH is defined as: LINUX_IMAGE_PATH = $(LINUX_ARCH_PATH)/boot/$(LINUX_IMAGE_NAME) However, on MIPS, some kernel image types are available from arch/mips/boot/compressed, or even at the top-level directory. For such cases, LINUX_IMAGE_NAME might be set (using BR2_LINUX_KERNEL_IMAGE_NAME) to values such as: compressed/vmlinux.bin.z or ../../../uzImage.bin Except that the line: $(INSTALL) -m 0644 -D $(LINUX_IMAGE_PATH) $(1)/$(LINUX_IMAGE_NAME) will lead to such images be installed in: $(TARGET_DIR)/boot/compressed/vmlinux.bin.z $(BINARIES_DIR)/compressed/vmlinux.bin.z and: $(TARGET_DIR)/boot/../../../uzImage.bin $(BINARIES_DIR)/../../../uzImage.bin which of course is completely bogus. So let's install them under their name, not their full relative path to arch/ARCH/boot/. Reported-by: Paul Cercueil <paul@crapouillou.net> Cc: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: run depmod only if modules are enabledGravatar Carlos Santos2020-03-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the kernel configuration CONFIG_MODULES disabled, there's no /lib/modules/<version> directory, causing this: depmod: ERROR: could not open directory [...]/target/lib/modules/4.19.8: No such file or directory depmod: FATAL: could not search modules: No such file or directory Makefile:745: recipe for target 'target-finalize' failed Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/483712831 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712817 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712814 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712796 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712729 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712727 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712698 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712691 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712660 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712573 https://gitlab.com/buildroot.org/buildroot/-/jobs/483712574 Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Carlos Santos <unixmania@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: Allow modprobe for out-of-tre modulesGravatar Carlos Santos2020-03-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a package installs a kernel module, it is currently not possible to have it loaded with modprobe or when the kernel requests an alias for it, as the module is not listed in /lib/modules/<kernel-version>/modules.dep and the associated files. So, we need to run depmod after all packages are installed, to register any such out-of-tree module. This means we should be able to let go of calling depmod at the time the kernel is installed, but if we pass an invalid command, the kernel whines: DEPMOD 5.4.27 ./scripts/depmod.sh: 46: /dev/null: Permission denied make[2]: *** [Makefile:1326: _modinst_post] Error 126 This is because the kernel does not directly call to depmod, but uses a wrapper that is not happy if depmod is not depmod. Since the call to depmod does not cost much, we just keep it. Signed-off-by: Carlos Santos <unixmania@gmail.com> [yann.morin.1998@free.fr: - keep calling depmod when installing kernel - expand commit log ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
* linux: add automatic selinux config selectionGravatar Adam Duskett2020-03-141-0/+8
| | | | | | | | | | | | | | | | | | | | Enabling SELinux support in the kernel requires several options, many of which are in different areas. These options are as follows: - CONFIG_AUDIT - CONFIG_DEFAULT_SECURITY_SELINUX - CONFIG_INET - CONFIG_NET - CONFIG_SECURITY - CONFIG_SECURITY_NETWORK - CONFIG_SECURITY_SELINUX As such, if a user selects the libselinux package, it is much easier to select these options for them, much like we already do with other packages such as systemd or iptables. Signed-off-by: Adam Duskett <Aduskett@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: use correct conditional for wireguard kernel config fixupGravatar Peter Korsgaard2020-02-161-1/+1
| | | | | | | | | | | | Commit de591c5c3a93 (package/wireguard-linux-compat: new package) split up the wireguard package in wireguard-tools and wireguard-linux-compat, but forgot to update the conditional in linux.mk, so the kernel config fixups needed for wireguard are no longer applied. Update the conditional to use the BR2_PACKAGE_WIREGUARD_LINUX_COMPAT symbol instead. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: license files hashes are only valid for latest known versionGravatar Markus Mayer2020-02-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | The content of COPYING changed between v4.16 and v4.17. Since kernels before and after the change are supported, storing the hash for this file will cause an error during "make legal-info" when a kernel with the respective other hash is being used. So, for the kernel, we do like we did for ATF: the license file is only listed for the latest version. In the process, add the missing license files referenced from COPYING and align the fields to the new spacing convention. Signed-off-by: Markus Mayer <mmayer@broadcom.com> [yann.morin.1998@free.fr: - only list the licenses files for the latest version - restore the hash for COPYING - introduce hashes for the two new license files - expand commit log accordingly ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux/linux.mk: use HOST_MAKE_ENV rather than TARGET_MAKE_ENVGravatar Peter Korsgaard2020-02-021-7/+5
| | | | | | | | | | | | | | | | | | | While the kernel is built for the target, the build may need various host libraries depending on config (and kernel version), so use HOST_MAKE_ENV instead of TARGET_MAKE_ENV. In particular, this ensures that our host-pkgconf will look for host libraries and not target ones. Fixes building scripts/dtc for Buildroot configurations enabling libyaml and host-pkgconf for kernels after commit 067c650c45 (dtc: Use pkg-config to locate libyaml). With this enabled, we can drop the PKG_CONFIG_* variables for the _NEEDS_HOST_LIBELF conditional, as those are included in HOST_MAKE_ENV. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/linux: fix LINUX_PKGDIR with br2-external linux-extensionsGravatar Yann E. MORIN2020-01-251-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When 'make' includes a new Makefile, it appends its path to the MAKEFILE_LIST variable. From that variable, we construct a few set of derivative variables: pkgdir = $(dir $(lastword $(MAKEFILE_LIST))) pkgname = $(lastword $(subst /, ,$(pkgdir))) Essentially, pkgdir is the full directory where the package is located (either relative to Buildroot's top directory for in-tree packages, or absolute for packages in br2-external trees), while pkgname is the last component of that directory. pkgdir is in turn used to seed FOO_PKGDIR. This all happens when we eventually call the package-generic infra, later down in the file. When they are parsed, the Makefiles for each linux-extensions are appended to MAKEFILE_LIST, after the linux.mk one. But since they are located in the same directory as the main linux.mk, the last component of MAKEFILE_LIST, which is no longer the main linux.mk, will still yield the correct values for the linux package. This is a tough assumption we made there and then. When we added the support for br2-external linux extensions, we where very cautious to explicitly scan them from a directory named 'linux', so that this would yield the correct package name. And that worked well so far, until someone needed to build an older kernel, for which our conditional patch is needed, and which just failed: /bin/bash: [...]/buildroot-external-linux-test/linux//0001-timeconst.pl-Eliminate-Perl-warning.patch.conditional: No such file or directory When we scan linux extensions from a br2-external tree, the last component of MAKEFILE_LIST is no longer in the same directory as the main linux.mk, and thus the assumption above falls to pieces... Again, when we added support for linux extensions from br2-external, although we cared about the package name (pkgname), we completely missed out on the package directory, and the LINUX_PKGDIR variable. We do not have a very clean way out of this mess, but we have a nice dirty trick: Scan the linux extensions from a br2-external tree before we scan the in-tree ones. That way, the last component of MAKEFILE_LIST is back to one that is in the same directory as the main linux.mk, and we're back on tracks. This is still very fragile, though, but short of a complete overhaul on how packages are parsed and evaluated, this is the best we can come in short order. Reported-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Heiko Thiery <heiko.thiery@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Tested-by: Heiko Thiery <heiko.thiery@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: Set MMU page size for ARC processorsGravatar Alexey Brodkin2019-12-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ARC processors have configurable size of MMU page. This configuration happens during ASIC design and couldn't be changed in final silicone not to mention runtime changes. Given PAGE_SIZE macro is used a lot throughout the Linux kernel sources we just hardcode a required value during the kernel configuration. We used to support different MMU page sizes for ARC in Buildroot for quite some time now but so far we only tweaked uClibc on the matter. That left us with the kernel configured with whatever was in used defconfig. In most of real cases that's OK because typically we're building firmware for a particular ASIC which is supposed to have a unique kernel defconfig. But if we're dealing with FPGA-based boards or even simlators like Synopsys DesignWare nSIM or QEMU it's possible to have dfferent MMU page size configured in that target mostly for the sake of testing. And so we're trying to solve 2 problems here: 1. Make sure both user-space (via libc settings) and the Linux kernel are "on the same page", i.e. expect to use the same MMU page size. 2. Simplify process of testing different page sizes. As now we first need to set page size in Buildroot and then in the kernel via "make linux-configure" or via Kconfig fragment. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> [yann.morin.1998@free.fr: simplify the conditions] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
* linux: add option to select the CIP real-time kernelGravatar Angelo Compagnucci2019-11-261-1/+1
| | | | | | | | This patch adds Linux CIP RT, the PREEMPT_RT real-time variant maintained by the CIP team. Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: change CIP kernel download methodGravatar Angelo Compagnucci2019-11-201-1/+2
| | | | | | | | | Downloading from https a tarball is faster than cloning a git repo. If needed, BR2_LINUX_KERNEL_CUSTOM_GIT can be used as a fallback mechanism to downlad the CIP kernel with git. Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: fix indentationGravatar Pierre-Jean Texier2019-09-301-1/+1
| | | | | | | | | | | | Fixes: $: ./utils/check-package linux/* linux/linux.mk:528: expected indent with tabs 1318 lines processed 1 warnings generated Signed-off-by: Pierre-Jean Texier <pjtexier@koncepto.io> Acked-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: allow br2-externals to provide their own Linux extensionsGravatar McCabe, Robert J2019-09-281-4/+9
| | | | | | Signed-off-by: McCabe, Robert J <robert.mccabe@rockwellcollins.com> Acked-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/xtables-addons: bump to version 3.4Gravatar Christopher McCrory2019-09-151-1/+2
| | | | | | | | | | | | | | Add hash for LICENSE. This version works with linux kernel 5.0 and newer. It requires CONFIG_NF_NAT enabled in the kernel configuration, otherwise it fails to build: ERROR: "nf_nat_setup_info" [/home/thomas/projets/buildroot/output/build/xtables-addons-3.4/extensions/xt_DNETMAP.ko] undefined! Signed-off-by: Christopher McCrory <chrismcc@gmail.com> [Thomas: enable CONFIG_NF_NAT in the kernel configuration.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: Force CONFIG_NET=y when using mdev+devtempfs for /dev managementGravatar Titouan Christophe2019-07-311-0/+2
| | | | | | | | | Since mdev was switched to the daemon mode introduced in Busybox 1.31.0, it requires CONFIG_NET to be enabled in the kernel such that the mdev daemon can listen to netlink events. Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: disable Werror for powerpc kernelsGravatar Romain Naour2019-06-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >From patch [1] included in kernel >= 5.0: "The upcoming GCC 9 release extends the -Wmissing-attributes warnings (enabled by -Wall) to C and aliases: it warns when particular function attributes are missing in the aliases but not in their target. In particular, it triggers for all the init/cleanup_module aliases in the kernel (defined by the module_init/exit macros), ending up being very noisy. These aliases point to the __init/__exit functions of a module, which are defined as __cold (among other attributes). However, the aliases themselves do not have the __cold attribute. Since the compiler behaves differently when compiling a __cold function as well as when compiling paths leading to calls to __cold functions, the warning is trying to point out the possibly-forgotten attribute in the alias." Werror is set by default while building ppc kernel [2], but some warning can be introduced while building current kernel with newer compiler (for example building kernel 4.19 with gcc 9.1). For the same reason why we remove Werror in packages's compiler flags. Building with Werror is not bulletproof when we start using a newer compiler that introduce new warnings. This is the case here. Also this option is a bit strange since it's specific to ppc kernels: "The intention is to make it harder for people to inadvertantly introduce warnings in the arch/powerpc code." Other kernel developers on other arch may be interested by a similar/more generic option. So, It's clearly intended for kernel developers. Instead of backporting this patch [1] to kernel 4.19, select unconditionally the Kconfig option CONFIG_PPC_DISABLE_WERROR that allow to disable Werror. Fixes: https://gitlab.com/kubu93/toolchains-builder/-/jobs/205435741 [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=a6e60d84989fa0e91db7f236eda40453b0e44afa [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=ba55bd74360ea4b8b95e73ed79474d37ff482b36 [3] https://gitlab.com/bootlin/toolchains-builder Fix-suggested-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: build after intel-microcode if enabled for early loading supportGravatar Peter Korsgaard2019-05-241-1/+2
| | | | | | | | To support building in (a subset of) the intel-microcode files into the kernel using the CONFIG_EXTRA_FIRMWARE option, we need to ensure that the microcode files are installed before the Linux kernel is built. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: split calling "all" and "$(LINUX_TARGET_NAME)" targetsGravatar Thomas Petazzoni2019-04-241-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit ffbe46a5295ce4e0442728f2ad3e19afa7eaa8ed ("linux: simplify LINUX_BUILD_CMDS"), we changed LINUX_BUILD_CMDS to essentially do: make all $(LINUX_TARGET_NAME) Unfortunately, it turns out that it breaks the build of a number of defconfigs, with errors such as: fixdep: error opening file: arch/xtensa/boot/lib/.inftrees.o.d: No such file or directory Calling "all" and "$(LINUX_TARGET_NAME)" as separate make invocations avoids this problem, and fixes the build of several defconfigs. Fixes: ts7680_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339583 qemu_xtensa_lx60_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339553 roseapplepi_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339564 qemu_xtensa_lx60_nommu_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339554 qemu_ppc64_e5500_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339539 freescale_t2080_qds_rdb_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339455 arcturus_ucp1020_defconfig https://gitlab.com/buildroot.org/buildroot/-/jobs/199339399 Cc: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <peter@korsgaard.com> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> [Thomas: add comment in the code to explain why we call the two make targets separately, as suggested by Yann E. Morin] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: simplify LINUX_BUILD_CMDSGravatar Thomas Petazzoni2019-04-131-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently do the Linux build as follows: make <imagename> if modules enabled; make modules; fi However, Clement Léger recently reported that due to us not using the "all" target, the GDB scripts that the kernel can build when CONFIG_GDB_SCRIPTS is enabled are not built, since upstream kernel commit 67274c083438340ad16c1437caebc84e1253b224 (merged in v5.1) moved that logic to a separate scripts_gdb target, which is a dependency of the "all" target. While we could add some more logic to explicit generate the "scripts_gdb" target, this logic would fail on Linux < 5.1 for which this make target doesn't exist. So instead, let's simplify the build logic, and use: make all <imagename> The "all" target automatically depends on "modules" if CONFIG_MODULES is set, so we no longer need to explicit generate the "modules" target separately. As a result of this change, we may generate additional kernel images compared to what was done previously, but such images would anyway not be installed, and the additional build time is minimal. We did some research as to why the kernel build was done like this in Buildroot, and it's been like that since linux/linux.mk was added back in 2010 by commit 487e21cff69b30b404146b2ffb46959a728a4002 ("New, simpler, infrastructure for building the Linux kernel"). Reported-by: Clément Leger <cleger@kalray.eu> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* linux: use host pkg-config when host libelf is setGravatar Stuart Summers2019-04-131-5/+11
| | | | | | | | | | | | | | | | | | | | A patch was added to the Linux kernel in 5.1.0-rc3 which adds a requirement that the host build environment include pkg-config. Add the correct host-pkgconf dependency and environment variables to ensure Linux picks up the correct libraries. Move the existing LINUX_MAKE_ENV assignment earlier, to simplify the append-assignment in the libelf conditional block. Fixes: #11761 Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Yann E. MORIN <yann.morin.1998@free.fr> Suggested-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Stuart Summers <stuart.summers@intel.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Arnout: extend commit message as suggested by Yann] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* linux{, -headers}: support downloads of v5+Gravatar Arnout Vandecappelle (Essensium/Mind)2019-03-141-7/+2
| | | | | | | | | | | | | | | | With the arrival of linux v5.0, we need yet another condition to set _SITE correctly. Instead of continuing this madness, solve the problem generically: use v2.6 for 2.6.*, and use the number before the first dot in the other cases. While we're at it, remove the comment which has been incorrect since 80d7b68167a5c8893e906ace6b5f0b0166336406 (7 years ago). Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Tested-by: Jan Kundrát <jan.kundrat@cesnet.cz> Tested-by: Adam Duskett <aduskett@gmail.com> Reviewed-by: Adam Duskett <aduskett@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: don't check hashes for user-supplied patchesGravatar Yann E. MORIN2019-02-171-0/+3
| | | | | | | | | | | | | We have virtually no way to know the hashes for user-supplied patches, so we should just ignore them. Reported-by: Simon van der Veldt <simon.vanderveldt@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Peter Korsgaard <peter@korsgaard.com> Tested-by: Simon van der Veldt <simon.vanderveldt@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* linux: bump Linux CIP to version v4.4.171-cip30Gravatar Angelo Compagnucci2019-02-051-1/+1
| | | | | | | | This patch bumps the Linux CIP version to v4.4.171-cip30 and updates the download url to the new official one. Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: add option to enable support for Device Tree overlaysGravatar Titouan Christophe2019-02-031-0/+4
| | | | | | | | | | Add an option to compile device trees in Linux with symbol generation such that device tree overlays can be loaded on the target system Signed-off-by: Titouan Christophe <titouan.christophe@railnova.eu> [Arnout: remove "default n" and move setting of LINUX_MAKE_ENV to the place where the rest is set.] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* linux: use HOSTCC_NOCCACHE as kconfig HOSTCCGravatar Thomas Petazzoni2019-01-161-7/+10
| | | | | | | | | | | | | | | | | | | linux is a bit different than other kconfig-package, because it has "toolchain" in KCONFIG_DEPENDENCIES. Thanks to this, host-ccache *is* ready by the time kconfig invocations are made, so we could use $(HOSTCC) as the host compiler for kconfig related operations. However, for consistency with other kconfig-package packages, we chose to use $(HOSTCC_NOCCACHE) as well. We cannot rely on the default value of HOSTCC passed by the kconfig-package infrastructure, because $(LINUX_MAKE_FLAGS) also contains a HOSTCC definition that would override the one passed by the kconfig-package infrastructure. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* pcm-tools: new packageGravatar Carlos Santos2018-12-081-0/+2
| | | | | | | | | | | | | | | | Processor Counter Monitor (PCM) is an application programming interface (API) and a set of tools based on the API to monitor performance and energy metrics of Intel(R) Core(TM), Xeon(R), Atom(TM) and Xeon Phi(TM) processors. This package contains a patch on the pmu-query.py script to look for the pcm-core program at the default path. It's not nice to have a Buildroot specific patch but let's use one while we look for a solution that is acceptable upstream. Signed-off-by: Carlos Santos <casantos@datacom.ind.br> [Peter: Needs C++, force X86_MSR on in linux] Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* linux: ensure images/ exist before creating files thereGravatar Yann E. MORIN2018-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | When using an initramfs, on the first-pass build, we create a dummy cpio so that the build succeeeds. The real cpio will come later, and we'll do a second-pass build to use the actual cpio. However, when we touch that dummy cpio, the images/ directory may not yet exist, since commit d0f4f95e39 (Makefile: rework main directory creation logic) removed its creation at the begining of the build, to only at the moment we need it, i.e. during the *_INSTALL_IMAGES_CMDS steps. However, the linux build is not a _INSTALL_IMAGES_CMDS step, so there is no guarantee that images/ already exist at that time. Fix that by explicitly creating images/ before touching the dummy cpio. Reported-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Matthew Weber <matthew.weber@rockwellcollins.com> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: Matthew Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* Merge branch 'next'Gravatar Peter Korsgaard2018-12-021-0/+3
|\ | | | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
| * linux: enable MICROCODE_INTEL if intel-microcode is selectedGravatar Carlos Santos2018-11-121-0/+3
| | | | | | | | | | | | | | | | | | We already turn on kernel features for several packages, so let's do it for intel-microcode too, otherwise it's impossible to load the microcode (by means of iucode-tools). Signed-off-by: Carlos Santos <casantos@datacom.com.br> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>