Makefile.modsign 791 B

1234567891011121314151617181920212223242526272829
  1. # SPDX-License-Identifier: GPL-2.0
  2. # ==========================================================================
  3. # Signing modules
  4. # ==========================================================================
  5. PHONY := __modsign
  6. __modsign:
  7. include scripts/Kbuild.include
  8. modules := $(sort $(shell cat modules.order))
  9. PHONY += $(modules)
  10. __modsign: $(modules)
  11. @:
  12. quiet_cmd_sign_ko = SIGN [M] $(2)/$(notdir $@)
  13. cmd_sign_ko = $(mod_sign_cmd) $(2)/$(notdir $@)
  14. # Modules built outside the kernel source tree go into extra by default
  15. INSTALL_MOD_DIR ?= extra
  16. ext-mod-dir = $(INSTALL_MOD_DIR)$(subst $(patsubst %/,%,$(KBUILD_EXTMOD)),,$(@D))
  17. modinst_dir = $(if $(KBUILD_EXTMOD),$(ext-mod-dir),kernel/$(@D))
  18. $(modules):
  19. $(call cmd,sign_ko,$(MODLIB)/$(modinst_dir))
  20. .PHONY: $(PHONY)