Commit Graph

114 Commits (4a6795409d1520fd3da3e909a8bcf9d7fd0927bb)

Author SHA1 Message Date
Paul Spooren 4791afa734 kernel-defaults: ensure SOURCE_DATE_EPOCH on /init
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>
5 years ago
Rafał Miłecki 966ba6daa4 kernel: fix downloading rcX releases
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>
5 years ago
Koen Vandeputte d29e47f191 config: don't define the same symbol twice
In commit fce35bce0f ("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: fce35bce0f ("config: support new symbol intro'd in kernel
4.12")

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte fce35bce0f config: support new symbol intro'd in kernel 4.12
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>
6 years ago
Alexander Couzens e5fc15bf9a build: move definition of KBUILD_BUILD_TIMESTAMP to include/kernel.mk
Fixes: 0aed054bec (build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS
variables and move to kernel.mk)

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
7 years ago
Felix Fietkau 0aed054bec build: add KERNEL_MAKE and KERNEL_MAKE_FLAGS variables and move to kernel.mk
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>
7 years ago
Florian Fainelli b6746a6ffb include: Do not alter KERNELRELEASE for external/git kernels
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>
7 years ago
Florian Fainelli d0a6340717 Revert "kernel: prevent addition of scm marker to localversion"
This reverts commit 0df2c6563a 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>
7 years ago
Rafał Miłecki f6433eede7 kernel: move initramfs's init script out of base-files
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>
7 years ago
Felix Fietkau 370d740647 kernel: do not try to copy vmlinux out of arch/$(ARCH)/boot
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Felix Fietkau 1f12a3daaa kernel: speed up build system by getting rid of redundant work
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>
7 years ago
Felix Fietkau 84bd74057f build: use mkhash to replace various quirky md5sum/openssl calls
Signed-off-by: Felix Fietkau <nbd@nbd.name>
7 years ago
Florian Fainelli 9a08c0ba80 include/kernel: Switch to git download method
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]
8 years ago
Felix Fietkau 685ed1e072 kernel: add STAGING_DIR_HOST/lib to host library search path
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau f5860f898a build: use perl instead of GNU date for KBUILD_BUILD_TIMESTAMP
Fixes warning on non-Linux systems

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Josua Mayer 57ef81d78f kernel: prevent adding custom string to localversion
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>
8 years ago
Josua Mayer 0df2c6563a kernel: prevent addition of scm marker to localversion
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>
8 years ago
Jonas Gorski 86ec410418 kernel: check SOURCE_DATE_EPOCH before setting KBUILD_BUILD_TIMESTAMP
Make sure SOURCE_DATE_EPOCH actually contains something.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
8 years ago
Jonas Gorski 5fe923b15d kernel: allow reproducable builds
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>
8 years ago
Felix Fietkau 22ef1c83b3 kernel: make the kernel build auto-clean the build dir like package builds
Previous behavior can be restored by using QUILT=1 on target/prepare

Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Felix Fietkau 9ae952cf8c build: split scripts/metadata.pl into target-metadata.pl and package-metadata.pl
Signed-off-by: Felix Fietkau <nbd@nbd.name>
8 years ago
Florian Fainelli 09344fde2a kernel: Revert "kernel: set root on NFS when enabled"
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
8 years ago
Felix Fietkau 108a499c81 kernel: enable CONFIG_KALLSYMS_UNCOMPRESSED=y
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
8 years ago
Florian Fainelli d9fab87607 kernel: set root on NFS when enabled
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
8 years ago
Felix Fietkau b3f7902a06 include/kernel: add custom USER/DOMAIN config options
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
8 years ago
Felix Fietkau 4ab26a52ef build: skip rebuild of kernel images if the source did not change
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48145
8 years ago
Felix Fietkau 9c949b0dca build: suppress unnecessary kernel config rewrites to speed up build
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 48143
8 years ago
Felix Fietkau 3bbb927728 build: Allow kernel modules to set build ID debug symbol
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
9 years ago
John Crispin 3ec7ccf501 config: add an option to enable KPROBE
Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>

SVN-Revision: 45212
9 years ago
Felix Fietkau 5d9eeab64a build: remove obsolete references to cris and avr32
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 44965
9 years ago
Jo-Philipp Wich b941d2fd65 include: pass kernel version when generating kconfig overrides
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 44189
9 years ago
Felix Fietkau 9318930993 kernel: allow specifying kernel images to be copied separately from kernel make command line
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 43619
10 years ago
Felix Fietkau b0ef5e66fa build: remove useless quote stripping for KERNELNAME, add fallback for it in the kernel build command line
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 42781
10 years ago
Felix Fietkau a402b5c48d build: make sure modules are modposted after initramfs image is built
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
10 years ago
John Crispin 8295b1f7f2 target/linux/*/image/Makefile: eliminate more LINUX_DIR users
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41792
10 years ago
John Crispin 34106f4a1a include: Allow git kernel branch selection
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
10 years ago
John Crispin c77feae6be include: Clean-up kernel git command options management
The way git options are managed in kernel-defaults.mk makes additions

difficult. If requires different code path for each option; it's
ok so far as we handle only one option, but if we want to make the git
clone mechanism more flexible, more option will be required, which
will become tedious.

So; we'll move the GIT options into a variable, that may or may not be
set depending on the configuration, and we'll pass this variable to the
git command.

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 40945
10 years ago
John Crispin 45e3540a3f config: Remove KERNEL_GIT_LOCAL_REPOSITORY option
The GIT_LOCAL_REPOSITORY option adds the --reference argument to the
git clone kernel command line, if KERNEL_GIT_CLONE_URI is set.

This option is intended to speed-up the repo creation by using local
objets rather than downloading it. However, a local repo can be cloned
much faster by setting GIT_LOCAL_REPOSITORY directly to the local tree.

In that case, git clone will bypass the normal "git aware" transport
mechanism and clone the repository by copying and hardlinking objects
rather than downloading it, resulting in a significant speed increase.

That makes the GIT_LOCAL_REPOSITORY option pretty useless so we'll just
remove it and recommand the usage of KERNEL_GIT_CLONE_URI directly.

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 40944
10 years ago
John Crispin 76133009c9 sparse: add as a new package selectable from the config
This change does multiple things, all related to enable sparse usage as
a static analysis tool selectable from the OpenWrt configuration:
*add a KERNEL_SPARSE option in the config to add sparse to the kernel
 build (through the C=1 option usage)
*add sparse as a new host tools. It will get selected automatically when
 the above option will be enabled

Signed-off-by: Mathieu Olivari <mathieu@qca.qualcomm.com>

SVN-Revision: 40490
10 years ago
Felix Fietkau 627e974c99 partially revert "build: remove check for nonexistant CONFIG_TAR_VERBOSITY variable and move TAR_OPTIONS to unpack.mk"
This complicates the evaluation order for some packages

SVN-Revision: 40006
10 years ago
John Crispin b5542f6aed include: r39979 broke kernel unpacking
Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 40002
10 years ago
Felix Fietkau f440e7faea kernel: fix parallel build issues with header install
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 39424
10 years ago
Imre Kaloz 7aaa9bc91c add x86_64 target support
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>

SVN-Revision: 39208
10 years ago
Florian Fainelli cdcde21b8d include: handle LZ4 compression scheme
Kernel 3.12 now offers LZ4 compression which will make initramfs builds
fail because we do not know how to substitute the relevant config
symbols, fix that.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 38533
11 years ago
Felix Fietkau bb494ed639 kernel: fix remaining initramfs related breakage
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37518
11 years ago
Luka Perkov 448decfa8e include: fix path for kernel-generated cpio removal
Signed-off-by: Luka Perkov <luka@openwrt.org>

SVN-Revision: 37128
11 years ago
Florian Fainelli 5b5fd9f92d include: force a kernel-generated cpio removal and rebuild
Make sure that the kernel rebuilds the initramfs cpio archive file by
deleting it before so we get it re-generated properly.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 37125
11 years ago
Florian Fainelli bc7260a125 buildroot: filter out dtbs KERNELNAME target (#13785)
Do not attempt to copy arch/$(LINUX_KARCH)/boot/dtbs because these are
not real files, fixes #13785.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 37107
11 years ago
Florian Fainelli eab95ea467 buildroot: copy KENRNELNAME files to $(KDIR)
In order to support building both normal and initramfs kernel, we will
rebuild the wrappers around the vmlinux ELF binary, copy these with an
appropriate extension when they exist.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 37048
11 years ago
Florian Fainelli a890ccd6e0 buildroot: build a second pass kernel if initramfs is enabled
If initramfs is enabled, build a second pass kernel containing the CPIO
rootfs, preliminary work to get non exclusive enabling of initramfs.

Signed-off-by: Florian Fainelli <florian@openwrt.org>

SVN-Revision: 37047
11 years ago