* [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only
@ 2015-07-06 13:09 Luca Ceresoli
2015-07-06 13:09 ` [Buildroot] [PATCH 2/2] rtl8188eu: new package Luca Ceresoli
2015-07-06 13:49 ` [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Thomas Petazzoni
0 siblings, 2 replies; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-06 13:09 UTC (permalink / raw)
To: buildroot
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.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
package/busybox/busybox.mk | 16 ++++++++++------
system/Config.in | 13 +++++++++++++
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 51b35bc..73a6d61 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -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
diff --git a/system/Config.in b/system/Config.in
index b72aa17..da2376e 100644
--- a/system/Config.in
+++ b/system/Config.in
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-06 13:09 [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Luca Ceresoli
@ 2015-07-06 13:09 ` Luca Ceresoli
2015-07-06 13:17 ` Thomas Petazzoni
2015-07-18 21:30 ` Thomas Petazzoni
2015-07-06 13:49 ` [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Thomas Petazzoni
1 sibling, 2 replies; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-06 13:09 UTC (permalink / raw)
To: buildroot
This standalone driver needs a few small patches to properly build and install
within Buildroot.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
---
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
diff --git a/package/Config.in b/package/Config.in
index 23858ca..bd00f16 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -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"
diff --git a/package/rtl8188eu/0001-Makefile-quote-CROSS_COMPILE.patch b/package/rtl8188eu/0001-Makefile-quote-CROSS_COMPILE.patch
new file mode 100644
index 0000000..9b375fe
--- /dev/null
+++ b/package/rtl8188eu/0001-Makefile-quote-CROSS_COMPILE.patch
@@ -0,0 +1,33 @@
+From 7b7d6b392a963b462c0240296daa38d6413f6246 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <luca@lucaceresoli.net>
+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 <luca@lucaceresoli.net>
+---
+ 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
+
diff --git a/package/rtl8188eu/0002-Makefile-add-a-modules_install-target.patch b/package/rtl8188eu/0002-Makefile-add-a-modules_install-target.patch
new file mode 100644
index 0000000..fe0aa94
--- /dev/null
+++ b/package/rtl8188eu/0002-Makefile-add-a-modules_install-target.patch
@@ -0,0 +1,34 @@
+From f7e5725ea2e848546830ac2da117d808b4c19d08 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <luca@lucaceresoli.net>
+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 <luca@lucaceresoli.net>
+---
+ 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
+
diff --git a/package/rtl8188eu/0003-Makefile-add-a-firmware_install-target.patch b/package/rtl8188eu/0003-Makefile-add-a-firmware_install-target.patch
new file mode 100644
index 0000000..eebef3a
--- /dev/null
+++ b/package/rtl8188eu/0003-Makefile-add-a-firmware_install-target.patch
@@ -0,0 +1,32 @@
+From d8063ef657fd44e29ef2fffba07f0632d1e60a92 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <luca@lucaceresoli.net>
+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 <luca@lucaceresoli.net>
+---
+ 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
+
diff --git a/package/rtl8188eu/0004-Makefile-install-use-firmware_install-to-copy-the-fi.patch b/package/rtl8188eu/0004-Makefile-install-use-firmware_install-to-copy-the-fi.patch
new file mode 100644
index 0000000..18e9ead
--- /dev/null
+++ b/package/rtl8188eu/0004-Makefile-install-use-firmware_install-to-copy-the-fi.patch
@@ -0,0 +1,39 @@
+From c4d952d6184d82413c09f5ad668305ce37effbba Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <luca@lucaceresoli.net>
+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 <luca@lucaceresoli.net>
+---
+ 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
+
diff --git a/package/rtl8188eu/0005-Makefile-install-remove-double-firmware-installation.patch b/package/rtl8188eu/0005-Makefile-install-remove-double-firmware-installation.patch
new file mode 100644
index 0000000..8dac074
--- /dev/null
+++ b/package/rtl8188eu/0005-Makefile-install-remove-double-firmware-installation.patch
@@ -0,0 +1,28 @@
+From 7339528fdf72468fa1a0a0a28ccd5a5a966f0dd0 Mon Sep 17 00:00:00 2001
+From: Luca Ceresoli <luca@lucaceresoli.net>
+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 <luca@lucaceresoli.net>
+---
+ 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
+
diff --git a/package/rtl8188eu/Config.in b/package/rtl8188eu/Config.in
new file mode 100644
index 0000000..3228c67
--- /dev/null
+++ b/package/rtl8188eu/Config.in
@@ -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
diff --git a/package/rtl8188eu/rtl8188eu.mk b/package/rtl8188eu/rtl8188eu.mk
new file mode 100644
index 0000000..843d9b0
--- /dev/null
+++ b/package/rtl8188eu/rtl8188eu.mk
@@ -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))
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-06 13:09 ` [Buildroot] [PATCH 2/2] rtl8188eu: new package Luca Ceresoli
@ 2015-07-06 13:17 ` Thomas Petazzoni
2015-07-06 13:59 ` Luca Ceresoli
2015-07-18 21:30 ` Thomas Petazzoni
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-06 13:17 UTC (permalink / raw)
To: buildroot
Luca,
On Mon, 6 Jul 2015 15:09:35 +0200, Luca Ceresoli wrote:
> diff --git a/package/rtl8188eu/Config.in b/package/rtl8188eu/Config.in
> new file mode 100644
> index 0000000..3228c67
> --- /dev/null
> +++ b/package/rtl8188eu/Config.in
> @@ -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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only
2015-07-06 13:09 [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Luca Ceresoli
2015-07-06 13:09 ` [Buildroot] [PATCH 2/2] rtl8188eu: new package Luca Ceresoli
@ 2015-07-06 13:49 ` Thomas Petazzoni
2015-07-06 14:08 ` Luca Ceresoli
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-06 13:49 UTC (permalink / raw)
To: buildroot
Luca,
On Mon, 6 Jul 2015 15:09:34 +0200, Luca Ceresoli wrote:
> 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.
>
> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Are you really a poor soul stuck with a pre-2.6.32 kernel preventing
you from using devtmpfs ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-06 13:17 ` Thomas Petazzoni
@ 2015-07-06 13:59 ` Luca Ceresoli
2015-07-06 14:36 ` Thomas Petazzoni
0 siblings, 1 reply; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-06 13:59 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Thomas Petazzoni wrote:
> Luca,
>
> On Mon, 6 Jul 2015 15:09:35 +0200, Luca Ceresoli wrote:
>
>> diff --git a/package/rtl8188eu/Config.in b/package/rtl8188eu/Config.in
>> new file mode 100644
>> index 0000000..3228c67
>> --- /dev/null
>> +++ b/package/rtl8188eu/Config.in
>> @@ -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.
--
Luca
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only
2015-07-06 13:49 ` [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Thomas Petazzoni
@ 2015-07-06 14:08 ` Luca Ceresoli
0 siblings, 0 replies; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-06 14:08 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Thomas Petazzoni wrote:
> Luca,
>
> On Mon, 6 Jul 2015 15:09:34 +0200, Luca Ceresoli wrote:
>> 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.
>>
>> Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
>
> 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! :.(...
--
Luca
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-06 13:59 ` Luca Ceresoli
@ 2015-07-06 14:36 ` Thomas Petazzoni
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-06 14:36 UTC (permalink / raw)
To: buildroot
Dear Luca Ceresoli,
On Mon, 06 Jul 2015 15:59:51 +0200, Luca Ceresoli wrote:
> 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" :-)
> 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.
> 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.
> 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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-06 13:09 ` [Buildroot] [PATCH 2/2] rtl8188eu: new package Luca Ceresoli
2015-07-06 13:17 ` Thomas Petazzoni
@ 2015-07-18 21:30 ` Thomas Petazzoni
2015-07-21 16:26 ` Luca Ceresoli
1 sibling, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-18 21:30 UTC (permalink / raw)
To: buildroot
Dear Luca Ceresoli,
On Mon, 6 Jul 2015 15:09:35 +0200, Luca Ceresoli wrote:
> diff --git a/package/rtl8188eu/rtl8188eu.mk b/package/rtl8188eu/rtl8188eu.mk
> new file mode 100644
> index 0000000..843d9b0
> --- /dev/null
> +++ b/package/rtl8188eu/rtl8188eu.mk
> @@ -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))
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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-18 21:30 ` Thomas Petazzoni
@ 2015-07-21 16:26 ` Luca Ceresoli
2015-07-21 20:57 ` Thomas Petazzoni
0 siblings, 1 reply; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-21 16:26 UTC (permalink / raw)
To: buildroot
Dear Thomas,
Thomas Petazzoni wrote:
> Dear Luca Ceresoli,
>
> On Mon, 6 Jul 2015 15:09:35 +0200, Luca Ceresoli wrote:
>
>> diff --git a/package/rtl8188eu/rtl8188eu.mk b/package/rtl8188eu/rtl8188eu.mk
>> new file mode 100644
>> index 0000000..843d9b0
>> --- /dev/null
>> +++ b/package/rtl8188eu/rtl8188eu.mk
>> @@ -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))
>
> In addition to the previous discussion, this package should also
> probably be using the new kernel-module infrastructure.
Yes, I guess so.
>
> 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)...
--
Luca
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-21 16:26 ` Luca Ceresoli
@ 2015-07-21 20:57 ` Thomas Petazzoni
2015-07-22 10:17 ` Luca Ceresoli
0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-21 20:57 UTC (permalink / raw)
To: buildroot
Luca,
On Tue, 21 Jul 2015 18:26:48 +0200, Luca Ceresoli wrote:
> > 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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-21 20:57 ` Thomas Petazzoni
@ 2015-07-22 10:17 ` Luca Ceresoli
2015-07-22 11:26 ` Thomas Petazzoni
0 siblings, 1 reply; 12+ messages in thread
From: Luca Ceresoli @ 2015-07-22 10:17 UTC (permalink / raw)
To: buildroot
Il 21/07/2015 22:57, Thomas Petazzoni ha scritto:
> Luca,
>
> On Tue, 21 Jul 2015 18:26:48 +0200, Luca Ceresoli wrote:
>
>>> 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?
>>
>> 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.
>
> 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.
--
Luca
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Buildroot] [PATCH 2/2] rtl8188eu: new package
2015-07-22 10:17 ` Luca Ceresoli
@ 2015-07-22 11:26 ` Thomas Petazzoni
0 siblings, 0 replies; 12+ messages in thread
From: Thomas Petazzoni @ 2015-07-22 11:26 UTC (permalink / raw)
To: buildroot
Luca,
On Wed, 22 Jul 2015 12:17:22 +0200, Luca Ceresoli wrote:
> >> 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.
> > 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.
> > 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
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
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-07-22 11:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-06 13:09 [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Luca Ceresoli
2015-07-06 13:09 ` [Buildroot] [PATCH 2/2] rtl8188eu: new package Luca Ceresoli
2015-07-06 13:17 ` Thomas Petazzoni
2015-07-06 13:59 ` Luca Ceresoli
2015-07-06 14:36 ` Thomas Petazzoni
2015-07-18 21:30 ` Thomas Petazzoni
2015-07-21 16:26 ` Luca Ceresoli
2015-07-21 20:57 ` Thomas Petazzoni
2015-07-22 10:17 ` Luca Ceresoli
2015-07-22 11:26 ` Thomas Petazzoni
2015-07-06 13:49 ` [Buildroot] [PATCH 1/2] system: allow using mdev for firmware loading only Thomas Petazzoni
2015-07-06 14:08 ` Luca Ceresoli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox