~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/scripts/Makefile.modinst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /scripts/Makefile.modinst (Architecture ppc) and /scripts/Makefile.modinst (Architecture i386)


  1 # SPDX-License-Identifier: GPL-2.0                  1 # SPDX-License-Identifier: GPL-2.0
  2 # ============================================      2 # ==========================================================================
  3 # Installing modules                                3 # Installing modules
  4 # ============================================      4 # ==========================================================================
  5                                                     5 
  6 PHONY := __modinst                                  6 PHONY := __modinst
  7 __modinst:                                          7 __modinst:
  8                                                     8 
  9 include include/config/auto.conf                    9 include include/config/auto.conf
 10 include $(srctree)/scripts/Kbuild.include          10 include $(srctree)/scripts/Kbuild.include
 11                                                    11 
 12 install-y :=                                       12 install-y :=
 13                                                    13 
 14 ifeq ($(KBUILD_EXTMOD)$(sign-only),)               14 ifeq ($(KBUILD_EXTMOD)$(sign-only),)
 15                                                    15 
 16 # remove the old directory and symlink             16 # remove the old directory and symlink
 17 $(shell rm -fr $(MODLIB)/kernel $(MODLIB)/buil     17 $(shell rm -fr $(MODLIB)/kernel $(MODLIB)/build)
 18                                                    18 
 19 install-$(CONFIG_MODULES) += $(addprefix $(MOD     19 install-$(CONFIG_MODULES) += $(addprefix $(MODLIB)/, build modules.order)
 20                                                    20 
 21 $(MODLIB)/build: FORCE                             21 $(MODLIB)/build: FORCE
 22         $(call cmd,symlink)                        22         $(call cmd,symlink)
 23                                                    23 
 24 quiet_cmd_symlink = SYMLINK $@                     24 quiet_cmd_symlink = SYMLINK $@
 25       cmd_symlink = ln -s $(CURDIR) $@             25       cmd_symlink = ln -s $(CURDIR) $@
 26                                                    26 
 27 $(MODLIB)/modules.order: modules.order FORCE       27 $(MODLIB)/modules.order: modules.order FORCE
 28         $(call cmd,install_modorder)               28         $(call cmd,install_modorder)
 29                                                    29 
 30 quiet_cmd_install_modorder = INSTALL $@            30 quiet_cmd_install_modorder = INSTALL $@
 31       cmd_install_modorder = sed 's:^\(.*\)\.o     31       cmd_install_modorder = sed 's:^\(.*\)\.o$$:kernel/\1.ko:' $< > $@
 32                                                    32 
 33 # Install modules.builtin(.modinfo,.ranges) ev     33 # Install modules.builtin(.modinfo,.ranges) even when CONFIG_MODULES is disabled.
 34 install-y += $(addprefix $(MODLIB)/, modules.b     34 install-y += $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo)
 35                                                    35 
 36 install-$(CONFIG_BUILTIN_MODULE_RANGES) += $(M     36 install-$(CONFIG_BUILTIN_MODULE_RANGES) += $(MODLIB)/modules.builtin.ranges
 37                                                    37 
 38 $(addprefix $(MODLIB)/, modules.builtin module     38 $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo modules.builtin.ranges): $(MODLIB)/%: % FORCE
 39         $(call cmd,install)                        39         $(call cmd,install)
 40                                                    40 
 41 endif                                              41 endif
 42                                                    42 
 43 modules := $(call read-file, $(MODORDER))          43 modules := $(call read-file, $(MODORDER))
 44                                                    44 
 45 ifeq ($(KBUILD_EXTMOD),)                           45 ifeq ($(KBUILD_EXTMOD),)
 46 dst := $(MODLIB)/kernel                            46 dst := $(MODLIB)/kernel
 47 else                                               47 else
 48 INSTALL_MOD_DIR ?= updates                         48 INSTALL_MOD_DIR ?= updates
 49 dst := $(MODLIB)/$(INSTALL_MOD_DIR)                49 dst := $(MODLIB)/$(INSTALL_MOD_DIR)
 50 endif                                              50 endif
 51                                                    51 
 52 $(foreach x, % :, $(if $(findstring $x, $(dst)     52 $(foreach x, % :, $(if $(findstring $x, $(dst)), \
 53         $(error module installation path canno     53         $(error module installation path cannot contain '$x')))
 54                                                    54 
 55 suffix-y                                :=         55 suffix-y                                :=
 56 ifdef CONFIG_MODULE_COMPRESS_ALL                   56 ifdef CONFIG_MODULE_COMPRESS_ALL
 57 suffix-$(CONFIG_MODULE_COMPRESS_GZIP)   := .gz     57 suffix-$(CONFIG_MODULE_COMPRESS_GZIP)   := .gz
 58 suffix-$(CONFIG_MODULE_COMPRESS_XZ)     := .xz     58 suffix-$(CONFIG_MODULE_COMPRESS_XZ)     := .xz
 59 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD)   := .zs     59 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD)   := .zst
 60 endif                                              60 endif
 61                                                    61 
 62 modules := $(patsubst $(extmod_prefix)%.o, $(d     62 modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules))
 63 install-$(CONFIG_MODULES) += $(modules)            63 install-$(CONFIG_MODULES) += $(modules)
 64                                                    64 
 65 __modinst: $(install-y)                            65 __modinst: $(install-y)
 66         @:                                         66         @:
 67                                                    67 
 68 #                                                  68 #
 69 # Installation                                     69 # Installation
 70 #                                                  70 #
 71 quiet_cmd_install = INSTALL $@                     71 quiet_cmd_install = INSTALL $@
 72       cmd_install = cp $< $@                       72       cmd_install = cp $< $@
 73                                                    73 
 74 # Strip                                            74 # Strip
 75 #                                                  75 #
 76 # INSTALL_MOD_STRIP, if defined, will cause mo     76 # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped after they
 77 # are installed. If INSTALL_MOD_STRIP is '1',      77 # are installed. If INSTALL_MOD_STRIP is '1', then the default option
 78 # --strip-debug will be used. Otherwise, INSTA     78 # --strip-debug will be used. Otherwise, INSTALL_MOD_STRIP value will be used
 79 # as the options to the strip command.             79 # as the options to the strip command.
 80 ifdef INSTALL_MOD_STRIP                            80 ifdef INSTALL_MOD_STRIP
 81                                                    81 
 82 ifeq ($(INSTALL_MOD_STRIP),1)                      82 ifeq ($(INSTALL_MOD_STRIP),1)
 83 strip-option := --strip-debug                      83 strip-option := --strip-debug
 84 else                                               84 else
 85 strip-option := $(INSTALL_MOD_STRIP)               85 strip-option := $(INSTALL_MOD_STRIP)
 86 endif                                              86 endif
 87                                                    87 
 88 quiet_cmd_strip = STRIP   $@                       88 quiet_cmd_strip = STRIP   $@
 89       cmd_strip = $(STRIP) $(strip-option) $@      89       cmd_strip = $(STRIP) $(strip-option) $@
 90                                                    90 
 91 else                                               91 else
 92                                                    92 
 93 quiet_cmd_strip =                                  93 quiet_cmd_strip =
 94       cmd_strip = :                                94       cmd_strip = :
 95                                                    95 
 96 endif                                              96 endif
 97                                                    97 
 98 #                                                  98 #
 99 # Signing                                          99 # Signing
100 # Don't stop modules_install even if we can't     100 # Don't stop modules_install even if we can't sign external modules.
101 #                                                 101 #
102 ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_K    102 ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),)
103 sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG    103 sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY)
104 else                                              104 else
105 sig-key := $(CONFIG_MODULE_SIG_KEY)               105 sig-key := $(CONFIG_MODULE_SIG_KEY)
106 endif                                             106 endif
107 quiet_cmd_sign = SIGN    $@                       107 quiet_cmd_sign = SIGN    $@
108       cmd_sign = scripts/sign-file $(CONFIG_MO    108       cmd_sign = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) "$(sig-key)" certs/signing_key.x509 $@ \
109                  $(if $(KBUILD_EXTMOD),|| true    109                  $(if $(KBUILD_EXTMOD),|| true)
110                                                   110 
111 ifeq ($(sign-only),)                              111 ifeq ($(sign-only),)
112                                                   112 
113 # During modules_install, modules are signed o    113 # During modules_install, modules are signed only when CONFIG_MODULE_SIG_ALL=y.
114 ifndef CONFIG_MODULE_SIG_ALL                      114 ifndef CONFIG_MODULE_SIG_ALL
115 quiet_cmd_sign :=                                 115 quiet_cmd_sign :=
116       cmd_sign := :                               116       cmd_sign := :
117 endif                                             117 endif
118                                                   118 
119 # Create necessary directories                    119 # Create necessary directories
120 $(foreach dir, $(sort $(dir $(install-y))), $(    120 $(foreach dir, $(sort $(dir $(install-y))), $(shell mkdir -p $(dir)))
121                                                   121 
122 $(dst)/%.ko: $(extmod_prefix)%.ko FORCE           122 $(dst)/%.ko: $(extmod_prefix)%.ko FORCE
123         $(call cmd,install)                       123         $(call cmd,install)
124         $(call cmd,strip)                         124         $(call cmd,strip)
125         $(call cmd,sign)                          125         $(call cmd,sign)
126                                                   126 
127 ifdef CONFIG_MODULES                              127 ifdef CONFIG_MODULES
128 __modinst: depmod                                 128 __modinst: depmod
129                                                   129 
130 PHONY += depmod                                   130 PHONY += depmod
131 depmod: $(install-y)                              131 depmod: $(install-y)
132         $(call cmd,depmod)                        132         $(call cmd,depmod)
133                                                   133 
134 quiet_cmd_depmod = DEPMOD  $(MODLIB)              134 quiet_cmd_depmod = DEPMOD  $(MODLIB)
135       cmd_depmod = $(srctree)/scripts/depmod.s    135       cmd_depmod = $(srctree)/scripts/depmod.sh $(KERNELRELEASE)
136 endif                                             136 endif
137                                                   137 
138 else                                              138 else
139                                                   139 
140 $(dst)/%.ko: FORCE                                140 $(dst)/%.ko: FORCE
141         $(call cmd,sign)                          141         $(call cmd,sign)
142                                                   142 
143 endif                                             143 endif
144                                                   144 
145 #                                                 145 #
146 # Compression                                     146 # Compression
147 #                                                 147 #
148 quiet_cmd_gzip = GZIP    $@                       148 quiet_cmd_gzip = GZIP    $@
149       cmd_gzip = $(KGZIP) -n -f $<                149       cmd_gzip = $(KGZIP) -n -f $<
150 quiet_cmd_xz = XZ      $@                         150 quiet_cmd_xz = XZ      $@
151       cmd_xz = $(XZ) --check=crc32 --lzma2=dic    151       cmd_xz = $(XZ) --check=crc32 --lzma2=dict=1MiB -f $<
152 quiet_cmd_zstd = ZSTD    $@                       152 quiet_cmd_zstd = ZSTD    $@
153       cmd_zstd = $(ZSTD) --rm -f -q $<            153       cmd_zstd = $(ZSTD) --rm -f -q $<
154                                                   154 
155 $(dst)/%.ko.gz: $(dst)/%.ko FORCE                 155 $(dst)/%.ko.gz: $(dst)/%.ko FORCE
156         $(call cmd,gzip)                          156         $(call cmd,gzip)
157                                                   157 
158 $(dst)/%.ko.xz: $(dst)/%.ko FORCE                 158 $(dst)/%.ko.xz: $(dst)/%.ko FORCE
159         $(call cmd,xz)                            159         $(call cmd,xz)
160                                                   160 
161 $(dst)/%.ko.zst: $(dst)/%.ko FORCE                161 $(dst)/%.ko.zst: $(dst)/%.ko FORCE
162         $(call cmd,zstd)                          162         $(call cmd,zstd)
163                                                   163 
164 PHONY += FORCE                                    164 PHONY += FORCE
165 FORCE:                                            165 FORCE:
166                                                   166 
167 .PHONY: $(PHONY)                                  167 .PHONY: $(PHONY)
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php