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

Merge tag 'kbuild-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

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
...

+242 -366
+1 -1
Documentation/kbuild/kconfig-language.rst
··· 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
+1 -1
Documentation/process/changes.rst
··· 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
-1
MAINTAINERS
··· 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
+3 -12
Makefile
··· 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 ··· 1488 1497 debian snap tar-install \ 1489 1498 .config .config.old .version \ 1490 1499 Module.symvers \ 1491 - certs/signing_key.pem certs/signing_key.x509 \ 1500 + certs/signing_key.pem \ 1492 1501 certs/x509.genkey \ 1493 1502 vmlinux-gdb.py \ 1494 1503 *.spec ··· 1714 1723 # now expand this into a simple variable to reduce the cost of shell evaluations 1715 1724 prepare: CC_VERSION_TEXT := $(CC_VERSION_TEXT) 1716 1725 prepare: 1717 - @if [ "$(CC_VERSION_TEXT)" != $(CONFIG_CC_VERSION_TEXT) ]; then \ 1726 + @if [ "$(CC_VERSION_TEXT)" != "$(CONFIG_CC_VERSION_TEXT)" ]; then \ 1718 1727 echo >&2 "warning: the compiler differs from the one used to build the kernel"; \ 1719 - echo >&2 " The kernel was built by: "$(CONFIG_CC_VERSION_TEXT); \ 1728 + echo >&2 " The kernel was built by: $(CONFIG_CC_VERSION_TEXT)"; \ 1720 1729 echo >&2 " You are using: $(CC_VERSION_TEXT)"; \ 1721 1730 fi 1722 1731
+1 -2
arch/Kconfig
··· 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
+2 -2
arch/arc/Makefile
··· 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 -2
arch/arc/boot/dts/Makefile
··· 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
-2
arch/arm/Kconfig.debug
··· 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
+4 -4
arch/arm/boot/compressed/Makefile
··· 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
+3 -1
arch/h8300/boot/compressed/Makefile
··· 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 -5
arch/h8300/boot/dts/Makefile
··· 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
+4 -4
arch/microblaze/Makefile
··· 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
+6 -6
arch/mips/boot/compressed/Makefile
··· 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
-6
arch/nds32/Makefile
··· 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 -6
arch/nds32/boot/dts/Makefile
··· 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 -1
arch/nios2/boot/dts/Makefile
··· 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 -6
arch/openrisc/boot/dts/Makefile
··· 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
+11 -13
arch/parisc/boot/compressed/Makefile
··· 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 ··· 57 59 suffix-$(CONFIG_KERNEL_LZO) := lzo 58 60 suffix-$(CONFIG_KERNEL_XZ) := xz 59 61 60 - $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE 62 + $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 61 63 $(call if_changed,gzip) 62 - $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE 63 - $(call if_changed,bzip2) 64 - $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE 65 - $(call if_changed,lz4) 66 - $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE 67 - $(call if_changed,lzma) 68 - $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE 69 - $(call if_changed,lzo) 70 - $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE 71 - $(call if_changed,xzkern) 64 + $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 65 + $(call if_changed,bzip2_with_size) 66 + $(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE 67 + $(call if_changed,lz4_with_size) 68 + $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 69 + $(call if_changed,lzma_with_size) 70 + $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 71 + $(call if_changed,lzo_with_size) 72 + $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE 73 + $(call if_changed,xzkern_with_size) 72 74 73 75 LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T 74 76 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
+1 -1
arch/powerpc/boot/Makefile
··· 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 -3
arch/riscv/boot/dts/canaan/Makefile
··· 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
+13 -15
arch/s390/boot/compressed/Makefile
··· 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 ··· 66 68 suffix-$(CONFIG_KERNEL_XZ) := .xz 67 69 suffix-$(CONFIG_KERNEL_ZSTD) := .zst 68 70 69 - $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE 71 + $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 70 72 $(call if_changed,gzip) 71 - $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE 72 - $(call if_changed,bzip2) 73 - $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE 74 - $(call if_changed,lz4) 75 - $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE 76 - $(call if_changed,lzma) 77 - $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE 78 - $(call if_changed,lzo) 79 - $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE 80 - $(call if_changed,xzkern) 81 - $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE 82 - $(call if_changed,zstd22) 73 + $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 74 + $(call if_changed,bzip2_with_size) 75 + $(obj)/vmlinux.bin.lz4: $(obj)/vmlinux.bin FORCE 76 + $(call if_changed,lz4_with_size) 77 + $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 78 + $(call if_changed,lzma_with_size) 79 + $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 80 + $(call if_changed,lzo_with_size) 81 + $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE 82 + $(call if_changed,xzkern_with_size) 83 + $(obj)/vmlinux.bin.zst: $(obj)/vmlinux.bin FORCE 84 + $(call if_changed,zstd22_with_size) 83 85 84 86 OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed 85 87 $(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE
+8 -8
arch/sh/boot/Makefile
··· 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 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
+10 -12
arch/sh/boot/compressed/Makefile
··· 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 -3
arch/sh/boot/dts/Makefile
··· 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))
+6 -6
arch/x86/boot/compressed/Makefile
··· 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
+1 -1
arch/xtensa/Makefile
··· 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
+1 -4
arch/xtensa/boot/dts/Makefile
··· 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
certs/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 + /extract-cert 2 3 /x509_certificate_list 3 4 /x509_revocation_list
+1 -3
certs/Kconfig
··· 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.
+32 -91
certs/Makefile
··· 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 ··· 40 50 # fail and that the kernel may be used afterwards. 41 51 # 42 52 ############################################################################### 43 - ifndef CONFIG_MODULE_SIG_HASH 44 - $(error Could not determine digest type to use from kernel config) 45 - endif 46 - 47 - redirect_openssl = 2>&1 48 - quiet_redirect_openssl = 2>&1 49 - silent_redirect_openssl = 2>/dev/null 50 - openssl_available = $(shell openssl help 2>/dev/null && echo yes) 51 53 52 54 # We do it this way rather than having a boolean option for enabling an 53 55 # external private key, because 'make randconfig' might enable such a 54 56 # boolean option and we unfortunately can't make it depend on !RANDCONFIG. 55 - ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem") 57 + ifeq ($(CONFIG_MODULE_SIG_KEY),certs/signing_key.pem) 56 58 57 - ifeq ($(openssl_available),yes) 58 - X509TEXT=$(shell openssl x509 -in "certs/signing_key.pem" -text 2>/dev/null) 59 - endif 59 + keytype-$(CONFIG_MODULE_SIG_KEY_TYPE_ECDSA) := -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 60 60 61 - # Support user changing key type 62 - ifdef CONFIG_MODULE_SIG_KEY_TYPE_ECDSA 63 - keytype_openssl = -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 64 - ifeq ($(openssl_available),yes) 65 - $(if $(findstring id-ecPublicKey,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem")) 66 - endif 67 - endif # CONFIG_MODULE_SIG_KEY_TYPE_ECDSA 61 + quiet_cmd_gen_key = GENKEY $@ 62 + cmd_gen_key = openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ 63 + -batch -x509 -config $< \ 64 + -outform PEM -out $@ -keyout $@ $(keytype-y) 2>&1 68 65 69 - ifdef CONFIG_MODULE_SIG_KEY_TYPE_RSA 70 - ifeq ($(openssl_available),yes) 71 - $(if $(findstring rsaEncryption,$(X509TEXT)),,$(shell rm -f "certs/signing_key.pem")) 72 - endif 73 - endif # CONFIG_MODULE_SIG_KEY_TYPE_RSA 66 + $(obj)/signing_key.pem: $(obj)/x509.genkey FORCE 67 + $(call if_changed,gen_key) 74 68 75 - $(obj)/signing_key.pem: $(obj)/x509.genkey 76 - @$(kecho) "###" 77 - @$(kecho) "### Now generating an X.509 key pair to be used for signing modules." 78 - @$(kecho) "###" 79 - @$(kecho) "### If this takes a long time, you might wish to run rngd in the" 80 - @$(kecho) "### background to keep the supply of entropy topped up. It" 81 - @$(kecho) "### needs to be run as root, and uses a hardware random" 82 - @$(kecho) "### number generator if one is available." 83 - @$(kecho) "###" 84 - $(Q)openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ 85 - -batch -x509 -config $(obj)/x509.genkey \ 86 - -outform PEM -out $(obj)/signing_key.pem \ 87 - -keyout $(obj)/signing_key.pem \ 88 - $(keytype_openssl) \ 89 - $($(quiet)redirect_openssl) 90 - @$(kecho) "###" 91 - @$(kecho) "### Key pair generated." 92 - @$(kecho) "###" 69 + targets += signing_key.pem 93 70 71 + quiet_cmd_copy_x509_config = COPY $@ 72 + cmd_copy_x509_config = cat $(srctree)/$(src)/default_x509.genkey > $@ 73 + 74 + # You can provide your own config file. If not present, copy the default one. 94 75 $(obj)/x509.genkey: 95 - @$(kecho) Generating X.509 key generation config 96 - @echo >$@ "[ req ]" 97 - @echo >>$@ "default_bits = 4096" 98 - @echo >>$@ "distinguished_name = req_distinguished_name" 99 - @echo >>$@ "prompt = no" 100 - @echo >>$@ "string_mask = utf8only" 101 - @echo >>$@ "x509_extensions = myexts" 102 - @echo >>$@ 103 - @echo >>$@ "[ req_distinguished_name ]" 104 - @echo >>$@ "#O = Unspecified company" 105 - @echo >>$@ "CN = Build time autogenerated kernel key" 106 - @echo >>$@ "#emailAddress = unspecified.user@unspecified.company" 107 - @echo >>$@ 108 - @echo >>$@ "[ myexts ]" 109 - @echo >>$@ "basicConstraints=critical,CA:FALSE" 110 - @echo >>$@ "keyUsage=digitalSignature" 111 - @echo >>$@ "subjectKeyIdentifier=hash" 112 - @echo >>$@ "authorityKeyIdentifier=keyid" 76 + $(call cmd,copy_x509_config) 77 + 113 78 endif # CONFIG_MODULE_SIG_KEY 114 79 115 - $(eval $(call config_filename,MODULE_SIG_KEY)) 116 - 117 80 # If CONFIG_MODULE_SIG_KEY isn't a PKCS#11 URI, depend on it 118 - ifeq ($(patsubst pkcs11:%,%,$(firstword $(MODULE_SIG_KEY_FILENAME))),$(firstword $(MODULE_SIG_KEY_FILENAME))) 119 - X509_DEP := $(MODULE_SIG_KEY_SRCPREFIX)$(MODULE_SIG_KEY_FILENAME) 81 + ifneq ($(filter-out pkcs11:%, %(CONFIG_MODULE_SIG_KEY)),) 82 + X509_DEP := $(CONFIG_MODULE_SIG_KEY) 120 83 endif 121 84 122 - # GCC PR#66871 again. 123 85 $(obj)/system_certificates.o: $(obj)/signing_key.x509 124 86 125 - targets += signing_key.x509 126 - $(obj)/signing_key.x509: scripts/extract-cert $(X509_DEP) FORCE 127 - $(call if_changed,extract_certs,$(MODULE_SIG_KEY_SRCPREFIX)$(CONFIG_MODULE_SIG_KEY)) 87 + $(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE 88 + $(call if_changed,extract_certs,$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY))) 128 89 endif # CONFIG_MODULE_SIG 129 90 130 - ifeq ($(CONFIG_SYSTEM_REVOCATION_LIST),y) 131 - 132 - $(eval $(call config_filename,SYSTEM_REVOCATION_KEYS)) 91 + targets += signing_key.x509 133 92 134 93 $(obj)/revocation_certificates.o: $(obj)/x509_revocation_list 135 94 136 - quiet_cmd_extract_certs = EXTRACT_CERTS $(patsubst "%",%,$(2)) 137 - cmd_extract_certs = scripts/extract-cert $(2) $@ 95 + $(obj)/x509_revocation_list: $(CONFIG_SYSTEM_REVOCATION_KEYS) $(obj)/extract-cert FORCE 96 + $(call if_changed,extract_certs,$(if $(CONFIG_SYSTEM_REVOCATION_KEYS),$<,"")) 138 97 139 98 targets += x509_revocation_list 140 - $(obj)/x509_revocation_list: scripts/extract-cert $(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(SYSTEM_REVOCATION_KEYS_FILENAME) FORCE 141 - $(call if_changed,extract_certs,$(SYSTEM_REVOCATION_KEYS_SRCPREFIX)$(CONFIG_SYSTEM_REVOCATION_KEYS)) 142 - endif 99 + 100 + hostprogs := extract-cert 101 + 102 + HOSTCFLAGS_extract-cert.o = $(shell pkg-config --cflags libcrypto 2> /dev/null) 103 + HOSTLDLIBS_extract-cert = $(shell pkg-config --libs libcrypto 2> /dev/null || echo -lcrypto)
+17
certs/default_x509.genkey
··· 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
+1 -1
drivers/acpi/Makefile
··· 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
+2 -2
drivers/base/firmware_loader/builtin/Makefile
··· 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,%,$@)
+1 -2
include/linux/slab.h
··· 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();
+1 -1
include/uapi/linux/soundcard.h
··· 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()
-1
init/Kconfig
··· 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
+1 -1
init/Makefile
··· 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)
-1
kernel/gcov/Kconfig
··· 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
+2 -2
net/wireless/Makefile
··· 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
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
-47
scripts/Kbuild.include
··· 196 196 endif 197 197 198 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 - ############################################################################### 246 199 247 200 # delete partially updated (i.e. corrupted) files on error 248 201 .DELETE_ON_ERROR:
+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 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)
+28 -7
scripts/Makefile.lib
··· 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 ··· 470 455 # big dictionary would increase the memory usage too much in the multi-call 471 456 # decompression mode. A BCJ filter isn't used either. 472 457 quiet_cmd_xzkern = XZKERN $@ 473 - cmd_xzkern = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ 458 + cmd_xzkern = cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh > $@ 459 + 460 + quiet_cmd_xzkern_with_size = XZKERN $@ 461 + cmd_xzkern_with_size = { cat $(real-prereqs) | sh $(srctree)/scripts/xz_wrap.sh; \ 474 462 $(size_append); } > $@ 475 463 476 464 quiet_cmd_xzmisc = XZMISC $@ ··· 496 478 # be used because it would require zstd to allocate a 128 MB buffer. 497 479 498 480 quiet_cmd_zstd = ZSTD $@ 499 - cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@ 481 + cmd_zstd = cat $(real-prereqs) | $(ZSTD) -19 > $@ 500 482 501 483 quiet_cmd_zstd22 = ZSTD22 $@ 502 - cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ 484 + cmd_zstd22 = cat $(real-prereqs) | $(ZSTD) -22 --ultra > $@ 485 + 486 + quiet_cmd_zstd22_with_size = ZSTD22 $@ 487 + cmd_zstd22_with_size = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ 503 488 504 489 # ASM offsets 505 490 # ---------------------------------------------------------------------------
+2 -2
scripts/Makefile.modinst
··· 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 :=
+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
+3 -8
scripts/gen_autoksyms.sh
··· 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
scripts/headers_check.pl usr/include/headers_check.pl
+2 -1
scripts/kconfig/Makefile
··· 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 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'
+10 -7
scripts/kconfig/conf.c
··· 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; ··· 164 163 def_default, 165 164 def_yes, 166 165 def_mod, 167 - def_y2m, 168 - def_m2y, 169 166 def_no, 170 167 def_random 171 168 }; ··· 301 302 return has_changed; 302 303 } 303 304 304 - static void conf_rewrite_mod_or_yes(enum conf_def_mode mode) 305 + static void conf_rewrite_tristates(tristate old_val, tristate new_val) 305 306 { 306 307 struct symbol *sym; 307 308 int i; 308 - tristate old_val = (mode == def_y2m) ? yes : mod; 309 - tristate new_val = (mode == def_y2m) ? mod : yes; 310 309 311 310 for_all_symbols(i, sym) { 312 311 if (sym_get_type(sym) == S_TRISTATE && ··· 682 685 {"olddefconfig", no_argument, &input_mode_opt, olddefconfig}, 683 686 {"yes2modconfig", no_argument, &input_mode_opt, yes2modconfig}, 684 687 {"mod2yesconfig", no_argument, &input_mode_opt, mod2yesconfig}, 688 + {"mod2noconfig", no_argument, &input_mode_opt, mod2noconfig}, 685 689 {NULL, 0, NULL, 0} 686 690 }; 687 691 ··· 711 713 printf(" --randconfig New config with random answer to all options\n"); 712 714 printf(" --yes2modconfig Change answers from yes to mod if possible\n"); 713 715 printf(" --mod2yesconfig Change answers from mod to yes if possible\n"); 716 + printf(" --mod2noconfig Change answers from mod to no if possible\n"); 714 717 printf(" (If none of the above is given, --oldaskconfig is the default)\n"); 715 718 } 716 719 ··· 787 788 case olddefconfig: 788 789 case yes2modconfig: 789 790 case mod2yesconfig: 791 + case mod2noconfig: 790 792 conf_read(NULL); 791 793 break; 792 794 case allnoconfig: ··· 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;
+13 -11
scripts/kconfig/confdata.c
··· 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: ··· 702 700 703 701 static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym) 704 702 { 705 - __print_symbol(fp, sym, OUTPUT_N_NONE, true); 703 + __print_symbol(fp, sym, OUTPUT_N_NONE, false); 706 704 } 707 705 708 706 void print_symbol_for_listconfig(struct symbol *sym)
+1 -1
scripts/kconfig/streamline_config.pl
··· 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
+1 -1
scripts/min-tool-version.sh
··· 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 *)
+2
scripts/remove-stale-files
··· 39 39 rm -f arch/parisc/boot/compressed/${f} 40 40 done 41 41 fi 42 + 43 + rm -f scripts/extract-cert
+4 -5
scripts/setlocalversion
··· 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 ··· 123 125 fi 124 126 125 127 # CONFIG_LOCALVERSION and LOCALVERSION (if set) 126 - res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}" 128 + config_localversion=$(sed -n 's/^CONFIG_LOCALVERSION=\(.*\)$/\1/p' include/config/auto.conf) 129 + res="${res}${config_localversion}${LOCALVERSION}" 127 130 128 131 # scm version string if not at a tagged commit 129 - if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then 132 + if grep -q "^CONFIG_LOCALVERSION_AUTO=y$" include/config/auto.conf; then 130 133 # full scm version string 131 134 res="$res$(scm_version)" 132 135 elif [ "${LOCALVERSION+set}" != "set" ]; then
+1 -6
usr/Makefile
··· 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 ··· 16 21 17 22 $(obj)/initramfs_data.o: $(obj)/initramfs_inc_data 18 23 19 - ramfs-input := $(strip $(shell echo $(CONFIG_INITRAMFS_SOURCE))) 24 + ramfs-input := $(CONFIG_INITRAMFS_SOURCE) 20 25 cpio-data := 21 26 22 27 # If CONFIG_INITRAMFS_SOURCE is empty, generate a small initramfs with the
+4 -2
usr/include/Makefile
··· 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)/*)))