Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

certs: move scripts/extract-cert to certs/

extract-cert is only used in certs/Makefile.

Move it there and build extract-cert on demand.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

+15 -16
-1
MAINTAINERS
··· 4410 4410 S: Maintained 4411 4411 F: Documentation/admin-guide/module-signing.rst 4412 4412 F: certs/ 4413 - F: scripts/extract-cert.c 4414 4413 F: scripts/sign-file.c 4415 4414 4416 4415 CFAG12864B LCD DRIVER
+1
certs/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + /extract-cert 2 3 /x509_certificate_list 3 4 /x509_revocation_list
+9 -4
certs/Makefile
··· 13 13 endif 14 14 15 15 quiet_cmd_extract_certs = CERT $@ 16 - cmd_extract_certs = scripts/extract-cert $(2) $@ 16 + cmd_extract_certs = $(obj)/extract-cert $(2) $@ 17 17 18 18 $(obj)/system_certificates.o: $(obj)/x509_certificate_list 19 19 20 - $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) scripts/extract-cert FORCE 20 + $(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE 21 21 $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_TRUSTED_KEYS),$<,"")) 22 22 23 23 targets += x509_certificate_list ··· 74 74 75 75 $(obj)/system_certificates.o: $(obj)/signing_key.x509 76 76 77 - $(obj)/signing_key.x509: $(X509_DEP) scripts/extract-cert FORCE 77 + $(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE 78 78 $(call if_changed,extract_certs,$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY))) 79 79 endif # CONFIG_MODULE_SIG 80 80 ··· 82 82 83 83 $(obj)/revocation_certificates.o: $(obj)/x509_revocation_list 84 84 85 - $(obj)/x509_revocation_list: $(CONFIG_SYSTEM_REVOCATION_KEYS) scripts/extract-cert FORCE 85 + $(obj)/x509_revocation_list: $(CONFIG_SYSTEM_REVOCATION_KEYS) $(obj)/extract-cert FORCE 86 86 $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_REVOCATION_KEYS),$<,"")) 87 87 88 88 targets += x509_revocation_list 89 + 90 + hostprogs := extract-cert 91 + 92 + HOSTCFLAGS_extract-cert.o = $(shell pkg-config --cflags libcrypto 2> /dev/null) 93 + HOSTLDLIBS_extract-cert = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
-1
scripts/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 /asn1_compiler 3 3 /bin2c 4 - /extract-cert 5 4 /insert-sys-cert 6 5 /kallsyms 7 6 /module.lds
+2 -9
scripts/Makefile
··· 3 3 # scripts contains sources for various helper programs used throughout 4 4 # the kernel for the build process. 5 5 6 - CRYPTO_LIBS = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) 7 - CRYPTO_CFLAGS = $(shell pkg-config --cflags libcrypto 2> /dev/null) 8 - 9 6 hostprogs-always-$(CONFIG_BUILD_BIN2C) += bin2c 10 7 hostprogs-always-$(CONFIG_KALLSYMS) += kallsyms 11 8 hostprogs-always-$(BUILD_C_RECORDMCOUNT) += recordmcount 12 9 hostprogs-always-$(CONFIG_BUILDTIME_TABLE_SORT) += sorttable 13 10 hostprogs-always-$(CONFIG_ASN1) += asn1_compiler 14 11 hostprogs-always-$(CONFIG_MODULE_SIG_FORMAT) += sign-file 15 - hostprogs-always-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert 16 12 hostprogs-always-$(CONFIG_SYSTEM_EXTRA_CERTIFICATE) += insert-sys-cert 17 - hostprogs-always-$(CONFIG_SYSTEM_REVOCATION_LIST) += extract-cert 18 13 19 14 HOSTCFLAGS_sorttable.o = -I$(srctree)/tools/include 20 15 HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include 21 - HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS) 22 - HOSTLDLIBS_sign-file = $(CRYPTO_LIBS) 23 - HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) 24 - HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) 16 + HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null) 17 + HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) 25 18 26 19 ifdef CONFIG_UNWINDER_ORC 27 20 ifeq ($(ARCH),x86_64)
+1 -1
scripts/extract-cert.c certs/extract-cert.c
··· 29 29 void format(void) 30 30 { 31 31 fprintf(stderr, 32 - "Usage: scripts/extract-cert <source> <dest>\n"); 32 + "Usage: extract-cert <source> <dest>\n"); 33 33 exit(2); 34 34 } 35 35
+2
scripts/remove-stale-files
··· 34 34 rm -f arch/mips/boot/compressed/${f} 35 35 done 36 36 fi 37 + 38 + rm -f scripts/extract-cert