build: add simple 'install' target
authorJohannes Berg <johannes@sipsolutions.net>
Wed, 3 Apr 2013 22:50:47 +0000 (00:50 +0200)
committerJohannes Berg <johannes@sipsolutions.net>
Wed, 3 Apr 2013 22:50:47 +0000 (00:50 +0200)
This really just installs the modules, everything else
is still missing.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
backport/Makefile
backport/Makefile.build
backport/Makefile.real

index 079e2d96235cc8af90e149b629d1dd8df1da06a7..fde14bf463f34e711cb337bc6d4b7847c4c1e910 100644 (file)
@@ -8,13 +8,19 @@ MAKEFLAGS += --no-print-directory
 SHELL := /bin/bash
 BACKPORT_PWD := $(shell pwd)
 
-KLIB ?= /lib/modules/$(shell uname -r)/
+KMODDIR ?= updates
+ifneq ($(origin KLIB), undefined)
+KMODPATH_ARG := "INSTALL_MOD_PATH=$(KLIB)"
+else
+KLIB := /lib/modules/$(shell uname -r)/
+KMODPATH_ARG :=
+endif
 KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
 CONFIG_MD5 := $(shell md5sum $(KERNEL_CONFIG) | sed 's/\s.*//')
 
-export KLIB_BUILD BACKPORT_PWD
+export KLIB KLIB_BUILD BACKPORT_PWD KMODDIR KMODPATH_ARG
 
 # disable built-in rules for this file
 .SUFFIXES:
index 64c0b56884925d8226b00c0291373d976909c698..3ac4350e0b63840cfe3b76ecc917eba08fec0f15 100644 (file)
@@ -1,6 +1,6 @@
 include .config
 export
 
-.PHONY:
+.PHONY: modules
 modules:
        @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD) modules
index 3536fe2e4737b64e25d56d8d2e9582437220a9c5..c419772a808eb115dd483e0505311d4c69bf19cc 100644 (file)
@@ -65,3 +65,21 @@ include/linux/compat_autoconf.h: .config
 .PHONY: modules
 modules: include/linux/compat_autoconf.h
        @$(MAKE) -f Makefile.build modules
+
+.PHONY: install
+install: modules
+       @$(MAKE) -C $(KLIB_BUILD) M=$(BACKPORT_PWD)                     \
+               INSTALL_MOD_DIR=$(KMODDIR) $(KMODPATH_ARG)              \
+               modules_install
+       @/sbin/depmod -ae
+       @echo
+       @echo Your backported driver modules should be installed now.
+       @echo Try loading them with modprobe.
+       @echo
+# FIXME:
+#      compress modules
+#      check depmod
+#      iwlwifi vs. iwlagn
+#      iwl4965 vs. iwlagn
+#      install/load/unload/... scripts?
+#      compat firmware class udev stuff