Skip to contentSkip to conversation

Added linux drivers backports project

PATCH Superseded Petr Vorel 2 participants 4 messages Apr 17, 2015

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 Added linux drivers backports project

From: Petr Vorel <[email protected]>

Just added missing custom checks.

Kind regards,
Petr

author
#1 lore raw

PATCH 1/1 Added linux drivers backports project

From: Petr Vorel <[email protected]>

https://backports.wiki.kernel.org

---
 package/Config.in                            |  1 +
 package/linux-backports/Config.in            | 37 ++++++++++++++++++++
 package/linux-backports/linux-backports.hash |  2 ++
 package/linux-backports/linux-backports.mk   | 51 ++++++++++++++++++++++++++++
 4 files changed, 91 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
package/Config.in +1 -0
index 34b6017..c8e24a7 100644
@@ -365,6 +365,7 @@ endif
 	source "package/iucode-tool/Config.in"
 	source "package/kbd/Config.in"
 	source "package/lcdproc/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"
package/linux-backports/Config.in new file +37 -0
new file mode 100644
index 0000000..3e4e383
@@ -0,0 +1,37 @@
+config BR2_PACKAGE_LINUX_BACKPORTS
+	bool "Linux kernel driver backports"
+	depends on BR2_LINUX_KERNEL
+	help
+	  The backports package includes many Linux drivers from recent
+	  kernels, backported to older ones.
+
+	  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 a defconfig"
+
+config BR2_PACKAGE_LINUX_BACKPORTS_USE_CUSTOM_CONFIG
+	bool "Using a custom 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. 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
+
+endif
package/linux-backports/linux-backports.hash new file +2 -0
new file mode 100644
index 0000000..42ea0b3
@@ -0,0 +1,2 @@
+# From: https://www.kernel.org/pub/linux/kernel/projects/backports/stable/v3.18.1/sha256sums.asc
+sha256 ff3d4d5192c4d57d7415dfcd60e02ea4fa21e0de224ae0ce2b5b9f2e9c815783  backports-3.18.1-1.tar.xz
package/linux-backports/linux-backports.mk new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
1.8.0
#2 lore raw

PATCH 1/1 Added linux drivers backports project

Quoted 5 lines · Petr Vorel

From: Petr Vorel <[email protected]>

https://backports.wiki.kernel.org

In the future, please give your patch a version number (by giving the argument
-v3 or --subject-prefix='PATCH v3' to git send-email or format-patch). Also include a changelog below your SoB, separated by --- (you can do this while amending your commit).

[snip]

package/linux-backports/linux-backports.mk line 8

Quoted 2 lines
package/linux-backports/linux-backports.mk new file +2 -0
+LINUX_BACKPORTS_MAKE_OPTS = \
+	$(TARGET_MAKE_ENV) \

This should be in LINUX_BACKPORTS_MAKE_ENV instead of _OPTS.

Actually, kconfig-package should probably do a default assignment for
LINUX_BACKPORTS_MAKE_ENV, but since it doesn't you have to do it explicitly.

Quoted 4 lines
package/linux-backports/linux-backports.mk new file +4 -0
+	$(LINUX_MAKE_FLAGS) \
+	KLIB_BUILD=$(LINUX_DIR) \
+	KLIB=$(TARGET_DIR)
+

package/linux-backports/linux-backports.mk line 22

Quoted 10 lines
package/linux-backports/linux-backports.mk new file +10 -0
+
+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 = $(BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE)
+endif
+
+define LINUX_BACKPORTS_BUILD_CMDS
+	$(LINUX_BACKPORTS_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
+		-C $(@D)

This would fit on a single line.

However, ince below you're calling modules_install directly, would it be
possible/reasonable to do the build in the same way? It's always nice if the different CMDS definitions look the same. So

	$(LINUX_BACKPORTS_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
		-C $(LINUX_DIR) M=$(@D) \
		modules

But if the backports build system does some extra magic (NOT kconfig stuff, but
other magic), then of course you shouldn't do this.

package/linux-backports/linux-backports.mk line 32

Quoted 10 lines
package/linux-backports/linux-backports.mk new file +10 -0
+endef
+
+define LINUX_BACKPORTS_INSTALL_TARGET_CMDS
+	$(LINUX_BACKPORTS_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
+		-C $(LINUX_DIR) M=$(@D) \
+		INSTALL_MOD_DIR=backports \
+		modules_install
+endef
+
+LINUX_BACKPORTS_KCONFIG_EDITORS = menuconfig xconfig gconfig

No nconfig? Not that it matters much...

Regards,
Arnout

Quoted 20 lines
package/linux-backports/linux-backports.mk new file +19 -0
+LINUX_BACKPORTS_KCONFIG_OPTS = $(LINUX_BACKPORTS_MAKE_OPTS)
+
+$(eval $(kconfig-package))
+
+# Checks to give errors that the user can understand
+ifeq ($(filter source,$(MAKECMDGOALS)),)
+ifeq ($(BR2_PACKAGE_LINUX_BACKPORTS_USE_DEFCONFIG),y)
+ifeq ($(call qstrip,$(BR2_PACKAGE_LINUX_BACKPORTS_DEFCONFIG)),)
+$(error No kernel 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 kernel configuration file specified, check your BR2_PACKAGE_LINUX_BACKPORTS_CUSTOM_CONFIG_FILE setting)
+endif
+endif
+
+endif
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
author
#3 lore raw

PATCH 1/1 Added linux drivers backports project

Quoted 4 lines

In the future, please give your patch a version number (by giving the argument
-v3 or --subject-prefix='PATCH v3' to git send-email or format-patch). Also include a changelog below your SoB, separated by --- (you can do this while amending your commit).

Fixed, hope it's correct this time. Sent as -v4.

Quoted 2 lines

Actually, kconfig-package should probably do a default assignment for
LINUX_BACKPORTS_MAKE_ENV, but since it doesn't you have to do it explicitly.

I need LINUX_BACKPORTS_MAKE_ENV, as KLIB and KLIB_BUILD aren't set.

Quoted 10 lines

However, ince below you're calling modules_install directly, would it be
possible/reasonable to do the build in the same way? It's always nice if the different CMDS definitions look the same. So

	$(LINUX_BACKPORTS_MAKE_ENV) $(MAKE) $(LINUX_BACKPORTS_MAKE_OPTS) \
		-C $(LINUX_DIR) M=$(@D) \
		modules

But if the backports build system does some extra magic (NOT kconfig stuff, but
other magic), then of course you shouldn't do this.

Unfortunately it has to be build this way (or I haven't found any better). LINUX_BACKPORTS_BUILD_CMDS needs -C $(@D), otherwise there is infinite loop. I'm surprised, as $(@D) is backport directory (I'd expect to be add automatically) - suppose I have an error somewhere.
LINUX_BACKPORTS_INSTALL_TARGET_CMDS needs -C $(LINUX_DIR) M=$(@D)
=> different commands.

Quoted 1 line

No nconfig? Not that it matters much...

Taken from busybox where it wasn't (sent as separate patch). Added...
BTW: I'd expect to have one unique default variable for all of those.

Kind regards,
Petr