Commit Graph

299 Commits

Author SHA1 Message Date
Yann E. MORIN
a4b0884469 package/linux: check for config file before calling kconfig-package
If we check that the user provides a config file after we call to the
kconfig-package infra, the error message we get is the one for the
kconfig-package infra, not the custom error message we want to show to
the user.

So, only call kconfig-package after we do the check. Move the check with
the existing checks for the DTS, for consistency.

[Thomas: put the checks together, but right before the kconfig-package
call, rather than in the middle of the code, were the DTS related
tests were located.]

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-14 10:27:52 +02:00
Yann E. MORIN
ce2b7face0 package/linux: don't enforce check for DTS when not building
Currently, this is triggering the error message:
    make randconfig
    make source

Limit the checks that enforce a DTS is set and at most one DTB is
appended to when we are actually building, like is done for the
configuration-file variables.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-14 10:26:31 +02:00
Thomas Petazzoni
90d008ea7a linux: adjust fixup logic for ktap
The ktap package requires some parts of the kernel tracing
infrastructure to be enabled, especially
CONFIG_EVENT_TRACING. However, this option is a blind option in the
kernel, so enabling it in linux.mk has no effect: we need to enable a
non-blind option that selects CONFIG_EVENT_TRACING. We've chosen to
select CONFIG_ENABLE_DEFAULT_TRACERS.

This fixes the build of ktap.

[Thomas: use CONFIG_ENABLE_DEFAULT_TRACERS as suggested by Arnout.]

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2015-07-13 18:26:58 +02:00
Floris Bos
87bd1e3724 linux: add option to specify config fragments
Signed-off-by: Floris Bos <bos@je-eigen-domein.nl>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Gergely Imreh <imrehg@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-21 23:42:48 +02:00
Yann E. MORIN
715ebe3b4d linux: do not check hashes for custom versions and tarballs
This one is a bit tricky, as the version can come from the linux-headers
package, so we must also account for that.

We currently have no hash file for linux, but better do the change now,
which allows us to later add a hash file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-02 15:11:01 +02:00
Thomas Petazzoni
fa6289bb1a packages: refactor checks using BR_BUILDING
Instead of manually testing MAKECMDGOALS, use the newly introduced
BR_BUILDING variable to know if we're building or not.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-26 21:43:25 +02:00
Yann E. MORIN
9bd541d3b2 linux: simplify adding new extensions
Curently, all three linux extensions follow the same layout:
  - test if the extension is enabled
  - add itself to linux' patch-dependencies
  - declare a macro, added as the pre-patch hook

Except for the macro, all can be commonalised.

Add a simple infrastructure for that:
  - extensions declare themselves in the list of extensions
  - extensions define their macro
  - the infra adds them to the patch-dependencies and pre-patch
    hooks as appropriate

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-09 22:57:51 +02:00
Thomas Petazzoni
0eba4759fa packages: apply custom patches using *.patch instead of <pkg>-*.patch
Several packages have some logic to apply custom patches that existed
before the BR2_GLOBAL_PATCH_DIR mechanism: at91bootstrap,
at91bootstrap3, barebox, uboot and linux. Currently, the logic of
those packages to apply custom patches is to match
<package-name>-*.patch, which is not consistent with what we've done
for patches stored in the package directory, and for patches stored in
BR2_GLOBAL_PATCH_DIR: in such cases, we simply apply *.patch.

Therefore, for consistency reasons, this commit changes these packages
to also apply *.patch.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-06 11:04:59 +02:00
Jerzy Grzegorek
bd8c733fb4 packages: indentation cleanup
This commit doesn't touch infra packages.

Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-31 13:57:41 +02:00
Thomas Petazzoni
7430a41801 linux: use the package infrastructure to download patches
The linux package has a special handling of patches, with quite a bit
of legacy in it. A problem caused by this special handling is that the
linux package calls directly the DOWNLOAD_WGET macro, which means that
the package infrastructure isn't aware of which patches get
downloaded, and it prevents doing changes inside the package download
infrastructure.

This commit changes the handling of patches in the linux package in
the following way:

 * The LINUX_PATCHES variable is kept as is: it lists all the patches
   mentioned in the Config.in option BR2_LINUX_KERNEL_PATCH. This
   option can contain http://, ftp://, https:// URLs, path to local
   files or local directories.

   This variable is *not* used by the generic package infrastructure,
   so it is purely internal to the Linux package.

 * The LINUX_PATCH variable is now filled in with the list of patches
   that should be downloaded. It is derived from LINUX_PATCHES by
   filtering the patches that have http://, ftp:// or https:// in
   their path. Since <pkg>_PATCH is handled by the package
   infrastructure, it means that those patches are now automatically
   downloaded and applied by the package infrastructure.

 * The LINUX_APPLY_PATCHES hook is renamed to
   LINUX_APPLY_LOCAL_PATCHES, because it is now only responsible of
   applying local patches: remote patches are handled by
   LINUX_PATCH. The implementation of the hook is changed to filter
   out the patches that have already taken care of by LINUX_PATCH, so
   that we only iterate through the list of local patches or local
   patch directories.

[Thomas: adjust comment in the code according to Yann comments.]

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Romain Naour <romain.naour@openwide.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-03-30 23:38:13 +02:00
Sébastien Szymanski
540e14a81c linux: stop if one linux patches doesn't apply
If you have several linux patches directories, Buildroot does not stop
if one patches of the first directories don't apply. This patch fixes
this.

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-16 19:46:10 +01:00
Yann E. MORIN
68443c52dd linux: add note about why it's safe to include other .mk files
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-13 22:04:29 +01:00
Luca Ceresoli
b0b9606530 Remove trailing slash from all package site URLs
The recommended form is without the trailing slash. Buildroot will add a slash
between FOO_SITE and FOO_SOURCE as appropriate.

Reported-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-03-10 20:40:08 +01:00
Ivo Slanina
541d9937d4 linux/linux.mk: custom dts path - build dtb only from *.dts files
When building device tree blobs from custom *.dts files, buildroot
initializes KERNEL_DTS_NAME variable from all given file names.
This causes that user can't provide one *.dts file and some other
*.dtsi files as dependencies.

Problem is fixed by adding filter for initializing KERNEL_DTS_NAME
variable with *.dts files only. All user provided files are copied
into kernel source tree, but only file names suffixed with *.dts
are used for building appropriate *.dtb files.

[Thomas: add comment into the code to explain why we are filtering
.dts files only.]

Signed-off-by: Ivo Slanina <ivo.slanina@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-03-04 23:38:15 +01:00
Peter Korsgaard
7403ea730d Merge branch 'next'
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-03-02 23:26:20 +01:00
Sébastien Szymanski
a0e44a348a linux: add support for 4.x versions
Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-02-27 16:14:27 +01:00
Yann E. MORIN
67596b6b6e linux: get rid of avr32 specifics
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 17:43:17 +01:00
Thomas De Schampheleire
00daf37c4f linux: avoid unnecessary changes in defconfig for INITRAMFS_SOURCE
When Buildroot is configured to append the root filesystem to the Linux
kernel as initramfs, Buildroot sets the path to the initramfs source
dynamically in the Linux configuration file.

As this path is specified as an absolute path, typically being different
for different users of the same project (e.g. containing a username),
saving the configuration to a version control system (for example using
'make linux-update-defconfig') would result in a difference for this
path at every invocation by a different user.
Although this is technically not an issue, it is confusing that this
generates a difference.

Address this issue by using a not-yet-expanded make variable to specify
the path to the initramfs source. That variable will be expanded by the
Linux build system, which uses it both as a Makefile variable and a
shell variable; thus, it needs to be specified in LINUX_MAKE_ENV (so
it is exported and available in sub-processes of make).  Any saved
configuration file would simply contain the reference to the
not-yet-expanded variable.

As in the Linux build system, the config variables are both read from
make as from a shell script, we cannot use $() syntax as this would be
interpreted as a command invocation by the shell. Instead, use ${}
syntax which is interpreted as variable reference both by the shell as
by make.

[Thomas:
 - Really make the patch work by using $(LINUX_MAKE_ENV) instead of
   $(TARGET_MAKE_ENV). Otherwise, the new BR2_BINARIES_DIR variable is
   not passed at all stages of the build process, which makes the
   build fail when an initramfs is used.]

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 17:31:03 +01:00
Thomas De Schampheleire
dff25ea2b9 linux: migrate to the kconfig infrastructure
Migrate the linux package to the kconfig infrastructure.
A notable change compared to the original behavior:

- the targets linux-update-(def)config are now always saving the config
  file, even for a defconfig bundled in the linux sources. This is done
  to keep the kconfig infrastructure simple.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:37:50 +01:00
Thomas De Schampheleire
89a47724e9 linux: qstrip the path to the custom configuration file
Even though this is not strictly necessary with the current version of
linux.mk, it becomes necessary when migrating linux.mk to the kconfig
infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:37:20 +01:00
Ivo Slanina
d9d575e0b2 linux/linux.mk: fixed downloading kernel patches
Patches located at ftp or http(s) URLs were downloaded using DOWNLOAD
macro. For example, if linux source was located at external git
repository, DOWNLOAD macro uses git scheme as well and buildroot
tried to downlod a path using DOWNLOAD_GIT macro. As a result, nothing
was downloaded and build siletly passes.

Patches located at mentioned URLs is now downloaded directly with
DOWNLOAD_WGET macro.

Signed-off-by: Ivo Slanina <ivo.slanina@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-14 16:48:56 +01:00
Ivo Slanina
fc6ee4cadb linux/linux.mk: added https:// pattern for kernel patches
Patches located at https:// scheme URL were threated as directories,
causing build failures.

Fixed by adding https:// pattern.

Signed-off-by: Ivo Slanina <ivo.slanina@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-14 16:48:56 +01:00
Gustavo Zacarias
e5d715dda5 xtables-addons: enable necessary kernel options
Enable the required conntrack/netfilter options, otherwise
xtables-addons will fail to build.
The basic iptables options are already covered by the iptables package
which is a required dependency anyway.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-10 18:45:23 +01:00
Gustavo Zacarias
2cbda5b674 iptables: enable basic kernel options
Enable the basic kernel options for iptables to be useful at least to
filter incoming connections.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-10 18:45:15 +01:00
Gustavo Zacarias
49b147ccbb linux: fix breakage from d4b2b032a0
Unbreak qemu_xtensa_lx60_defconfig where LINUX_IMAGE_NAME !=
LINUX_TARGET_NAME.
It incorrectly overwrites LINUX_IMAGE_NAME even if it was set before,
defeating the purpose of IMAGE being different than TARGET.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-12-24 15:00:48 +01:00
Yann E. MORIN
d4b2b032a0 linux: fix recursively defined variable
When running 'make printvars', the output stops at the time we dump the
Linux related variables, with:

    linux/linux.mk:109: *** Recursive variable `LINUX_TARGET_NAME'
    references itself (eventually).  Stop.

And that's expected, since we have:

    109 LINUX_TARGET_NAME = $(LINUX_IMAGE_NAME)
    [...]
    112 ifeq ($(LINUX_IMAGE_NAME),)
    113 LINUX_IMAGE_NAME = $(LINUX_TARGET_NAME)
    114 endif

Even though they are defined in a way that ensures they are in fact not
recursively defined (the if-block ensures that), 'printvars' does dump
all our variables by evaluating all of them, which in that specific case
implies they are recursively defined.

Fix that by explicitly setting LINUX_IMAGE_NAME in each if-block.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-12-15 22:38:08 +01:00
Jerzy Grzegorek
1769933d98 package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-26 05:47:05 +01:00
Fabio Porcedda
1586ce3a3d apply-patches.sh: Use the "APPLY_PATCHES" variable to call the script
To easy up adding optional parameters when calling the
"apply-patches.sh" add and use the "APPLY_PATCHES" variable to execute
the script.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 01:31:32 +02:00
Jerzy Grzegorek
774ff0d13f package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-25 01:11:26 +02:00
Thomas De Schampheleire
f268f7131b .mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.

This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.

Alignment of line continuation characters (\) is kept as-is.

The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
    -e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'

Brief explanation of this command:
    ^\([A-Z0-9a-z_]\+\)     a regular variable at the beginning of the line
    \([?:+]\?=\)            any assignment character =, :=, ?=, +=
    \([^\\]\+\)             any string not containing a line continuation
    \([^\\ \t]\+\s*\\\)     string, optional whitespace, followed by a
                            line continuation character
    \(\s*\\\)               optional whitespace, followed by a line
                            continuation character

Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.

This expression was tested on following test text: (initial tab not
included)

	FOO     = spaces before
	FOO     =   spaces before and after
	FOO	= tab before
	FOO	  = tab and spaces before
	FOO =	tab after
	FOO =	   tab and spaces after
	FOO =   	spaces and tab after
	FOO =    \
	FOO = bar \
	FOO = bar space    \
	FOO   =		   \
	GENIMAGE_DEPENDENCIES   = host-pkgconf libconfuse
	FOO     += spaces before
	FOO     ?=   spaces before and after
	FOO     :=
	FOO     =
	FOO	=
	FOO	  =
	FOO =
	   $(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
	AT91BOOTSTRAP3_DEFCONFIG = \
	AXEL_DISABLE_I18N=--i18n=0

After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
  expression leaves the number of whitespace between the value and line
  continuation character intact, but the whitespace before that could have
  changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
  actually makes the code more readable.

Finally, the end result was manually reviewed.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 15:00:28 +02:00
Jean-Baptiste Theou
a47b633d79 linux: fix LINUX_SITE for release candidates
Signed-off-by: Jean-Baptiste Theou <jtheou@adeneo-embedded.us>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-07 22:16:21 +02:00
Jerzy Grzegorek
c7f4b96471 package: remove the trailing slash sign from <PKG>_SITE variable
Since the trailing slash is stripped from $($(PKG)_SITE) by pkg-generic.mk:

$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE))

so it is redundant.
This patch removes it from $(PKG)_SITE variable for BR consistency.

Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-31 23:17:46 +02:00
Thomas De Schampheleire
025d4a1729 linux: remove support of linux26-* targets
The linux-* mirror targets of linux26-* have been added a very long time ago
(2010) and linux 2.6 is now considered 'old' anyway. It no longer makes
sense to support these linux26-* targets, so this patch removes them.

This is a simplification introduced in preparation of the kconfig-package
infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-29 23:47:03 +02:00
Philippe Proulx
5224cdcc14 linux: support multiple custom DTS files
[Thomas: fix minor typo in help text.]

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-28 22:35:12 +02:00
Gustavo Zacarias
f8f3073b18 linux: fix fallout from c78d57637c
The new variable LINUX_TARGET_NAME is unconditionally used but it may be
unset leading to a default kernel build (which might not be uImage or
other requested format).
See http://lists.busybox.net/pipermail/buildroot/2014-July/102069.html

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-17 22:57:29 +02:00
Waldemar Brodkorb
c78d57637c linux: add option to explicitly specify the kernel image name
For example the upcoming qemu-xtensa patch is using this feature,
where the target is called "zImage", but the resulting kernel name
is "Image.elf".

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 22:18:45 +02:00
Thomas De Schampheleire
62bbfbaa63 pkg-utils: kconfig helpers: use single iso double quoting
The echo statements in the kconfig helpers are currently using double
quotes. For KCONFIG_SET_OPT this is problematic when the value argument
itself contains a double quote (a string value). In this case, the statement
    echo "$(1)=$(2)" >> $(3)
would become:
    echo "FOO="string value"" >> /some/path/.config
resulting in the string
    FOO=string value
in the config file, rather than the properly quoted
    FOO="string value"

The linux package worked around this by escaping the quote characters, but
a prettier solution is to use single quoting in the helpers (or
alternatively use no quoting at all).
A side effect of this change is that a $variable in the key or value would
no longer be interpreted by the shell, removing any unexpected behavior.

This change is only really necessary for KCONFIG_SET_OPT, but for symmetry
reasons the other helpers are updated too.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 19:18:40 +02:00
Eric Le Bihan
773ee9797a smack: new package.
SMACK stands for Simplified Mandatory Access Control Kernel. It is a Linux
Security Module which provides a Mandatory Access Control mechanism,
like SELinux, but aiming towards simplicity.

This package provides the tools to load/unload the policy from the
kernel as well as a library allowing applications to interact with
SMACK. The proper kernel options are also set.

[Thomas:
- fixed license to be LGPLv2.1 instead of LGPLv2.1+. Even though the
  debian/copyright file has the "or later" indication, none of the .c
  source files carry it, so I suppose LGPLv2.1 is more correct.
- added !BR2_PREFER_STATIC_LIB dependency.
- added dependency on host-pkgconf, since Smack configure.ac uses
  PKG_CHECK_MODULES.]

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-21 12:15:45 +02:00
Fabio Porcedda
eca29bdf5f linux: remove dirs dependency
The "dirs" dependency is redundant because now the "generic-package"
infrastructure add automatically the "dirs" dependency so just remove
the redundant references.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-06 22:51:02 +01:00
Fabio Porcedda
96d91375a3 linux: fix coding style
As stated in the Buildroot user manual add one space before and after
a = sign.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-06 22:50:55 +01:00
Thomas Petazzoni
0dc7901b00 Revert "linux: only depend on host-lzop if needed"
This reverts commit ca80782f45. The
whole host-lzop optional dependency logic cannot work, since the
configuration file will only be known after the kernel sources are
extracted, if an internal kernel defconfig is used, which is quite
common.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04 19:16:41 +01:00
Thomas Petazzoni
69628fc16f Revert "linux: check the configuration file exists"
This reverts commit b4cacbf5b1. The
whole host-lzop optional dependency logic cannot work, since the
configuration file will only be known after the kernel sources are
extracted, if an internal kernel defconfig is used, which is quite
common.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04 19:16:36 +01:00
Thomas Petazzoni
d30542712b Revert "linux: fix check of configuration file existence"
This reverts commit 477c28cf1d. The
whole host-lzop optional dependency logic cannot work, since the
configuration file will only be known after the kernel sources are
extracted, if an internal kernel defconfig is used, which is quite
common.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04 19:16:30 +01:00
Thomas Petazzoni
4ff3aa2288 Revert "linux: fix the KCONFIG_GET_OPT calls to be inside a BR2_LINUX_KERNEL test"
This reverts commit 4ad1ea59a5. The
whole host-lzop optional dependency logic cannot work, since the
configuration file will only be known after the kernel sources are
extracted, if an internal kernel defconfig is used, which is quite
common.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-04 19:15:45 +01:00
Thomas Petazzoni
4ad1ea59a5 linux: fix the KCONFIG_GET_OPT calls to be inside a BR2_LINUX_KERNEL test
The KCONFIG_GET_OPT calls added by
ca80782f45 ('linux: only depend on
host-lzop if needed') are made even if the kernel package is not
selected. This hangs the linux.mk parsing as they try to read from a
file that doesn't exist.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 22:55:49 +01:00
Thomas Petazzoni
477c28cf1d linux: fix check of configuration file existence
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 22:40:46 +01:00
Yann E. MORIN
b4cacbf5b1 linux: check the configuration file exists
... and abort early, before we even use it.

Reported-by: Peter Korsgaard <jacmet@uclibc.org>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 22:22:18 +01:00
Yann E. MORIN
ca80782f45 linux: only depend on host-lzop if needed
There is no reason to always depend on host-lzop, even when the kernel
compression is not LZO.

Since LZO is not the default compression option in the kernel (and there
is not sign that will change in the foreseeable future), it will always
appear in a config file, whether it is a complete config file or it is
only a defconfig.

So, only depend on host-lzop if the LZO compression is enabled in the
kernel config file (either the defconfig or the custom config file).
This includes:
  - kernel compression itself
  - initrd compression
  - initramfs compression

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-03-03 22:22:06 +01:00
eric.le.bihan.dev@free.fr
4c10eedc10 systemd: enable required kernel features.
When systemd is chosen as init system, the required kernel features are
enabled.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-25 21:28:05 +01:00
eric.le.bihan.dev@free.fr
2c66e4429d systemd: bump to v207
This patch bumps systemd to v207 but also declares it as a provider for the
udev virtual package.

Starting with systemd 183, udev has been merged into
systemd. The udev daemon is now installed as /lib/systemd/systemd-udevd.
This means that /dev management using udev is only available if systemd
is chosen as init system.

When configuring systemd, the following options are available:

- activation of systemd-journal-gatewayd, to access the journal via
  HTTP.
- activation of extra features like journal compression and sealing.

Support for uClibc has also been removed because:

- upstream has no interest in supporting uClibc.
- using a shrinked libc brings no advantage, given the size of all the
  programs included in Systemd. So using glibc does not matter.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-12 22:14:36 +01:00
eric.le.bihan.dev@free.fr
fabcb119b9 udev: convert to virtual package
This patch converts udev to a virtual package. For the moment, there is only
one provider for the udev features: eudev.

Packages meant to provide udev-like features must select the symbol
BR2_PACKAGE_HAS_UDEV.

Packages depending on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV or
BR2_PACKAGE_UDEV have been converted to use the new symbol.

[Peter: move legacy symbols under 2014.05]
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-12 22:14:19 +01:00
eric.le.bihan.dev@free.fr
937a95449e eudev: new package
eudev is a userspace device management daemon. It is a standalone
version, independent from systemd. It is a fork maintained by Gentoo.

Features:

 - No extra configuration options are available: Gudev is build if
   libglib2 is selected.
 - No dependency on hwdata as the package uses its own hardware
   database (as does systemd).

eudev 1.3 is in sync with systemd v207.

[Peter: add BR2_USE_MMU dependency]
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-12 22:14:16 +01:00
Thomas De Schampheleire
05e2e35715 linux: don't automatically set uevent_helper with mdev /dev management
When mdev /dev management is chosen in the buildroot configuration, the
Linux configuration is updated automatically to set option
CONFIG_UEVENT_HELPER_PATH to "/sbin/mdev". However, the help text of this
option explicitly recommends not setting this option due to large
performance impact during boot (experienced first hand by the reporter ánd
author).

The mdev startup script S10mdev already sets the helper during userspace
boot, which will make sure mdev is working correctly.

Fixes bug #6596: https://bugs.busybox.net/show_bug.cgi?id=6596

Reported-by: Andreas Koop <andreas.koop@zf.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-09 22:50:50 +01:00
Rafal Fabich
73da2ff6f7 Added local directory as source of kernel code
Add the option to use a local directory as the source for
building the Linux kernel, which can be useful during
kernel development.

Signed-off-by: Rafal Fabich <rafal.fabich@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-04 11:01:46 +01:00
Yann E. MORIN
0a541c8f24 linux: ensure buildroot_defconfig is writable
If $(KERNEL_SOURCE_CONFIG) is read-only (eg. because Buildroot's source
dir is), the rm of $(KERNEL_ARCH_PATH)/configs/buildroot_defconfig will
either fail, or prompt the user, both of which we want to avoid.

Make it writable by using $(INSTALL).

Fixes: #4363
Signed-off-by: Nathan Lynch <ntl@pobox.com>
[yann.morin.1998@free.fr: use $(INSTALL) instead of cp, don't 'rm -f']
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-28 22:56:17 +01:00
Jeremy Rosen
bd53398cd6 linux: force inotify kernel option when udev is used as dev handler
[Peter: drop unneeded devtmpfs handling]
Signed-off-by: Jérémy Rosen <jeremy.rosen@openwide.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-01-08 22:28:00 +01:00
Thomas Petazzoni
ed23c92b62 linux: enable initrd/initramfs support when cpio rootfs is chosen
When one enables the generation of a cpio archive of the root
filesystem, the most likely usage is as an initramfs for the
kernel. This commit ensures that the kernel has initramfs support when
the rootfs cpio image format is chosen.

This will for example ensure that if the user selects the ISO9660
filesystem format (which uses a cpio initramfs), the kernel will have
proper support to load and use the initramfs.

It is worth mentionning that when BR2_TARGET_ROOTFS_INITRAMFS is
enabled, then BR2_TARGET_ROOTFS_CPIO is always enabled. That's why we
move the enabling of CONFIG_BLK_DEV_INITRD from the initramfs case to
the cpio case.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-29 18:58:26 +01:00
Anders Darander
aaef2cad85 linux.mk: enable options for ktap
Certain tracing related options are required to be able to build ktapvm.ko, enable those.

Enable CONFIG_FUNTCTION_TRACER as otherwise, CONFIG_EVENT_TRACING won't stick. (Some
tracer needs to be enabled for this).

[Peter: add a note to ktap Config.in explaining this is done]
Signed-off-by: Anders Darander <anders@chargestorm.se>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-16 22:09:40 +01:00
Arnout Vandecappelle
13ae0075a9 uboot-tools: factor out common mkimage infrastructure
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-11-11 00:37:03 +01:00
Thomas De Schampheleire
63ecded2e3 linux: add support for custom Mercurial repository
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-27 01:51:09 +02:00
Peter Korsgaard
3f817237fd linux.mk: target-install: drop extra (invalid) DEPMOD parameter
DEPMOD is already specified in LINUX_MAKE_FLAGS, and is no longer located
in HOST_DIR/usr/sbin after the move to host-kmod, so drop it from here.

Reported-by: Ryan Coe <bluemrp9@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-11 13:21:53 +02:00
Peter Korsgaard
cc34519201 linux: fix depmod location after move to host-kmod
The host-kmod version of depmod gets installed into HOST_DIR/sbin, so
adjust the path we use to refer to it in linux.mk

Reported-by: Ryan Coe <bluemrp9@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-10 21:56:35 +02:00
Jérôme Pouiller
741cbccb74 Fix build reproducibility in Make 3.82
Make 3.82 no longer sort the result of wildcards (see
http://comments.gmane.org/gmane.comp.gnu.make.bugs/4260). This may break
build reproducibility.

This patch sort results of wildcards to ensure reproducibility.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-06 23:27:42 +02:00
Thomas Petazzoni
b4837455d5 linux: use kmod instead of module-init-tools
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-09-02 22:59:27 +02:00
Reuben Dowle
235535405c Install DTB as part of images install command
When installing DTB to the images directory, do this as part of the image
install commands rather than the target install commands.

Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com.az>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-01 17:39:43 +02:00
Nathan Ford
1ac04c321f Fix building initramfs kernel with appended dtb
The target for building the kernel with a cpio initramfs is not
calling the append dtb commands, creating a final kernel image
without an appended dtb. Instead it needs to call kernel make on
the intermediate target, then call the append dtb commands
to produce the final image as the primary kernel build target
does.

Signed-off-by: Nathan Ford <nford@westpond.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-01 17:38:44 +02:00
Maxime Ripard
ae86a3c533 linux: Fix uImage with appended DTs generation
Fixes bug #5516 - appended device tree blobs on uImage fails

Before version 3.7 of the kernel, building the zImage and then the
uImage will rewrite the zImage in the process, removing the device tree
we just appended.

Use mkimage to append the device tree to the uImage and rebuild the
headers directly.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2013-08-01 17:38:41 +02:00
Jerzy Grzegorek
e0d9d33cc2 fix white spaces
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-20 21:13:57 +02:00
Yann E. MORIN
72189e5b10 linux: remove EABI conditional
We're only EABI now, so we want to always build an EABI kernel
when we're building for ARM.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-14 22:16:40 +02:00
Valentine Barshak
391c82efa1 linux: Do not force GZIP initramfs compression
Initramfs compression does not make much sense for the architectures
that support compressed kernel images because in this case the data
would be compressed twice. This will eventually result in a bigger
kernel image and time overhead when uncompressing it.
The only reason to use compressed initramfs is to reduce memory
usage when the kernel prepares rootfs, and both the unpacked
filesystem and initramfs.cpio are present in the memory.

Buildroot attempts to force GZIP compression for initramfs,
however it doesn't always work because initramfs compression mode
depends on RAM disk compression supported by the kernel.
Thus, CONFIG_INITRAMFS_COMPRESSION_GZIP depends on CONFIG_RD_GZIP.
If CONFIG_RD_GZIP is not set, setting GZIP initramfs compression
will have no effect.

Besides, the kernel also supports other compression methods,
like BZIP2, LZMA, XZ and LZO. Forcing the good old GZIP does not
really make much sense any more.

This removes initramfs compression settings from Buildroot,
so that the default value preset in the kernel config is used,
which is CONFIG_INITRAMFS_COMPRESSION_NONE.

If initramfs compression is still needed, it can be set
in the kernel config (using make linux-menuconfig)

Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-08 14:50:31 +02:00
Alexandre Belloni
95442bb324 Normalize separator size to 80 in remaining makefiles
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-20 17:32:07 +02:00
Alexandre Belloni
702704014d Fix package headers to comply with coding style
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-06 17:26:35 +02:00
Thomas Petazzoni
82d2a47478 linux: qstrip the custom DTS path
This fixes a problem reported by wacha@mit.bme.hu, see
http://lists.busybox.net/pipermail/buildroot/2013-June/073312.html.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-06-05 21:05:18 +02:00
Peter Korsgaard
1ba51d2fbd Merge branch 'next' 2013-06-02 16:33:05 +02:00
Fabio Porcedda
9b273ea860 linux: CONFIG_KERNEL_LZO option requires host-lzop
When the LZO compression mode is chosen the linux kernel requires
lzop host utility at build time.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-14 17:30:56 +02:00
Raúl Sánchez Siles
98b5cc3eb4 Choose xz compressed tarball for linux kernel.
Prefer xz compressed tarball so some bandwidth is saved for kernel headers
and kernel itself downloads.

Signed-off-by: Raúl Sánchez Siles <rasasi78@gmail.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-05-11 22:43:58 +02:00
Peter Korsgaard
0ffdc16e7d linux: error out early if user forgot to specify dts name(s)
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-15 08:55:53 +02:00
Peter Korsgaard
3cab8aaeb7 linux: don't use $ in dtb comment as the shell tries to expand them
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-04-14 19:31:30 +02:00
Julien Boibessot
8215e19b53 linux: Add a load address option for building uImage on 3.7+ multi-platform kernels
[Peter: add quotes as suggested by Arnout]
Signed-off-by: Julien Boibessot <julien.boibessot@armadeus.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-03-15 10:58:13 +01:00
Maxime Ripard
88d350ca3c linux: Install the device tree in /boot when installing the kernel
The option BR2_LINUX_KERNEL_INSTALL_TARGET used to install the kernel in
/boot in the rootfs. The introduction of the device tree builds made it
possible to generate device tree blobs, and stored them in IMAGES_DIR
like the kernel, but didn't copy the dtb in /boot when _INSTALL_TARGET
was enabled.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-02-19 23:30:10 +01:00
Arnout Vandecappelle (Essensium/Mind)
579fea2273 linux, uboot, mxs-bootlets, barebox: avoid double slash in CUSTOM_TARBALL
Closes #5846

The $(dir ...) function leaves a slash at the end, so that the LINUX_SITE
variable for a custom tarball ends in a slash. The DOWNLOAD macro adds
another slash between SITE and SOURCE, which results in a double slash in
the download URL.

Fix this by stripping off the final slash from the _SITE in all packages that
have a custom tarball.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-13 20:39:47 +01:00
Arnout Vandecappelle (Essensium/Mind)
a1cfe20df6 linux: fix appended dtb handling of pre/post v3.8-rc1
The $(wildcard ) doesn't work for LINUX_APPEND_DTB, because the .dtb
doesn't exist yet at that point.

Also factor the common part out.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-09 00:07:56 +01:00
Peter Korsgaard
88ef92dfcb linux: fix double LINUX_APPEND_DTB
Introduced by 5b33e0b6a (linux: handle new dtb location since 3.8-rc1 for
appended dtbs).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-08 10:12:02 +01:00
Peter Korsgaard
5b33e0b6a1 linux: handle new dtb location since 3.8-rc1 for appended dtbs
Similar to how we've done it for seperate dtbs (ef34705087).

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-01-06 16:47:05 +01:00
Peter Korsgaard
ef34705087 linux: handle new dtb location since 3.8-rc1
.dtb files are now generated in arch/$ARCH/boot/dts instead of
arch/$ARCH/boot, so extend the LINUX_INSTALL_DTB rule to look there
as well.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-21 09:07:45 +01:00
Peter Korsgaard
309c2f50fa linux: simplify dtb variables
Only qstrip once and add a KERNEL_DTBS helper variable to simplify the dtb
rules.

No functional change.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-21 08:42:55 +01:00
Maxime Ripard
dd1aa62cce linux: Support multiple device tree build
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-20 15:25:10 +01:00
Sonic Zhang
1f299105e7 linux: Rename blackfin kernel Image file from vmImage back to uImage
Consist with other architectures.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-08-11 20:03:32 +02:00
Maxime Ripard
18e752de87 linux: Add new image formats for PowerPC and Microblaze
Add the following Linux kernel image formats:

 * cuImage(powerpc)
 * simpleImage(microblaze)
 * linux.bin(microblaze)

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-31 23:08:28 +02:00
Maxime Ripard
978928e4ac Add support for appended device tree blobs for arm
This patch adds support for the ARM-only appended device tree
mechanism present in the kernel.

This option allows to add at the end of the kernel image the
device tree blob so that we can still boot device tree enabled
kernels with old bootloaders.

This patch also adds the needed logic to genereate such an image
when building zImages or uImages, also adding the necessary parts
to rebuild the uImage.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-31 23:08:28 +02:00
Maxime Ripard
902609fbb3 Factorize the u-boot images code
This patch introduces the BR2_LINUX_KERNEL_UBOOT_IMAGE boolean to
factorize more code that will be shared in the next patches that
introduces other uImage-like targets.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-31 23:08:28 +02:00
Maxime Ripard
69fc497df0 Rework support for the device tree
This patch introduces some support for device tree-enabled kernels.

It replaces the former BR2_LINUX_KERNEL_DTS_FILE option that was
microblaze-only, that was quite limited. This option was quite
limited, first obviously because it was restricted to microblaze,
but also because it targetted only external device tree source files,
and allowed only to build simpleImages using the custom image name
mechanism.

This patch adds a much more generic one, that can work on basically
every architecture that supports device tree. It allows to build
both device tree source file that comes with the kernel source or to
set the path to the device tree file to use so that one can use a
custom device tree.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-31 23:08:28 +02:00
Maxime Ripard
942fc4c554 Revert "Microblaze: build kernel with device tree"
This is way too specific to microblaze-only. Remove this support to
introduce a more generic way to do support device tree kernels.

This reverts commit aaed42d156.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-31 23:08:28 +02:00
Arnout Vandecappelle (Essensium/Mind)
e1502ebc0c all packages: rename XXXTARGETS to xxx-package
Also remove the redundant $(call ...).

This is a purely mechanical change, performed with
find package linux toolchain boot -name \*.mk | \
  xargs sed -i -e 's/$(eval $(call GENTARGETS))/$(eval $(generic-package))/' \
               -e 's/$(eval $(call AUTOTARGETS))/$(eval $(autotools-package))/' \
               -e 's/$(eval $(call CMAKETARGETS))/$(eval $(cmake-package))/'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17 20:23:05 +02:00
Luca Ceresoli
67f1836d27 linux: define license
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17 19:06:32 +02:00
Thomas De Schampheleire
707d44d0a2 linux: install dtc (device tree compiler) as host tool if selected
Having dtc as a host tool can be useful for users that have a custom
boot scenario where the device tree is not embedded in the kernel.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-05-15 22:59:20 +02:00
Thomas Petazzoni
f18c51657f linux: improve the 'make linux-*' special commands
This patch improves two things:

 * It makes sure that the linux-menuconfig and al. commands can be
   executed even if the user hasn't executed 'make' before. Until now,
   the commands were depending on the .configured stamp, which is not
   sufficient since the linux package has been converted to the
   GENTARGETS infrastructure. Instead, depend on the linux-configure
   phony target.

 * It makes sure that those commands are not available when the Linux
   package is not selected, just like we do for Barebox.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-05-05 08:49:02 +02:00
Maxime Ripard
90759a6636 Enable cgroups in Linux if we use systemd
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-04-02 23:14:04 +02:00
Markus Kaindl
c9ccdf877a linux.mk: .ub-File copying after building initramfs
test should exit with Exit-Code 0 if no .ub-File present and copy the
file if Exit-Code 1, otherwise make fails

Signed-off-by: Markus Kaindl <markus.kaindl@stusta.mhn.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-03-21 11:44:22 +01:00
Stephan Hoffmann
aaed42d156 Microblaze: build kernel with device tree
This patch adds the options needed to build the SimpleImage containing
the device tree structure needed for the Microblaze architecture.

Handling Device Tree and SimpleImage will be handled in a general way
in the future.

I provide this patch to be able to build the system in the meantime.

Signed-off-by: Stephan Hoffmann <sho@relinux.de>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-03-18 22:55:18 +01:00
Alvaro G. M
0a4856ce27 DOWNLOAD: change $1=DIRECTORY_URL, $2=FILE_NAME to $1=FULL_FILE_URL, $2=FILE_NAME
This modifies the definition of DOWNLOAD to receive two arguments:
the first one is the full URL of the file to download, whereas the second
(and optional) is the name the file will have once downloaded.

Same thing with the SOURCE_CHECK_WGET and SCP functions.

All calls to these functions have been changed to the shortest form of
the new API, except for toolchains acquisition. Since there is quite a
number of different toolchains this call to DOWNLOAD is better set to the
generic one.

Signed-off-by: Alvaro G. M <alvaro.gamez@hazent.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: Stephan Hoffmann <sho@relinux.de>
Downloading Microblaze LE toolchain works on a clean install
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-03-18 22:21:16 +01:00
Peter Korsgaard
7b911b583a linux: drop LZMA environment variable
Not used anymore.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-02-10 10:44:47 +01:00
Thomas Petazzoni
5ba5301cdc linux: use the depmod built in HOST_DIR
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-01-31 23:23:11 +01:00
Thomas De Schampheleire
0900c12556 linux: add linux-update-config and linux-update-defconfig targets
In analogy to build targets uclibc-update and busybox-update, add
extra targets to copy the current configuration to the custom
configuration file set in buildroot. These targets facilitate the
work of developers adding support for a specific board.

linux-update-config copies .config directly.
linux-update-defconfig first creates a defconfig and copies that.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-11-11 20:13:14 +01:00
Kelvin Cheung
c1485d51e8 Add vmlinuz support in Kernel binary format for MIPS.
Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-10-28 10:52:31 +02:00
Gustavo Zacarias
80d7b68167 linux: bump default kernel to version 3.1
Bump default kernel vesion to 3.1 to match headers.
Also implement downloads for 3.x series kernels.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-10-24 17:49:13 +02:00
Thomas Petazzoni
0849e8193e package: remove useless arguments from GENTARGETS
Thanks to the pkgparentdir and pkgname functions, we can rewrite the
GENTARGETS macro in a way that avoids the need for each package to
repeat its name and the directory in which it is present.

[Peter: pkgdir->pkgparentdir]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-29 23:09:58 +02:00
Arnout Vandecappelle (Essensium/Mind)
13a3afc536 fs/initramfs: refactor with fs/cpio
An initramfs is in fact the same as a cpio archive, but embedded in
the kernel.  So instead of duplicating the cpio infrastructure,
we can simply build images/rootfs.cpio and link that into the
kernel.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-27 22:46:00 +02:00
Thomas De Schampheleire
3011d23518 linux: Add Linux Kernel extensions menu
Add a kernel sub-menu (called "Linux Kernel Extensions"), which makes
possible to patch it or tweak the kernel build step.

 * All linux/linux-ext-*.mk files will be read by the make process.
 * The menu can be customized in "linux/Config.ext.in".

[Peter: small fixes]
Signed-off-by: Benoit Mauduit <benoit.mauduit@openwide.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-18 22:59:20 +02:00
Thomas Petazzoni
59a326b934 support: move patch-kernel.sh and rename it
The name "patch-kernel.sh" is a bit stupid, since this script is used
to patch everything in Buildroot, not only kernel trees.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-09-17 08:15:32 +02:00
Jean-Christophe PLAGNIOL-VILLARD
f5777ce8fb linux: add linux/linux26-savedefconfig support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-08-22 22:15:35 +02:00
Peter Korsgaard
7a2fa1f8db uboot-tools: add fw_printenv, rename to uboot-tools
Move fw_printenv / fw_setenv options from the uboot bootloader build to
the uboot-mkimage package, and rename it to uboot-tools.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-18 15:27:52 +02:00
Peter Korsgaard
ea7f5ff976 linux: fix build with release candidates
Fixes *** Recursive variable `LINUX_SITE' references itself

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-14 16:38:07 +02:00
Thomas Petazzoni
f45f775b4f linux: add support for 3.x and -rc versions
The assumption that all kernels are in
http://www.kernel.org/pub/linux/kernel/v2.6/ is no longer true:
versions 3.x are in separate directories.

We now compute the directory name from the major and minor versions of
the version provided by the user. This assumes that the 3.1 version
will be in a /v3.1/ directory, which we don't know yet because the 3.1
cycle hasn't started yet.

At the same time, we add support for the official -rcX versions.

Patch tested by compiling 3.0-rc6, which Buildroot has successfully
downloaded and built.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-11 23:43:48 +02:00
Thomas Petazzoni
205fb19cdb linux: allow specification of a custom Git repository as a source
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-11 23:40:49 +02:00
Thomas Petazzoni
b0d446dee4 Improve TARGETS handling for bootloaders and kernel
As the kernel and bootloaders do not use the normal BR2_PACKAGE_*
Kconfig options, their target name was not automatically added to the
global TARGETS variable. Each bootloader .mk and the linux.mk had to
add their own target manually to TARGETS, and the package
infrastructure was making tests on non-existing Kconfig variables.

This commit improves the package infrastructure so that it looks at
BR2_PACKAGE_<pkg> for packages, BR2_TARGET_<pkg> for bootloaders and
at the special BR2_LINUX_KERNEL for the linux package.

This allows to simplify a little bit the bootloaders and linux .mk
files.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-11 23:40:23 +02:00
Thomas Petazzoni
9af0ee86b7 linux: convert to the GENTARGETS infrastructure
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-11 23:39:17 +02:00
Thomas Petazzoni
af52661d19 linux: rename LINUX26 to LINUX
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-11 23:38:58 +02:00
Peter Korsgaard
ce03b89881 linux: simplify modules check
No need to mix make and shell code.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-07 23:40:09 +02:00
Thomas Petazzoni
eff25f4cca linux: make it possible to install the kernel in /boot
[Peter: always copy to output/images as requested by Luca]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-07 23:16:05 +02:00
Yegor Yefremov
726b15f64a Create menu entry to select device creation method
Four methods for the creation of device files in /dev are now
proposed:

 - static method uses device table as before
 - devtmpfs method enables this feature in kernel
 - mdev method adds mdev starting script to the file system
    and selects mdev itself for installation
 - udev method selects udev for installation

All dynamic methods are based on devtmpfs, so one doesn't need to care
about /dev folder.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-05-09 14:20:03 +02:00
Martin Hicks
e2ed6c8e77 linux: Add support to specify special Kernel Image make target
This is useful for ARCHes like PowerPC that have a whole lot of
special targets for each different board.  The kernel image target
tells make which OpenFirmware machine description file is combined into
the kernel binary.

[Peter: fix long lines]
Signed-Off-By:  Martin Hicks <mort@bork.org>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-04-01 14:53:46 +02:00
Mike Frysinger
871db074b1 initial support for Blackfin processors
[Peter: don't allow MMU on bfin]
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-02-07 14:29:19 +01:00
Martin Hicks
d10e46fb76 Enable ccache for kernel compile
Just needed to pass in ccache as a prefix to the CROSS_TARGET variable.

Signed-off-by: Martin Hicks <mort@bork.org>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-02-01 20:51:15 +01:00
Peter Korsgaard
c1ce30f7f7 linux: fix linux- aliases
The generic linux-% alias conflicts with the linux-fusion package, so
add explicit aliases instead.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-27 22:50:18 +01:00
Thomas Petazzoni
e88704dfba linux: don't force IPv6 configuration in kernel
As per the discussion at
http://lists.busybox.net/pipermail/buildroot/2010-December/040030.html,
remove the bits that forced the IPv6 configuration in the kernel
depending on the toolchain ability to support (or not) IPv6. You may
have a toolchain with IPv6 support but still don't want to have IPv6
in your kernel.

The only parameters we adjust in the kernel configuration are:

 * ARM EABI, since we got a lot of bug reports regarding misconfigured
   kernel compared to the ABI used by userspace applications.

 * initramfs, since its contents are generated by Buildroot itself

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-22 22:19:30 +01:00
Bjørn Forsman
14c1a15fab linux: fix linux-% shortcut targets
linux-% shortcut targets (short for linux26-%) ignores the ouput dir
$(O) so that 'make O=output.arm linux-menuconfig' is actually run in the
default $(O) directory output/ and not in output.arm/. Fix by passing on
$(O) if set.

[Peter: Use EXTRAMAKEARGS]
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-19 21:16:37 +01:00
Bjørn Forsman
bf6fa18f4d linux: support 'make linux26-nconfig'
Signed-off-by: Bjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-19 21:10:00 +01:00
Thomas Petazzoni
84c4a10a75 linux: add KERNEL_ARCH_PATH to fix x86-specific issue
Both i386 and x86_64 architectures are supported by the arch/x86
directory in the kernel. So, when we copy the kernel configuration
file to arch/$(KERNEL_ARCH)/configs/, it does not work because
arch/i386 and arch/x86_64 do not exist.

So, we introduce KERNEL_ARCH_PATH, which is the path to the
architecture specific directory in the kernel source tree.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-17 17:00:18 +01:00
Thomas Petazzoni
71c05023d7 linux: add support for ELF vmlinux image
The ELF vmlinux image found at the root of the kernel source tree is
the format that Qemu needs when emulating mips(el) or ppc targets, so
add support for it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-17 16:53:18 +01:00
Thomas Petazzoni
55b0a375ea linux: support a space-separated list of patches
The kernel being a component that often needs a fairly important set
of changes to be adapted to a particular hardware platform, having
maximum flexibility on the patching process is a nice
thing. Therefore, as per the discussions from the Buildroot Developer
Day, we add a mechanism to apply a list of patches (that could come
either from URLs, local files or local directories).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-16 22:30:18 +01:00
Thomas Petazzoni
fb358f7b38 linux: Import minimal defconfigs as defconfigs
Now that minimal kernel defconfigs are used in Buildroot, the problem
is that copying those minimal configuration files to .config in the
kernel source tree does not work, as kconfig will ask interactively
what should be the value for all unspecified options.

On suggestion on Sam Ravnborg, the easiest way to solve this is to
import the minimal defconfig file as a defconfig inside the kernel
tree (in arch/$(ARCH)/configs) and configure the kernel with it.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-16 22:25:32 +01:00
Mike Frysinger
b7a2358f0b linux: restore DEPMOD usage
The linux.mk rewrite lost the DEPMOD setting while installing modules
which means depending on host-module-init-tools has been useless.
Instead, the build system has been executing /sbin/depmod.

While we're here, drop the INSTALL_MOD_PATH since LINUX26_MAKE_FLAGS
already contains it.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-11 22:57:07 +01:00
Mike Frysinger
176afdb3a1 linux: add shorter shortcuts
We only have one Linux kernel package, and "linux26-" is an anachronism
in today's world.  So add useful "linux-%" shortcuts to the "linux26-%".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-11 02:01:10 +01:00
Mike Frysinger
56d387716a linux: set a few more initramfs opts for newer kernels
Building with linux-2.6.36 and initramfs support causes the build to
pause while it prompts for newer options (uid/gid/compression).  So
have the build system inject the newer options into the linux config
automatically.  Older versions should just ignore these.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-11 01:41:00 +01:00
Mike Frysinger
3bbf1c2ea6 linux: drop LDFLAGS override
The current linux code overrides LDFLAGS that the kernel itself might be
setting up. Looking at the history, there doesn't seem to be any reason
for this override. It was added in ea8b1fa6a6 without any logic.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-12-07 23:01:35 +01:00
Mike Frysinger
f80fdd2a33 linux: update paths to compiled cpio files
Linux has been using "usr/initramfs_data.cpio" for a few releases as the
generated cpio name, so the buildroot match of "...cpio.*" won't actually
clean out the previous result.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-11-17 17:22:51 +01:00
Peter Korsgaard
d0c3d1cf43 sed: get rid of host-sed variant
And all the infrastructure surrounding it. A broken sed implementation
is quite rare nowadays, as seen by the fact that the current host-sed
support has been broken for a while, so just get rid of it.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-09-30 23:09:39 +02:00
Thomas Petazzoni
96652637cc linux: fix uImage location on AVR32
On most architectures, the kernel image can be found in
arch/<ARCH>/boot, but on AVR32, it's in arch/<ARCH>/boot/images.

Issue initially reported by Joachim Pihl
<joachim.pihl@sensordevelopments.com>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-09-29 00:14:21 +02:00
Thomas Petazzoni
b626dc0791 linux: restrict output image formats to the appropriate arches
Some Linux kernel output image formats are available on some archs,
some not. For example 'uImage' is not supported on MIPS, so let's
prevent the user from making this selection.

Issue initially reported by Choi, David <David.Choi@Micrel.Com>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-09-29 00:14:21 +02:00
Peter Korsgaard
3e5e39a8a2 barebox/u-boot/linux: don't error out on missing config when make source
As it breaks 'make allyesconfig; make source', used for the source mirror.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-09-28 14:43:25 +02:00
Thomas Petazzoni
ee3f319249 linux: don't force no initramfs
When initramfs was not selected as a root filesystem, we forcefully
disabled the initramfs in the kernel configuration.

However, it prevents an user from manually managing its initramfs, as
we override the option he has set in his kernel configuration
file. There's no real reason to do so: when initramfs is not selected
as the root filesystem, just don't touch initramfs related options in
the kernel configuration.

Problem reported by Sergey Naumov <sknaumov@gmail.com>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-09-15 21:17:35 +02:00
Thomas Petazzoni
af5dc83da4 linux: more mistake detection
Just as we do for U-Boot, error out in the Linux kernel makefile when
the defconfig name or the configuration file path are not
correct. What prompted me to implement this was a report on IRC from
an user using BR 2010.05 and not understand why the kernel build
process was failing. It was because he just forgot to set the path of
the configuration file.

Of course, it doesn't catch all mistakes (like pointing to a
non-existing defconfig or to a non-existing configuration file), but
it at least catches basic mistakes.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-07-29 22:18:57 +02:00
Peter Korsgaard
c9ff3273eb linux: linux26-{menu,x,g}config needs host-sed
Similar to how it's done for uclibc-menuconfig.

Reported-by: Paul Jones <paul@pauljones.id.au>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-07-20 08:45:45 +02:00
Thomas Petazzoni
f507921d39 linux: add support for initramfs
In Buildroot, the kernel is built and installed *before* the root
filesystems are built. This allows the root filesystem to correctly
contain the kernel modules that have been installed.

However, in the initramfs case, the root filesystem is part of the
kernel. Therefore, the kernel should be built *after* the root
filesystem (which, in the initramfs case simply builds a text file
listing all files/directories/devices/symlinks that should be part of
the initramfs). However, this isn't possible as the initramfs text
file would lack all kernel modules.

So, the solution choosen here is to keep the normal order: kernel is
built before the root filesystem is generated, and to add a little
quirk to retrigger a kernel compilation after the root filesystem
generation.

To do so, we add a ROOTFS_$(FSTYPE)_POST_TARGETS variable to the
fs/common.mk infrastructure. This allows individual filesystems to set
a target name that we should depend on *after* generating the root
filesystem itself (contrary to normal ROOTFS_$(FSTYPE)_DEPENDENCIES,
on which we depend *before* generating the root filesystem).

The initramfs code in fs/initramfs/initramfs.mk uses this to add a
dependency on 'linux26-rebuild-with-initramfs'.

In linux/linux.mk, we do various things :

 * If BR2_TARGET_ROOTFS_INITRAMFS is enabled (i.e if initramfs is
   enabled as a root filesystem type), then we create an empty
   rootfs.initramfs file (remember that at this point, the root
   filesystem hasn't been generated) and we adjust the kernel
   configuration to include an initramfs. Of course, in the initial
   kernel build, this initramfs will be empty.

 * In the linux26-rebuild-with-initramfs target, we retrigger a
   compilation of the kernel image, after removing the initramfs in
   the kernel sources to make sure it gets properly rebuilt (we've
   experienced cases were modifying the rootfs.initramfs file wouldn't
   retrigger the generation of the initramfs at the kernel level).

This is fairly quirky, but initramfs really is a special case, so in
one way or another, we need a little quirk to solve its specialness.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-22 21:20:28 +02:00
Thomas Petazzoni
4944e8c883 linux: add support for linux26-{menuconfig,xconfig,gconfig} targets
These targets allow the user to customize the configuration of the
Linux kernel. After changing the kernel configuration, the next time
the user runs "make", the kernel is rebuilt to take into account the
new configuration (not rebuilt from scratch).

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-22 21:20:27 +02:00
Thomas Petazzoni
100c09a53b linux: adjust kernel config according to the Buildroot configuration
We only adjust the configuration or ARM EABI and IPv6. The (more
complicated) initramfs case is handled in a separate commit. The user
is expected to take care of all other configuration details (like
having Netfilter enabled to make iptables work, etc.)

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-22 21:20:27 +02:00
Thomas Petazzoni
dc4d5647a5 linux: Add dependency on host-module-init-tools
In order to not depend on module init tools being installed on the
development environment of the Buildroot user, let's build module init
tools for the host.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-22 21:20:27 +02:00
Thomas Petazzoni
487e21cff6 New, simpler, infrastructure for building the Linux kernel
This patch introduces a single, simple, infrastructure to build the
Linux kernel. The configuration is limited to :

 * Kernel version: a fixed recent stable version, same as kernel
   headers version (for internal toolchains only), custom stable
   version, or custom tarball URL

 * Kernel patch: either a local file, directory or an URL

 * Kernel configuration: either the name of a defconfig or the
   location of a custom configuration file

 * Kernel image: either uImage, bzImage, zImage or vmlinux.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-22 21:20:25 +02:00