Fix firmware installation
PATCH 1/1 Fix firmware installation
When installing modules which have their firmware only in firmware/ (no subdirectory), the build fails with:
$ make INSTALL_MOD_PATH=/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root KERNELRELEASE=2.6.38.2-desktop-2.mga modules_install INSTALL drivers/usb/serial/usbserial.ko INSTALL drivers/usb/serial/whiteheat.ko make[1]: *** No rule to make target `/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root/lib/firmware/./', needed by `/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root/lib/firmware/whiteheat_loader.fw'. Stop. make: *** [_modinst_post] Error 2
If one is building a kernel with a module like 3c359, which has its firmware in firmware/3com/, the mkdir -p firmware/3com/ will create the firmware/ directory, allowing to install firmwares in firmware/, masking the error.
I noticed it while building with make 3.82, so this problem may be related to that.
scripts/Makefile.fwinst +1 -1
@@ -27,7 +27,7 @@ endif installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) -installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. +installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs
Quoted 9 lines · Arnaud Patard
When installing modules which have their firmware only in
firmware/(no subdirectory), the build fails with:$ make INSTALL_MOD_PATH=/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root KERNELRELEASE=2.6.38.2-desktop-2.mga modules_install INSTALL drivers/usb/serial/usbserial.ko INSTALL drivers/usb/serial/whiteheat.ko make[1]: *** No rule to make target `/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root/lib/firmware/./', needed by `/home/rtp/devel/kernel/BUILD/kernel-x86_64/temp-root/lib/firmware/whiteheat_loader.fw'. Stop. make: *** [_modinst_post] Error 2
Quoted 6 lines
If one is building a kernel with a module like 3c359, which has its firmware in
firmware/3com/, the mkdir -pfirmware/3com/will create thefirmware/directory, allowing to install firmwares infirmware/, masking the error.I noticed it while building with make 3.82, so this problem may be related to that.
I can reproduce the bug, but your patch doesn't fix it for me:
$ make O=/dev/shm/build INSTALL_MOD_PATH=/dev/shm/modinst modules_install INSTALL arch/x86/kernel/test_nx.ko INSTALL drivers/scsi/scsi_wait_scan.ko INSTALL drivers/usb/serial/usbserial.ko INSTALL drivers/usb/serial/whiteheat.ko INSTALL drivers/watchdog/hpwdt.ko INSTALL net/netfilter/xt_mark.ko make[2]: *** No rule to make target `/dev/shm/modinst/lib/firmware/./', needed by `/dev/shm/modinst/lib/firmware/whiteheat_loader.fw'. Stop. make[1]: *** [_modinst_post] Error 2 make: *** [sub-make] Error 2 $ make --version GNU Make 3.82 ...
This is an x86_64 defconfig with CONFIG_USB_SERIAL and CONFIG_USB_SERIAL_WHITEHEAT set to 'm'.
Michal
Quoted 21 lines
Signed-off-by Arnaud Patard <[email protected]>Index: linux-2.6.38/scripts/Makefile.fwinst
===================================================================scripts/Makefile.fwinst +1
-2@@ -27,7 +27,7 @@ endif installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) -installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/. +installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs --To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html