Skip to contentSkip to conversation

system: allow using mdev for firmware loading only

PATCH New Luca Ceresoli 2 participants 12 messages Jul 6, 2015 – Jul 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 system: allow using mdev for firmware loading only

Busybox's mdev nicely provides the ability to load a firmware requested by the kernel.

However, when using a static /dev management, mdev is not installed as a hotplug helper (i.e. S10mdev is not installed) and CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not enabled in the busybox configuration.

Provide a knob for static /dev users to easily enable mdev for firmware loading.

This is just a matter of extending the ifeq condition around the S10mdev installation and kconfig fixups that enable the needed configuration in busybox. But leave mdev.conf installation under the old condition, it's not needed for firmware loading.

---
 package/busybox/busybox.mk | 16 ++++++++++------
 system/Config.in           | 13 +++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)
package/busybox/busybox.mk +10 -6
index 51b35bc..73a6d61 100644
@@ -55,16 +55,13 @@ define BUSYBOX_PERMISSIONS
 	/usr/share/udhcpc/default.script f 755  0  0 - - - - -
 endef
 
-# If mdev will be used for device creation enable it and copy S10mdev to /etc/init.d
-ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
+# If mdev will be used for device creation, or at least for firmware loading,
+# enable it and copy S10mdev to /etc/init.d
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV)$(BR2_ROOTFS_MDEV_FIRMWARE_LOADING),y)
 define BUSYBOX_INSTALL_MDEV_SCRIPT
 	$(INSTALL) -D -m 0755 package/busybox/S10mdev \
 		$(TARGET_DIR)/etc/init.d/S10mdev
 endef
-define BUSYBOX_INSTALL_MDEV_CONF
-	$(INSTALL) -D -m 0644 package/busybox/mdev.conf \
-		$(TARGET_DIR)/etc/mdev.conf
-endef
 define BUSYBOX_SET_MDEV
 	$(call KCONFIG_ENABLE_OPT,CONFIG_MDEV,$(BUSYBOX_BUILD_CONFIG))
 	$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_MDEV_CONF,$(BUSYBOX_BUILD_CONFIG))
@@ -73,6 +70,13 @@ define BUSYBOX_SET_MDEV
 endef
 endif
 
+ifeq ($(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_MDEV),y)
+define BUSYBOX_INSTALL_MDEV_CONF
+	$(INSTALL) -D -m 0644 package/busybox/mdev.conf \
+		$(TARGET_DIR)/etc/mdev.conf
+endef
+endif
+
 # sha passwords need USE_BB_CRYPT_SHA
 ifeq ($(BR2_TARGET_GENERIC_PASSWD_SHA256)$(BR2_TARGET_GENERIC_PASSWD_SHA512),y)
 define BUSYBOX_SET_CRYPT_SHA
system/Config.in +13 -0
index b72aa17..da2376e 100644
@@ -127,6 +127,19 @@ endchoice
 comment "/dev management using udev (from systemd)"
 	depends on BR2_INIT_SYSTEMD
 
+config BR2_ROOTFS_MDEV_FIRMWARE_LOADING
+	bool "Use mdev for firmware loading"
+	depends on BR2_ROOTFS_DEVICE_CREATION_STATIC
+	help
+	  Some devices need to load firmware before they can be usable.
+	  The kernel will ask the (userspace) hotplug helper to provide
+	  a firmware.
+
+	  Even if you do not need mdev for device creation, say Y if you
+	  want to install it as a hotplug helper so it takes care of
+	  firmware loading. Otherwise you need to setup a different
+	  mechanism for your firmwares to be loaded.
+
 config BR2_ROOTFS_DEVICE_TABLE
 	string "Path to the permission tables"
 	default "system/device_table.txt"
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 rtl8188eu: new package

This standalone driver needs a few small patches to properly build and install within Buildroot.

---

Pathces sent upstream: https://github.com/lwfinger/rtl8188eu/pull/128

---
 package/Config.in                                  |  1 +
 .../0001-Makefile-quote-CROSS_COMPILE.patch        | 33 ++++++++++++++++++
 ...002-Makefile-add-a-modules_install-target.patch | 34 +++++++++++++++++++
 ...03-Makefile-add-a-firmware_install-target.patch | 32 ++++++++++++++++++
 ...stall-use-firmware_install-to-copy-the-fi.patch | 39 ++++++++++++++++++++++
 ...stall-remove-double-firmware-installation.patch | 28 ++++++++++++++++
 package/rtl8188eu/Config.in                        | 18 ++++++++++
 package/rtl8188eu/rtl8188eu.mk                     | 22 ++++++++++++
 8 files changed, 207 insertions(+)
 create mode 100644 package/rtl8188eu/0001-Makefile-quote-CROSS_COMPILE.patch
 create mode 100644 package/rtl8188eu/0002-Makefile-add-a-modules_install-target.patch
 create mode 100644 package/rtl8188eu/0003-Makefile-add-a-firmware_install-target.patch
 create mode 100644 package/rtl8188eu/0004-Makefile-install-use-firmware_install-to-copy-the-fi.patch
 create mode 100644 package/rtl8188eu/0005-Makefile-install-remove-double-firmware-installation.patch
 create mode 100644 package/rtl8188eu/Config.in
 create mode 100644 package/rtl8188eu/rtl8188eu.mk
package/Config.in +1 -0
index 23858ca..bd00f16 100644
@@ -400,6 +400,7 @@ endif
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
 	source "package/rpi-userland/Config.in"
+	source "package/rtl8188eu/Config.in"
 	source "package/sane-backends/Config.in"
 	source "package/sdparm/Config.in"
 	source "package/setserial/Config.in"
package/rtl8188eu/0001-Makefile-quote-CROSS_COMPILE.patch new file +33 -0
new file mode 100644
index 0000000..9b375fe
@@ -0,0 +1,33 @@
+From 7b7d6b392a963b462c0240296daa38d6413f6246 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Fri, 3 Jul 2015 14:45:03 +0200
+Subject: [PATCH 1/5] Makefile: quote CROSS_COMPILE
+
+When using a CROSS_COMPILE value that contains a whitespace, such as
+"ccache arm-linux-", building fails because only the first word is passed down
+to the kernel Makefile as CROSS_COMPILE. Successive words are interpreted as
+targets.
+
+Fix by quoting CROSS_COMPILE.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index ea1b316..76db121 100644
+--- a/Makefile
++++ b/Makefile
+@@ -144,7 +144,7 @@ export CONFIG_RTL8188EU = m
+ all: modules
+ 
+ modules:
+-	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) -C $(KSRC) M=$(shell pwd)  modules
++	$(MAKE) ARCH=$(ARCH) CROSS_COMPILE="$(CROSS_COMPILE)" -C $(KSRC) M=$(shell pwd)  modules
+ 
+ strip:
+ 	$(CROSS_COMPILE)strip 8188eu.ko --strip-unneeded
+-- 
+1.9.1
+
package/rtl8188eu/0002-Makefile-add-a-modules_install-target.patch new file +34 -0
new file mode 100644
index 0000000..fe0aa94
@@ -0,0 +1,34 @@
+From f7e5725ea2e848546830ac2da117d808b4c19d08 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Fri, 3 Jul 2015 15:51:38 +0200
+Subject: [PATCH 2/5] Makefile: add a modules_install target
+
+Allows to cleanly install the module in the standard way, as suggested by
+Documentation/kbuild/modules.txt in the kernel sources.
+
+This is needed when installing from within a build system (such as Buildroot)
+that implement depmod on its own, and does not need the blacklist and other
+fixups that are implemented by the 'install' target.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+---
+ Makefile | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 76db121..63e0103 100644
+--- a/Makefile
++++ b/Makefile
+@@ -149,6 +149,9 @@ modules:
+ strip:
+ 	$(CROSS_COMPILE)strip 8188eu.ko --strip-unneeded
+ 
++modules_install:
++	$(MAKE) -C $(KSRC) M=`pwd` modules_install
++
+ install:
+ 	install -p -m 644 8188eu.ko  $(MODDESTDIR)
+ 	@if [ -a /lib/modules/$(KVER)/kernel/drivers/staging/rtl8188eu/r8188eu.ko ] ; then modprobe -r r8188eu; fi;
+-- 
+1.9.1
+
package/rtl8188eu/0003-Makefile-add-a-firmware_install-target.patch new file +32 -0
new file mode 100644
index 0000000..eebef3a
@@ -0,0 +1,32 @@
+From d8063ef657fd44e29ef2fffba07f0632d1e60a92 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Mon, 6 Jul 2015 09:59:46 +0200
+Subject: [PATCH 3/5] Makefile: add a firmware_install target
+
+When installing using the modules_install target, the firmware is not
+installed. Add an ad-hoc target that just installs the firmware into
+$(INSTALL_MOD_PATH)/lib/firmware/rtlwifi/.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+---
+ Makefile | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index 63e0103..4012f9a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -152,6 +152,10 @@ strip:
+ modules_install:
+ 	$(MAKE) -C $(KSRC) M=`pwd` modules_install
+ 
++firmware_install:
++	install -D -m 644 rtl8188eufw.bin \
++		$(INSTALL_MOD_PATH)/lib/firmware/rtlwifi/rtl8188eufw.bin
++
+ install:
+ 	install -p -m 644 8188eu.ko  $(MODDESTDIR)
+ 	@if [ -a /lib/modules/$(KVER)/kernel/drivers/staging/rtl8188eu/r8188eu.ko ] ; then modprobe -r r8188eu; fi;
+-- 
+1.9.1
+
package/rtl8188eu/0004-Makefile-install-use-firmware_install-to-copy-the-fi.patch new file +39 -0
new file mode 100644
index 0000000..18e9ead
@@ -0,0 +1,39 @@
+From c4d952d6184d82413c09f5ad668305ce37effbba Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Mon, 6 Jul 2015 10:03:11 +0200
+Subject: [PATCH 4/5] Makefile: install: use firmware_install to copy the
+ firmware
+
+Now there is a specific target to install the firmware, use it everywhere.
+
+Note: this does not change the behaviour if INSTALL_MOD_PATH is undefined.
+Otherwise the firmware is now installed under the INSTALL_MOD_PATH prefix.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+---
+ Makefile | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4012f9a..8faf484 100644
+--- a/Makefile
++++ b/Makefile
+@@ -156,14 +156,12 @@ firmware_install:
+ 	install -D -m 644 rtl8188eufw.bin \
+ 		$(INSTALL_MOD_PATH)/lib/firmware/rtlwifi/rtl8188eufw.bin
+ 
+-install:
++install: firmware_install
+ 	install -p -m 644 8188eu.ko  $(MODDESTDIR)
+ 	@if [ -a /lib/modules/$(KVER)/kernel/drivers/staging/rtl8188eu/r8188eu.ko ] ; then modprobe -r r8188eu; fi;
+ 	@echo "blacklist r8188eu" > /etc/modprobe.d/50-8188eu.conf
+ 	cp rtl8188eufw.bin /lib/firmware/.
+ 	/sbin/depmod -a ${KVER}
+-	mkdir -p /lib/firmware/rtlwifi
+-	cp -n rtl8188eufw.bin /lib/firmware/rtlwifi/.
+ 
+ uninstall:
+ 	rm -f $(MODDESTDIR)/8188eu.ko
+-- 
+1.9.1
+
package/rtl8188eu/0005-Makefile-install-remove-double-firmware-installation.patch new file +28 -0
new file mode 100644
index 0000000..8dac074
@@ -0,0 +1,28 @@
+From 7339528fdf72468fa1a0a0a28ccd5a5a966f0dd0 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <[email protected]>
+Date: Mon, 6 Jul 2015 10:05:00 +0200
+Subject: [PATCH 5/5] Makefile: install: remove double firmware installation
+
+The firmware is already installed in /lib/firmware/rtlwifi, no need to
+install it also in /lib/firmware.
+
+Signed-off-by: Luca Ceresoli <[email protected]>
+---
+ Makefile | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 8faf484..8bef18e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -160,7 +160,6 @@ install: firmware_install
+ 	install -p -m 644 8188eu.ko  $(MODDESTDIR)
+ 	@if [ -a /lib/modules/$(KVER)/kernel/drivers/staging/rtl8188eu/r8188eu.ko ] ; then modprobe -r r8188eu; fi;
+ 	@echo "blacklist r8188eu" > /etc/modprobe.d/50-8188eu.conf
+-	cp rtl8188eufw.bin /lib/firmware/.
+ 	/sbin/depmod -a ${KVER}
+ 
+ uninstall:
+-- 
+1.9.1
+
package/rtl8188eu/Config.in new file +18 -0
new file mode 100644
index 0000000..3228c67
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_RTL8188EU
+	bool "rtl8188eu"
+	depends on BR2_LINUX_KERNEL && !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS
+	select BR2_ROOTFS_MDEV_FIRMWARE_LOADING if BR2_ROOTFS_DEVICE_CREATION_STATIC
+	help
+	  A standalone driver for the RTL8188EU USB Wi-Fi adapter.
+	  This is needed only for Linux kernels before 3.12.
+	  Since 3.12, there is a (staging) driver in mainline, with a similar
+	  codebase.
+
+	  Note: if you use a static /dev management, this package enables mdev
+	  as a hotplug helper to load the firmware that is needed for the chip
+	  to work.
+
+	  https://github.com/lwfinger/rtl8188eu
+
+comment "rtl8188eu needs a Linux kernel to be built and static, mdev or udev /dev management"
+	depends on !BR2_LINUX_KERNEL || BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS
package/rtl8188eu/rtl8188eu.mk new file +22 -0
new file mode 100644
index 0000000..843d9b0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rtl8188eu
+#
+################################################################################
+
+RTL8188EU_VERSION = 3091828c8f4b4a01cbec6025128bf77e6e7b9f97
+RTL8188EU_SITE = $(call github,lwfinger,rtl8188eu,$(RTL8188EU_VERSION))
+RTL8188EU_DEPENDENCIES = linux
+RTL8188EU_LICENSE = GPLv2
+RTL8188EU_LICENSE_FILES = COPYING
+
+define RTL8188EU_BUILD_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR)
+endef
+
+define RTL8188EU_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR) \
+		modules_install firmware_install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 rtl8188eu: new package

Luca,

package/rtl8188eu/Config.in line 3

Quoted 9 lines · Luca Ceresoli
package/rtl8188eu/Config.in new file +3 -0
new file mode 100644
index 0000000..3228c67
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_RTL8188EU
+	bool "rtl8188eu"
+	depends on BR2_LINUX_KERNEL && !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS

Even though my understanding of firmware loading is not very deep, I believe this is wrong. Since quite some time, the kernel has been able to load firmware by itself, without the help of a userspace helper program.

See
http://lxr.free-electrons.com/source/drivers/base/firmware_class.c#L1089.
It first tries to load the firmware through a userspace helper. But if that doesn't work, it falls back to fw_get_filesystem_firmware(), which makes the kernel directly load the firmware itself.

See also:

config FW_LOADER_USER_HELPER_FALLBACK
bool "Fallback user-helper invocation for firmware loading" depends on FW_LOADER
select FW_LOADER_USER_HELPER
help
This option enables / disables the invocation of user-helper (e.g. udev) for loading firmware files as a fallback after the direct file loading in kernel fails. The user-mode helper is no longer required unless you have a special firmware file that resides in a non-standard path. Moreover, the udev support has been deprecated upstream.

If you are unsure about this, say N here.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#3 lore raw

PATCH 2/2 rtl8188eu: new package

Dear Thomas,

Quoted 4 lines · Thomas Petazzoni

Luca,

On Mon, 6 Jul 2015 15:09:35 +0200, Luca Ceresoli wrote:

Quoted 14 lines

package/rtl8188eu/Config.in line 3

Quoted 9 lines
package/rtl8188eu/Config.in new file +3 -0
new file mode 100644
index 0000000..3228c67
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_RTL8188EU
+	bool "rtl8188eu"
+	depends on BR2_LINUX_KERNEL && !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS

Even though my understanding of firmware loading is not very deep, I believe this is wrong. Since quite some time, the kernel has been able to load firmware by itself, without the help of a userspace helper program.

Unless I'm wrong, this feature is only available since 3.7 (abb139e75c2: "firmware: teach the kernel to load firmware files directly from the filesystem").

But your suggestion is applicable for versions 3.7 to 3.11.

So I should drop the dependency on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS and clearly point out in the help text that you must set up some firmware loading mechanism, and let users discover on their own how they should achieve that.

Overall, the available choices for firmware loading are:
- the kernel-only mechanism (3.7+ only)
- /dev management by mdev ot udev
- static /dev management + BR2_ROOTFS_MDEV_FIRMWARE_LOADING (patch 1 of this series).

Should we add a section to the manual about this? We have a few words under "/dev management", but they do not encompass the kernel-only loading.

BTW, my use case here is a 2.6.30 kernel, which has no devtmpfs and no kernel-only firmware loading. So I must use static /dev management, and still install mdev as a hotplug helper for firmware loading.

Signature · 1 line
Luca
#4 lore raw

PATCH 2/2 rtl8188eu: new package

Dear Luca Ceresoli,

Quoted 3 lines · Luca Ceresoli

Unless I'm wrong, this feature is only available since 3.7 (abb139e75c2: "firmware: teach the kernel to load firmware files directly from the filesystem").

Right, it's been there for a "while" :-)

Quoted 4 lines

So I should drop the dependency on !BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS and clearly point out in the help text that you must set up some firmware loading mechanism, and let users discover on their own how they should achieve that.

Correct. In the linux-firmware package for example, we don't have anything that enforces having a firmware loading mechanism available.

Quoted 9 lines

Overall, the available choices for firmware loading are:
- the kernel-only mechanism (3.7+ only)
- /dev management by mdev ot udev
- static /dev management + BR2_ROOTFS_MDEV_FIRMWARE_LOADING (patch 1 of this series).

Should we add a section to the manual about this? We have a few words under "/dev management", but they do not encompass the kernel-only loading.

Yes, that might be great.

Quoted 3 lines

BTW, my use case here is a 2.6.30 kernel, which has no devtmpfs and no kernel-only firmware loading. So I must use static /dev management, and still install mdev as a hotplug helper for firmware loading.

Poor soul :-)

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 2/2 rtl8188eu: new package

In reply to Luca Ceresoli

Dear Luca Ceresoli,

Quoted 18 lines · Luca Ceresoli
package/rtl8188eu/rtl8188eu.mk new file +12 -0
new file mode 100644
index 0000000..843d9b0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rtl8188eu
+#
+################################################################################
+
+RTL8188EU_VERSION = 3091828c8f4b4a01cbec6025128bf77e6e7b9f97
+RTL8188EU_SITE = $(call github,lwfinger,rtl8188eu,$(RTL8188EU_VERSION))
+RTL8188EU_DEPENDENCIES = linux
+RTL8188EU_LICENSE = GPLv2
+RTL8188EU_LICENSE_FILES = COPYING
+

package/rtl8188eu/rtl8188eu.mk line 22

Quoted 10 lines
package/rtl8188eu/rtl8188eu.mk new file +10 -0
+define RTL8188EU_BUILD_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR)
+endef
+
+define RTL8188EU_INSTALL_TARGET_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR) \
+		modules_install firmware_install
+endef
+
+$(eval $(generic-package))

In addition to the previous discussion, this package should also probably be using the new kernel-module infrastructure.

Can you respin a new version? In the mean time, I'll mark this one as "Changes Requested" in patchwork.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#6 lore raw

PATCH 2/2 rtl8188eu: new package

Dear Thomas,

Quoted 27 lines · Thomas Petazzoni

Dear Luca Ceresoli,

Quoted 23 lines · Luca Ceresoli
package/rtl8188eu/rtl8188eu.mk new file +17 -0
new file mode 100644
index 0000000..843d9b0
@@ -0,0 +1,22 @@
+################################################################################
+#
+# rtl8188eu
+#
+################################################################################
+
+RTL8188EU_VERSION = 3091828c8f4b4a01cbec6025128bf77e6e7b9f97
+RTL8188EU_SITE = $(call github,lwfinger,rtl8188eu,$(RTL8188EU_VERSION))
+RTL8188EU_DEPENDENCIES = linux
+RTL8188EU_LICENSE = GPLv2
+RTL8188EU_LICENSE_FILES = COPYING
+
+define RTL8188EU_BUILD_CMDS
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR)
+endef
+
+define RTL8188EU_INSTALL_TARGET_CMDS
Quoted 8 lines

package/rtl8188eu/rtl8188eu.mk line 22

Quoted 5 lines
package/rtl8188eu/rtl8188eu.mk new file +5 -0
+	$(MAKE) -C $(@D) $(LINUX_MAKE_FLAGS) KSRC=$(LINUX_DIR) \
+		modules_install firmware_install
+endef
+
+$(eval $(generic-package))

In addition to the previous discussion, this package should also probably be using the new kernel-module infrastructure.

Yes, I guess so.

Quoted 3 lines

Can you respin a new version? In the mean time, I'll mark this one as "Changes Requested" in patchwork.

It's on my todo list.

However, I still haven't understood your opinion about using mdev without devtmpfs (it's for firmware loading in this case)...

Signature · 1 line
Luca
#7 lore raw

PATCH 2/2 rtl8188eu: new package

Luca,

Quoted 7 lines · Luca Ceresoli
Quoted 2 lines

Can you respin a new version? In the mean time, I'll mark this one as "Changes Requested" in patchwork.

It's on my todo list.

However, I still haven't understood your opinion about using mdev without devtmpfs (it's for firmware loading in this case)...

I think it's OK to support this case. People using kernels older than 2.6.32 are stuck with static /dev and may have to load firmwares.

Now, I'm wondering if we should simply make the "mdev" /dev management option work with both static /dev *and* devtmpfs, or if we should have something like "mdev with static /dev" and "mdev with devtmpfs".

Do you have some proposals?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#8 lore raw

PATCH 2/2 rtl8188eu: new package

Il 21/07/2015 22:57, Thomas Petazzoni ha scritto:

Quoted 8 lines

Luca,

Quoted 4 lines · Luca Ceresoli
Quoted 2 lines

Can you respin a new version? In the mean time, I'll mark this one as "Changes Requested" in patchwork.

It's on my todo list.

BTW, I think the rtl8188eu can go on its own way, without waiting for the discussion about /dev management, right?

Quoted 6 lines
Quoted 3 lines

However, I still haven't understood your opinion about using mdev without devtmpfs (it's for firmware loading in this case)...

I think it's OK to support this case. People using kernels older than 2.6.32 are stuck with static /dev and may have to load firmwares.

Another use case is to have dynamic /dev management on kernels <2.6.32, even without any firmware loading need. mdev is reportedly working without devtmpfs. I haven't tested it seriously, but it might be very interesting for the poor souls.

Quoted 6 lines

Now, I'm wondering if we should simply make the "mdev" /dev management option work with both static /dev *and* devtmpfs, or if we should have something like "mdev with static /dev" and "mdev with devtmpfs".

Do you have some proposals?

Idea 1:
- just add a new entry to "/dev management":
( ) Static using device table
( ) Static using device table + mdev <- New option
(X) Dynamic using devtmpfs only
( ) Dynamic using {devtmpfs +} mdev {} = new wording only
( ) Dynamic using {devtmpfs +} eudev {} = new wording only

Idea 2:
- Add a new bool named "Use devtmpfs"
- y (default) -> enable devtmpfs in the kernel config
- n -> use the static device table
- Change "/dev management" to "dynamic /dev management":
( ) none
(X) mdev
( ) eudev

Idea 2 enables 2 new behaviours: "static + mdev" and "static + eudev". Does the latter make any sense? I've never used eudev, I have no idea.

Idea 2 is somewhat more flexible, and closer to the implementation. This probably means also farther away from the user...

Idea 1 involves less changes and no legacy burden. Besides, it shows an option for each use case. This allows to document each of the five options in menuconfig, with hints to use cases, without the need to switch to the manual for a use-case to kconfig-options-to-enable map.

Theoretically we might also make optional the firmware loading feature of mdev, but I really don't think it's worth the effort.

Signature · 1 line
Luca
#9 lore raw

PATCH 2/2 rtl8188eu: new package

Luca,

Quoted 4 lines · Luca Ceresoli
Quoted 1 line
Quoted 1 line

It's on my todo list.

BTW, I think the rtl8188eu can go on its own way, without waiting for the discussion about /dev management, right?

Absolutely, I'll be happy to take rtl8818eu independently from the discussion on /dev management and firmware loading.

Quoted 7 lines
Quoted 2 lines

I think it's OK to support this case. People using kernels older than 2.6.32 are stuck with static /dev and may have to load firmwares.

Another use case is to have dynamic /dev management on kernels <2.6.32, even without any firmware loading need. mdev is reportedly working without devtmpfs. I haven't tested it seriously, but it might be very interesting for the poor souls.

Correct. So far I believe Peter's position was that people still using kernel older than 2.6.32 should simply use static, but maybe that was a too restrictive decision.

Quoted 10 lines
Quoted 1 line

Do you have some proposals?

Idea 1:
- just add a new entry to "/dev management":
( ) Static using device table
( ) Static using device table + mdev <- New option
(X) Dynamic using devtmpfs only
( ) Dynamic using {devtmpfs +} mdev {} = new wording only
( ) Dynamic using {devtmpfs +} eudev {} = new wording only

Quoted 8 lines

Idea 2:
- Add a new bool named "Use devtmpfs"
- y (default) -> enable devtmpfs in the kernel config
- n -> use the static device table
- Change "/dev management" to "dynamic /dev management":
( ) none
(X) mdev
( ) eudev

I think I prefer idea (1) here. It's closer to what we already have, and as you say, it's probably clearer for the user / easier to document.

Our manual has a complete section about /dev management at
http://buildroot.org/downloads/manual/manual.html#_dev_management, so this will have to be updated.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#10 lore raw

PATCH 1/2 system: allow using mdev for firmware loading only

In reply to Luca Ceresoli

Luca,

Quoted 11 lines · Luca Ceresoli

Busybox's mdev nicely provides the ability to load a firmware requested by the kernel.

However, when using a static /dev management, mdev is not installed as a hotplug helper (i.e. S10mdev is not installed) and CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not enabled in the busybox configuration.

Provide a knob for static /dev users to easily enable mdev for firmware loading.

Quoted 6 lines

This is just a matter of extending the ifeq condition around the S10mdev installation and kconfig fixups that enable the needed configuration in busybox. But leave mdev.conf installation under the old condition, it's not needed for firmware loading.

Are you really a poor soul stuck with a pre-2.6.32 kernel preventing you from using devtmpfs ?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#11 lore raw

PATCH 1/2 system: allow using mdev for firmware loading only

Dear Thomas,

Quoted 19 lines · Thomas Petazzoni

Luca,

Quoted 16 lines · Luca Ceresoli

Busybox's mdev nicely provides the ability to load a firmware requested by the kernel.

However, when using a static /dev management, mdev is not installed as a hotplug helper (i.e. S10mdev is not installed) and CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not enabled in the busybox configuration.

Provide a knob for static /dev users to easily enable mdev for firmware loading.

This is just a matter of extending the ifeq condition around the S10mdev installation and kconfig fixups that enable the needed configuration in busybox. But leave mdev.conf installation under the old condition, it's not needed for firmware loading.

Quoted 4 lines
Quoted 1 line

Are you really a poor soul stuck with a pre-2.6.32 kernel preventing you from using devtmpfs ?

"You, poor souls condemned to the Circle of Jurassic Kernel Users, shall be using 2.6.30.10... for eternity! Abandon all devtmpfs hope, ye who enter here!"

Yes, I am doomed! :.(...

Signature · 1 line
Luca