Back to home page

LXR

 
 

    


0001 # ==========================================================================
0002 # Signing modules
0003 # ==========================================================================
0004 
0005 PHONY := __modsign
0006 __modsign:
0007 
0008 include scripts/Kbuild.include
0009 
0010 __modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
0011 modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
0012 
0013 PHONY += $(modules)
0014 __modsign: $(modules)
0015         @:
0016 
0017 quiet_cmd_sign_ko = SIGN [M] $(2)/$(notdir $@)
0018         cmd_sign_ko = $(mod_sign_cmd) $(2)/$(notdir $@)
0019 
0020 # Modules built outside the kernel source tree go into extra by default
0021 INSTALL_MOD_DIR ?= extra
0022 ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
0023 
0024 modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
0025 
0026 $(modules):
0027         $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir))
0028 
0029 # Declare the contents of the .PHONY variable as phony.  We keep that
0030 # information in a variable se we can use it in if_changed and friends.
0031 
0032 .PHONY: $(PHONY)