Skip to contentSkip to conversation

backports: skip some install operations if KLIB is defined

PATCH New Eliad Peller 1 participant 1 message Sep 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backports: skip some install operations if KLIB is defined

When a custom rootfs is being used, there is no point in running various installation operations (such as depmod) on the host file system.

---
I assume here KLIB is only used when some cross-compilation is used, so local installation probably won't follow. I'm not sure this is correct, though...
is there a better way to detect such scenario (without false positives)?

 backport/Makefile      | 4 +++-
 backport/Makefile.real | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
backport/Makefile +3 -1
index ca69f41..3165c0e 100644
@@ -11,16 +11,18 @@ BACKPORT_PWD := $(shell pwd)
 KMODDIR ?= updates
 ifneq ($(origin KLIB), undefined)
 KMODPATH_ARG := "INSTALL_MOD_PATH=$(KLIB)"
+ROOTFS_DIR := $(KLIB)
 else
 KLIB := /lib/modules/$(shell uname -r)/
 KMODPATH_ARG :=
+ROOTFS_DIR :=
 endif
 KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
 CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) 2>/dev/null | sed 's/\s.*//')
 
-export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG
+export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG ROOTFS_DIR
 
 # disable built-in rules for this file
 .SUFFIXES:
backport/Makefile.real +2 -0
index c09663c..9756c32 100644
@@ -87,12 +87,14 @@ install: modules
 	@$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD)			\
 		INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG)		\
 		modules_install
+ifeq ($(ROOTFS_DIR),)
 	@./scripts/blacklist.sh $(KLIB)/ $(KLIB)/$(KMODDIR)
 	@./scripts/compress_modules.sh $(KLIB)/$(KMODDIR)
 	@./scripts/check_depmod.sh
 	@./scripts/backport_firmware_install.sh
 	@/sbin/depmod -a
 	@./scripts/update-initramfs.sh $(KLIB)
+endif
 	@echo
 	@echo Your backported driver modules should be installed now.
 	@echo Reboot.
Signature · 1 line
1.8.3.rc1.35.g9b79519