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 ...
Showing the changes to scripts (16 of 57 files). Show all
Unified · Split
| @@ -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 := |
| @@ -1,162 +0,0 @@ | ||
| 1 | −/* Extract X.509 certificate in DER form from PKCS#11 or PEM. | |
| 2 | − * | |
| 3 | − * Copyright © 2014-2015 Red Hat, Inc. All Rights Reserved. | |
| 4 | − * Copyright © 2015 Intel Corporation. | |
| 5 | − * | |
| 6 | − * Authors: David Howells <dhowells@redhat.com> | |
| 7 | − * David Woodhouse <dwmw2@infradead.org> | |
| 8 | − * | |
| 9 | − * This program is free software; you can redistribute it and/or | |
| 10 | − * modify it under the terms of the GNU Lesser General Public License | |
| 11 | − * as published by the Free Software Foundation; either version 2.1 | |
| 12 | − * of the licence, or (at your option) any later version. | |
| 13 | − */ | |
| 14 | −#define _GNU_SOURCE | |
| 15 | −#include <stdio.h> | |
| 16 | −#include <stdlib.h> | |
| 17 | −#include <stdint.h> | |
| 18 | −#include <stdbool.h> | |
| 19 | −#include <string.h> | |
| 20 | −#include <err.h> | |
| 21 | −#include <openssl/bio.h> | |
| 22 | −#include <openssl/pem.h> | |
| 23 | −#include <openssl/err.h> | |
| 24 | −#include <openssl/engine.h> | |
| 25 | − | |
| 26 | −#define PKEY_ID_PKCS7 2 | |
| 27 | − | |
| 28 | −static __attribute__((noreturn)) | |
| 29 | −void format(void) | |
| 30 | −{ | |
| 31 | − fprintf(stderr, | |
| 32 | − "Usage: scripts/extract-cert <source> <dest>\n"); | |
| 33 | − exit(2); | |
| 34 | −} | |
| 35 | − | |
| 36 | −static void display_openssl_errors(int l) | |
| 37 | −{ | |
| 38 | − const char *file; | |
| 39 | − char buf[120]; | |
| 40 | − int e, line; | |
| 41 | − | |
| 42 | − if (ERR_peek_error() == 0) | |
| 43 | − return; | |
| 44 | − fprintf(stderr, "At main.c:%d:\n", l); | |
| 45 | − | |
| 46 | − while ((e = ERR_get_error_line(&file, &line))) { | |
| 47 | − ERR_error_string(e, buf); | |
| 48 | − fprintf(stderr, "- SSL %s: %s:%d\n", buf, file, line); | |
| 49 | − } | |
| 50 | −} | |
| 51 | − | |
| 52 | −static void drain_openssl_errors(void) | |
| 53 | −{ | |
| 54 | − const char *file; | |
| 55 | − int line; | |
| 56 | − | |
| 57 | − if (ERR_peek_error() == 0) | |
| 58 | − return; | |
| 59 | − while (ERR_get_error_line(&file, &line)) {} | |
| 60 | −} | |
| 61 | − | |
| 62 | −#define ERR(cond, fmt, ...) \ | |
| 63 | − do { \ | |
| 64 | − bool __cond = (cond); \ | |
| 65 | − display_openssl_errors(__LINE__); \ | |
| 66 | − if (__cond) { \ | |
| 67 | − err(1, fmt, ## __VA_ARGS__); \ | |
| 68 | − } \ | |
| 69 | − } while(0) | |
| 70 | − | |
| 71 | −static const char *key_pass; | |
| 72 | −static BIO *wb; | |
| 73 | −static char *cert_dst; | |
| 74 | −static int kbuild_verbose; | |
| 75 | − | |
| 76 | −static void write_cert(X509 *x509) | |
| 77 | −{ | |
| 78 | − char buf[200]; | |
| 79 | − | |
| 80 | − if (!wb) { | |
| 81 | − wb = BIO_new_file(cert_dst, "wb"); | |
| 82 | − ERR(!wb, "%s", cert_dst); | |
| 83 | − } | |
| 84 | − X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf)); | |
| 85 | − ERR(!i2d_X509_bio(wb, x509), "%s", cert_dst); | |
| 86 | − if (kbuild_verbose) | |
| 87 | − fprintf(stderr, "Extracted cert: %s\n", buf); | |
| 88 | −} | |
| 89 | − | |
| 90 | −int main(int argc, char **argv) | |
| 91 | −{ | |
| 92 | − char *cert_src; | |
| 93 | − | |
| 94 | − OpenSSL_add_all_algorithms(); | |
| 95 | − ERR_load_crypto_strings(); | |
| 96 | − ERR_clear_error(); | |
| 97 | − | |
| 98 | − kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0"); | |
| 99 | − | |
| 100 | − key_pass = getenv("KBUILD_SIGN_PIN"); | |
| 101 | − | |
| 102 | − if (argc != 3) | |
| 103 | − format(); | |
| 104 | − | |
| 105 | − cert_src = argv[1]; | |
| 106 | − cert_dst = argv[2]; | |
| 107 | − | |
| 108 | − if (!cert_src[0]) { | |
| 109 | − /* Invoked with no input; create empty file */ | |
| 110 | − FILE *f = fopen(cert_dst, "wb"); | |
| 111 | − ERR(!f, "%s", cert_dst); | |
| 112 | − fclose(f); | |
| 113 | − exit(0); | |
| 114 | − } else if (!strncmp(cert_src, "pkcs11:", 7)) { | |
| 115 | − ENGINE *e; | |
| 116 | − struct { | |
| 117 | − const char *cert_id; | |
| 118 | − X509 *cert; | |
| 119 | − } parms; | |
| 120 | − | |
| 121 | − parms.cert_id = cert_src; | |
| 122 | − parms.cert = NULL; | |
| 123 | − | |
| 124 | − ENGINE_load_builtin_engines(); | |
| 125 | − drain_openssl_errors(); | |
| 126 | − e = ENGINE_by_id("pkcs11"); | |
| 127 | − ERR(!e, "Load PKCS#11 ENGINE"); | |
| 128 | − if (ENGINE_init(e)) | |
| 129 | − drain_openssl_errors(); | |
| 130 | − else | |
| 131 | − ERR(1, "ENGINE_init"); | |
| 132 | − if (key_pass) | |
| 133 | − ERR(!ENGINE_ctrl_cmd_string(e, "PIN", key_pass, 0), "Set PKCS#11 PIN"); | |
| 134 | − ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &parms, NULL, 1); | |
| 135 | − ERR(!parms.cert, "Get X.509 from PKCS#11"); | |
| 136 | − write_cert(parms.cert); | |
| 137 | − } else { | |
| 138 | − BIO *b; | |
| 139 | − X509 *x509; | |
| 140 | − | |
| 141 | − b = BIO_new_file(cert_src, "rb"); | |
| 142 | − ERR(!b, "%s", cert_src); | |
| 143 | − | |
| 144 | − while (1) { | |
| 145 | − x509 = PEM_read_bio_X509(b, NULL, NULL, NULL); | |
| 146 | − if (wb && !x509) { | |
| 147 | − unsigned long err = ERR_peek_last_error(); | |
| 148 | − if (ERR_GET_LIB(err) == ERR_LIB_PEM && | |
| 149 | − ERR_GET_REASON(err) == PEM_R_NO_START_LINE) { | |
| 150 | − ERR_clear_error(); | |
| 151 | − break; | |
| 152 | − } | |
| 153 | − } | |
| 154 | − ERR(!x509, "%s", cert_src); | |
| 155 | − write_cert(x509); | |
| 156 | − } | |
| 157 | − } | |
| 158 | − | |
| 159 | − BIO_free(wb); | |
| 160 | − | |
| 161 | − return 0; | |
| 162 | −} | |
| @@ -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 |
| @@ -1,171 +0,0 @@ | ||
| 1 | −#!/usr/bin/env perl | |
| 2 | −# SPDX-License-Identifier: GPL-2.0 | |
| 3 | −# | |
| 4 | −# headers_check.pl execute a number of trivial consistency checks | |
| 5 | −# | |
| 6 | −# Usage: headers_check.pl dir arch [files...] | |
| 7 | −# dir: dir to look for included files | |
| 8 | −# arch: architecture | |
| 9 | −# files: list of files to check | |
| 10 | −# | |
| 11 | −# The script reads the supplied files line by line and: | |
| 12 | −# | |
| 13 | −# 1) for each include statement it checks if the | |
| 14 | −# included file actually exists. | |
| 15 | −# Only include files located in asm* and linux* are checked. | |
| 16 | −# The rest are assumed to be system include files. | |
| 17 | −# | |
| 18 | −# 2) It is checked that prototypes does not use "extern" | |
| 19 | −# | |
| 20 | −# 3) Check for leaked CONFIG_ symbols | |
| 21 | − | |
| 22 | −use warnings; | |
| 23 | −use strict; | |
| 24 | −use File::Basename; | |
| 25 | − | |
| 26 | −my ($dir, $arch, @files) = @ARGV; | |
| 27 | − | |
| 28 | −my $ret = 0; | |
| 29 | −my $line; | |
| 30 | −my $lineno = 0; | |
| 31 | −my $filename; | |
| 32 | − | |
| 33 | −foreach my $file (@files) { | |
| 34 | − $filename = $file; | |
| 35 | − | |
| 36 | − open(my $fh, '<', $filename) | |
| 37 | − or die "$filename: $!\n"; | |
| 38 | − $lineno = 0; | |
| 39 | − while ($line = <$fh>) { | |
| 40 | − $lineno++; | |
| 41 | − &check_include(); | |
| 42 | − &check_asm_types(); | |
| 43 | − &check_sizetypes(); | |
| 44 | − &check_declarations(); | |
| 45 | − # Dropped for now. Too much noise &check_config(); | |
| 46 | − } | |
| 47 | − close $fh; | |
| 48 | −} | |
| 49 | −exit $ret; | |
| 50 | − | |
| 51 | −sub check_include | |
| 52 | −{ | |
| 53 | − if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) { | |
| 54 | − my $inc = $1; | |
| 55 | − my $found; | |
| 56 | − $found = stat($dir . "/" . $inc); | |
| 57 | − if (!$found) { | |
| 58 | − $inc =~ s#asm/#asm-$arch/#; | |
| 59 | − $found = stat($dir . "/" . $inc); | |
| 60 | − } | |
| 61 | − if (!$found) { | |
| 62 | − printf STDERR "$filename:$lineno: included file '$inc' is not exported\n"; | |
| 63 | − $ret = 1; | |
| 64 | − } | |
| 65 | − } | |
| 66 | −} | |
| 67 | − | |
| 68 | −sub check_declarations | |
| 69 | −{ | |
| 70 | − # soundcard.h is what it is | |
| 71 | − if ($line =~ m/^void seqbuf_dump\(void\);/) { | |
| 72 | − return; | |
| 73 | − } | |
| 74 | − # drm headers are being C++ friendly | |
| 75 | − if ($line =~ m/^extern "C"/) { | |
| 76 | − return; | |
| 77 | − } | |
| 78 | − if ($line =~ m/^(\s*extern|unsigned|char|short|int|long|void)\b/) { | |
| 79 | − printf STDERR "$filename:$lineno: " . | |
| 80 | − "userspace cannot reference function or " . | |
| 81 | − "variable defined in the kernel\n"; | |
| 82 | − } | |
| 83 | −} | |
| 84 | − | |
| 85 | −sub check_config | |
| 86 | −{ | |
| 87 | − if ($line =~ m/[^a-zA-Z0-9_]+CONFIG_([a-zA-Z0-9_]+)[^a-zA-Z0-9_]/) { | |
| 88 | − printf STDERR "$filename:$lineno: leaks CONFIG_$1 to userspace where it is not valid\n"; | |
| 89 | − } | |
| 90 | −} | |
| 91 | − | |
| 92 | −my $linux_asm_types; | |
| 93 | −sub check_asm_types | |
| 94 | −{ | |
| 95 | − if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { | |
| 96 | − return; | |
| 97 | − } | |
| 98 | − if ($lineno == 1) { | |
| 99 | − $linux_asm_types = 0; | |
| 100 | − } elsif ($linux_asm_types >= 1) { | |
| 101 | − return; | |
| 102 | − } | |
| 103 | − if ($line =~ m/^\s*#\s*include\s+<asm\/types.h>/) { | |
| 104 | − $linux_asm_types = 1; | |
| 105 | − printf STDERR "$filename:$lineno: " . | |
| 106 | − "include of <linux/types.h> is preferred over <asm/types.h>\n" | |
| 107 | − # Warn until headers are all fixed | |
| 108 | − #$ret = 1; | |
| 109 | − } | |
| 110 | −} | |
| 111 | − | |
| 112 | −my $linux_types; | |
| 113 | −my %import_stack = (); | |
| 114 | −sub check_include_typesh | |
| 115 | −{ | |
| 116 | − my $path = $_[0]; | |
| 117 | − my $import_path; | |
| 118 | − | |
| 119 | − my $fh; | |
| 120 | − my @file_paths = ($path, $dir . "/" . $path, dirname($filename) . "/" . $path); | |
| 121 | − for my $possible ( @file_paths ) { | |
| 122 | − if (not $import_stack{$possible} and open($fh, '<', $possible)) { | |
| 123 | − $import_path = $possible; | |
| 124 | − $import_stack{$import_path} = 1; | |
| 125 | − last; | |
| 126 | − } | |
| 127 | − } | |
| 128 | − if (eof $fh) { | |
| 129 | − return; | |
| 130 | − } | |
| 131 | − | |
| 132 | − my $line; | |
| 133 | − while ($line = <$fh>) { | |
| 134 | − if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) { | |
| 135 | − $linux_types = 1; | |
| 136 | − last; | |
| 137 | − } | |
| 138 | − if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { | |
| 139 | − check_include_typesh($included); | |
| 140 | − } | |
| 141 | − } | |
| 142 | − close $fh; | |
| 143 | − delete $import_stack{$import_path}; | |
| 144 | −} | |
| 145 | − | |
| 146 | −sub check_sizetypes | |
| 147 | −{ | |
| 148 | − if ($filename =~ /types.h|int-l64.h|int-ll64.h/o) { | |
| 149 | − return; | |
| 150 | − } | |
| 151 | − if ($lineno == 1) { | |
| 152 | − $linux_types = 0; | |
| 153 | − } elsif ($linux_types >= 1) { | |
| 154 | − return; | |
| 155 | − } | |
| 156 | − if ($line =~ m/^\s*#\s*include\s+<linux\/types.h>/) { | |
| 157 | − $linux_types = 1; | |
| 158 | − return; | |
| 159 | − } | |
| 160 | − if (my $included = ($line =~ /^\s*#\s*include\s+[<"](\S+)[>"]/)[0]) { | |
| 161 | − check_include_typesh($included); | |
| 162 | − } | |
| 163 | − if ($line =~ m/__[us](8|16|32|64)\b/) { | |
| 164 | − printf STDERR "$filename:$lineno: " . | |
| 165 | − "found __[us]{8,16,32,64} type " . | |
| 166 | − "without #include <linux/types.h>\n"; | |
| 167 | − $linux_types = 2; | |
| 168 | − # Warn until headers are all fixed | |
| 169 | − #$ret = 1; | |
| 170 | − } | |
| 171 | −} | |
| @@ -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 |