Pull Kbuild updates from Masahiro Yamada: - Add new kconfig target 'make mod2noconfig', which will be useful to speed up the build and test iteration. - Raise the minimum supported version of LLVM to 11.0.0 - Refactor certs/Makefile - Change the format of include/config/auto.conf to stop double-quoting string type CONFIG options. - Fix ARCH=sh builds in dash - Separate compression macros for general purposes (cmd_bzip2 etc.) and the ones for decompressors (cmd_bzip2_with_size etc.) - Misc Makefile cleanups * tag 'kbuild-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) kbuild: add cmd_file_size arch: decompressor: remove useless vmlinux.bin.all-y kbuild: rename cmd_{bzip2,lzma,lzo,lz4,xzkern,zstd22} kbuild: drop $(size_append) from cmd_zstd sh: rename suffix-y to suffix_y doc: kbuild: fix default in `imply` table microblaze: use built-in function to get CPU_{MAJOR,MINOR,REV} certs: move scripts/extract-cert to certs/ kbuild: do not quote string values in include/config/auto.conf kbuild: do not include include/config/auto.conf from shell scripts certs: simplify $(srctree)/ handling and remove config_filename macro kbuild: stop using config_filename in scripts/Makefile.modsign certs: remove misleading comments about GCC PR certs: refactor file cleaning certs: remove unneeded -I$(srctree) option for system_certificates.o certs: unify duplicated cmd_extract_certs and improve the log certs: use $< and $@ to simplify the key generation rule kbuild: remove headers_check stub kbuild: move headers_check.pl to usr/include/ certs: use if_changed to re-generate the key when the key type is changed ...
Unified · Split
| @@ -176,7 +176,7 @@ applicable everywhere (see syntax). · 175 unmodified lines | ||
| 176 | 176 | y y y Y/m/n |
| 177 | 177 | n m n N/m |
| 178 | 178 | m m m M/n |
| 179 | − y m n M/n | |
| 179 | + y m m M/n | |
| 180 | 180 | y n * N |
| 181 | 181 | === === ============= ============== |
| 182 | 182 | |
| @@ -30,7 +30,7 @@ you probably needn't concern yourself with pcmciautils. · 29 unmodified lines | ||
| 30 | 30 | Program Minimal version Command to check the version |
| 31 | 31 | ====================== =============== ======================================== |
| 32 | 32 | GNU C 5.1 gcc --version |
| 33 | −Clang/LLVM (optional) 10.0.1 clang --version | |
| 33 | +Clang/LLVM (optional) 11.0.0 clang --version | |
| 34 | 34 | GNU make 3.81 make --version |
| 35 | 35 | binutils 2.23 ld -v |
| 36 | 36 | flex 2.5.35 flex --version |
| @@ -4467,7 +4467,6 @@ L: keyrings@vger.kernel.org · 4466 unmodified lines | ||
| 4467 | 4467 | S: Maintained |
| 4468 | 4468 | F: Documentation/admin-guide/module-signing.rst |
| 4469 | 4469 | F: certs/ |
| 4470 | −F: scripts/extract-cert.c | |
| 4471 | 4470 | F: scripts/sign-file.c |
| 4472 | 4471 | |
| 4473 | 4472 | CFAG12864B LCD DRIVER |
| @@ -1278,15 +1278,6 @@ headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts · 1277 unmodified lines | ||
| 1278 | 1278 | $(Q)$(MAKE) $(hdr-inst)=include/uapi |
| 1279 | 1279 | $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi |
| 1280 | 1280 | |
| 1281 | −# Deprecated. It is no-op now. | |
| 1282 | −PHONY += headers_check | |
| 1283 | −headers_check: | |
| 1284 | − @echo >&2 "=================== WARNING ===================" | |
| 1285 | − @echo >&2 "Since Linux 5.5, 'make headers_check' is no-op," | |
| 1286 | − @echo >&2 "and will be removed after Linux 5.15 release." | |
| 1287 | − @echo >&2 "Please remove headers_check from your scripts." | |
| 1288 | − @echo >&2 "===============================================" | |
| 1289 | − | |
| 1290 | 1281 | ifdef CONFIG_HEADERS_INSTALL |
| 1291 | 1282 | prepare: headers |
| 1292 | 1283 | endif |
| @@ -1497,7 +1488,7 @@ MRPROPER_FILES += include/config include/generated \ · 204 unmodified lines | ||
| 1497 | 1488 | debian snap tar-install \ |
| 1498 | 1489 | .config .config.old .version \ |
| 1499 | 1490 | Module.symvers \ |
| 1500 | − certs/signing_key.pem certs/signing_key.x509 \ | |
| 1491 | + certs/signing_key.pem \ | |
| 1501 | 1492 | certs/x509.genkey \ |
| 1502 | 1493 | vmlinux-gdb.py \ |
| 1503 | 1494 | *.spec |
| @@ -1723,9 +1714,9 @@ PHONY += prepare · 219 unmodified lines | ||
| 1723 | 1714 | # now expand this into a simple variable to reduce the cost of shell evaluations |
| 1724 | 1715 | prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT) |
| 1725 | 1716 | prepare: |
| 1726 | − @if [ "$(CC_VERSION_TEXT)" != $(CONFIG_CC_VERSION_TEXT) ]; then \ | |
| 1717 | + @if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \ | |
| 1727 | 1718 | echo >&2 "warning: the compiler differs from the one used to build the kernel"; \ |
| 1728 | − echo >&2 " The kernel was built by: "$(CONFIG_CC_VERSION_TEXT); \ | |
| 1719 | + echo >&2 " The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \ | |
| 1729 | 1720 | echo >&2 " You are using: $(CC_VERSION_TEXT)"; \ |
| 1730 | 1721 | fi |
| 1731 | 1722 | |
| @@ -648,8 +648,7 @@ config ARCH_SUPPORTS_LTO_CLANG_THIN · 647 unmodified lines | ||
| 648 | 648 | |
| 649 | 649 | config HAS_LTO_CLANG |
| 650 | 650 | def_bool y |
| 651 | − # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 | |
| 652 | − depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD && AS_IS_LLVM | |
| 651 | + depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM | |
| 653 | 652 | depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) |
| 654 | 653 | depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) |
| 655 | 654 | depends on ARCH_SUPPORTS_LTO_CLANG |
| @@ -14,10 +14,10 @@ cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__ · 13 unmodified lines | ||
| 14 | 14 | tune-mcpu-def-$(CONFIG_ISA_ARCOMPACT) := -mcpu=arc700 |
| 15 | 15 | tune-mcpu-def-$(CONFIG_ISA_ARCV2) := -mcpu=hs38 |
| 16 | 16 | |
| 17 | −ifeq ($(CONFIG_ARC_TUNE_MCPU),"") | |
| 17 | +ifeq ($(CONFIG_ARC_TUNE_MCPU),) | |
| 18 | 18 | cflags-y += $(tune-mcpu-def-y) |
| 19 | 19 | else |
| 20 | −tune-mcpu := $(shell echo $(CONFIG_ARC_TUNE_MCPU)) | |
| 20 | +tune-mcpu := $(CONFIG_ARC_TUNE_MCPU) | |
| 21 | 21 | ifneq ($(call cc-option,$(tune-mcpu)),) |
| 22 | 22 | cflags-y += $(tune-mcpu) |
| 23 | 23 | else |
| @@ -2,8 +2,8 @@ · 1 unmodified line | ||
| 2 | 2 | # Built-in dtb |
| 3 | 3 | builtindtb-y := nsim_700 |
| 4 | 4 | |
| 5 | −ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),"") | |
| 6 | − builtindtb-y := $(patsubst "%",%,$(CONFIG_ARC_BUILTIN_DTB_NAME)) | |
| 5 | +ifneq ($(CONFIG_ARC_BUILTIN_DTB_NAME),) | |
| 6 | + builtindtb-y := $(CONFIG_ARC_BUILTIN_DTB_NAME) | |
| 7 | 7 | endif |
| 8 | 8 | |
| 9 | 9 | obj-y += $(builtindtb-y).dtb.o |
| @@ -66,8 +66,6 @@ config UNWINDER_FRAME_POINTER · 65 unmodified lines | ||
| 66 | 66 | config UNWINDER_ARM |
| 67 | 67 | bool "ARM EABI stack unwinder" |
| 68 | 68 | depends on AEABI && !FUNCTION_GRAPH_TRACER |
| 69 | − # https://github.com/ClangBuiltLinux/linux/issues/732 | |
| 70 | − depends on !LD_IS_LLD || LLD_VERSION >= 110000 | |
| 71 | 69 | select ARM_UNWIND |
| 72 | 70 | help |
| 73 | 71 | This option enables stack unwinding support in the kernel |
| @@ -76,10 +76,10 @@ CPPFLAGS_vmlinux.lds += -DTEXT_OFFSET="$(TEXT_OFFSET)" · 75 unmodified lines | ||
| 76 | 76 | CPPFLAGS_vmlinux.lds += -DMALLOC_SIZE="$(MALLOC_SIZE)" |
| 77 | 77 | |
| 78 | 78 | compress-$(CONFIG_KERNEL_GZIP) = gzip |
| 79 | −compress-$(CONFIG_KERNEL_LZO) = lzo | |
| 80 | −compress-$(CONFIG_KERNEL_LZMA) = lzma | |
| 81 | −compress-$(CONFIG_KERNEL_XZ) = xzkern | |
| 82 | −compress-$(CONFIG_KERNEL_LZ4) = lz4 | |
| 79 | +compress-$(CONFIG_KERNEL_LZO) = lzo_with_size | |
| 80 | +compress-$(CONFIG_KERNEL_LZMA) = lzma_with_size | |
| 81 | +compress-$(CONFIG_KERNEL_XZ) = xzkern_with_size | |
| 82 | +compress-$(CONFIG_KERNEL_LZ4) = lz4_with_size | |
| 83 | 83 | |
| 84 | 84 | libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o |
| 85 | 85 | |
| @@ -30,9 +30,11 @@ $(obj)/vmlinux.bin: vmlinux FORCE · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | suffix-$(CONFIG_KERNEL_GZIP) := gzip |
| 32 | 32 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
| 33 | +compress-$(CONFIG_KERNEL_GZIP) := gzip | |
| 34 | +compress-$(CONFIG_KERNEL_LZO) := lzo_with_size | |
| 33 | 35 | |
| 34 | 36 | $(obj)/vmlinux.bin.$(suffix-y): $(obj)/vmlinux.bin FORCE |
| 35 | − $(call if_changed,$(suffix-y)) | |
| 37 | + $(call if_changed,$(compress-y)) | |
| 36 | 38 | |
| 37 | 39 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300-linux -T |
| 38 | 40 | OBJCOPYFLAGS := -O binary |
| @@ -1,9 +1,5 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | −ifneq '$(CONFIG_H8300_BUILTIN_DTB)' '""' | |
| 3 | −BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_H8300_BUILTIN_DTB)).dtb.o | |
| 4 | −endif | |
| 5 | − | |
| 6 | −obj-y += $(BUILTIN_DTB) | |
| 2 | +obj-y += $(addsuffix .dtb.o, $(CONFIG_H8300_BUILTIN_DTB)) | |
| 7 | 3 | |
| 8 | 4 | dtb-$(CONFIG_H8300H_SIM) := h8300h_sim.dtb |
| 9 | 5 | dtb-$(CONFIG_H8S_SIM) := h8s_sim.dtb |
| @@ -5,10 +5,10 @@ UTS_SYSNAME = -DUTS_SYSNAME=\"Linux\" · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | # What CPU version are we building for, and crack it open |
| 7 | 7 | # as major.minor.rev |
| 8 | −CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER)) | |
| 9 | −CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1) | |
| 10 | −CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2) | |
| 11 | −CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3) | |
| 8 | +CPU_VER := $(CONFIG_XILINX_MICROBLAZE0_HW_VER) | |
| 9 | +CPU_MAJOR := $(word 1, $(subst ., , $(CPU_VER))) | |
| 10 | +CPU_MINOR := $(word 2, $(subst ., , $(CPU_VER))) | |
| 11 | +CPU_REV := $(word 3, $(subst ., , $(CPU_VER))) | |
| 12 | 12 | |
| 13 | 13 | export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV |
| 14 | 14 | |
| @@ -64,12 +64,12 @@ $(obj)/vmlinux.bin: $(KBUILD_IMAGE) FORCE · 63 unmodified lines | ||
| 64 | 64 | $(call if_changed,objcopy) |
| 65 | 65 | |
| 66 | 66 | tool_$(CONFIG_KERNEL_GZIP) = gzip |
| 67 | −tool_$(CONFIG_KERNEL_BZIP2) = bzip2 | |
| 68 | −tool_$(CONFIG_KERNEL_LZ4) = lz4 | |
| 69 | −tool_$(CONFIG_KERNEL_LZMA) = lzma | |
| 70 | −tool_$(CONFIG_KERNEL_LZO) = lzo | |
| 71 | −tool_$(CONFIG_KERNEL_XZ) = xzkern | |
| 72 | −tool_$(CONFIG_KERNEL_ZSTD) = zstd22 | |
| 67 | +tool_$(CONFIG_KERNEL_BZIP2) = bzip2_with_size | |
| 68 | +tool_$(CONFIG_KERNEL_LZ4) = lz4_with_size | |
| 69 | +tool_$(CONFIG_KERNEL_LZMA) = lzma_with_size | |
| 70 | +tool_$(CONFIG_KERNEL_LZO) = lzo_with_size | |
| 71 | +tool_$(CONFIG_KERNEL_XZ) = xzkern_with_size | |
| 72 | +tool_$(CONFIG_KERNEL_ZSTD) = zstd22_with_size | |
| 73 | 73 | |
| 74 | 74 | targets += vmlinux.bin.z |
| 75 | 75 | |
| @@ -31,12 +31,6 @@ core-y += arch/nds32/kernel/ arch/nds32/mm/ · 30 unmodified lines | ||
| 31 | 31 | core-$(CONFIG_FPU) += arch/nds32/math-emu/ |
| 32 | 32 | libs-y += arch/nds32/lib/ |
| 33 | 33 | |
| 34 | −ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' | |
| 35 | −BUILTIN_DTB := y | |
| 36 | −else | |
| 37 | −BUILTIN_DTB := n | |
| 38 | −endif | |
| 39 | − | |
| 40 | 34 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 41 | 35 | KBUILD_CFLAGS += $(call cc-option, -EL) |
| 42 | 36 | KBUILD_AFLAGS += $(call cc-option, -EL) |
| @@ -1,7 +1,2 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | −ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' | |
| 3 | −BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_NDS32_BUILTIN_DTB)).dtb.o | |
| 4 | −else | |
| 5 | −BUILTIN_DTB := | |
| 6 | −endif | |
| 7 | −obj-$(CONFIG_OF) += $(BUILTIN_DTB) | |
| 2 | +obj-$(CONFIG_OF) += $(addsuffix .dtb.o, $(CONFIG_NDS32_BUILTIN_DTB)) | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | |
| 3 | −obj-y := $(patsubst "%.dts",%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE)) | |
| 3 | +obj-y := $(patsubst %.dts,%.dtb.o,$(CONFIG_NIOS2_DTB_SOURCE)) | |
| 4 | 4 | |
| 5 | 5 | dtstree := $(srctree)/$(src) |
| 6 | 6 | dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts)) |
| @@ -1,9 +1,4 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | −ifneq '$(CONFIG_OPENRISC_BUILTIN_DTB)' '""' | |
| 3 | −BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_OPENRISC_BUILTIN_DTB)).dtb.o | |
| 4 | −else | |
| 5 | −BUILTIN_DTB := | |
| 6 | −endif | |
| 7 | −obj-y += $(BUILTIN_DTB) | |
| 2 | +obj-y += $(addsuffix .dtb.o, $(CONFIG_OPENRISC_BUILTIN_DTB)) | |
| 8 | 3 | |
| 9 | 4 | #DTC_FLAGS ?= -p 1024 |
| @@ -50,8 +50,6 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment -R .note -S · 49 unmodified lines | ||
| 50 | 50 | $(obj)/vmlinux.bin: vmlinux FORCE |
| 51 | 51 | $(call if_changed,objcopy) |
| 52 | 52 | |
| 53 | −vmlinux.bin.all-y := $(obj)/vmlinux.bin | |
| 54 | − | |
| 55 | 53 | suffix-$(CONFIG_KERNEL_GZIP) := gz |
| 56 | 54 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 |
| 57 | 55 | suffix-$(CONFIG_KERNEL_LZ4) := lz4 |
| @@ -59,18 +57,18 @@ suffix-$(CONFIG_KERNEL_LZMA) := lzma · 1 unmodified line | ||
| 59 | 57 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
| 60 | 58 | suffix-$(CONFIG_KERNEL_XZ) := xz |
| 61 | 59 | |
| 62 | −$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE | |
| 60 | +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | |
| 63 | 61 | $(call if_changed,gzip) |
| 64 | −$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE | |
| 65 | − $(call if_changed,bzip2) | |
| 66 | −$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE | |
| 67 | − $(call if_changed,lz4) | |
| 68 | −$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE | |
| 69 | − $(call if_changed,lzma) | |
| 70 | −$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE | |
| 71 | − $(call if_changed,lzo) | |
| 72 | −$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE | |
| 73 | − $(call if_changed,xzkern) | |
| 62 | +$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | |
| 63 | + $(call if_changed,bzip2_with_size) | |
| 64 | +$(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE | |
| 65 | + $(call if_changed,lz4_with_size) | |
| 66 | +$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | |
| 67 | + $(call if_changed,lzma_with_size) | |
| 68 | +$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE | |
| 69 | + $(call if_changed,lzo_with_size) | |
| 70 | +$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE | |
| 71 | + $(call if_changed,xzkern_with_size) | |
| 74 | 72 | |
| 75 | 73 | LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T |
| 76 | 74 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE |
| @@ -365,7 +365,7 @@ image-$(CONFIG_PPC_PMAC) += zImage.coff zImage.miboot · 364 unmodified lines | ||
| 365 | 365 | endif |
| 366 | 366 | |
| 367 | 367 | # Allow extra targets to be added to the defconfig |
| 368 | −image-y += $(subst ",,$(CONFIG_EXTRA_TARGETS)) | |
| 368 | +image-y += $(CONFIG_EXTRA_TARGETS) | |
| 369 | 369 | |
| 370 | 370 | initrd- := $(patsubst zImage%, zImage.initrd%, $(image-)) |
| 371 | 371 | initrd-y := $(patsubst zImage%, zImage.initrd%, \ |
| @@ -1,5 +1,3 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | −ifneq ($(CONFIG_SOC_CANAAN_K210_DTB_SOURCE),"") | |
| 3 | −dtb-y += $(strip $(shell echo $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE))).dtb | |
| 2 | +dtb-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .dtb, $(CONFIG_SOC_CANAAN_K210_DTB_SOURCE)) | |
| 4 | 3 | obj-$(CONFIG_SOC_CANAAN_K210_DTB_BUILTIN) += $(addsuffix .o, $(dtb-y)) |
| 5 | −endif | |
| @@ -58,8 +58,6 @@ OBJCOPYFLAGS_vmlinux.bin := -O binary --remove-section=.comment --remove-section · 57 unmodified lines | ||
| 58 | 58 | $(obj)/vmlinux.bin: vmlinux FORCE |
| 59 | 59 | $(call if_changed,objcopy) |
| 60 | 60 | |
| 61 | −vmlinux.bin.all-y := $(obj)/vmlinux.bin | |
| 62 | − | |
| 63 | 61 | suffix-$(CONFIG_KERNEL_GZIP) := .gz |
| 64 | 62 | suffix-$(CONFIG_KERNEL_BZIP2) := .bz2 |
| 65 | 63 | suffix-$(CONFIG_KERNEL_LZ4) := .lz4 |
| @@ -68,20 +66,20 @@ suffix-$(CONFIG_KERNEL_LZO) := .lzo · 2 unmodified lines | ||
| 68 | 66 | suffix-$(CONFIG_KERNEL_XZ) := .xz |
| 69 | 67 | suffix-$(CONFIG_KERNEL_ZSTD) := .zst |
| 70 | 68 | |
| 71 | −$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE | |
| 69 | +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | |
| 72 | 70 | $(call if_changed,gzip) |
| 73 | −$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE | |
| 74 | − $(call if_changed,bzip2) | |
| 75 | −$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE | |
| 76 | − $(call if_changed,lz4) | |
| 77 | −$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE | |
| 78 | − $(call if_changed,lzma) | |
| 79 | −$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE | |
| 80 | − $(call if_changed,lzo) | |
| 81 | −$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE | |
| 82 | − $(call if_changed,xzkern) | |
| 83 | −$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE | |
| 84 | − $(call if_changed,zstd22) | |
| 71 | +$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | |
| 72 | + $(call if_changed,bzip2_with_size) | |
| 73 | +$(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE | |
| 74 | + $(call if_changed,lz4_with_size) | |
| 75 | +$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | |
| 76 | + $(call if_changed,lzma_with_size) | |
| 77 | +$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE | |
| 78 | + $(call if_changed,lzo_with_size) | |
| 79 | +$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE | |
| 80 | + $(call if_changed,xzkern_with_size) | |
| 81 | +$(obj)/vmlinux.bin.zst: $(obj)/vmlinux.bin FORCE | |
| 82 | + $(call if_changed,zstd22_with_size) | |
| 85 | 83 | |
| 86 | 84 | OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed |
| 87 | 85 | $(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE |
| @@ -19,12 +19,12 @@ CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000 · 18 unmodified lines | ||
| 19 | 19 | CONFIG_ENTRY_OFFSET ?= 0x00001000 |
| 20 | 20 | CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START) |
| 21 | 21 | |
| 22 | −suffix-y := bin | |
| 23 | −suffix-$(CONFIG_KERNEL_GZIP) := gz | |
| 24 | −suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | |
| 25 | −suffix-$(CONFIG_KERNEL_LZMA) := lzma | |
| 26 | −suffix-$(CONFIG_KERNEL_XZ) := xz | |
| 27 | −suffix-$(CONFIG_KERNEL_LZO) := lzo | |
| 22 | +suffix_y := bin | |
| 23 | +suffix_$(CONFIG_KERNEL_GZIP) := gz | |
| 24 | +suffix_$(CONFIG_KERNEL_BZIP2) := bz2 | |
| 25 | +suffix_$(CONFIG_KERNEL_LZMA) := lzma | |
| 26 | +suffix_$(CONFIG_KERNEL_XZ) := xz | |
| 27 | +suffix_$(CONFIG_KERNEL_LZO) := lzo | |
| 28 | 28 | |
| 29 | 29 | targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \ |
| 30 | 30 | uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin \ |
| @@ -106,10 +106,10 @@ OBJCOPYFLAGS_uImage.srec := -I binary -O srec · 75 unmodified lines | ||
| 106 | 106 | $(obj)/uImage.srec: $(obj)/uImage FORCE |
| 107 | 107 | $(call if_changed,objcopy) |
| 108 | 108 | |
| 109 | −$(obj)/uImage: $(obj)/uImage.$(suffix-y) | |
| 109 | +$(obj)/uImage: $(obj)/uImage.$(suffix_y) | |
| 110 | 110 | @ln -sf $(notdir $<) $@ |
| 111 | 111 | @echo ' Image $@ is ready' |
| 112 | 112 | |
| 113 | 113 | export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ |
| 114 | 114 | CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \ |
| 115 | − KERNEL_MEMORY suffix-y | |
| 115 | + KERNEL_MEMORY suffix_y | |
| @@ -47,22 +47,20 @@ $(obj)/vmlinux: $(addprefix $(obj)/, $(OBJECTS)) FORCE · 46 unmodified lines | ||
| 47 | 47 | $(obj)/vmlinux.bin: vmlinux FORCE |
| 48 | 48 | $(call if_changed,objcopy) |
| 49 | 49 | |
| 50 | −vmlinux.bin.all-y := $(obj)/vmlinux.bin | |
| 51 | − | |
| 52 | −$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE | |
| 50 | +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | |
| 53 | 51 | $(call if_changed,gzip) |
| 54 | −$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE | |
| 55 | − $(call if_changed,bzip2) | |
| 56 | −$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE | |
| 57 | − $(call if_changed,lzma) | |
| 58 | −$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE | |
| 59 | − $(call if_changed,xzkern) | |
| 60 | −$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE | |
| 61 | − $(call if_changed,lzo) | |
| 52 | +$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE | |
| 53 | + $(call if_changed,bzip2_with_size) | |
| 54 | +$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE | |
| 55 | + $(call if_changed,lzma_with_size) | |
| 56 | +$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE | |
| 57 | + $(call if_changed,xzkern_with_size) | |
| 58 | +$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE | |
| 59 | + $(call if_changed,lzo_with_size) | |
| 62 | 60 | |
| 63 | 61 | OBJCOPYFLAGS += -R .empty_zero_page |
| 64 | 62 | |
| 65 | 63 | LDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T |
| 66 | 64 | |
| 67 | −$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE | |
| 65 | +$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE | |
| 68 | 66 | $(call if_changed,ld) |
| @@ -1,4 +1,2 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | −ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"") | |
| 3 | −obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o | |
| 4 | −endif | |
| 2 | +obj-$(CONFIG_USE_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE)) | |
| @@ -126,17 +126,17 @@ vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs · 125 unmodified lines | ||
| 126 | 126 | $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE |
| 127 | 127 | $(call if_changed,gzip) |
| 128 | 128 | $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE |
| 129 | − $(call if_changed,bzip2) | |
| 129 | + $(call if_changed,bzip2_with_size) | |
| 130 | 130 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE |
| 131 | − $(call if_changed,lzma) | |
| 131 | + $(call if_changed,lzma_with_size) | |
| 132 | 132 | $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE |
| 133 | − $(call if_changed,xzkern) | |
| 133 | + $(call if_changed,xzkern_with_size) | |
| 134 | 134 | $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE |
| 135 | − $(call if_changed,lzo) | |
| 135 | + $(call if_changed,lzo_with_size) | |
| 136 | 136 | $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE |
| 137 | − $(call if_changed,lz4) | |
| 137 | + $(call if_changed,lz4_with_size) | |
| 138 | 138 | $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE |
| 139 | − $(call if_changed,zstd22) | |
| 139 | + $(call if_changed,zstd22_with_size) | |
| 140 | 140 | |
| 141 | 141 | suffix-$(CONFIG_KERNEL_GZIP) := gz |
| 142 | 142 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | # Core configuration. |
| 13 | 13 | # (Use VAR=<xtensa_config> to use another default compiler.) |
| 14 | 14 | |
| 15 | −variant-y := $(patsubst "%",%,$(CONFIG_XTENSA_VARIANT_NAME)) | |
| 15 | +variant-y := $(CONFIG_XTENSA_VARIANT_NAME) | |
| 16 | 16 | |
| 17 | 17 | VARIANT = $(variant-y) |
| 18 | 18 | |
| @@ -7,10 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | # |
| 8 | 8 | # |
| 9 | 9 | |
| 10 | −BUILTIN_DTB_SOURCE := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o | |
| 11 | −ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"") | |
| 12 | −obj-$(CONFIG_OF) += $(BUILTIN_DTB_SOURCE) | |
| 13 | −endif | |
| 10 | +obj-$(CONFIG_OF) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_SOURCE)) | |
| 14 | 11 | |
| 15 | 12 | # for CONFIG_OF_ALL_DTBS test |
| 16 | 13 | dtstree := $(srctree)/$(src) |
| @@ -1,3 +1,4 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | +/extract-cert | |
| 2 | 3 | /x509_certificate_list |
| 3 | 4 | /x509_revocation_list |
| @@ -17,21 +17,19 @@ config MODULE_SIG_KEY · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | choice |
| 19 | 19 | prompt "Type of module signing key to be generated" |
| 20 | − default MODULE_SIG_KEY_TYPE_RSA | |
| 20 | + depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) | |
| 21 | 21 | help |
| 22 | 22 | The type of module signing key type to generate. This option |
| 23 | 23 | does not apply if a #PKCS11 URI is used. |
| 24 | 24 | |
| 25 | 25 | config MODULE_SIG_KEY_TYPE_RSA |
| 26 | 26 | bool "RSA" |
| 27 | − depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) | |
| 28 | 27 | help |
| 29 | 28 | Use an RSA key for module signing. |
| 30 | 29 | |
| 31 | 30 | config MODULE_SIG_KEY_TYPE_ECDSA |
| 32 | 31 | bool "ECDSA" |
| 33 | 32 | select CRYPTO_ECDSA |
| 34 | − depends on MODULE_SIG || (IMA_APPRAISE_MODSIG && MODULES) | |
| 35 | 33 | help |
| 36 | 34 | Use an elliptic curve key (NIST P384) for module signing. Consider |
| 37 | 35 | using a strong hash like sha256 or sha384 for hashing modules. |
| @@ -6,31 +6,21 @@ · 5 unmodified lines | ||
| 6 | 6 | obj-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += system_keyring.o system_certificates.o common.o |
| 7 | 7 | obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist.o common.o |
| 8 | 8 | obj-$(CONFIG_SYSTEM_REVOCATION_LIST) += revocation_certificates.o |
| 9 | −ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),"") | |
| 9 | +ifneq ($(CONFIG_SYSTEM_BLACKLIST_HASH_LIST),) | |
| 10 | 10 | obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_hashes.o |
| 11 | 11 | else |
| 12 | 12 | obj-$(CONFIG_SYSTEM_BLACKLIST_KEYRING) += blacklist_nohashes.o |
| 13 | 13 | endif |
| 14 | 14 | |
| 15 | −ifeq ($(CONFIG_SYSTEM_TRUSTED_KEYRING),y) | |
| 15 | +quiet_cmd_extract_certs = CERT $@ | |
| 16 | + cmd_extract_certs = $(obj)/extract-cert $(2) $@ | |
| 16 | 17 | |
| 17 | −$(eval $(call config_filename,SYSTEM_TRUSTED_KEYS)) | |
| 18 | − | |
| 19 | −# GCC doesn't include .incbin files in -MD generated dependencies (PR#66871) | |
| 20 | 18 | $(obj)/system_certificates.o: $(obj)/x509_certificate_list |
| 21 | 19 | |
| 22 | −# Cope with signing_key.x509 existing in $(srctree) not $(objtree) | |
| 23 | −AFLAGS_system_certificates.o := -I$(srctree) | |
| 24 | − | |
| 25 | −quiet_cmd_extract_certs = EXTRACT_CERTS $(patsubst "%",%,$(2)) | |
| 26 | − cmd_extract_certs = scripts/extract-cert $(2) $@ | |
| 20 | +$(obj)/x509_certificate_list: $(CONFIG_SYSTEM_TRUSTED_KEYS) $(obj)/extract-cert FORCE | |
| 21 | + $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_TRUSTED_KEYS),$<,"")) | |
| 27 | 22 | |
| 28 | 23 | targets += x509_certificate_list |
| 29 | −$(obj)/x509_certificate_list: scripts/extract-cert $(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(SYSTEM_TRUSTED_KEYS_FILENAME) FORCE | |
| 30 | − $(call if_changed,extract_certs,$(SYSTEM_TRUSTED_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_TRUSTED_KEYS)) | |
| 31 | −endif # CONFIG_SYSTEM_TRUSTED_KEYRING | |
| 32 | − | |
| 33 | −clean-files := x509_certificate_list .x509.list x509_revocation_list | |
| 34 | 24 | |
| 35 | 25 | ifeq ($(CONFIG_MODULE_SIG),y) |
| 36 | 26 | SIGN_KEY = y |
| @@ -50,103 +40,54 @@ ifdef SIGN_KEY · 13 unmodified lines | ||
| 50 | 40 | # fail and that the kernel may be used afterwards. |
| 51 | 41 | # |
| 52 | 42 | ############################################################################### |
| 53 | −ifndef CONFIG_MODULE_SIG_HASH | |
| 54 | −$(error Could not determine digest type to use from kernel config) | |
| 55 | −endif | |
| 56 | − | |
| 57 | −redirect_openssl = 2>&1 | |
| 58 | −quiet_redirect_openssl = 2>&1 | |
| 59 | −silent_redirect_openssl = 2>/dev/null | |
| 60 | −openssl_available = $(shell openssl help 2>/dev/null && echo yes) | |
| 61 | 43 | |
| 62 | 44 | # We do it this way rather than having a boolean option for enabling an |
| 63 | 45 | # external private key, because 'make randconfig' might enable such a |
| 64 | 46 | # boolean option and we unfortunately can't make it depend on !RANDCONFIG. |
| 65 | −ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem") | |
| 47 | +ifeq ($(CONFIG_MODULE_SIG_KEY),certs/signing_key.pem) | |
| 66 | 48 | |
| 67 | −ifeq ($(openssl_available),yes) | |
| 68 | −X509TEXT=$(shell openssl x509 -in "certs/signing_key.pem" -text 2>/dev/null) | |
| 69 | −endif | |
| 49 | +keytype-$(CONFIG_MODULE_SIG_KEY_TYPE_ECDSA) := -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 | |
| 70 | 50 | |
| 71 | −# Support user changing key type | |
| 72 | −ifdef CONFIG_MODULE_SIG_KEY_TYPE_ECDSA | |
| 73 | −keytype_openssl = -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 | |
| 74 | −ifeq ($(openssl_available),yes) | |
| 75 | −$(if $(findstring id-ecPublicKey,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem")) | |
| 76 | −endif | |
| 77 | −endif # CONFIG_MODULE_SIG_KEY_TYPE_ECDSA | |
| 51 | +quiet_cmd_gen_key = GENKEY $@ | |
| 52 | + cmd_gen_key = openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ | |
| 53 | + -batch -x509 -config $< \ | |
| 54 | + -outform PEM -out $@ -keyout $@ $(keytype-y) 2>&1 | |
| 78 | 55 | |
| 79 | −ifdef CONFIG_MODULE_SIG_KEY_TYPE_RSA | |
| 80 | −ifeq ($(openssl_available),yes) | |
| 81 | −$(if $(findstring rsaEncryption,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem")) | |
| 82 | −endif | |
| 83 | −endif # CONFIG_MODULE_SIG_KEY_TYPE_RSA | |
| 84 | − | |
| 85 | −$(obj)/signing_key.pem: $(obj)/x509.genkey | |
| 86 | − @$(kecho) "###" | |
| 87 | − @$(kecho) "### Now generating an X.509 key pair to be used for signing modules." | |
| 88 | − @$(kecho) "###" | |
| 89 | − @$(kecho) "### If this takes a long time, you might wish to run rngd in the" | |
| 90 | − @$(kecho) "### background to keep the supply of entropy topped up. It" | |
| 91 | − @$(kecho) "### needs to be run as root, and uses a hardware random" | |
| 92 | − @$(kecho) "### number generator if one is available." | |
| 93 | − @$(kecho) "###" | |
| 94 | − $(Q)openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ | |
| 95 | − -batch -x509 -config $(obj)/x509.genkey \ | |
| 96 | − -outform PEM -out $(obj)/signing_key.pem \ | |
| 97 | − -keyout $(obj)/signing_key.pem \ | |
| 98 | − $(keytype_openssl) \ | |
| 99 | − $($(quiet)redirect_openssl) | |
| 100 | − @$(kecho) "###" | |
| 101 | − @$(kecho) "### Key pair generated." | |
| 102 | − @$(kecho) "###" | |
| 56 | +$(obj)/signing_key.pem: $(obj)/x509.genkey FORCE | |
| 57 | + $(call if_changed,gen_key) | |
| 58 | + | |
| 59 | +targets += signing_key.pem | |
| 103 | 60 | |
| 61 | +quiet_cmd_copy_x509_config = COPY $@ | |
| 62 | + cmd_copy_x509_config = cat $(srctree)/$(src)/default_x509.genkey > $@ | |
| 63 | + | |
| 64 | +# You can provide your own config file. If not present, copy the default one. | |
| 104 | 65 | $(obj)/x509.genkey: |
| 105 | − @$(kecho) Generating X.509 key generation config | |
| 106 | − @echo >$@ "[ req ]" | |
| 107 | − @echo >>$@ "default_bits = 4096" | |
| 108 | − @echo >>$@ "distinguished_name = req_distinguished_name" | |
| 109 | − @echo >>$@ "prompt = no" | |
| 110 | − @echo >>$@ "string_mask = utf8only" | |
| 111 | − @echo >>$@ "x509_extensions = myexts" | |
| 112 | − @echo >>$@ | |
| 113 | − @echo >>$@ "[ req_distinguished_name ]" | |
| 114 | − @echo >>$@ "#O = Unspecified company" | |
| 115 | − @echo >>$@ "CN = Build time autogenerated kernel key" | |
| 116 | − @echo >>$@ "#emailAddress = unspecified.user@unspecified.company" | |
| 117 | − @echo >>$@ | |
| 118 | − @echo >>$@ "[ myexts ]" | |
| 119 | − @echo >>$@ "basicConstraints=critical,CA:FALSE" | |
| 120 | − @echo >>$@ "keyUsage=digitalSignature" | |
| 121 | − @echo >>$@ "subjectKeyIdentifier=hash" | |
| 122 | − @echo >>$@ "authorityKeyIdentifier=keyid" | |
| 123 | −endif # CONFIG_MODULE_SIG_KEY | |
| 66 | + $(call cmd,copy_x509_config) | |
| 124 | 67 | |
| 125 | −$(eval $(call config_filename,MODULE_SIG_KEY)) | |
| 68 | +endif # CONFIG_MODULE_SIG_KEY | |
| 126 | 69 | |
| 127 | 70 | # If CONFIG_MODULE_SIG_KEY isn't a PKCS#11 URI, depend on it |
| 128 | −ifeq ($(patsubst pkcs11:%,%,$(firstword $(MODULE_SIG_KEY_FILENAME))),$(firstword $(MODULE_SIG_KEY_FILENAME))) | |
| 129 | −X509_DEP := $(MODULE_SIG_KEY_SRCPREFIX)$(MODULE_SIG_KEY_FILENAME) | |
| 71 | +ifneq ($(filter-out pkcs11:%, %(CONFIG_MODULE_SIG_KEY)),) | |
| 72 | +X509_DEP := $(CONFIG_MODULE_SIG_KEY) | |
| 130 | 73 | endif |
| 131 | 74 | |
| 132 | −# GCC PR#66871 again. | |
| 133 | 75 | $(obj)/system_certificates.o: $(obj)/signing_key.x509 |
| 134 | 76 | |
| 135 | −targets += signing_key.x509 | |
| 136 | −$(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE | |
| 137 | − $(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY)) | |
| 77 | +$(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE | |
| 78 | + $(call if_changed,extract_certs,$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY))) | |
| 138 | 79 | endif # CONFIG_MODULE_SIG |
| 139 | 80 | |
| 140 | −ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y) | |
| 141 | − | |
| 142 | −$(eval $(call config_filename,SYSTEM_REVOCATION_KEYS)) | |
| 81 | +targets += signing_key.x509 | |
| 143 | 82 | |
| 144 | 83 | $(obj)/revocation_certificates.o: $(obj)/x509_revocation_list |
| 145 | 84 | |
| 146 | −quiet_cmd_extract_certs = EXTRACT_CERTS $(patsubst "%",%,$(2)) | |
| 147 | − cmd_extract_certs = scripts/extract-cert $(2) $@ | |
| 85 | +$(obj)/x509_revocation_list: $(CONFIG_SYSTEM_REVOCATION_KEYS) $(obj)/extract-cert FORCE | |
| 86 | + $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_REVOCATION_KEYS),$<,"")) | |
| 148 | 87 | |
| 149 | 88 | targets += x509_revocation_list |
| 150 | −$(obj)/x509_revocation_list: scripts/extract-cert $(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(SYSTEM_REVOCATION_KEYS_FILENAME) FORCE | |
| 151 | − $(call if_changed,extract_certs,$(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_REVOCATION_KEYS)) | |
| 152 | −endif | |
| 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) | |
| @@ -0,0 +1,17 @@ | ||
| 1 | +[ req ] | |
| 2 | +default_bits = 4096 | |
| 3 | +distinguished_name = req_distinguished_name | |
| 4 | +prompt = no | |
| 5 | +string_mask = utf8only | |
| 6 | +x509_extensions = myexts | |
| 7 | + | |
| 8 | +[ req_distinguished_name ] | |
| 9 | +#O = Unspecified company | |
| 10 | +CN = Build time autogenerated kernel key | |
| 11 | +#emailAddress = unspecified.user@unspecified.company | |
| 12 | + | |
| 13 | +[ myexts ] | |
| 14 | +basicConstraints=critical,CA:FALSE | |
| 15 | +keyUsage=digitalSignature | |
| 16 | +subjectKeyIdentifier=hash | |
| 17 | +authorityKeyIdentifier=keyid | |
| @@ -29,7 +29,7 @@ static __attribute__((noreturn)) · 28 unmodified lines | ||
| 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 | |
| @@ -9,7 +9,7 @@ ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT · 8 unmodified lines | ||
| 9 | 9 | # ACPI Boot-Time Table Parsing |
| 10 | 10 | # |
| 11 | 11 | ifeq ($(CONFIG_ACPI_CUSTOM_DSDT),y) |
| 12 | −tables.o: $(src)/../../include/$(subst $\",,$(CONFIG_ACPI_CUSTOM_DSDT_FILE)) ; | |
| 12 | +tables.o: $(src)/../../include/$(CONFIG_ACPI_CUSTOM_DSDT_FILE) ; | |
| 13 | 13 | |
| 14 | 14 | endif |
| 15 | 15 | |
| @@ -3,10 +3,10 @@ obj-y += main.o · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | # Create $(fwdir) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a |
| 5 | 5 | # leading /, it's relative to $(srctree). |
| 6 | −fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR)) | |
| 6 | +fwdir := $(CONFIG_EXTRA_FIRMWARE_DIR) | |
| 7 | 7 | fwdir := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir)) |
| 8 | 8 | |
| 9 | −firmware := $(addsuffix .gen.o, $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE))) | |
| 9 | +firmware := $(addsuffix .gen.o, $(CONFIG_EXTRA_FIRMWARE)) | |
| 10 | 10 | obj-y += $(firmware) |
| 11 | 11 | |
| 12 | 12 | FWNAME = $(patsubst $(obj)/%.gen.S,%,$@) |
| @@ -403,8 +403,7 @@ static __always_inline unsigned int __kmalloc_index(size_t size, · 402 unmodified lines | ||
| 403 | 403 | if (size <= 16 * 1024 * 1024) return 24; |
| 404 | 404 | if (size <= 32 * 1024 * 1024) return 25; |
| 405 | 405 | |
| 406 | − if ((IS_ENABLED(CONFIG_CC_IS_GCC) || CONFIG_CLANG_VERSION >= 110000) | |
| 407 | − && !IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && size_is_constant) | |
| 406 | + if (!IS_ENABLED(CONFIG_PROFILE_ALL_BRANCHES) && size_is_constant) | |
| 408 | 407 | BUILD_BUG_ON_MSG(1, "unexpected size in kmalloc_index()"); |
| 409 | 408 | else |
| 410 | 409 | BUG(); |
| @@ -1051,7 +1051,7 @@ typedef struct mixer_vol_table { · 1050 unmodified lines | ||
| 1051 | 1051 | * the GPL version of OSS-4.x and build against that version |
| 1052 | 1052 | * of the header. |
| 1053 | 1053 | * |
| 1054 | − * We redefine the extern keyword so that make headers_check | |
| 1054 | + * We redefine the extern keyword so that usr/include/headers_check.pl | |
| 1055 | 1055 | * does not complain about SEQ_USE_EXTBUF. |
| 1056 | 1056 | */ |
| 1057 | 1057 | #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF() |
| @@ -1414,7 +1414,6 @@ config LD_DEAD_CODE_DATA_ELIMINATION · 1413 unmodified lines | ||
| 1414 | 1414 | config LD_ORPHAN_WARN |
| 1415 | 1415 | def_bool y |
| 1416 | 1416 | depends on ARCH_WANT_LD_ORPHAN_WARN |
| 1417 | − depends on !LD_IS_LLD || LLD_VERSION >= 110000 | |
| 1418 | 1417 | depends on $(ld-option,--orphan-handling=warn) |
| 1419 | 1418 | |
| 1420 | 1419 | config SYSCTL |
| @@ -31,7 +31,7 @@ quiet_cmd_compile.h = CHK $@ · 30 unmodified lines | ||
| 31 | 31 | cmd_compile.h = \ |
| 32 | 32 | $(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ |
| 33 | 33 | "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT_BUILD)" \ |
| 34 | − "$(CONFIG_PREEMPT_RT)" $(CONFIG_CC_VERSION_TEXT) "$(LD)" | |
| 34 | + "$(CONFIG_PREEMPT_RT)" "$(CONFIG_CC_VERSION_TEXT)" "$(LD)" | |
| 35 | 35 | |
| 36 | 36 | include/generated/compile.h: FORCE |
| 37 | 37 | $(call cmd,compile.h) |
| @@ -4,7 +4,6 @@ menu "GCOV-based kernel profiling" · 3 unmodified lines | ||
| 4 | 4 | config GCOV_KERNEL |
| 5 | 5 | bool "Enable gcov-based kernel profiling" |
| 6 | 6 | depends on DEBUG_FS |
| 7 | − depends on !CC_IS_CLANG || CLANG_VERSION >= 110000 | |
| 8 | 7 | depends on !ARCH_WANTS_NO_INSTR || CC_HAS_NO_PROFILE_FN_ATTR |
| 9 | 8 | select CONSTRUCTORS |
| 10 | 9 | default n |
| @@ -33,8 +33,8 @@ $(obj)/shipped-certs.c: $(wildcard $(srctree)/$(src)/certs/*.hex) · 32 unmodified lines | ||
| 33 | 33 | echo 'unsigned int shipped_regdb_certs_len = sizeof(shipped_regdb_certs);'; \ |
| 34 | 34 | ) > $@ |
| 35 | 35 | |
| 36 | −$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%) \ | |
| 37 | − $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR:"%"=%)/*.x509) | |
| 36 | +$(obj)/extra-certs.c: $(CONFIG_CFG80211_EXTRA_REGDB_KEYDI) \ | |
| 37 | + $(wildcard $(CONFIG_CFG80211_EXTRA_REGDB_KEYDIR)/*.x509) | |
| 38 | 38 | @$(kecho) " GEN $@" |
| 39 | 39 | $(Q)(set -e; \ |
| 40 | 40 | allf=""; \ |
| @@ -1,7 +1,6 @@ | ||
| 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 |
| @@ -195,53 +195,6 @@ why = \ · 194 unmodified lines | ||
| 195 | 195 | echo-why = $(call escsq, $(strip $(why))) |
| 196 | 196 | endif |
| 197 | 197 | |
| 198 | −############################################################################### | |
| 199 | −# | |
| 200 | −# When a Kconfig string contains a filename, it is suitable for | |
| 201 | −# passing to shell commands. It is surrounded by double-quotes, and | |
| 202 | −# any double-quotes or backslashes within it are escaped by | |
| 203 | −# backslashes. | |
| 204 | −# | |
| 205 | −# This is no use for dependencies or $(wildcard). We need to strip the | |
| 206 | −# surrounding quotes and the escaping from quotes and backslashes, and | |
| 207 | −# we *do* need to escape any spaces in the string. So, for example: | |
| 208 | −# | |
| 209 | −# Usage: $(eval $(call config_filename,FOO)) | |
| 210 | −# | |
| 211 | −# Defines FOO_FILENAME based on the contents of the CONFIG_FOO option, | |
| 212 | −# transformed as described above to be suitable for use within the | |
| 213 | −# makefile. | |
| 214 | −# | |
| 215 | −# Also, if the filename is a relative filename and exists in the source | |
| 216 | −# tree but not the build tree, define FOO_SRCPREFIX as $(srctree)/ to | |
| 217 | −# be prefixed to *both* command invocation and dependencies. | |
| 218 | −# | |
| 219 | −# Note: We also print the filenames in the quiet_cmd_foo text, and | |
| 220 | −# perhaps ought to have a version specially escaped for that purpose. | |
| 221 | −# But it's only cosmetic, and $(patsubst "%",%,$(CONFIG_FOO)) is good | |
| 222 | −# enough. It'll strip the quotes in the common case where there's no | |
| 223 | −# space and it's a simple filename, and it'll retain the quotes when | |
| 224 | −# there's a space. There are some esoteric cases in which it'll print | |
| 225 | −# the wrong thing, but we don't really care. The actual dependencies | |
| 226 | −# and commands *do* get it right, with various combinations of single | |
| 227 | −# and double quotes, backslashes and spaces in the filenames. | |
| 228 | −# | |
| 229 | −############################################################################### | |
| 230 | −# | |
| 231 | −define config_filename | |
| 232 | −ifneq ($$(CONFIG_$(1)),"") | |
| 233 | −$(1)_FILENAME := $$(subst \\,\,$$(subst \$$(quote),$$(quote),$$(subst $$(space_escape),\$$(space),$$(patsubst "%",%,$$(subst $$(space),$$(space_escape),$$(CONFIG_$(1))))))) | |
| 234 | −ifneq ($$(patsubst /%,%,$$(firstword $$($(1)_FILENAME))),$$(firstword $$($(1)_FILENAME))) | |
| 235 | −else | |
| 236 | −ifeq ($$(wildcard $$($(1)_FILENAME)),) | |
| 237 | −ifneq ($$(wildcard $$(srctree)/$$($(1)_FILENAME)),) | |
| 238 | −$(1)_SRCPREFIX := $(srctree)/ | |
| 239 | −endif | |
| 240 | −endif | |
| 241 | −endif | |
| 242 | −endif | |
| 243 | −endef | |
| 244 | −# | |
| 245 | 198 | ############################################################################### |
| 246 | 199 | |
| 247 | 200 | # delete partially updated (i.e. corrupted) files on error |
| @@ -3,26 +3,19 @@ · 2 unmodified lines | ||
| 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 | HOSTLDLIBS_sorttable = -lpthread |
| 21 | 16 | HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include |
| 22 | −HOSTCFLAGS_sign-file.o = $(CRYPTO_CFLAGS) | |
| 23 | −HOSTLDLIBS_sign-file = $(CRYPTO_LIBS) | |
| 24 | −HOSTCFLAGS_extract-cert.o = $(CRYPTO_CFLAGS) | |
| 25 | −HOSTLDLIBS_extract-cert = $(CRYPTO_LIBS) | |
| 17 | +HOSTCFLAGS_sign-file.o = $(shell pkg-config --cflags libcrypto 2> /dev/null) | |
| 18 | +HOSTLDLIBS_sign-file = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto) | |
| 26 | 19 | |
| 27 | 20 | ifdef CONFIG_UNWINDER_ORC |
| 28 | 21 | ifeq ($(ARCH),x86_64) |
| @@ -399,20 +399,35 @@ printf "%08x\n" $$dec_size | \ · 398 unmodified lines | ||
| 399 | 399 | } \ |
| 400 | 400 | ) |
| 401 | 401 | |
| 402 | +quiet_cmd_file_size = GEN $@ | |
| 403 | + cmd_file_size = $(size_append) > $@ | |
| 404 | + | |
| 402 | 405 | quiet_cmd_bzip2 = BZIP2 $@ |
| 403 | − cmd_bzip2 = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@ | |
| 406 | + cmd_bzip2 = cat $(real-prereqs) | $(KBZIP2) -9 > $@ | |
| 407 | + | |
| 408 | +quiet_cmd_bzip2_with_size = BZIP2 $@ | |
| 409 | + cmd_bzip2_with_size = { cat $(real-prereqs) | $(KBZIP2) -9; $(size_append); } > $@ | |
| 404 | 410 | |
| 405 | 411 | # Lzma |
| 406 | 412 | # --------------------------------------------------------------------------- |
| 407 | 413 | |
| 408 | 414 | quiet_cmd_lzma = LZMA $@ |
| 409 | − cmd_lzma = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@ | |
| 415 | + cmd_lzma = cat $(real-prereqs) | $(LZMA) -9 > $@ | |
| 416 | + | |
| 417 | +quiet_cmd_lzma_with_size = LZMA $@ | |
| 418 | + cmd_lzma_with_size = { cat $(real-prereqs) | $(LZMA) -9; $(size_append); } > $@ | |
| 410 | 419 | |
| 411 | 420 | quiet_cmd_lzo = LZO $@ |
| 412 | − cmd_lzo = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ | |
| 421 | + cmd_lzo = cat $(real-prereqs) | $(KLZOP) -9 > $@ | |
| 422 | + | |
| 423 | +quiet_cmd_lzo_with_size = LZO $@ | |
| 424 | + cmd_lzo_with_size = { cat $(real-prereqs) | $(KLZOP) -9; $(size_append); } > $@ | |
| 413 | 425 | |
| 414 | 426 | quiet_cmd_lz4 = LZ4 $@ |
| 415 | − cmd_lz4 = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \ | |
| 427 | + cmd_lz4 = cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout > $@ | |
| 428 | + | |
| 429 | +quiet_cmd_lz4_with_size = LZ4 $@ | |
| 430 | + cmd_lz4_with_size = { cat $(real-prereqs) | $(LZ4) -l -c1 stdin stdout; \ | |
| 416 | 431 | $(size_append); } > $@ |
| 417 | 432 | |
| 418 | 433 | # U-Boot mkimage |
| @@ -455,7 +470,10 @@ quiet_cmd_uimage = UIMAGE $@ · 36 unmodified lines | ||
| 455 | 470 | # big dictionary would increase the memory usage too much in the multi-call |
| 456 | 471 | # decompression mode. A BCJ filter isn't used either. |
| 457 | 472 | quiet_cmd_xzkern = XZKERN $@ |
| 458 | − cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ | |
| 473 | + cmd_xzkern = cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh > $@ | |
| 474 | + | |
| 475 | +quiet_cmd_xzkern_with_size = XZKERN $@ | |
| 476 | + cmd_xzkern_with_size = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ | |
| 459 | 477 | $(size_append); } > $@ |
| 460 | 478 | |
| 461 | 479 | quiet_cmd_xzmisc = XZMISC $@ |
| @@ -478,10 +496,13 @@ quiet_cmd_xzmisc = XZMISC $@ · 16 unmodified lines | ||
| 478 | 496 | # be used because it would require zstd to allocate a 128 MB buffer. |
| 479 | 497 | |
| 480 | 498 | quiet_cmd_zstd = ZSTD $@ |
| 481 | − cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@ | |
| 499 | + cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@ | |
| 482 | 500 | |
| 483 | 501 | quiet_cmd_zstd22 = ZSTD22 $@ |
| 484 | − cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ | |
| 502 | + cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra > $@ | |
| 503 | + | |
| 504 | +quiet_cmd_zstd22_with_size = ZSTD22 $@ | |
| 505 | + cmd_zstd22_with_size = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ | |
| 485 | 506 | |
| 486 | 507 | # ASM offsets |
| 487 | 508 | # --------------------------------------------------------------------------- |
| @@ -66,9 +66,9 @@ endif · 65 unmodified lines | ||
| 66 | 66 | # Don't stop modules_install even if we can't sign external modules. |
| 67 | 67 | # |
| 68 | 68 | ifeq ($(CONFIG_MODULE_SIG_ALL),y) |
| 69 | +sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) | |
| 69 | 70 | quiet_cmd_sign = SIGN $@ |
| 70 | −$(eval $(call config_filename,MODULE_SIG_KEY)) | |
| 71 | − cmd_sign = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY) certs/signing_key.x509 $@ \ | |
| 71 | + cmd_sign = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) $(sig-key) certs/signing_key.x509 $@ \ | |
| 72 | 72 | $(if $(KBUILD_EXTMOD),|| true) |
| 73 | 73 | else |
| 74 | 74 | quiet_cmd_sign := |
| @@ -16,20 +16,15 @@ case "$KBUILD_VERBOSE" in · 15 unmodified lines | ||
| 16 | 16 | ;; |
| 17 | 17 | esac |
| 18 | 18 | |
| 19 | −# We need access to CONFIG_ symbols | |
| 20 | −. include/config/auto.conf | |
| 21 | − | |
| 22 | 19 | needed_symbols= |
| 23 | 20 | |
| 24 | 21 | # Special case for modversions (see modpost.c) |
| 25 | −if [ -n "$CONFIG_MODVERSIONS" ]; then | |
| 22 | +if grep -q "^CONFIG_MODVERSIONS=y$" include/config/auto.conf; then | |
| 26 | 23 | needed_symbols="$needed_symbols module_layout" |
| 27 | 24 | fi |
| 28 | 25 | |
| 29 | −ksym_wl= | |
| 30 | −if [ -n "$CONFIG_UNUSED_KSYMS_WHITELIST" ]; then | |
| 31 | − # Use 'eval' to expand the whitelist path and check if it is relative | |
| 32 | − eval ksym_wl="$CONFIG_UNUSED_KSYMS_WHITELIST" | |
| 26 | +ksym_wl=$(sed -n 's/^CONFIG_UNUSED_KSYMS_WHITELIST=\(.*\)$/\1/p' include/config/auto.conf) | |
| 27 | +if [ -n "$ksym_wl" ]; then | |
| 33 | 28 | [ "${ksym_wl}" != "${ksym_wl#/}" ] || ksym_wl="$abs_srctree/$ksym_wl" |
| 34 | 29 | if [ ! -f "$ksym_wl" ] || [ ! -r "$ksym_wl" ]; then |
| 35 | 30 | echo "ERROR: '$ksym_wl' whitelist file not found" >&2 |
| @@ -69,7 +69,7 @@ localyesconfig localmodconfig: $(obj)/conf · 68 unmodified lines | ||
| 69 | 69 | # deprecated for external use |
| 70 | 70 | simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \ |
| 71 | 71 | alldefconfig randconfig listnewconfig olddefconfig syncconfig \ |
| 72 | − helpnewconfig yes2modconfig mod2yesconfig | |
| 72 | + helpnewconfig yes2modconfig mod2yesconfig mod2noconfig | |
| 73 | 73 | |
| 74 | 74 | PHONY += $(simple-targets) |
| 75 | 75 | |
| @@ -134,6 +134,7 @@ help: · 58 unmodified lines | ||
| 134 | 134 | @echo ' randconfig - New config with random answer to all options' |
| 135 | 135 | @echo ' yes2modconfig - Change answers from yes to mod if possible' |
| 136 | 136 | @echo ' mod2yesconfig - Change answers from mod to yes if possible' |
| 137 | + @echo ' mod2noconfig - Change answers from mod to no if possible' | |
| 137 | 138 | @echo ' listnewconfig - List new options' |
| 138 | 139 | @echo ' helpnewconfig - List new options and help text' |
| 139 | 140 | @echo ' olddefconfig - Same as oldconfig but sets new symbols to their' |
| @@ -35,6 +35,7 @@ enum input_mode { · 34 unmodified lines | ||
| 35 | 35 | olddefconfig, |
| 36 | 36 | yes2modconfig, |
| 37 | 37 | mod2yesconfig, |
| 38 | + mod2noconfig, | |
| 38 | 39 | }; |
| 39 | 40 | static enum input_mode input_mode = oldaskconfig; |
| 40 | 41 | static int input_mode_opt; |
| @@ -163,8 +164,6 @@ enum conf_def_mode { · 122 unmodified lines | ||
| 163 | 164 | def_default, |
| 164 | 165 | def_yes, |
| 165 | 166 | def_mod, |
| 166 | − def_y2m, | |
| 167 | − def_m2y, | |
| 168 | 167 | def_no, |
| 169 | 168 | def_random |
| 170 | 169 | }; |
| @@ -302,12 +301,10 @@ static bool conf_set_all_new_symbols(enum conf_def_mode mode) · 131 unmodified lines | ||
| 302 | 301 | return has_changed; |
| 303 | 302 | } |
| 304 | 303 | |
| 305 | −static void conf_rewrite_mod_or_yes(enum conf_def_mode mode) | |
| 304 | +static void conf_rewrite_tristates(tristate old_val, tristate new_val) | |
| 306 | 305 | { |
| 307 | 306 | struct symbol *sym; |
| 308 | 307 | int i; |
| 309 | − tristate old_val = (mode == def_y2m) ? yes : mod; | |
| 310 | − tristate new_val = (mode == def_y2m) ? mod : yes; | |
| 311 | 308 | |
| 312 | 309 | for_all_symbols(i, sym) { |
| 313 | 310 | if (sym_get_type(sym) == S_TRISTATE && |
| @@ -685,6 +682,7 @@ static const struct option long_opts[] = { · 371 unmodified lines | ||
| 685 | 682 | {"olddefconfig", no_argument, &input_mode_opt, olddefconfig}, |
| 686 | 683 | {"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig}, |
| 687 | 684 | {"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig}, |
| 685 | + {"mod2noconfig", no_argument, &input_mode_opt, mod2noconfig}, | |
| 688 | 686 | {NULL, 0, NULL, 0} |
| 689 | 687 | }; |
| 690 | 688 | |
| @@ -713,6 +711,7 @@ static void conf_usage(const char *progname) · 22 unmodified lines | ||
| 713 | 711 | printf(" --randconfig New config with random answer to all options\n"); |
| 714 | 712 | printf(" --yes2modconfig Change answers from yes to mod if possible\n"); |
| 715 | 713 | printf(" --mod2yesconfig Change answers from mod to yes if possible\n"); |
| 714 | + printf(" --mod2noconfig Change answers from mod to no if possible\n"); | |
| 716 | 715 | printf(" (If none of the above is given, --oldaskconfig is the default)\n"); |
| 717 | 716 | } |
| 718 | 717 | |
| @@ -788,6 +787,7 @@ int main(int ac, char **av) · 69 unmodified lines | ||
| 788 | 787 | case olddefconfig: |
| 789 | 788 | case yes2modconfig: |
| 790 | 789 | case mod2yesconfig: |
| 790 | + case mod2noconfig: | |
| 791 | 791 | conf_read(NULL); |
| 792 | 792 | break; |
| 793 | 793 | case allnoconfig: |
| @@ -862,10 +862,13 @@ int main(int ac, char **av) · 68 unmodified lines | ||
| 862 | 862 | case savedefconfig: |
| 863 | 863 | break; |
| 864 | 864 | case yes2modconfig: |
| 865 | − conf_rewrite_mod_or_yes(def_y2m); | |
| 865 | + conf_rewrite_tristates(yes, mod); | |
| 866 | 866 | break; |
| 867 | 867 | case mod2yesconfig: |
| 868 | − conf_rewrite_mod_or_yes(def_m2y); | |
| 868 | + conf_rewrite_tristates(mod, yes); | |
| 869 | + break; | |
| 870 | + case mod2noconfig: | |
| 871 | + conf_rewrite_tristates(mod, no); | |
| 869 | 872 | break; |
| 870 | 873 | case oldaskconfig: |
| 871 | 874 | rootEntry = &rootmenu; |
| @@ -244,19 +244,21 @@ static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p) · 243 unmodified lines | ||
| 244 | 244 | p, sym->name); |
| 245 | 245 | return 1; |
| 246 | 246 | case S_STRING: |
| 247 | − if (*p++ != '"') | |
| 248 | − break; | |
| 249 | − for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { | |
| 250 | − if (*p2 == '"') { | |
| 251 | − *p2 = 0; | |
| 247 | + /* No escaping for S_DEF_AUTO (include/config/auto.conf) */ | |
| 248 | + if (def != S_DEF_AUTO) { | |
| 249 | + if (*p++ != '"') | |
| 252 | 250 | break; |
| 251 | + for (p2 = p; (p2 = strpbrk(p2, "\"\\")); p2++) { | |
| 252 | + if (*p2 == '"') { | |
| 253 | + *p2 = 0; | |
| 254 | + break; | |
| 255 | + } | |
| 256 | + memmove(p2, p2 + 1, strlen(p2)); | |
| 253 | 257 | } |
| 254 | − memmove(p2, p2 + 1, strlen(p2)); | |
| 255 | − } | |
| 256 | − if (!p2) { | |
| 257 | − if (def != S_DEF_AUTO) | |
| 258 | + if (!p2) { | |
| 258 | 259 | conf_warning("invalid string found"); |
| 259 | − return 1; | |
| 260 | + return 1; | |
| 261 | + } | |
| 260 | 262 | } |
| 261 | 263 | /* fall through */ |
| 262 | 264 | case S_INT: |
| @@ -700,7 +702,7 @@ static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym) · 437 unmodified lines | ||
| 700 | 702 | |
| 701 | 703 | static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym) |
| 702 | 704 | { |
| 703 | − __print_symbol(fp, sym, OUTPUT_N_NONE, true); | |
| 705 | + __print_symbol(fp, sym, OUTPUT_N_NONE, false); | |
| 704 | 706 | } |
| 705 | 707 | |
| 706 | 708 | void print_symbol_for_listconfig(struct symbol *sym) |
| @@ -170,7 +170,7 @@ sub read_kconfig { · 169 unmodified lines | ||
| 170 | 170 | $source =~ s/\$\($env\)/$ENV{$env}/; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | − open(my $kinfile, '<', $source) || die "Can't open $kconfig"; | |
| 173 | + open(my $kinfile, '<', $source) || die "Can't open $source"; | |
| 174 | 174 | while (<$kinfile>) { |
| 175 | 175 | chomp; |
| 176 | 176 | |
| @@ -34,6 +34,10 @@ LD="$1" · 33 unmodified lines | ||
| 34 | 34 | KBUILD_LDFLAGS="$2" |
| 35 | 35 | LDFLAGS_vmlinux="$3" |
| 36 | 36 | |
| 37 | +is_enabled() { | |
| 38 | + grep -q "^$1=y" include/config/auto.conf | |
| 39 | +} | |
| 40 | + | |
| 37 | 41 | # Nice output in kbuild format |
| 38 | 42 | # Will be supressed by "make -s" |
| 39 | 43 | info() |
| @@ -80,11 +84,11 @@ modpost_link() · 40 unmodified lines | ||
| 80 | 84 | ${KBUILD_VMLINUX_LIBS} \ |
| 81 | 85 | --end-group" |
| 82 | 86 | |
| 83 | − if [ -n "${CONFIG_LTO_CLANG}" ]; then | |
| 87 | + if is_enabled CONFIG_LTO_CLANG; then | |
| 84 | 88 | gen_initcalls |
| 85 | 89 | lds="-T .tmp_initcalls.lds" |
| 86 | 90 | |
| 87 | − if [ -n "${CONFIG_MODVERSIONS}" ]; then | |
| 91 | + if is_enabled CONFIG_MODVERSIONS; then | |
| 88 | 92 | gen_symversions |
| 89 | 93 | lds="${lds} -T .tmp_symversions.lds" |
| 90 | 94 | fi |
| @@ -104,21 +108,21 @@ objtool_link() · 13 unmodified lines | ||
| 104 | 108 | local objtoolcmd; |
| 105 | 109 | local objtoolopt; |
| 106 | 110 | |
| 107 | − if [ "${CONFIG_LTO_CLANG} ${CONFIG_STACK_VALIDATION}" = "y y" ]; then | |
| 111 | + if is_enabled CONFIG_LTO_CLANG && is_enabled CONFIG_STACK_VALIDATION; then | |
| 108 | 112 | # Don't perform vmlinux validation unless explicitly requested, |
| 109 | 113 | # but run objtool on vmlinux.o now that we have an object file. |
| 110 | − if [ -n "${CONFIG_UNWINDER_ORC}" ]; then | |
| 114 | + if is_enabled CONFIG_UNWINDER_ORC; then | |
| 111 | 115 | objtoolcmd="orc generate" |
| 112 | 116 | fi |
| 113 | 117 | |
| 114 | 118 | objtoolopt="${objtoolopt} --duplicate" |
| 115 | 119 | |
| 116 | − if [ -n "${CONFIG_FTRACE_MCOUNT_USE_OBJTOOL}" ]; then | |
| 120 | + if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then | |
| 117 | 121 | objtoolopt="${objtoolopt} --mcount" |
| 118 | 122 | fi |
| 119 | 123 | fi |
| 120 | 124 | |
| 121 | − if [ -n "${CONFIG_VMLINUX_VALIDATION}" ]; then | |
| 125 | + if is_enabled CONFIG_VMLINUX_VALIDATION; then | |
| 122 | 126 | objtoolopt="${objtoolopt} --noinstr" |
| 123 | 127 | fi |
| 124 | 128 | |
| @@ -127,19 +131,19 @@ objtool_link() · 2 unmodified lines | ||
| 127 | 131 | objtoolcmd="check" |
| 128 | 132 | fi |
| 129 | 133 | objtoolopt="${objtoolopt} --vmlinux" |
| 130 | − if [ -z "${CONFIG_FRAME_POINTER}" ]; then | |
| 134 | + if ! is_enabled CONFIG_FRAME_POINTER; then | |
| 131 | 135 | objtoolopt="${objtoolopt} --no-fp" |
| 132 | 136 | fi |
| 133 | − if [ -n "${CONFIG_GCOV_KERNEL}" ] || [ -n "${CONFIG_LTO_CLANG}" ]; then | |
| 137 | + if is_enabled CONFIG_GCOV_KERNEL || is_enabled CONFIG_LTO_CLANG; then | |
| 134 | 138 | objtoolopt="${objtoolopt} --no-unreachable" |
| 135 | 139 | fi |
| 136 | − if [ -n "${CONFIG_RETPOLINE}" ]; then | |
| 140 | + if is_enabled CONFIG_RETPOLINE; then | |
| 137 | 141 | objtoolopt="${objtoolopt} --retpoline" |
| 138 | 142 | fi |
| 139 | − if [ -n "${CONFIG_X86_SMAP}" ]; then | |
| 143 | + if is_enabled CONFIG_X86_SMAP; then | |
| 140 | 144 | objtoolopt="${objtoolopt} --uaccess" |
| 141 | 145 | fi |
| 142 | − if [ -n "${CONFIG_SLS}" ]; then | |
| 146 | + if is_enabled CONFIG_SLS; then | |
| 143 | 147 | objtoolopt="${objtoolopt} --sls" |
| 144 | 148 | fi |
| 145 | 149 | info OBJTOOL ${1} |
| @@ -164,7 +168,7 @@ vmlinux_link() · 18 unmodified lines | ||
| 164 | 168 | # skip output file argument |
| 165 | 169 | shift |
| 166 | 170 | |
| 167 | − if [ -n "${CONFIG_LTO_CLANG}" ]; then | |
| 171 | + if is_enabled CONFIG_LTO_CLANG; then | |
| 168 | 172 | # Use vmlinux.o instead of performing the slow LTO link again. |
| 169 | 173 | objs=vmlinux.o |
| 170 | 174 | libs= |
| @@ -192,7 +196,7 @@ vmlinux_link() · 21 unmodified lines | ||
| 192 | 196 | ldflags="${ldflags} ${wl}--strip-debug" |
| 193 | 197 | fi |
| 194 | 198 | |
| 195 | − if [ -n "${CONFIG_VMLINUX_MAP}" ]; then | |
| 199 | + if is_enabled CONFIG_VMLINUX_MAP; then | |
| 196 | 200 | ldflags="${ldflags} ${wl}-Map=${output}.map" |
| 197 | 201 | fi |
| 198 | 202 | |
| @@ -242,15 +246,15 @@ kallsyms() · 43 unmodified lines | ||
| 242 | 246 | { |
| 243 | 247 | local kallsymopt; |
| 244 | 248 | |
| 245 | − if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then | |
| 249 | + if is_enabled CONFIG_KALLSYMS_ALL; then | |
| 246 | 250 | kallsymopt="${kallsymopt} --all-symbols" |
| 247 | 251 | fi |
| 248 | 252 | |
| 249 | − if [ -n "${CONFIG_KALLSYMS_ABSOLUTE_PERCPU}" ]; then | |
| 253 | + if is_enabled CONFIG_KALLSYMS_ABSOLUTE_PERCPU; then | |
| 250 | 254 | kallsymopt="${kallsymopt} --absolute-percpu" |
| 251 | 255 | fi |
| 252 | 256 | |
| 253 | − if [ -n "${CONFIG_KALLSYMS_BASE_RELATIVE}" ]; then | |
| 257 | + if is_enabled CONFIG_KALLSYMS_BASE_RELATIVE; then | |
| 254 | 258 | kallsymopt="${kallsymopt} --base-relative" |
| 255 | 259 | fi |
| 256 | 260 | |
| @@ -315,9 +319,6 @@ if [ "$1" = "clean" ]; then · 58 unmodified lines | ||
| 315 | 319 | exit 0 |
| 316 | 320 | fi |
| 317 | 321 | |
| 318 | −# We need access to CONFIG_ symbols | |
| 319 | −. include/config/auto.conf | |
| 320 | − | |
| 321 | 322 | # Update version |
| 322 | 323 | info GEN .version |
| 323 | 324 | if [ -r .version ]; then |
| @@ -346,7 +347,7 @@ tr '\0' '\n' < modules.builtin.modinfo | sed -n 's/^[[:alnum:]:_]*\.file=//p' | · 22 unmodified lines | ||
| 346 | 347 | tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$/.ko/' > modules.builtin |
| 347 | 348 | |
| 348 | 349 | btf_vmlinux_bin_o="" |
| 349 | −if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then | |
| 350 | +if is_enabled CONFIG_DEBUG_INFO_BTF; then | |
| 350 | 351 | btf_vmlinux_bin_o=.btf.vmlinux.bin.o |
| 351 | 352 | if ! gen_btf .tmp_vmlinux.btf $btf_vmlinux_bin_o ; then |
| 352 | 353 | echo >&2 "Failed to generate BTF for vmlinux" |
| @@ -358,7 +359,7 @@ fi · 5 unmodified lines | ||
| 358 | 359 | kallsymso="" |
| 359 | 360 | kallsymso_prev="" |
| 360 | 361 | kallsyms_vmlinux="" |
| 361 | −if [ -n "${CONFIG_KALLSYMS}" ]; then | |
| 362 | +if is_enabled CONFIG_KALLSYMS; then | |
| 362 | 363 | |
| 363 | 364 | # kallsyms support |
| 364 | 365 | # Generate section listing all symbols and add it into vmlinux |
| @@ -398,7 +399,7 @@ fi · 33 unmodified lines | ||
| 398 | 399 | vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o} |
| 399 | 400 | |
| 400 | 401 | # fill in BTF IDs |
| 401 | −if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then | |
| 402 | +if is_enabled CONFIG_DEBUG_INFO_BTF && is_enabled CONFIG_BPF; then | |
| 402 | 403 | info BTFIDS vmlinux |
| 403 | 404 | ${RESOLVE_BTFIDS} vmlinux |
| 404 | 405 | fi |
| @@ -406,7 +407,7 @@ fi · 1 unmodified line | ||
| 406 | 407 | info SYSMAP System.map |
| 407 | 408 | mksysmap vmlinux System.map |
| 408 | 409 | |
| 409 | −if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then | |
| 410 | +if is_enabled CONFIG_BUILDTIME_TABLE_SORT; then | |
| 410 | 411 | info SORTTAB vmlinux |
| 411 | 412 | if ! sorttable vmlinux; then |
| 412 | 413 | echo >&2 Failed to sort kernel tables |
| @@ -415,7 +416,7 @@ if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then · 2 unmodified lines | ||
| 415 | 416 | fi |
| 416 | 417 | |
| 417 | 418 | # step a (see comment above) |
| 418 | −if [ -n "${CONFIG_KALLSYMS}" ]; then | |
| 419 | +if is_enabled CONFIG_KALLSYMS; then | |
| 419 | 420 | mksysmap ${kallsyms_vmlinux} .tmp_System.map |
| 420 | 421 | |
| 421 | 422 | if ! cmp -s System.map .tmp_System.map; then |
| @@ -28,7 +28,7 @@ llvm) · 27 unmodified lines | ||
| 28 | 28 | if [ "$SRCARCH" = s390 ]; then |
| 29 | 29 | echo 13.0.0 |
| 30 | 30 | else |
| 31 | − echo 10.0.1 | |
| 31 | + echo 11.0.0 | |
| 32 | 32 | fi |
| 33 | 33 | ;; |
| 34 | 34 | *) |
| @@ -39,3 +39,5 @@ if [ -n "${building_out_of_srctree}" ]; then · 38 unmodified lines | ||
| 39 | 39 | rm -f arch/parisc/boot/compressed/${f} |
| 40 | 40 | done |
| 41 | 41 | fi |
| 42 | + | |
| 43 | +rm -f scripts/extract-cert | |
| @@ -111,9 +111,7 @@ if $scm_only; then · 110 unmodified lines | ||
| 111 | 111 | exit |
| 112 | 112 | fi |
| 113 | 113 | |
| 114 | −if test -e include/config/auto.conf; then | |
| 115 | − . include/config/auto.conf | |
| 116 | −else | |
| 114 | +if ! test -e include/config/auto.conf; then | |
| 117 | 115 | echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2 |
| 118 | 116 | exit 1 |
| 119 | 117 | fi |
| @@ -125,10 +123,11 @@ if test ! "$srctree" -ef .; then · 5 unmodified lines | ||
| 125 | 123 | fi |
| 126 | 124 | |
| 127 | 125 | # CONFIG_LOCALVERSION and LOCALVERSION (if set) |
| 128 | −res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" | |
| 126 | +config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf) | |
| 127 | +res="${res}${config_localversion}${LOCALVERSION}" | |
| 129 | 128 | |
| 130 | 129 | # scm version string if not at a tagged commit |
| 131 | −if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then | |
| 130 | +if grep -q "^CONFIG_LOCALVERSION_AUTO=y$" include/config/auto.conf; then | |
| 132 | 131 | # full scm version string |
| 133 | 132 | res="$res$(scm_version)" |
| 134 | 133 | elif [ "${LOCALVERSION+set}" != "set" ]; then |
| @@ -3,11 +3,6 @@ · 2 unmodified lines | ||
| 3 | 3 | # kbuild file for usr/ - including initramfs image |
| 4 | 4 | # |
| 5 | 5 | |
| 6 | −# cmd_bzip2, cmd_lzma, cmd_lzo, cmd_lz4 from scripts/Makefile.lib appends the | |
| 7 | −# size at the end of the compressed file, which unfortunately does not work | |
| 8 | −# with unpack_to_rootfs(). Make size_append no-op. | |
| 9 | −override size_append := : | |
| 10 | − | |
| 11 | 6 | compress-y := shipped |
| 12 | 7 | compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip |
| 13 | 8 | compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2 |
| @@ -21,7 +16,7 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o · 7 unmodified lines | ||
| 21 | 16 | |
| 22 | 17 | $(obj)/initramfs_data.o: $(obj)/initramfs_inc_data |
| 23 | 18 | |
| 24 | −ramfs-input := $(strip $(shell echo $(CONFIG_INITRAMFS_SOURCE))) | |
| 19 | +ramfs-input := $(CONFIG_INITRAMFS_SOURCE) | |
| 25 | 20 | cpio-data := |
| 26 | 21 | |
| 27 | 22 | # If CONFIG_INITRAMFS_SOURCE is empty, generate a small initramfs with the |
| @@ -99,10 +99,12 @@ quiet_cmd_hdrtest = HDRTEST $< · 98 unmodified lines | ||
| 99 | 99 | cmd_hdrtest = \ |
| 100 | 100 | $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \ |
| 101 | 101 | $(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \ |
| 102 | − $(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \ | |
| 102 | + $(PERL) $(srctree)/$(src)/headers_check.pl $(obj) $(SRCARCH) $<; \ | |
| 103 | 103 | touch $@ |
| 104 | 104 | |
| 105 | 105 | $(obj)/%.hdrtest: $(obj)/%.h FORCE |
| 106 | 106 | $(call if_changed_dep,hdrtest) |
| 107 | 107 | |
| 108 | −clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*))) | |
| 108 | +# Since GNU Make 4.3, $(patsubst $(obj)/%/,%,$(wildcard $(obj)/*/)) works. | |
| 109 | +# To support older Make versions, use a somewhat tedious way. | |
| 110 | +clean-files += $(filter-out Makefile headers_check.pl, $(notdir $(wildcard $(obj)/*))) | |
File renamed without changes.