* [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports)
@ 2015-07-22 14:58 Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 1/4 v8] core/pkg-kconfig: do not override @D Yann E. MORIN
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-07-22 14:58 UTC (permalink / raw)
To: buildroot
Hello All!
This series introduces linux-backports, which contains drivers from
recent kernels, backported unto older kernels (down to 3.0).
The series starts by fixing a shortcoming in the pkg-kconfig infra, then
does a bit of eye-candy in the Linux package, and finally introduces
linux-backports.
The thirs patch, linux-backports itself, uses a pure generic package,
and does not make use of the kernel-module infra, while the fourth and
latest patch converts it over to the kernel-module infra.
I'm not sure using the kernel-module infra is worth it, because it does
not gain us much in this case. Yet, it makes for a slightly more
beautiful .mk (IMHO!), even if a bit longer (+4 lines).
In the end, using it or not is the same to me (with a very slight
preference for using it, of course, but I won't mind either way).
Thanks go to Petr for doing the initial packaging of linux-backports,
and Arnout for suggesting the fix in patch 1. :-)
Regards,
Yann E. MORIN.
The following changes since commit 1f640a4e7a42667a88101f6ceb787fbb118a6acf:
zedboard: Switch to U-Boot 2015.07 (2015-07-22 14:31:55 +0200)
are available in the git repository at:
git://git.busybox.net/~ymorin/git/buildroot yem/linux-backports
for you to fetch changes up to 200f17ef13ac12610b33139a1b1f8820fc0c85bd:
package/linux-backports: switch to using the kernel-module infra (2015-07-22 16:44:57 +0200)
----------------------------------------------------------------
Petr Vorel (1):
package/linux-backports: new package
Yann E. MORIN (3):
core/pkg-kconfig: do not override @D
package/linux: trash stderr in LINUX_VERSION_PROBED
package/linux-backports: switch to using the kernel-module infra
linux/linux.mk | 2 +-
package/Config.in | 1 +
package/linux-backports/Config.in | 52 ++++++++++++++++++
package/linux-backports/linux-backports.hash | 2 +
package/linux-backports/linux-backports.mk | 81 ++++++++++++++++++++++++++++
package/pkg-kconfig.mk | 16 +++---
6 files changed, 146 insertions(+), 8 deletions(-)
create mode 100644 package/linux-backports/Config.in
create mode 100644 package/linux-backports/linux-backports.hash
create mode 100644 package/linux-backports/linux-backports.mk
--
.-----------------.--------------------.------------------.--------------------.
| 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] 8+ messages in thread
* [Buildroot] [PATCH 1/4 v8] core/pkg-kconfig: do not override @D
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
@ 2015-07-22 14:58 ` Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 2/4 v8] package/linux: trash stderr in LINUX_VERSION_PROBED Yann E. MORIN
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-07-22 14:58 UTC (permalink / raw)
To: buildroot
Currently, we override @D for the kconfig configurators, so the fixup
commands can use $(@D); otherwise @D would be simply '.' because it is
not a real file in the package build dir.
However, this breaks the soon-to-be-introduced linux-backports package,
which needs to have a dependency on the linux package to be configured.
The underlying reason is that @D is an automatic variable that is always
set by make to the directory part of the target of the rule. However,
automatic variables loose their "automatic" property when they are
manually set.
Furthermore, a variable that is defined for a rule is inherited by all
dependencies of that rule, so our manually-set @D is inherited all the
way down the dependency chain of linux-backports, down to the linux' own
.config rule, which is thus run with @D pointing to linux-backports'
build dir, not linux'.
Fix that by using a "static pattern rule", redirecting the configurators
to an intermediate stamp-like file which path is in the package build
dir, so we get a valid @D from the onset, without having to manually
fiddle with it.
Thanks to Arnout for suggesting that in the first place. Sorry I did
reject it as "too complex" when it was in fact the best solution.
Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
---
package/pkg-kconfig.mk | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/package/pkg-kconfig.mk b/package/pkg-kconfig.mk
index 3e17a70..375607f 100644
--- a/package/pkg-kconfig.mk
+++ b/package/pkg-kconfig.mk
@@ -104,15 +104,16 @@ endif
# that is clean wrt. our requirements.
#
# Because commands in $(1)_FIXUP_KCONFIG are probably using $(@D), we
-# fake it for the configurators (otherwise it is set to just '.', i.e.
-# the current directory where make is run, which happens to be in
-# $(TOPDIR), because the target of the rule is not an actual file, so
-# does not have any path component).
+# need to have a valid @D set. But, because the configurators rules are
+# not real files and do not contain the path to the package build dir,
+# @D would be just '.' in this case. So, we use an intermediate rule
+# with a stamp-like file which path is in the package build dir, so we
+# end up having a valid @D.
#
-$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): @D=$$($(2)_DIR)
-$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $$($(2)_DIR)/.stamp_kconfig_fixup_done
+$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS)): $(1)-%: $$($(2)_DIR)/.kconfig_editor_%
+$$($(2)_DIR)/.kconfig_editor_%: $$($(2)_DIR)/.stamp_kconfig_fixup_done
$$($(2)_MAKE_ENV) $$(MAKE) -C $$($(2)_DIR) \
- $$($(2)_KCONFIG_OPTS) $$(subst $(1)-,,$$@)
+ $$($(2)_KCONFIG_OPTS) $$(*)
rm -f $$($(2)_DIR)/.stamp_{kconfig_fixup_done,configured,built}
rm -f $$($(2)_DIR)/.stamp_{target,staging,images}_installed
$$(call $(2)_FIXUP_DOT_CONFIG)
@@ -169,6 +170,7 @@ endif # package enabled
$(1)-update-defconfig \
$(1)-savedefconfig \
$(1)-check-configuration-done \
+ $$($(2)_DIR)/.kconfig_editor_% \
$$(addprefix $(1)-,$$($(2)_KCONFIG_EDITORS))
endef # inner-kconfig-package
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 2/4 v8] package/linux: trash stderr in LINUX_VERSION_PROBED
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 1/4 v8] core/pkg-kconfig: do not override @D Yann E. MORIN
@ 2015-07-22 14:58 ` Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package Yann E. MORIN
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Yann E. MORIN @ 2015-07-22 14:58 UTC (permalink / raw)
To: buildroot
The Linux buildsystem tries to run the compiler even just for
'kernelrelease' (which we store in LINUX_VERSION_PROBED) and we
sometimes need to use it before the toolchain is available; thus
we get spurious errors on stderr.
Consign stderr to oblivion when computing the 'kernelrelease'.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
linux/linux.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux/linux.mk b/linux/linux.mk
index 375a9e1..d91dbb2 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -76,7 +76,7 @@ LINUX_MAKE_ENV = \
# Get the real Linux version, which tells us where kernel modules are
# going to be installed in the target filesystem.
-LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease`
+LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`
ifeq ($(BR2_LINUX_KERNEL_USE_INTREE_DTS),y)
KERNEL_DTS_NAME = $(call qstrip,$(BR2_LINUX_KERNEL_INTREE_DTS_NAME))
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 1/4 v8] core/pkg-kconfig: do not override @D Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 2/4 v8] package/linux: trash stderr in LINUX_VERSION_PROBED Yann E. MORIN
@ 2015-07-22 14:58 ` Yann E. MORIN
2015-07-22 15:03 ` Thomas Petazzoni
2015-07-22 14:58 ` [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra Yann E. MORIN
2015-07-22 15:25 ` [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Thomas Petazzoni
4 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2015-07-22 14:58 UTC (permalink / raw)
To: buildroot
From: Petr Vorel <petr.vorel@gmail.com>
https://backports.wiki.kernel.org
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
Changes v7 -> v8: (Yann)
- fix option ordering and prompts in Config.in
- drop editors, only menuconfig is available
- add licensing information
- bump to 4.1.1-1, drop 4.0.1-1 patch
- move custom error message before call to kconfig-package
- use $(BR_BUILDING) instead of custom, wrong test on 'make source'
- drop intermediate variable to set LINUX_BACKPORTS_KCONFIG_FILE
- qstrip all variables from Config.in
- fix dependencies (tricky, needs kernel to be configured)
- check kernel is >= 3.0
Changes v6->v7:
* Bump version to lastest stable 4.0.1-1.
* Update to current version of kconfig-package.
* Add option to specify config fragments.
* Include upstream patch to fix build error.
Changes v5->v6:
Added changes by Arnout Vandecappelle in Mon Apr 20 21:46:34 UTC 2015:
* linux-backports.mk: $(LINUX_BACKPORTS_KCONFIG_FILE): linux
this doesn't help: we'd need to use:
LINUX_BACKPORTS_KCONFIG_FILE := $(LINUX_BACKPORTS_DIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
but then we don't get value for $(LINUX_BACKPORTS_DIR) nor $(@D).
* linux-backports.mk: LINUX_BACKPORTS_PATCH_DEPENDENCIES = linux
This also does not help, it does linux extracting, patching, but we
need also configuring. We'd need something like
LINUX_BACKPORTS_CONFIGURE_DEPENDENCIES to be implemented.
* Config.in: info about support from kernel 3.0.
* Config.in: help text wrapped to 72 columns.
Changes v4->v5:
* Added changes made by Thomas Petazzoni in Sun, 19 Apr 2015 11:03:26 +0200.
Changes v3->v4:
* Define LINUX_BACKPORTS_MAKE_ENV instead of LINUX_BACKPORTS_MAKE_OPTS, remove TARGET_MAKE_ENV from it.
* Add nconfig to LINUX_BACKPORTS_KCONFIG_EDITORS.
* Clean formating of build commands.
---
package/Config.in | 1 +
package/linux-backports/Config.in | 52 +++++++++++++++++
package/linux-backports/linux-backports.hash | 2 +
package/linux-backports/linux-backports.mk | 85 ++++++++++++++++++++++++++++
4 files changed, 140 insertions(+)
create mode 100644 package/linux-backports/Config.in
create mode 100644 package/linux-backports/linux-backports.hash
create mode 100644 package/linux-backports/linux-backports.mk
diff --git a/package/Config.in b/package/Config.in
index 9942e3a..db84cd7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -372,6 +372,7 @@ endif
source "package/kbd/Config.in"
source "package/lcdproc/Config.in"
source "package/libump/Config.in"
+ source "package/linux-backports/Config.in"
source "package/lirc-tools/Config.in"
source "package/lm-sensors/Config.in"
source "package/lshw/Config.in"
diff --git a/package/linux-backports/Config.in b/package/linux-backports/Config.in
new file mode 100644
index 0000000..e858a45
--- /dev/null
+++ b/package/linux-backports/Config.in
@@ -0,0 +1,52 @@
+comment "linux-backports needs a Linux kernel to be built"
+ depends on !BR2_LINUX_KERNEL
+
+config BR2_PACKAGE_LINUX_BACKPORTS
+ bool "linux-backports"
+ depends on BR2_LINUX_KERNEL
+ help
+ The linux-backports package includes many Linux drivers from
+ recent kernels, backported to older ones.
+
+ This version of linux-backports supports kernels starting from 3.0.
+
+ https://backports.wiki.kernel.org
+
+if BR2_PACKAGE_LINUX_BACKPORTS
+
+choice
+ prompt "Linux kernel driver backports configuration"
+ default BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG
+
+config BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG
+ bool "Using an in-tree defconfig file"
+
+config BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG
+ bool "Using a custom (def)config file"
+
+endchoice
+
+config BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG
+ string "Defconfig name"
+ depends on BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG
+ help
+ Name of the backports defconfig file to use, without the
+ leading defconfig-. The defconfig is located in defconfigs/
+ directory in the backports tree.
+
+config BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE
+ string "Configuration file path"
+ depends on BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG
+ help
+ Path to the backports configuration file
+
+ Note: this can be a defconfig file or a complete .config file,
+ which can later be saved back with make linux-update-(def)config.
+
+config BR2_PACKAGE_LINUX_BACKPORTS_CONFIG_FRAGMENT_FILES
+ string "Additional configuration fragment files"
+ help
+ A space-separated list of configuration fragment files, that
+ will be merged to the main linux-backports configuration file.
+
+endif # BR2_PACKAGE_LINUX_BACKPORTS
diff --git a/package/linux-backports/linux-backports.hash b/package/linux-backports/linux-backports.hash
new file mode 100644
index 0000000..0d41067
--- /dev/null
+++ b/package/linux-backports/linux-backports.hash
@@ -0,0 +1,2 @@
+# From: https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v4.1.1/sha256sums.asc
+sha256 7fca160665b801796ce50def18f2fd6def1c4452290e93ec5332444fb2021bd6 backports-4.1.1-1.tar.xz
diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
new file mode 100644
index 0000000..790d7e4
--- /dev/null
+++ b/package/linux-backports/linux-backports.mk
@@ -0,0 +1,85 @@
+################################################################################
+#
+# linux-backports
+#
+################################################################################
+
+LINUX_BACKPORTS_VERSION_MAJOR = 4.1.1
+LINUX_BACKPORTS_VERSION = $(LINUX_BACKPORTS_VERSION_MAJOR)-1
+LINUX_BACKPORTS_SOURCE = backports-$(LINUX_BACKPORTS_VERSION).tar.xz
+LINUX_BACKPORTS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/projects/backports/stable/v$(LINUX_BACKPORTS_VERSION_MAJOR)
+LINUX_BACKPORTS_LICENSE = GPLv2
+LINUX_BACKPORTS_LICENSE_FILES = COPYING
+
+LINUX_BACKPORTS_DEPENDENCIES = linux
+
+LINUX_BACKPORTS_MAKE_OPTS = \
+ $(LINUX_MAKE_FLAGS) \
+ KLIB_BUILD=$(LINUX_DIR) \
+ KLIB=$(TARGET_DIR)
+
+ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
+LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_DIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
+else ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG),y)
+LINUX_BACKPORTS_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE))
+endif
+
+define LINUX_BACKPORTS_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) -C $(@D)
+endef
+
+define LINUX_BACKPORTS_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
+ -C $(LINUX_DIR) M=$(@D) \
+ INSTALL_MOD_DIR=backports \
+ modules_install
+endef
+
+LINUX_BACKPORTS_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CONFIG_FRAGMENT_FILES))
+LINUX_BACKPORTS_KCONFIG_OPTS = $(LINUX_BACKPORTS_MAKE_OPTS)
+
+# Checks to give errors that the user can understand
+ifeq ($(BR_BUILDING),y)
+
+ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG)),)
+$(error No linux-backports defconfig name specified, check your BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG setting)
+endif
+endif
+
+ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE)),)
+$(error No linux-backports configuration file specified, check your BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE setting)
+endif
+endif
+
+endif # BR_BUILDING
+
+$(eval $(kconfig-package))
+
+# linux-backports' own .config file needs options from the kernel's own
+# .config file. The dependencies handling in the infrastructure does not
+# allow to express this kind of dependencies. Besides, linux.mk might
+# not have been parsed yet, so the Linux build dir is not yet known and
+# the LINUX_VERSION variable is not yet set, so we must re-construct that
+# manually here... :-(
+#
+# It must also come after the call to kconfig-package, so we get
+# LINUX_BACKPORTS_DIR properly defined.
+#
+# Thus, we need to have this specially-crafted, hand-made dependency...
+#
+# Furthermore, we want to check the kernel version, since linux-backports
+# only supports kernels >= 3.0. To avoid overriding linux-backports'
+# .config rule define in the kconfig-package infra, we use an intermediate
+# rule.
+#
+$(LINUX_BACKPORTS_DIR)/.config: linux-backports-check-kernel-version
+
+linux-backports-check-kernel-version: $(BUILD_DIR)/linux-$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))/.config
+ $(Q)LINUX_VERSION_PROBED=$(LINUX_VERSION_PROBED); \
+ if [ $${LINUX_VERSION_PROBED%%.*} -lt 3 ]; then \
+ printf "Linux version '%s' is too old for linux-backports (needs 3.0 or later)\n" \
+ "$${LINUX_VERSION_PROBED}"; \
+ exit 1; \
+ fi
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
` (2 preceding siblings ...)
2015-07-22 14:58 ` [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package Yann E. MORIN
@ 2015-07-22 14:58 ` Yann E. MORIN
2015-07-22 15:05 ` Thomas Petazzoni
2015-07-22 15:25 ` [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Thomas Petazzoni
4 siblings, 1 reply; 8+ messages in thread
From: Yann E. MORIN @ 2015-07-22 14:58 UTC (permalink / raw)
To: buildroot
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Petr Vorel <petr.vorel@gmail.com>
---
package/linux-backports/linux-backports.mk | 32 +++++++++++++-----------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/package/linux-backports/linux-backports.mk b/package/linux-backports/linux-backports.mk
index 790d7e4..7c10270 100644
--- a/package/linux-backports/linux-backports.mk
+++ b/package/linux-backports/linux-backports.mk
@@ -11,33 +11,28 @@ LINUX_BACKPORTS_SITE = $(BR2_KERNEL_MIRROR)/linux/kernel/projects/backports/stab
LINUX_BACKPORTS_LICENSE = GPLv2
LINUX_BACKPORTS_LICENSE_FILES = COPYING
-LINUX_BACKPORTS_DEPENDENCIES = linux
-
-LINUX_BACKPORTS_MAKE_OPTS = \
- $(LINUX_MAKE_FLAGS) \
- KLIB_BUILD=$(LINUX_DIR) \
- KLIB=$(TARGET_DIR)
-
ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
LINUX_BACKPORTS_KCONFIG_FILE = $(LINUX_BACKPORTS_DIR)/defconfigs/$(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG))
else ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG),y)
LINUX_BACKPORTS_KCONFIG_FILE = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE))
endif
-define LINUX_BACKPORTS_BUILD_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) -C $(@D)
-endef
-
-define LINUX_BACKPORTS_INSTALL_TARGET_CMDS
- $(TARGET_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
- -C $(LINUX_DIR) M=$(@D) \
- INSTALL_MOD_DIR=backports \
- modules_install
-endef
-
LINUX_BACKPORTS_KCONFIG_FRAGMENT_FILES = $(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_CONFIG_FRAGMENT_FILES))
LINUX_BACKPORTS_KCONFIG_OPTS = $(LINUX_BACKPORTS_MAKE_OPTS)
+LINUX_BACKPORTS_MAKE_OPTS = \
+ BACKPORT_DIR=$(@D) \
+ KLIB_BUILD=$(LINUX_DIR) \
+ KLIB=$(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED) \
+ `sed -r -e '/^\#/d;' $(@D)/.config`
+
+LINUX_BACKPORTS_MODULE_MAKE_OPTS = $(LINUX_BACKPORTS_MAKE_OPTS)
+
+define LINUX_BACKPORTS_AUTOCONF
+ $(MAKE) -C $(@D) $(LINUX_BACKPORTS_MAKE_OPTS) backport-include/backport/autoconf.h
+endef
+LINUX_BACKPORTS_POST_CONFIGURE_HOOKS += LINUX_BACKPORTS_AUTOCONF
+
# Checks to give errors that the user can understand
ifeq ($(BR_BUILDING),y)
@@ -55,6 +50,7 @@ endif
endif # BR_BUILDING
+$(eval $(kernel-module))
$(eval $(kconfig-package))
# linux-backports' own .config file needs options from the kernel's own
--
1.9.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package
2015-07-22 14:58 ` [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package Yann E. MORIN
@ 2015-07-22 15:03 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-07-22 15:03 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Wed, 22 Jul 2015 16:58:54 +0200, Yann E. MORIN wrote:
> +linux-backports-check-kernel-version: $(BUILD_DIR)/linux-$(call qstrip,$(BR2_LINUX_KERNEL_VERSION))/.config
Doesn't this fail really badly if:
LINUX_OVERRIDE_SRCDIR = <some value>
?
In this case, $(LINUX_DIR) is $(BUILD_DIR)/linux-custom/ and not
$(BUILD_DIR)/linux-$(call qstrip,$(BR2_LINUX_KERNEL_VERSION)).
Argh :-/
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra
2015-07-22 14:58 ` [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra Yann E. MORIN
@ 2015-07-22 15:05 ` Thomas Petazzoni
0 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-07-22 15:05 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Wed, 22 Jul 2015 16:58:55 +0200, Yann E. MORIN wrote:
> +LINUX_BACKPORTS_MAKE_OPTS = \
> + BACKPORT_DIR=$(@D) \
> + KLIB_BUILD=$(LINUX_DIR) \
> + KLIB=$(TARGET_DIR)/lib/modules/$(LINUX_VERSION_PROBED) \
> + `sed -r -e '/^\#/d;' $(@D)/.config`
For sure this last line needs a comment.
> +LINUX_BACKPORTS_MODULE_MAKE_OPTS = $(LINUX_BACKPORTS_MAKE_OPTS)
What is this useful for?
> +define LINUX_BACKPORTS_AUTOCONF
> + $(MAKE) -C $(@D) $(LINUX_BACKPORTS_MAKE_OPTS) backport-include/backport/autoconf.h
> +endef
> +LINUX_BACKPORTS_POST_CONFIGURE_HOOKS += LINUX_BACKPORTS_AUTOCONF
Also a comment above this would be good to have.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports)
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
` (3 preceding siblings ...)
2015-07-22 14:58 ` [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra Yann E. MORIN
@ 2015-07-22 15:25 ` Thomas Petazzoni
4 siblings, 0 replies; 8+ messages in thread
From: Thomas Petazzoni @ 2015-07-22 15:25 UTC (permalink / raw)
To: buildroot
Dear Yann E. MORIN,
On Wed, 22 Jul 2015 16:58:49 +0200, Yann E. MORIN wrote:
> Yann E. MORIN (3):
> core/pkg-kconfig: do not override @D
> package/linux: trash stderr in LINUX_VERSION_PROBED
I've applied those two preparations patches.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-07-22 15:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 14:58 [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 1/4 v8] core/pkg-kconfig: do not override @D Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 2/4 v8] package/linux: trash stderr in LINUX_VERSION_PROBED Yann E. MORIN
2015-07-22 14:58 ` [Buildroot] [PATCH 3/4 v8] package/linux-backports: new package Yann E. MORIN
2015-07-22 15:03 ` Thomas Petazzoni
2015-07-22 14:58 ` [Buildroot] [PATCH 4/4 v8] package/linux-backports: switch to using the kernel-module infra Yann E. MORIN
2015-07-22 15:05 ` Thomas Petazzoni
2015-07-22 15:25 ` [Buildroot] [PATCH 0/4 v8] linux-backports (new package) and misc related fixes (branch yem/linux-backports) Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox