Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop
@ 2014-02-08 16:26 Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 1/3] packages infra: add function to get a Kconfig option Yann E. MORIN
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-02-08 16:26 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

Hello All!

Here is a small series that makes Linux not always depend on host-lzop,
and also cleans up a little bit the linux.mk.


Changes v1 -> v2:
  - use simpler sed expression  (Peter)
  - don't use 'define' to define the function  (Arnout)
  - initrd and initramfs may also require lzo  (Peter)
  - move qstrip to the initial assignment  (Arnout)
  - check the linux config file exists  (Peter)


Regards,
Yann E. MORIN.


----------------------------------------------------------------
Yann E. MORIN (3):
      packages infra: add function to get a Kconfig option
      linux: only depend on host-lzop if needed
      linux: check the configuration file exists

 linux/linux.mk       | 15 +++++++++++++--
 package/pkg-utils.mk |  2 ++
 2 files changed, 15 insertions(+), 2 deletions(-)

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 1/3] packages infra: add function to get a Kconfig option
  2014-02-08 16:26 [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Yann E. MORIN
@ 2014-02-08 16:26 ` Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 2/3] linux: only depend on host-lzop if needed Yann E. MORIN
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-02-08 16:26 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

We so far have no mean to get the value from a Kconfig option from the
.config file of a package (eg. linux, busybox...).

Add a new function that returns the unmangled value of an option.
It expect two arguments:
  - the Kconfig option name (complete, with leading CONFIG if necessary)
  - the .config file to get it from

Note that, if the Kconfig option is a string, the returned value will
contain the leading and trailing double-quotes.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Peter Korsgaard <jacmet@uclibc.org>
Cc: Arnout Vandecappelle <arnout@mind.be>

---
Changes v1 -> v2:
  - use simpler sed expression  (Peter)
  - use simple assignment, not a define  (Arnout)

Note: when we have the Kconfig's 'config' script, we can revisit this
to use 'config' instead of our own sed hack.
---
 package/pkg-utils.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 91a1981..99fefe6 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -52,6 +52,8 @@ define KCONFIG_DISABLE_OPT
 	echo "# $(1) is not set" >> $(2)
 endef
 
+KCONFIG_GET_OPT = $(shell sed -e 's/^$(1)=//p' $(2))
+
 # Helper functions to determine the name of a package and its
 # directory from its makefile directory, using the $(MAKEFILE_LIST)
 # variable provided by make. This is used by the *TARGETS macros to
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 2/3] linux: only depend on host-lzop if needed
  2014-02-08 16:26 [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 1/3] packages infra: add function to get a Kconfig option Yann E. MORIN
@ 2014-02-08 16:26 ` Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 3/3] linux: check the configuration file exists Yann E. MORIN
  2014-03-03 21:23 ` [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Thomas Petazzoni
  3 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-02-08 16:26 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

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>

---
Changes v1 -> v2:
  - also select if initrd or initramfs compression is lzo  (Peter)
---
 linux/linux.mk | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/linux/linux.mk b/linux/linux.mk
index 1a81f77..e8c007d 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -41,7 +41,7 @@ endif
 LINUX_PATCHES = $(call qstrip,$(BR2_LINUX_KERNEL_PATCH))
 
 LINUX_INSTALL_IMAGES = YES
-LINUX_DEPENDENCIES  += host-kmod host-lzop
+LINUX_DEPENDENCIES  += host-kmod
 
 ifeq ($(BR2_LINUX_KERNEL_UBOOT_IMAGE),y)
 	LINUX_DEPENDENCIES += host-uboot-tools
@@ -163,7 +163,14 @@ LINUX_POST_PATCH_HOOKS += LINUX_APPLY_PATCHES
 ifeq ($(BR2_LINUX_KERNEL_USE_DEFCONFIG),y)
 KERNEL_SOURCE_CONFIG = $(KERNEL_ARCH_PATH)/configs/$(call qstrip,$(BR2_LINUX_KERNEL_DEFCONFIG))_defconfig
 else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
-KERNEL_SOURCE_CONFIG = $(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE)
+KERNEL_SOURCE_CONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
+endif
+
+ifeq ($(call KCONFIG_GET_OPT,CONFIG_KERNEL_LZO,$(KERNEL_SOURCE_CONFIG)),y)
+LINUX_DEPENDENCIES += host-lzop
+endif
+ifeq ($(call KCONFIG_GET_OPT,CONFIG_RD_LZO,$(KERNEL_SOURCE_CONFIG)),y)
+LINUX_DEPENDENCIES += host-lzop
 endif
 
 define LINUX_CONFIGURE_CMDS
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 3/3] linux: check the configuration file exists
  2014-02-08 16:26 [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 1/3] packages infra: add function to get a Kconfig option Yann E. MORIN
  2014-02-08 16:26 ` [Buildroot] [PATCH 2/3] linux: only depend on host-lzop if needed Yann E. MORIN
@ 2014-02-08 16:26 ` Yann E. MORIN
  2014-03-03 21:23 ` [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Thomas Petazzoni
  3 siblings, 0 replies; 6+ messages in thread
From: Yann E. MORIN @ 2014-02-08 16:26 UTC (permalink / raw)
  To: buildroot

From: "Yann E. MORIN" <yann.morin.1998@free.fr>

... 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>
---
 linux/linux.mk | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux/linux.mk b/linux/linux.mk
index e8c007d..f4a4bfd 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -166,6 +166,10 @@ else ifeq ($(BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG),y)
 KERNEL_SOURCE_CONFIG = $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE))
 endif
 
+ifeq ($(wildcard $(KERNEL_SOURCE_CONFIG)),)
+$(error Configuration file '$(KERNEL_SOURCE_CONFIG)' not found.)
+endif
+
 ifeq ($(call KCONFIG_GET_OPT,CONFIG_KERNEL_LZO,$(KERNEL_SOURCE_CONFIG)),y)
 LINUX_DEPENDENCIES += host-lzop
 endif
-- 
1.8.1.2

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop
  2014-02-08 16:26 [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Yann E. MORIN
                   ` (2 preceding siblings ...)
  2014-02-08 16:26 ` [Buildroot] [PATCH 3/3] linux: check the configuration file exists Yann E. MORIN
@ 2014-03-03 21:23 ` Thomas Petazzoni
  2014-03-04 18:19   ` Thomas Petazzoni
  3 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2014-03-03 21:23 UTC (permalink / raw)
  To: buildroot

Dear Yann E. MORIN,

On Sat,  8 Feb 2014 17:26:03 +0100, Yann E. MORIN wrote:

> Here is a small series that makes Linux not always depend on host-lzop,
> and also cleans up a little bit the linux.mk.

Series applied, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop
  2014-03-03 21:23 ` [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Thomas Petazzoni
@ 2014-03-04 18:19   ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2014-03-04 18:19 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 3 Mar 2014 22:23:17 +0100, Thomas Petazzoni wrote:
> Dear Yann E. MORIN,
> 
> On Sat,  8 Feb 2014 17:26:03 +0100, Yann E. MORIN wrote:
> 
> > Here is a small series that makes Linux not always depend on host-lzop,
> > and also cleans up a little bit the linux.mk.
> 
> Series applied, thanks.

And I've reverted it because it simply cannot work with internal
defconfig of the kernel, since they are only available after the kernel
has been extracted, which is too late to declare whether we need the
host-lzop dependency or not.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-04 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-08 16:26 [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Yann E. MORIN
2014-02-08 16:26 ` [Buildroot] [PATCH 1/3] packages infra: add function to get a Kconfig option Yann E. MORIN
2014-02-08 16:26 ` [Buildroot] [PATCH 2/3] linux: only depend on host-lzop if needed Yann E. MORIN
2014-02-08 16:26 ` [Buildroot] [PATCH 3/3] linux: check the configuration file exists Yann E. MORIN
2014-03-03 21:23 ` [Buildroot] [PATCH 0/3 v2] linux: do not always depend on host-lzop Thomas Petazzoni
2014-03-04 18:19   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox