From 7b7d6b392a963b462c0240296daa38d6413f6246 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli 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 --- 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 From f7e5725ea2e848546830ac2da117d808b4c19d08 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli 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 --- 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; From d8063ef657fd44e29ef2fffba07f0632d1e60a92 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli 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 --- 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; From c4d952d6184d82413c09f5ad668305ce37effbba Mon Sep 17 00:00:00 2001 From: Luca Ceresoli 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 --- 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 From 7339528fdf72468fa1a0a0a28ccd5a5a966f0dd0 Mon Sep 17 00:00:00 2001 From: Luca Ceresoli 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 --- 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: