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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull Kbuild updates from Masahiro Yamada:

- Enable -Wenum-conversion warning option

- Refactor the rpm-pkg target

- Fix scripts/setlocalversion to consider annotated tags for rt-kernel

- Add a jump key feature for the search menu of 'make nconfig'

- Support Qt6 for 'make xconfig'

- Enable -Wformat-overflow, -Wformat-truncation, -Wstringop-overflow,
and -Wrestrict warnings for W=1 builds

- Replace <asm/export.h> with <linux/export.h> for alpha, ia64, and
sparc

- Support DEB_BUILD_OPTIONS=parallel=N for the debian source package

- Refactor scripts/Makefile.modinst and fix some modules_sign issues

- Add a new Kconfig env variable to warn symbols that are not defined
anywhere

- Show help messages of config fragments in 'make help'

* tag 'kbuild-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (62 commits)
kconfig: fix possible buffer overflow
kbuild: Show marked Kconfig fragments in "help"
kconfig: add warn-unknown-symbols sanity check
kbuild: dummy-tools: make MPROFILE_KERNEL checks work on BE
Documentation/llvm: refresh docs
modpost: Skip .llvm.call-graph-profile section check
kbuild: support modules_sign for external modules as well
kbuild: support 'make modules_sign' with CONFIG_MODULE_SIG_ALL=n
kbuild: move more module installation code to scripts/Makefile.modinst
kbuild: reduce the number of mkdir calls during modules_install
kbuild: remove $(MODLIB)/source symlink
kbuild: move depmod rule to scripts/Makefile.modinst
kbuild: add modules_sign to no-{compiler,sync-config}-targets
kbuild: do not run depmod for 'make modules_sign'
kbuild: deb-pkg: support DEB_BUILD_OPTIONS=parallel=N in debian/rules
alpha: remove <asm/export.h>
alpha: replace #include <asm/export.h> with #include <linux/export.h>
ia64: remove <asm/export.h>
ia64: replace #include <asm/export.h> with #include <linux/export.h>
sparc: remove <asm/export.h>
...

+1075 -824
+1 -1
.gitignore
··· 74 74 # 75 75 # RPM spec file (make rpm-pkg) 76 76 # 77 - /*.spec 77 + /kernel.spec 78 78 /rpmbuild/ 79 79 80 80 #
+17
Documentation/kbuild/kconfig.rst
··· 56 56 If you set KCONFIG_OVERWRITECONFIG in the environment, Kconfig will not 57 57 break symlinks when .config is a symlink to somewhere else. 58 58 59 + KCONFIG_WARN_UNKNOWN_SYMBOLS 60 + ---------------------------- 61 + This environment variable makes Kconfig warn about all unrecognized 62 + symbols in the config input. 63 + 64 + KCONFIG_WERROR 65 + -------------- 66 + If set, Kconfig treats warnings as errors. 67 + 59 68 `CONFIG_` 60 69 --------- 61 70 If you set `CONFIG_` in the environment, Kconfig will prefix all symbols ··· 221 212 first (and in alphabetical order), then come all other symbols, 222 213 sorted in alphabetical order. 223 214 215 + In this menu, pressing the key in the (#) prefix will jump 216 + directly to that location. You will be returned to the current 217 + search results after exiting this new menu. 218 + 224 219 ---------------------------------------------------------------------- 225 220 226 221 User interface options for 'menuconfig' ··· 276 263 277 264 F8 (SymSearch) searches the configuration symbols for the 278 265 given string or regular expression (regex). 266 + 267 + In the SymSearch, pressing the key in the (#) prefix will 268 + jump directly to that location. You will be returned to the 269 + current search results after exiting this new menu. 279 270 280 271 NCONFIG_MODE 281 272 ------------
+80 -44
Documentation/kbuild/llvm.rst
··· 25 25 that supports C and the GNU C extensions required by the kernel, and is 26 26 pronounced "klang," not "see-lang." 27 27 28 - Clang 29 - ----- 28 + Building with LLVM 29 + ------------------ 30 30 31 - The compiler used can be swapped out via ``CC=`` command line argument to ``make``. 32 - ``CC=`` should be set when selecting a config and during a build. :: 31 + Invoke ``make`` via:: 33 32 34 - make CC=clang defconfig 33 + make LLVM=1 35 34 36 - make CC=clang 35 + to compile for the host target. For cross compiling:: 37 36 38 - Cross Compiling 39 - --------------- 37 + make LLVM=1 ARCH=arm64 40 38 41 - A single Clang compiler binary will typically contain all supported backends, 42 - which can help simplify cross compiling. :: 39 + The LLVM= argument 40 + ------------------ 43 41 44 - make ARCH=arm64 CC=clang CROSS_COMPILE=aarch64-linux-gnu- 45 - 46 - ``CROSS_COMPILE`` is not used to prefix the Clang compiler binary, instead 47 - ``CROSS_COMPILE`` is used to set a command line flag: ``--target=<triple>``. For 48 - example: :: 49 - 50 - clang --target=aarch64-linux-gnu foo.c 51 - 52 - LLVM Utilities 53 - -------------- 54 - 55 - LLVM has substitutes for GNU binutils utilities. They can be enabled individually. 56 - The full list of supported make variables:: 42 + LLVM has substitutes for GNU binutils utilities. They can be enabled 43 + individually. The full list of supported make variables:: 57 44 58 45 make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \ 59 46 OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \ 60 47 HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld 61 48 62 - To simplify the above command, Kbuild supports the ``LLVM`` variable:: 63 - 64 - make LLVM=1 49 + ``LLVM=1`` expands to the above. 65 50 66 51 If your LLVM tools are not available in your PATH, you can supply their 67 52 location using the LLVM variable with a trailing slash:: 68 53 69 54 make LLVM=/path/to/llvm/ 70 55 71 - which will use ``/path/to/llvm/clang``, ``/path/to/llvm/ld.lld``, etc. 56 + which will use ``/path/to/llvm/clang``, ``/path/to/llvm/ld.lld``, etc. The 57 + following may also be used:: 58 + 59 + PATH=/path/to/llvm:$PATH make LLVM=1 72 60 73 61 If your LLVM tools have a version suffix and you want to test with that 74 62 explicit version rather than the unsuffixed executables like ``LLVM=1``, you ··· 66 78 67 79 which will use ``clang-14``, ``ld.lld-14``, etc. 68 80 81 + To support combinations of out of tree paths with version suffixes, we 82 + recommend:: 83 + 84 + PATH=/path/to/llvm/:$PATH make LLVM=-14 85 + 69 86 ``LLVM=0`` is not the same as omitting ``LLVM`` altogether, it will behave like 70 - ``LLVM=1``. If you only wish to use certain LLVM utilities, use their respective 71 - make variables. 87 + ``LLVM=1``. If you only wish to use certain LLVM utilities, use their 88 + respective make variables. 72 89 73 - The integrated assembler is enabled by default. You can pass ``LLVM_IAS=0`` to 74 - disable it. 90 + The same value used for ``LLVM=`` should be set for each invocation of ``make`` 91 + if configuring and building via distinct commands. ``LLVM=`` should also be set 92 + as an environment variable when running scripts that will eventually run 93 + ``make``. 75 94 76 - Omitting CROSS_COMPILE 95 + Cross Compiling 96 + --------------- 97 + 98 + A single Clang compiler binary (and corresponding LLVM utilities) will 99 + typically contain all supported back ends, which can help simplify cross 100 + compiling especially when ``LLVM=1`` is used. If you use only LLVM tools, 101 + ``CROSS_COMPILE`` or target-triple-prefixes become unnecessary. Example:: 102 + 103 + make LLVM=1 ARCH=arm64 104 + 105 + As an example of mixing LLVM and GNU utilities, for a target like ``ARCH=s390`` 106 + which does not yet have ``ld.lld`` or ``llvm-objcopy`` support, you could 107 + invoke ``make`` via:: 108 + 109 + make LLVM=1 ARCH=s390 LD=s390x-linux-gnu-ld.bfd \ 110 + OBJCOPY=s390x-linux-gnu-objcopy 111 + 112 + This example will invoke ``s390x-linux-gnu-ld.bfd`` as the linker and 113 + ``s390x-linux-gnu-objcopy``, so ensure those are reachable in your ``$PATH``. 114 + 115 + ``CROSS_COMPILE`` is not used to prefix the Clang compiler binary (or 116 + corresponding LLVM utilities) as is the case for GNU utilities when ``LLVM=1`` 117 + is not set. 118 + 119 + The LLVM_IAS= argument 77 120 ---------------------- 78 121 79 - As explained above, ``CROSS_COMPILE`` is used to set ``--target=<triple>``. 122 + Clang can assemble assembler code. You can pass ``LLVM_IAS=0`` to disable this 123 + behavior and have Clang invoke the corresponding non-integrated assembler 124 + instead. Example:: 80 125 81 - If ``CROSS_COMPILE`` is not specified, the ``--target=<triple>`` is inferred 82 - from ``ARCH``. 126 + make LLVM=1 LLVM_IAS=0 83 127 84 - That means if you use only LLVM tools, ``CROSS_COMPILE`` becomes unnecessary. 128 + ``CROSS_COMPILE`` is necessary when cross compiling and ``LLVM_IAS=0`` 129 + is used in order to set ``--prefix=`` for the compiler to find the 130 + corresponding non-integrated assembler (typically, you don't want to use the 131 + system assembler when targeting another architecture). Example:: 85 132 86 - For example, to cross-compile the arm64 kernel:: 133 + make LLVM=1 ARCH=arm LLVM_IAS=0 CROSS_COMPILE=arm-linux-gnueabi- 87 134 88 - make ARCH=arm64 LLVM=1 89 135 90 - If ``LLVM_IAS=0`` is specified, ``CROSS_COMPILE`` is also used to derive 91 - ``--prefix=<path>`` to search for the GNU assembler and linker. :: 136 + Ccache 137 + ------ 92 138 93 - make ARCH=arm64 LLVM=1 LLVM_IAS=0 CROSS_COMPILE=aarch64-linux-gnu- 139 + ``ccache`` can be used with ``clang`` to improve subsequent builds, (though 140 + KBUILD_BUILD_TIMESTAMP_ should be set to a deterministic value between builds 141 + in order to avoid 100% cache misses, see Reproducible_builds_ for more info): 142 + 143 + KBUILD_BUILD_TIMESTAMP='' make LLVM=1 CC="ccache clang" 144 + 145 + .. _KBUILD_BUILD_TIMESTAMP: kbuild.html#kbuild-build-timestamp 146 + .. _Reproducible_builds: reproducible-builds.html#timestamps 94 147 95 148 Supported Architectures 96 149 ----------------------- ··· 164 135 * - hexagon 165 136 - Maintained 166 137 - ``LLVM=1`` 138 + * - loongarch 139 + - Maintained 140 + - ``LLVM=1`` 167 141 * - mips 168 142 - Maintained 169 143 - ``LLVM=1`` 170 144 * - powerpc 171 145 - Maintained 172 - - ``CC=clang`` 146 + - ``LLVM=1`` 173 147 * - riscv 174 - - Maintained 148 + - Supported 175 149 - ``LLVM=1`` 176 150 * - s390 177 151 - Maintained ··· 203 171 Getting LLVM 204 172 ------------- 205 173 206 - We provide prebuilt stable versions of LLVM on `kernel.org <https://kernel.org/pub/tools/llvm/>`_. 174 + We provide prebuilt stable versions of LLVM on `kernel.org 175 + <https://kernel.org/pub/tools/llvm/>`_. These have been optimized with profile 176 + data for building Linux kernels, which should improve kernel build times 177 + relative to other distributions of LLVM. 178 + 207 179 Below are links that may be useful for building LLVM from source or procuring 208 180 it through a distribution's package manager. 209 181
+1
MAINTAINERS
··· 11382 11382 F: scripts/mk* 11383 11383 F: scripts/mod/ 11384 11384 F: scripts/package/ 11385 + F: usr/ 11385 11386 11386 11387 KERNEL HARDENING (not covered by other areas) 11387 11388 M: Kees Cook <keescook@chromium.org>
+30 -142
Makefile
··· 280 280 # Installation targets should not require compiler. Unfortunately, vdso_install 281 281 # is an exception where build artifacts may be updated. This must be fixed. 282 282 no-compiler-targets := $(no-dot-config-targets) install dtbs_install \ 283 - headers_install modules_install kernelrelease image_name 284 - no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \ 283 + headers_install modules_install modules_sign kernelrelease image_name 284 + no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \ 285 285 image_name 286 286 single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %.symtypes %/ 287 287 ··· 510 510 YACC = bison 511 511 AWK = awk 512 512 INSTALLKERNEL := installkernel 513 - DEPMOD = depmod 514 513 PERL = perl 515 514 PYTHON3 = python3 516 515 CHECK = sparse ··· 563 564 KBUILD_CFLAGS += -fno-common 564 565 KBUILD_CFLAGS += -fno-PIE 565 566 KBUILD_CFLAGS += -fno-strict-aliasing 566 - KBUILD_CFLAGS += -Wall 567 - KBUILD_CFLAGS += -Wundef 568 - KBUILD_CFLAGS += -Werror=implicit-function-declaration 569 - KBUILD_CFLAGS += -Werror=implicit-int 570 - KBUILD_CFLAGS += -Werror=return-type 571 - KBUILD_CFLAGS += -Werror=strict-prototypes 572 - KBUILD_CFLAGS += -Wno-format-security 573 - KBUILD_CFLAGS += -Wno-trigraphs 574 567 575 568 KBUILD_CPPFLAGS := -D__KERNEL__ 576 569 KBUILD_RUSTFLAGS := $(rust_common_flags) \ ··· 815 824 endif # need-config 816 825 817 826 KBUILD_CFLAGS += -fno-delete-null-pointer-checks 818 - KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) 819 - KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) 820 - KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) 821 - KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) 822 827 823 828 ifdef CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE 824 829 KBUILD_CFLAGS += -O2 ··· 845 858 KBUILD_CFLAGS += -fno-reorder-blocks -fno-ipa-cp-clone -fno-partial-inlining 846 859 endif 847 860 848 - ifneq ($(CONFIG_FRAME_WARN),0) 849 - KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN) 850 - endif 851 - 852 861 stackp-flags-y := -fno-stack-protector 853 862 stackp-flags-$(CONFIG_STACKPROTECTOR) := -fstack-protector 854 863 stackp-flags-$(CONFIG_STACKPROTECTOR_STRONG) := -fstack-protector-strong 855 864 856 865 KBUILD_CFLAGS += $(stackp-flags-y) 857 866 858 - KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror 859 - KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y) 860 - KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds 861 - 862 867 KBUILD_RUSTFLAGS-$(CONFIG_WERROR) += -Dwarnings 863 868 KBUILD_RUSTFLAGS += $(KBUILD_RUSTFLAGS-y) 864 - 865 - ifdef CONFIG_CC_IS_CLANG 866 - # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. 867 - KBUILD_CFLAGS += -Wno-gnu 868 - else 869 - 870 - # gcc inanely warns about local variables called 'main' 871 - KBUILD_CFLAGS += -Wno-main 872 - endif 873 - 874 - # These warnings generated too much noise in a regular build. 875 - # Use make W=1 to enable them (see scripts/Makefile.extrawarn) 876 - KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) 877 - KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) 878 - 879 - # These result in bogus false positives 880 - KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer) 881 869 882 870 ifdef CONFIG_FRAME_POINTER 883 871 KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls ··· 988 1026 # arch Makefile may override CC so keep this after arch Makefile is included 989 1027 NOSTDINC_FLAGS += -nostdinc 990 1028 991 - # Variable Length Arrays (VLAs) should not be used anywhere in the kernel 992 - KBUILD_CFLAGS += -Wvla 993 - 994 - # disable pointer signed / unsigned warnings in gcc 4.0 995 - KBUILD_CFLAGS += -Wno-pointer-sign 996 - 997 - # In order to make sure new function cast mismatches are not introduced 998 - # in the kernel (to avoid tripping CFI checking), the kernel should be 999 - # globally built with -Wcast-function-type. 1000 - KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) 1001 - 1002 1029 # To gain proper coverage for CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE, 1003 1030 # the kernel uses only C99 flexible arrays for dynamically sized trailing 1004 1031 # arrays. Enforce this for everything that may examine structure sizes and 1005 1032 # perform bounds checking. 1006 1033 KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3) 1007 - 1008 - # disable stringop warnings in gcc 8+ 1009 - KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) 1010 - 1011 - # We'll want to enable this eventually, but it's not going away for 5.7 at least 1012 - KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) 1013 - 1014 - # Another good warning that we'll want to enable eventually 1015 - KBUILD_CFLAGS += $(call cc-disable-warning, restrict) 1016 - 1017 - # Enabled with W=2, disabled by default as noisy 1018 - ifdef CONFIG_CC_IS_GCC 1019 - KBUILD_CFLAGS += -Wno-maybe-uninitialized 1020 - endif 1021 - 1022 - # The allocators already balk at large sizes, so silence the compiler 1023 - # warnings for bounds checks involving those possible values. While 1024 - # -Wno-alloc-size-larger-than would normally be used here, earlier versions 1025 - # of gcc (<9.1) weirdly don't handle the option correctly when _other_ 1026 - # warnings are produced (?!). Using -Walloc-size-larger-than=SIZE_MAX 1027 - # doesn't work (as it is documented to), silently resolving to "0" prior to 1028 - # version 9.1 (and producing an error more recently). Numeric values larger 1029 - # than PTRDIFF_MAX also don't work prior to version 9.1, which are silently 1030 - # ignored, continuing to default to PTRDIFF_MAX. So, left with no other 1031 - # choice, we must perform a versioned check to disable this warning. 1032 - # https://lore.kernel.org/lkml/20210824115859.187f272f@canb.auug.org.au 1033 - KBUILD_CFLAGS-$(call gcc-min-version, 90100) += -Wno-alloc-size-larger-than 1034 - KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) 1035 1034 1036 1035 # disable invalid "can't wrap" optimizations for signed / pointers 1037 1036 KBUILD_CFLAGS += -fno-strict-overflow ··· 1004 1081 ifdef CONFIG_CC_IS_GCC 1005 1082 KBUILD_CFLAGS += -fconserve-stack 1006 1083 endif 1007 - 1008 - # Prohibit date/time macros, which would make the build non-deterministic 1009 - KBUILD_CFLAGS += -Werror=date-time 1010 - 1011 - # enforce correct pointer usage 1012 - KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) 1013 - 1014 - # Require designated initializers for all marked structures 1015 - KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) 1016 1084 1017 1085 # change __FILE__ to the relative path from the srctree 1018 1086 KBUILD_CPPFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=) ··· 1462 1548 modules_prepare: prepare 1463 1549 $(Q)$(MAKE) $(build)=scripts scripts/module.lds 1464 1550 1465 - export modules_sign_only := 1466 - 1467 - ifeq ($(CONFIG_MODULE_SIG),y) 1468 - PHONY += modules_sign 1469 - modules_sign: modules_install 1470 - @: 1471 - 1472 - # modules_sign is a subset of modules_install. 1473 - # 'make modules_install modules_sign' is equivalent to 'make modules_install'. 1474 - ifeq ($(filter modules_install,$(MAKECMDGOALS)),) 1475 - modules_sign_only := y 1476 - endif 1477 - endif 1478 - 1479 1551 endif # CONFIG_MODULES 1480 - 1481 - modinst_pre := 1482 - ifneq ($(filter modules_install,$(MAKECMDGOALS)),) 1483 - modinst_pre := __modinst_pre 1484 - endif 1485 - 1486 - modules_install: $(modinst_pre) 1487 - PHONY += __modinst_pre 1488 - __modinst_pre: 1489 - @rm -rf $(MODLIB)/kernel 1490 - @rm -f $(MODLIB)/source 1491 - @mkdir -p $(MODLIB) 1492 - ifdef CONFIG_MODULES 1493 - @ln -s $(abspath $(srctree)) $(MODLIB)/source 1494 - @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ 1495 - rm -f $(MODLIB)/build ; \ 1496 - ln -s $(CURDIR) $(MODLIB)/build ; \ 1497 - fi 1498 - @sed 's:^\(.*\)\.o$$:kernel/\1.ko:' modules.order > $(MODLIB)/modules.order 1499 - endif 1500 - @cp -f modules.builtin $(MODLIB)/ 1501 - @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/ 1502 1552 1503 1553 ### 1504 1554 # Cleaning is done on three levels. ··· 1472 1594 # make distclean Remove editor backup files, patch leftover files and the like 1473 1595 1474 1596 # Directories & files removed with 'make clean' 1475 - CLEAN_FILES += include/ksym vmlinux.symvers modules-only.symvers \ 1597 + CLEAN_FILES += vmlinux.symvers modules-only.symvers \ 1476 1598 modules.builtin modules.builtin.modinfo modules.nsdeps \ 1477 1599 compile_commands.json .thinlto-cache rust/test rust/doc \ 1478 1600 rust-project.json .vmlinux.objs .vmlinux.export.c ··· 1486 1608 certs/signing_key.pem \ 1487 1609 certs/x509.genkey \ 1488 1610 vmlinux-gdb.py \ 1489 - *.spec rpmbuild \ 1611 + kernel.spec rpmbuild \ 1490 1612 rust/libmacros.so 1491 1613 1492 1614 # clean - Delete most, but leave enough to build external modules ··· 1553 1675 @echo ' mrproper - Remove all generated files + config + various backup files' 1554 1676 @echo ' distclean - mrproper + remove editor backup and patch files' 1555 1677 @echo '' 1556 - @echo 'Configuration targets:' 1557 1678 @$(MAKE) -f $(srctree)/scripts/kconfig/Makefile help 1558 1679 @echo '' 1559 1680 @echo 'Other generic targets:' ··· 1800 1923 @echo ' rust-analyzer - generate rust-project.json rust-analyzer support file' 1801 1924 @echo '' 1802 1925 1926 + ifndef CONFIG_MODULES 1927 + modules modules_install: __external_modules_error 1803 1928 __external_modules_error: 1804 1929 @echo >&2 '***' 1805 1930 @echo >&2 '*** The present kernel disabled CONFIG_MODULES.' 1806 1931 @echo >&2 '*** You cannot build or install external modules.' 1807 1932 @echo >&2 '***' 1808 1933 @false 1934 + endif 1809 1935 1810 1936 endif # KBUILD_EXTMOD 1811 1937 1812 1938 # --------------------------------------------------------------------------- 1813 1939 # Modules 1814 1940 1815 - PHONY += modules modules_install modules_prepare 1941 + PHONY += modules modules_install modules_sign modules_prepare 1942 + 1943 + modules_install: 1944 + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst \ 1945 + sign-only=$(if $(filter modules_install,$(MAKECMDGOALS)),,y) 1946 + 1947 + ifeq ($(CONFIG_MODULE_SIG),y) 1948 + # modules_sign is a subset of modules_install. 1949 + # 'make modules_install modules_sign' is equivalent to 'make modules_install'. 1950 + modules_sign: modules_install 1951 + @: 1952 + else 1953 + modules_sign: 1954 + @echo >&2 '***' 1955 + @echo >&2 '*** CONFIG_MODULE_SIG is disabled. You cannot sign modules.' 1956 + @echo >&2 '***' 1957 + @false 1958 + endif 1816 1959 1817 1960 ifdef CONFIG_MODULES 1818 1961 ··· 1850 1953 modules_check: $(MODORDER) 1851 1954 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh $< 1852 1955 1853 - quiet_cmd_depmod = DEPMOD $(MODLIB) 1854 - cmd_depmod = $(CONFIG_SHELL) $(srctree)/scripts/depmod.sh $(DEPMOD) \ 1855 - $(KERNELRELEASE) 1856 - 1857 - modules_install: 1858 - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst 1859 - $(call cmd,depmod) 1860 - 1861 1956 else # CONFIG_MODULES 1862 1957 1863 - # Modules not configured 1864 - # --------------------------------------------------------------------------- 1865 - 1866 - PHONY += __external_modules_error 1867 - 1868 - modules modules_install: __external_modules_error 1958 + modules: 1869 1959 @: 1870 1960 1871 1961 KBUILD_MODULES := ··· 2030 2146 2031 2147 image_name: 2032 2148 @echo $(KBUILD_IMAGE) 2149 + 2150 + PHONY += run-command 2151 + run-command: 2152 + $(Q)$(KBUILD_RUN_COMMAND) 2033 2153 2034 2154 quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) 2035 2155 cmd_rmfiles = rm -rf $(rm-files)
-1
arch/alpha/include/asm/Kbuild
··· 3 3 generated-y += syscall_table.h 4 4 generic-y += agp.h 5 5 generic-y += asm-offsets.h 6 - generic-y += export.h 7 6 generic-y += kvm_para.h 8 7 generic-y += mcs_spinlock.h
+1 -1
arch/alpha/lib/callback_srm.S
··· 3 3 * arch/alpha/lib/callback_srm.S 4 4 */ 5 5 6 + #include <linux/export.h> 6 7 #include <asm/console.h> 7 - #include <asm/export.h> 8 8 9 9 .text 10 10 #define HWRPB_CRB_OFFSET 0xc0
+1 -1
arch/alpha/lib/clear_page.S
··· 4 4 * 5 5 * Zero an entire page. 6 6 */ 7 - #include <asm/export.h> 7 + #include <linux/export.h> 8 8 .text 9 9 .align 4 10 10 .global clear_page
+1 -1
arch/alpha/lib/clear_user.S
··· 10 10 * a successful copy). There is also some rather minor exception setup 11 11 * stuff. 12 12 */ 13 - #include <asm/export.h> 13 + #include <linux/export.h> 14 14 15 15 /* Allow an exception for an insn; exit if we get one. */ 16 16 #define EX(x,y...) \
+1 -1
arch/alpha/lib/copy_page.S
··· 4 4 * 5 5 * Copy an entire page. 6 6 */ 7 - #include <asm/export.h> 7 + #include <linux/export.h> 8 8 .text 9 9 .align 4 10 10 .global copy_page
+1 -1
arch/alpha/lib/copy_user.S
··· 12 12 * exception setup stuff.. 13 13 */ 14 14 15 - #include <asm/export.h> 15 + #include <linux/export.h> 16 16 17 17 /* Allow an exception for an insn; exit if we get one. */ 18 18 #define EXI(x,y...) \
+1 -1
arch/alpha/lib/csum_ipv6_magic.S
··· 13 13 * added by Ivan Kokshaysky <ink@jurassic.park.msu.ru> 14 14 */ 15 15 16 - #include <asm/export.h> 16 + #include <linux/export.h> 17 17 .globl csum_ipv6_magic 18 18 .align 4 19 19 .ent csum_ipv6_magic
+1 -1
arch/alpha/lib/divide.S
··· 46 46 * $28 - compare status 47 47 */ 48 48 49 - #include <asm/export.h> 49 + #include <linux/export.h> 50 50 #define halt .long 0 51 51 52 52 /*
+1 -1
arch/alpha/lib/ev6-clear_page.S
··· 4 4 * 5 5 * Zero an entire page. 6 6 */ 7 - #include <asm/export.h> 7 + #include <linux/export.h> 8 8 .text 9 9 .align 4 10 10 .global clear_page
+1 -1
arch/alpha/lib/ev6-clear_user.S
··· 29 29 * want to leave a hole (and we also want to avoid repeating lots of work) 30 30 */ 31 31 32 - #include <asm/export.h> 32 + #include <linux/export.h> 33 33 /* Allow an exception for an insn; exit if we get one. */ 34 34 #define EX(x,y...) \ 35 35 99: x,##y; \
+1 -1
arch/alpha/lib/ev6-copy_page.S
··· 57 57 destination pages are in the dcache, but it is my guess that this is 58 58 less important than the dcache miss case. */ 59 59 60 - #include <asm/export.h> 60 + #include <linux/export.h> 61 61 .text 62 62 .align 4 63 63 .global copy_page
+1 -1
arch/alpha/lib/ev6-copy_user.S
··· 23 23 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 24 24 */ 25 25 26 - #include <asm/export.h> 26 + #include <linux/export.h> 27 27 /* Allow an exception for an insn; exit if we get one. */ 28 28 #define EXI(x,y...) \ 29 29 99: x,##y; \
+1 -1
arch/alpha/lib/ev6-csum_ipv6_magic.S
··· 53 53 * may cause additional delay in rare cases (load-load replay traps). 54 54 */ 55 55 56 - #include <asm/export.h> 56 + #include <linux/export.h> 57 57 .globl csum_ipv6_magic 58 58 .align 4 59 59 .ent csum_ipv6_magic
+1 -1
arch/alpha/lib/ev6-divide.S
··· 56 56 * Try not to change the actual algorithm if possible for consistency. 57 57 */ 58 58 59 - #include <asm/export.h> 59 + #include <linux/export.h> 60 60 #define halt .long 0 61 61 62 62 /*
+1 -1
arch/alpha/lib/ev6-memchr.S
··· 28 28 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 29 29 * Try not to change the actual algorithm if possible for consistency. 30 30 */ 31 - #include <asm/export.h> 31 + #include <linux/export.h> 32 32 .set noreorder 33 33 .set noat 34 34
+1 -1
arch/alpha/lib/ev6-memcpy.S
··· 20 20 * Temp usage notes: 21 21 * $1,$2, - scratch 22 22 */ 23 - #include <asm/export.h> 23 + #include <linux/export.h> 24 24 .set noreorder 25 25 .set noat 26 26
+1 -1
arch/alpha/lib/ev6-memset.S
··· 27 27 * as fixes will need to be made in multiple places. The performance gain 28 28 * is worth it. 29 29 */ 30 - #include <asm/export.h> 30 + #include <linux/export.h> 31 31 .set noat 32 32 .set noreorder 33 33 .text
+1 -1
arch/alpha/lib/ev67-strcat.S
··· 20 20 * string once. 21 21 */ 22 22 23 - #include <asm/export.h> 23 + #include <linux/export.h> 24 24 .text 25 25 26 26 .align 4
+1 -1
arch/alpha/lib/ev67-strchr.S
··· 16 16 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 17 17 * Try not to change the actual algorithm if possible for consistency. 18 18 */ 19 - #include <asm/export.h> 19 + #include <linux/export.h> 20 20 #include <asm/regdef.h> 21 21 22 22 .set noreorder
+1 -1
arch/alpha/lib/ev67-strlen.S
··· 18 18 * U - upper subcluster; U0 - subcluster U0; U1 - subcluster U1 19 19 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 20 20 */ 21 - #include <asm/export.h> 21 + #include <linux/export.h> 22 22 .set noreorder 23 23 .set noat 24 24
+1 -1
arch/alpha/lib/ev67-strncat.S
··· 21 21 * Try not to change the actual algorithm if possible for consistency. 22 22 */ 23 23 24 - #include <asm/export.h> 24 + #include <linux/export.h> 25 25 .text 26 26 27 27 .align 4
+1 -1
arch/alpha/lib/ev67-strrchr.S
··· 19 19 * L - lower subcluster; L0 - subcluster L0; L1 - subcluster L1 20 20 */ 21 21 22 - #include <asm/export.h> 22 + #include <linux/export.h> 23 23 #include <asm/regdef.h> 24 24 25 25 .set noreorder
+1 -1
arch/alpha/lib/memchr.S
··· 31 31 - only minimum number of quadwords may be accessed 32 32 - the third argument is an unsigned long 33 33 */ 34 - #include <asm/export.h> 34 + #include <linux/export.h> 35 35 .set noreorder 36 36 .set noat 37 37
+1 -1
arch/alpha/lib/memmove.S
··· 7 7 * This is hand-massaged output from the original memcpy.c. We defer to 8 8 * memcpy whenever possible; the backwards copy loops are not unrolled. 9 9 */ 10 - #include <asm/export.h> 10 + #include <linux/export.h> 11 11 .set noat 12 12 .set noreorder 13 13 .text
+1 -1
arch/alpha/lib/memset.S
··· 14 14 * The scheduling comments are according to the EV5 documentation (and done by 15 15 * hand, so they might well be incorrect, please do tell me about it..) 16 16 */ 17 - #include <asm/export.h> 17 + #include <linux/export.h> 18 18 .set noat 19 19 .set noreorder 20 20 .text
+1 -1
arch/alpha/lib/strcat.S
··· 5 5 * 6 6 * Append a null-terminated string from SRC to DST. 7 7 */ 8 - #include <asm/export.h> 8 + #include <linux/export.h> 9 9 10 10 .text 11 11
+1 -1
arch/alpha/lib/strchr.S
··· 6 6 * Return the address of a given character within a null-terminated 7 7 * string, or null if it is not found. 8 8 */ 9 - #include <asm/export.h> 9 + #include <linux/export.h> 10 10 #include <asm/regdef.h> 11 11 12 12 .set noreorder
+1 -1
arch/alpha/lib/strcpy.S
··· 6 6 * Copy a null-terminated string from SRC to DST. Return a pointer 7 7 * to the null-terminator in the source. 8 8 */ 9 - #include <asm/export.h> 9 + #include <linux/export.h> 10 10 .text 11 11 12 12 .align 3
+1 -1
arch/alpha/lib/strlen.S
··· 12 12 * do this instead of the 9 instructions that 13 13 * binary search needs). 14 14 */ 15 - #include <asm/export.h> 15 + #include <linux/export.h> 16 16 .set noreorder 17 17 .set noat 18 18
+1 -1
arch/alpha/lib/strncat.S
··· 10 10 * past count, whereas libc may write to count+1. This follows the generic 11 11 * implementation in lib/string.c and is, IMHO, more sensible. 12 12 */ 13 - #include <asm/export.h> 13 + #include <linux/export.h> 14 14 .text 15 15 16 16 .align 3
+1 -1
arch/alpha/lib/strncpy.S
··· 11 11 * version has cropped that bit o' nastiness as well as assuming that 12 12 * __stxncpy is in range of a branch. 13 13 */ 14 - #include <asm/export.h> 14 + #include <linux/export.h> 15 15 .set noat 16 16 .set noreorder 17 17
+1 -1
arch/alpha/lib/strrchr.S
··· 6 6 * Return the address of the last occurrence of a given character 7 7 * within a null-terminated string, or null if it is not found. 8 8 */ 9 - #include <asm/export.h> 9 + #include <linux/export.h> 10 10 #include <asm/regdef.h> 11 11 12 12 .set noreorder
+1 -1
arch/alpha/lib/udiv-qrnnd.S
··· 25 25 # along with GCC; see the file COPYING. If not, write to the 26 26 # Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 27 27 # MA 02111-1307, USA. 28 - #include <asm/export.h> 28 + #include <linux/export.h> 29 29 30 30 .set noreorder 31 31 .set noat
+1
arch/arm/configs/dram_0x00000000.config
··· 1 + # Help: DRAM base at 0x00000000 1 2 CONFIG_DRAM_BASE=0x00000000
+1
arch/arm/configs/dram_0xc0000000.config
··· 1 + # Help: DRAM base at 0xc0000000 1 2 CONFIG_DRAM_BASE=0xc0000000
+1
arch/arm/configs/dram_0xd0000000.config
··· 1 + # Help: DRAM base at 0xd0000000 1 2 CONFIG_DRAM_BASE=0xd0000000
+1
arch/arm/configs/lpae.config
··· 1 + # Help: Enable Large Physical Address Extension mode 1 2 CONFIG_ARM_LPAE=y 2 3 CONFIG_VMSPLIT_2G=y
+1
arch/arm64/configs/virt.config
··· 1 + # Help: Virtualization guest 1 2 # 2 3 # Base options for platforms 3 4 #
-1
arch/ia64/include/asm/Kbuild
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 generated-y += syscall_table.h 3 3 generic-y += agp.h 4 - generic-y += export.h 5 4 generic-y += kvm_para.h 6 5 generic-y += mcs_spinlock.h 7 6 generic-y += vtime.h
+1 -2
arch/ia64/kernel/entry.S
··· 37 37 * pNonSys: !pSys 38 38 */ 39 39 40 - 40 + #include <linux/export.h> 41 41 #include <linux/pgtable.h> 42 42 #include <asm/asmmacro.h> 43 43 #include <asm/cache.h> ··· 49 49 #include <asm/thread_info.h> 50 50 #include <asm/unistd.h> 51 51 #include <asm/ftrace.h> 52 - #include <asm/export.h> 53 52 54 53 #include "minstate.h" 55 54
+1 -1
arch/ia64/kernel/esi_stub.S
··· 34 34 #define PSR_BITS_TO_SET \ 35 35 (IA64_PSR_BN) 36 36 37 + #include <linux/export.h> 37 38 #include <asm/processor.h> 38 39 #include <asm/asmmacro.h> 39 - #include <asm/export.h> 40 40 41 41 /* 42 42 * Inputs:
+1 -2
arch/ia64/kernel/head.S
··· 20 20 * Support for CPU Hotplug 21 21 */ 22 22 23 - 23 + #include <linux/export.h> 24 24 #include <linux/pgtable.h> 25 25 #include <asm/asmmacro.h> 26 26 #include <asm/fpu.h> ··· 33 33 #include <asm/mca_asm.h> 34 34 #include <linux/init.h> 35 35 #include <linux/linkage.h> 36 - #include <asm/export.h> 37 36 38 37 #ifdef CONFIG_HOTPLUG_CPU 39 38 #define SAL_PSR_BITS_TO_SET \
+1 -2
arch/ia64/kernel/ivt.S
··· 47 47 * Table is based upon EAS2.6 (Oct 1999) 48 48 */ 49 49 50 - 50 + #include <linux/export.h> 51 51 #include <linux/pgtable.h> 52 52 #include <asm/asmmacro.h> 53 53 #include <asm/break.h> ··· 58 58 #include <asm/thread_info.h> 59 59 #include <asm/unistd.h> 60 60 #include <asm/errno.h> 61 - #include <asm/export.h> 62 61 63 62 #if 0 64 63 # define PSR_DEFAULT_BITS psr.ac
+1 -1
arch/ia64/kernel/pal.S
··· 13 13 * 05/24/2000 eranian Added support for physical mode static calls 14 14 */ 15 15 16 + #include <linux/export.h> 16 17 #include <asm/asmmacro.h> 17 18 #include <asm/processor.h> 18 - #include <asm/export.h> 19 19 20 20 .data 21 21 pal_entry_point:
+1 -1
arch/ia64/lib/clear_page.S
··· 10 10 * 3/08/02 davidm Some more tweaking 11 11 */ 12 12 13 + #include <linux/export.h> 13 14 #include <asm/asmmacro.h> 14 15 #include <asm/page.h> 15 - #include <asm/export.h> 16 16 17 17 #ifdef CONFIG_ITANIUM 18 18 # define L3_LINE_SIZE 64 // Itanium L3 line size
+1 -1
arch/ia64/lib/clear_user.S
··· 12 12 * Stephane Eranian <eranian@hpl.hp.com> 13 13 */ 14 14 15 + #include <linux/export.h> 15 16 #include <asm/asmmacro.h> 16 - #include <asm/export.h> 17 17 18 18 // 19 19 // arguments
+1 -1
arch/ia64/lib/copy_page.S
··· 15 15 * 16 16 * 4/06/01 davidm Tuned to make it perform well both for cached and uncached copies. 17 17 */ 18 + #include <linux/export.h> 18 19 #include <asm/asmmacro.h> 19 20 #include <asm/page.h> 20 - #include <asm/export.h> 21 21 22 22 #define PIPE_DEPTH 3 23 23 #define EPI p[PIPE_DEPTH-1]
+1 -1
arch/ia64/lib/copy_page_mck.S
··· 60 60 * to fetch the second-half of the L2 cache line into L1, and the tX words are copied in 61 61 * an order that avoids bank conflicts. 62 62 */ 63 + #include <linux/export.h> 63 64 #include <asm/asmmacro.h> 64 65 #include <asm/page.h> 65 - #include <asm/export.h> 66 66 67 67 #define PREFETCH_DIST 8 // McKinley sustains 16 outstanding L2 misses (8 ld, 8 st) 68 68
+1 -1
arch/ia64/lib/copy_user.S
··· 30 30 * - fix extraneous stop bit introduced by the EX() macro. 31 31 */ 32 32 33 + #include <linux/export.h> 33 34 #include <asm/asmmacro.h> 34 - #include <asm/export.h> 35 35 36 36 // 37 37 // Tuneable parameters
+1 -2
arch/ia64/lib/flush.S
··· 8 8 * 05/28/05 Zoltan Menyhart Dynamic stride size 9 9 */ 10 10 11 + #include <linux/export.h> 11 12 #include <asm/asmmacro.h> 12 - #include <asm/export.h> 13 - 14 13 15 14 /* 16 15 * flush_icache_range(start,end)
+1 -1
arch/ia64/lib/idiv32.S
··· 15 15 * (http://www.goodreads.com/book/show/2019887.Ia_64_and_Elementary_Functions) 16 16 */ 17 17 18 + #include <linux/export.h> 18 19 #include <asm/asmmacro.h> 19 - #include <asm/export.h> 20 20 21 21 #ifdef MODULO 22 22 # define OP mod
+1 -1
arch/ia64/lib/idiv64.S
··· 15 15 * (http://www.goodreads.com/book/show/2019887.Ia_64_and_Elementary_Functions) 16 16 */ 17 17 18 + #include <linux/export.h> 18 19 #include <asm/asmmacro.h> 19 - #include <asm/export.h> 20 20 21 21 #ifdef MODULO 22 22 # define OP mod
+1 -1
arch/ia64/lib/ip_fast_csum.S
··· 13 13 * Copyright (C) 2002, 2006 Ken Chen <kenneth.w.chen@intel.com> 14 14 */ 15 15 16 + #include <linux/export.h> 16 17 #include <asm/asmmacro.h> 17 - #include <asm/export.h> 18 18 19 19 /* 20 20 * Since we know that most likely this function is called with buf aligned
+1 -1
arch/ia64/lib/memcpy.S
··· 14 14 * Stephane Eranian <eranian@hpl.hp.com> 15 15 * David Mosberger-Tang <davidm@hpl.hp.com> 16 16 */ 17 + #include <linux/export.h> 17 18 #include <asm/asmmacro.h> 18 - #include <asm/export.h> 19 19 20 20 GLOBAL_ENTRY(memcpy) 21 21
+1 -1
arch/ia64/lib/memcpy_mck.S
··· 14 14 * Copyright (C) 2002 Intel Corp. 15 15 * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com> 16 16 */ 17 + #include <linux/export.h> 17 18 #include <asm/asmmacro.h> 18 19 #include <asm/page.h> 19 - #include <asm/export.h> 20 20 21 21 #define EK(y...) EX(y) 22 22
+1 -1
arch/ia64/lib/memset.S
··· 18 18 Since a stf.spill f0 can store 16B in one go, we use this instruction 19 19 to get peak speed when value = 0. */ 20 20 21 + #include <linux/export.h> 21 22 #include <asm/asmmacro.h> 22 - #include <asm/export.h> 23 23 #undef ret 24 24 25 25 #define dest in0
+1 -1
arch/ia64/lib/strlen.S
··· 17 17 * 09/24/99 S.Eranian add speculation recovery code 18 18 */ 19 19 20 + #include <linux/export.h> 20 21 #include <asm/asmmacro.h> 21 - #include <asm/export.h> 22 22 23 23 // 24 24 //
+1 -1
arch/ia64/lib/strncpy_from_user.S
··· 17 17 * by Andreas Schwab <schwab@suse.de>). 18 18 */ 19 19 20 + #include <linux/export.h> 20 21 #include <asm/asmmacro.h> 21 - #include <asm/export.h> 22 22 23 23 GLOBAL_ENTRY(__strncpy_from_user) 24 24 alloc r2=ar.pfs,3,0,0,0
+1 -1
arch/ia64/lib/strnlen_user.S
··· 13 13 * Copyright (C) 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com> 14 14 */ 15 15 16 + #include <linux/export.h> 16 17 #include <asm/asmmacro.h> 17 - #include <asm/export.h> 18 18 19 19 GLOBAL_ENTRY(__strnlen_user) 20 20 .prologue
+1 -1
arch/ia64/lib/xor.S
··· 5 5 * Optimized RAID-5 checksumming functions for IA-64. 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <asm/asmmacro.h> 9 - #include <asm/export.h> 10 10 11 11 GLOBAL_ENTRY(xor_ia64_2) 12 12 .prologue
+1
arch/powerpc/configs/disable-werror.config
··· 1 + # Help: Disable -Werror 1 2 CONFIG_PPC_DISABLE_WERROR=y
+2
arch/powerpc/configs/security.config
··· 1 + # Help: Common security options for PowerPC builds 2 + 1 3 # This is the equivalent of booting with lockdown=integrity 2 4 CONFIG_SECURITY=y 3 5 CONFIG_SECURITYFS=y
+1
arch/riscv/configs/32-bit.config
··· 1 + # Help: Build a 32-bit image 1 2 CONFIG_ARCH_RV32I=y 2 3 CONFIG_32BIT=y 3 4 # CONFIG_PORTABLE is not set
+1
arch/riscv/configs/64-bit.config
··· 1 + # Help: Build a 64-bit image 1 2 CONFIG_ARCH_RV64I=y 2 3 CONFIG_64BIT=y
+1
arch/s390/configs/btf.config
··· 1 + # Help: Enable BTF debug info 1 2 CONFIG_DEBUG_INFO_BTF=y
+1
arch/s390/configs/kasan.config
··· 1 + # Help: Enable KASan for debugging 1 2 CONFIG_KASAN=y 2 3 CONFIG_KASAN_INLINE=y 3 4 CONFIG_KASAN_VMALLOC=y
-1
arch/sparc/include/asm/Kbuild
··· 2 2 generated-y += syscall_table_32.h 3 3 generated-y += syscall_table_64.h 4 4 generic-y += agp.h 5 - generic-y += export.h 6 5 generic-y += kvm_para.h 7 6 generic-y += mcs_spinlock.h
+1 -1
arch/sparc/kernel/entry.S
··· 8 8 * Copyright (C) 1997 Anton Blanchard (anton@progsoc.uts.edu.au) 9 9 */ 10 10 11 + #include <linux/export.h> 11 12 #include <linux/linkage.h> 12 13 #include <linux/errno.h> 13 14 #include <linux/pgtable.h> ··· 31 30 #include <asm/unistd.h> 32 31 33 32 #include <asm/asmmacro.h> 34 - #include <asm/export.h> 35 33 36 34 #define curptr g6 37 35
+1 -1
arch/sparc/kernel/head_32.S
··· 11 11 * CompactPCI platform by Eric Brower, 1999. 12 12 */ 13 13 14 + #include <linux/export.h> 14 15 #include <linux/version.h> 15 16 #include <linux/init.h> 16 17 ··· 26 25 #include <asm/thread_info.h> /* TI_UWINMASK */ 27 26 #include <asm/errno.h> 28 27 #include <asm/pgtable.h> /* PGDIR_SHIFT */ 29 - #include <asm/export.h> 30 28 31 29 .data 32 30 /* The following are used with the prom_vector node-ops to figure out
+1 -1
arch/sparc/kernel/head_64.S
··· 9 9 10 10 #include <linux/version.h> 11 11 #include <linux/errno.h> 12 + #include <linux/export.h> 12 13 #include <linux/threads.h> 13 14 #include <linux/init.h> 14 15 #include <linux/linkage.h> ··· 34 33 #include <asm/estate.h> 35 34 #include <asm/sfafsr.h> 36 35 #include <asm/unistd.h> 37 - #include <asm/export.h> 38 36 39 37 /* This section from from _start to sparc64_boot_end should fit into 40 38 * 0x0000000000404000 to 0x0000000000408000.
+1 -1
arch/sparc/lib/U1memcpy.S
··· 6 6 */ 7 7 8 8 #ifdef __KERNEL__ 9 + #include <linux/export.h> 9 10 #include <linux/linkage.h> 10 11 #include <asm/visasm.h> 11 12 #include <asm/asi.h> 12 - #include <asm/export.h> 13 13 #define GLOBAL_SPARE g7 14 14 #else 15 15 #define GLOBAL_SPARE g5
+1 -1
arch/sparc/lib/VISsave.S
··· 7 7 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 8 8 */ 9 9 10 + #include <linux/export.h> 10 11 #include <linux/linkage.h> 11 12 12 13 #include <asm/asi.h> ··· 15 14 #include <asm/ptrace.h> 16 15 #include <asm/visasm.h> 17 16 #include <asm/thread_info.h> 18 - #include <asm/export.h> 19 17 20 18 /* On entry: %o5=current FPRS value, %g7 is callers address */ 21 19 /* May clobber %o5, %g1, %g2, %g3, %g7, %icc, %xcc */
+1 -1
arch/sparc/lib/ashldi3.S
··· 6 6 * Copyright (C) 1999 David S. Miller (davem@redhat.com) 7 7 */ 8 8 9 + #include <linux/export.h> 9 10 #include <linux/linkage.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13 ENTRY(__ashldi3)
+1 -1
arch/sparc/lib/ashrdi3.S
··· 6 6 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 7 7 */ 8 8 9 + #include <linux/export.h> 9 10 #include <linux/linkage.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13 ENTRY(__ashrdi3)
+1 -1
arch/sparc/lib/atomic_64.S
··· 4 4 * Copyright (C) 1999, 2007 2012 David S. Miller (davem@davemloft.net) 5 5 */ 6 6 7 + #include <linux/export.h> 7 8 #include <linux/linkage.h> 8 9 #include <asm/asi.h> 9 10 #include <asm/backoff.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13
+1 -1
arch/sparc/lib/bitops.S
··· 4 4 * Copyright (C) 2000, 2007 David S. Miller (davem@davemloft.net) 5 5 */ 6 6 7 + #include <linux/export.h> 7 8 #include <linux/linkage.h> 8 9 #include <asm/asi.h> 9 10 #include <asm/backoff.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13
+1 -1
arch/sparc/lib/blockops.S
··· 5 5 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 10 #include <asm/page.h> 10 - #include <asm/export.h> 11 11 12 12 /* Zero out 64 bytes of memory at (buf + offset). 13 13 * Assumes %g1 contains zero.
+1 -1
arch/sparc/lib/bzero.S
··· 5 5 * Copyright (C) 2005 David S. Miller <davem@davemloft.net> 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 - #include <asm/export.h> 10 10 11 11 .text 12 12
+1 -1
arch/sparc/lib/checksum_32.S
··· 14 14 * BSD4.4 portable checksum routine 15 15 */ 16 16 17 + #include <linux/export.h> 17 18 #include <asm/errno.h> 18 - #include <asm/export.h> 19 19 20 20 #define CSUM_BIGCHUNK(buf, offset, sum, t0, t1, t2, t3, t4, t5) \ 21 21 ldd [buf + offset + 0x00], t0; \
+1 -1
arch/sparc/lib/checksum_64.S
··· 14 14 * BSD4.4 portable checksum routine 15 15 */ 16 16 17 - #include <asm/export.h> 17 + #include <linux/export.h> 18 18 .text 19 19 20 20 csum_partial_fix_alignment:
+1 -1
arch/sparc/lib/clear_page.S
··· 5 5 * Copyright (C) 1997 Jakub Jelinek (jakub@redhat.com) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/pgtable.h> 9 10 #include <asm/visasm.h> 10 11 #include <asm/thread_info.h> 11 12 #include <asm/page.h> 12 13 #include <asm/spitfire.h> 13 14 #include <asm/head.h> 14 - #include <asm/export.h> 15 15 16 16 /* What we used to do was lock a TLB entry into a specific 17 17 * TLB slot, clear the page with interrupts disabled, then
+1 -1
arch/sparc/lib/copy_in_user.S
··· 4 4 * Copyright (C) 1999, 2000, 2004 David S. Miller (davem@redhat.com) 5 5 */ 6 6 7 + #include <linux/export.h> 7 8 #include <linux/linkage.h> 8 9 #include <asm/asi.h> 9 - #include <asm/export.h> 10 10 11 11 #define XCC xcc 12 12
+1 -1
arch/sparc/lib/copy_page.S
··· 5 5 * Copyright (C) 1997 Jakub Jelinek (jakub@redhat.com) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <asm/visasm.h> 9 10 #include <asm/thread_info.h> 10 11 #include <asm/page.h> 11 12 #include <linux/pgtable.h> 12 13 #include <asm/spitfire.h> 13 14 #include <asm/head.h> 14 - #include <asm/export.h> 15 15 16 16 /* What we used to do was lock a TLB entry into a specific 17 17 * TLB slot, clear the page with interrupts disabled, then
+1 -1
arch/sparc/lib/copy_user.S
··· 12 12 * Returns 0 if successful, otherwise count of bytes not copied yet 13 13 */ 14 14 15 + #include <linux/export.h> 15 16 #include <asm/ptrace.h> 16 17 #include <asm/asmmacro.h> 17 18 #include <asm/page.h> 18 19 #include <asm/thread_info.h> 19 - #include <asm/export.h> 20 20 21 21 /* Work around cpp -rob */ 22 22 #define ALLOC #alloc
+1 -1
arch/sparc/lib/csum_copy.S
··· 4 4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net> 5 5 */ 6 6 7 - #include <asm/export.h> 7 + #include <linux/export.h> 8 8 9 9 #ifdef __KERNEL__ 10 10 #define GLOBAL_SPARE %g7
+1 -1
arch/sparc/lib/divdi3.S
··· 5 5 6 6 */ 7 7 8 - #include <asm/export.h> 8 + #include <linux/export.h> 9 9 .text 10 10 .align 4 11 11 .globl __divdi3
+1 -1
arch/sparc/lib/ffs.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/export.h> 2 3 #include <linux/linkage.h> 3 - #include <asm/export.h> 4 4 5 5 .register %g2,#scratch 6 6
+1 -1
arch/sparc/lib/fls.S
··· 5 5 * and onward. 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 - #include <asm/export.h> 10 10 11 11 .text 12 12 .register %g2, #scratch
+1 -1
arch/sparc/lib/fls64.S
··· 5 5 * and onward. 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 - #include <asm/export.h> 10 10 11 11 .text 12 12 .register %g2, #scratch
+1 -1
arch/sparc/lib/hweight.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/export.h> 2 3 #include <linux/linkage.h> 3 - #include <asm/export.h> 4 4 5 5 .text 6 6 .align 32
+1 -1
arch/sparc/lib/ipcsum.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/export.h> 2 3 #include <linux/linkage.h> 3 - #include <asm/export.h> 4 4 5 5 .text 6 6 ENTRY(ip_fast_csum) /* %o0 = iph, %o1 = ihl */
+1 -1
arch/sparc/lib/locks.S
··· 7 7 * Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz) 8 8 */ 9 9 10 + #include <linux/export.h> 10 11 #include <asm/ptrace.h> 11 12 #include <asm/psr.h> 12 13 #include <asm/smp.h> 13 14 #include <asm/spinlock.h> 14 - #include <asm/export.h> 15 15 16 16 .text 17 17 .align 4
+1 -1
arch/sparc/lib/lshrdi3.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/export.h> 2 3 #include <linux/linkage.h> 3 - #include <asm/export.h> 4 4 5 5 ENTRY(__lshrdi3) 6 6 cmp %o2, 0
+1 -1
arch/sparc/lib/mcount.S
··· 6 6 * This can also be tweaked for kernel stack overflow detection. 7 7 */ 8 8 9 + #include <linux/export.h> 9 10 #include <linux/linkage.h> 10 - #include <asm/export.h> 11 11 12 12 /* 13 13 * This is the main variant and is called by C code. GCC's -pg option
+1 -1
arch/sparc/lib/memcmp.S
··· 5 5 * Copyright (C) 2000, 2008 David S. Miller (davem@davemloft.net) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 10 #include <asm/asm.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13 ENTRY(memcmp)
+2 -1
arch/sparc/lib/memcpy.S
··· 8 8 * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 9 9 */ 10 10 11 - #include <asm/export.h> 11 + #include <linux/export.h> 12 + 12 13 #define FUNC(x) \ 13 14 .globl x; \ 14 15 .type x,@function; \
+1 -1
arch/sparc/lib/memmove.S
··· 5 5 * Copyright (C) 1996, 1997, 1998, 1999 Jakub Jelinek (jj@ultra.linux.cz) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 - #include <asm/export.h> 10 10 11 11 .text 12 12 ENTRY(memmove) /* o0=dst o1=src o2=len */
+1 -1
arch/sparc/lib/memscan_32.S
··· 5 5 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) 6 6 */ 7 7 8 - #include <asm/export.h> 8 + #include <linux/export.h> 9 9 10 10 /* In essence, this is just a fancy strlen. */ 11 11
+1 -1
arch/sparc/lib/memscan_64.S
··· 6 6 * Copyright (C) 1998 David S. Miller (davem@redhat.com) 7 7 */ 8 8 9 - #include <asm/export.h> 9 + #include <linux/export.h> 10 10 11 11 #define HI_MAGIC 0x8080808080808080 12 12 #define LO_MAGIC 0x0101010101010101
+1 -1
arch/sparc/lib/memset.S
··· 9 9 * clear_user. 10 10 */ 11 11 12 + #include <linux/export.h> 12 13 #include <asm/ptrace.h> 13 - #include <asm/export.h> 14 14 15 15 /* Work around cpp -rob */ 16 16 #define ALLOC #alloc
+1 -1
arch/sparc/lib/muldi3.S
··· 5 5 6 6 */ 7 7 8 - #include <asm/export.h> 8 + #include <linux/export.h> 9 9 .text 10 10 .align 4 11 11 .globl __muldi3
+1 -1
arch/sparc/lib/multi3.S
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 + #include <linux/export.h> 2 3 #include <linux/linkage.h> 3 - #include <asm/export.h> 4 4 5 5 .text 6 6 .align 4
+1 -1
arch/sparc/lib/strlen.S
··· 6 6 * Copyright (C) 1996, 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 7 7 */ 8 8 9 + #include <linux/export.h> 9 10 #include <linux/linkage.h> 10 11 #include <asm/asm.h> 11 - #include <asm/export.h> 12 12 13 13 #define LO_MAGIC 0x01010101 14 14 #define HI_MAGIC 0x80808080
+1 -1
arch/sparc/lib/strncmp_32.S
··· 4 4 * generic strncmp routine. 5 5 */ 6 6 7 + #include <linux/export.h> 7 8 #include <linux/linkage.h> 8 - #include <asm/export.h> 9 9 10 10 .text 11 11 ENTRY(strncmp)
+1 -1
arch/sparc/lib/strncmp_64.S
··· 5 5 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) 6 6 */ 7 7 8 + #include <linux/export.h> 8 9 #include <linux/linkage.h> 9 10 #include <asm/asi.h> 10 - #include <asm/export.h> 11 11 12 12 .text 13 13 ENTRY(strncmp)
+1 -1
arch/sparc/lib/xor.S
··· 9 9 * Copyright (C) 2006 David S. Miller <davem@davemloft.net> 10 10 */ 11 11 12 + #include <linux/export.h> 12 13 #include <linux/linkage.h> 13 14 #include <asm/visasm.h> 14 15 #include <asm/asi.h> 15 16 #include <asm/dcu.h> 16 17 #include <asm/spitfire.h> 17 - #include <asm/export.h> 18 18 19 19 /* 20 20 * Requirements:
-4
arch/x86/Makefile
··· 335 335 echo ' bzdisk/fdimage*/hdimage/isoimage also accept:' 336 336 echo ' FDARGS="..." arguments for the booted kernel' 337 337 echo ' FDINITRD=file initrd for the booted kernel' 338 - echo '' 339 - echo ' kvm_guest.config - Enable Kconfig items for running this kernel as a KVM guest' 340 - echo ' xen.config - Enable Kconfig items for running this kernel as a Xen guest' 341 - echo ' x86_debug.config - Enable tip tree debugging options for testing' 342 338 343 339 endef
+2 -2
include/linux/export.h
··· 50 50 __EXPORT_SYMBOL_REF(sym) ASM_NL \ 51 51 .previous 52 52 53 - #if !defined(CONFIG_MODULES) || defined(__DISABLE_EXPORTS) 53 + #if defined(__DISABLE_EXPORTS) 54 54 55 55 /* 56 56 * Allow symbol exports to be disabled completely so that C code may ··· 75 75 __ADDRESSABLE(sym) \ 76 76 asm(__stringify(___EXPORT_SYMBOL(sym, license, ns))) 77 77 78 - #endif /* CONFIG_MODULES */ 78 + #endif 79 79 80 80 #ifdef DEFAULT_SYMBOL_NAMESPACE 81 81 #define _EXPORT_SYMBOL(sym, license) __EXPORT_SYMBOL(sym, license, __stringify(DEFAULT_SYMBOL_NAMESPACE))
+2
kernel/configs/debug.config
··· 1 + # Help: Debugging for CI systems and finding regressions 2 + # 1 3 # The config is based on running daily CI for enterprise Linux distros to 2 4 # seek regressions on linux-next builds on different bare-metal and virtual 3 5 # platforms. It can be used for example,
+1
kernel/configs/kvm_guest.config
··· 1 + # Help: Bootable as a KVM guest 1 2 CONFIG_NET=y 2 3 CONFIG_NET_CORE=y 3 4 CONFIG_NETDEVICES=y
+2
kernel/configs/nopm.config
··· 1 + # Help: Disable Power Management 2 + 1 3 CONFIG_PM=n 2 4 CONFIG_SUSPEND=n 3 5 CONFIG_HIBERNATION=n
+1
kernel/configs/rust.config
··· 1 + # Help: Enable Rust 1 2 CONFIG_RUST=y
+1
kernel/configs/x86_debug.config
··· 1 + # Help: Debugging options for tip tree testing 1 2 CONFIG_X86_DEBUG_FPU=y 2 3 CONFIG_LOCK_STAT=y 3 4 CONFIG_DEBUG_VM=y
+2
kernel/configs/xen.config
··· 1 + # Help: Bootable as a Xen guest 2 + # 1 3 # global stuff - these enable us to allow some 2 4 # of the not so generic stuff below for xen 3 5 CONFIG_PARAVIRT=y
+107 -8
scripts/Makefile.extrawarn
··· 6 6 # They are independent, and can be combined like W=12 or W=123e. 7 7 # ========================================================================== 8 8 9 - KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) 9 + # Default set of warnings, always enabled 10 + KBUILD_CFLAGS += -Wall 11 + KBUILD_CFLAGS += -Wundef 12 + KBUILD_CFLAGS += -Werror=implicit-function-declaration 13 + KBUILD_CFLAGS += -Werror=implicit-int 14 + KBUILD_CFLAGS += -Werror=return-type 15 + KBUILD_CFLAGS += -Werror=strict-prototypes 16 + KBUILD_CFLAGS += -Wno-format-security 17 + KBUILD_CFLAGS += -Wno-trigraphs 18 + KBUILD_CFLAGS += $(call cc-disable-warning,frame-address,) 19 + KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member) 20 + 21 + ifneq ($(CONFIG_FRAME_WARN),0) 22 + KBUILD_CFLAGS += -Wframe-larger-than=$(CONFIG_FRAME_WARN) 23 + endif 24 + 25 + KBUILD_CPPFLAGS-$(CONFIG_WERROR) += -Werror 26 + KBUILD_CPPFLAGS += $(KBUILD_CPPFLAGS-y) 27 + KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUNDS) += -Wno-array-bounds 28 + 29 + ifdef CONFIG_CC_IS_CLANG 30 + # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable. 31 + KBUILD_CFLAGS += -Wno-gnu 32 + else 33 + 34 + # gcc inanely warns about local variables called 'main' 35 + KBUILD_CFLAGS += -Wno-main 36 + endif 37 + 38 + # These warnings generated too much noise in a regular build. 39 + # Use make W=1 to enable them (see scripts/Makefile.extrawarn) 40 + KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) 41 + KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) 42 + 43 + # These result in bogus false positives 44 + KBUILD_CFLAGS += $(call cc-disable-warning, dangling-pointer) 45 + 46 + # Variable Length Arrays (VLAs) should not be used anywhere in the kernel 47 + KBUILD_CFLAGS += -Wvla 48 + 49 + # disable pointer signed / unsigned warnings in gcc 4.0 50 + KBUILD_CFLAGS += -Wno-pointer-sign 51 + 52 + # In order to make sure new function cast mismatches are not introduced 53 + # in the kernel (to avoid tripping CFI checking), the kernel should be 54 + # globally built with -Wcast-function-type. 55 + KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) 56 + 57 + # The allocators already balk at large sizes, so silence the compiler 58 + # warnings for bounds checks involving those possible values. While 59 + # -Wno-alloc-size-larger-than would normally be used here, earlier versions 60 + # of gcc (<9.1) weirdly don't handle the option correctly when _other_ 61 + # warnings are produced (?!). Using -Walloc-size-larger-than=SIZE_MAX 62 + # doesn't work (as it is documented to), silently resolving to "0" prior to 63 + # version 9.1 (and producing an error more recently). Numeric values larger 64 + # than PTRDIFF_MAX also don't work prior to version 9.1, which are silently 65 + # ignored, continuing to default to PTRDIFF_MAX. So, left with no other 66 + # choice, we must perform a versioned check to disable this warning. 67 + # https://lore.kernel.org/lkml/20210824115859.187f272f@canb.auug.org.au 68 + KBUILD_CFLAGS-$(call gcc-min-version, 90100) += -Wno-alloc-size-larger-than 69 + KBUILD_CFLAGS += $(KBUILD_CFLAGS-y) $(CONFIG_CC_IMPLICIT_FALLTHROUGH) 70 + 71 + # Prohibit date/time macros, which would make the build non-deterministic 72 + KBUILD_CFLAGS += -Werror=date-time 73 + 74 + # enforce correct pointer usage 75 + KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types) 76 + 77 + # Require designated initializers for all marked structures 78 + KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) 79 + 80 + # Warn if there is an enum types mismatch 81 + KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) 10 82 11 83 # backward compatibility 12 84 KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS) ··· 96 24 97 25 KBUILD_CFLAGS += -Wextra -Wunused -Wno-unused-parameter 98 26 KBUILD_CFLAGS += -Wmissing-declarations 27 + KBUILD_CFLAGS += $(call cc-option, -Wrestrict) 99 28 KBUILD_CFLAGS += -Wmissing-format-attribute 100 29 KBUILD_CFLAGS += -Wmissing-prototypes 101 30 KBUILD_CFLAGS += -Wold-style-definition ··· 104 31 KBUILD_CFLAGS += $(call cc-option, -Wunused-but-set-variable) 105 32 KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable) 106 33 KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned) 34 + KBUILD_CFLAGS += $(call cc-option, -Wformat-overflow) 35 + KBUILD_CFLAGS += $(call cc-option, -Wformat-truncation) 36 + KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow) 107 37 KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation) 108 - # The following turn off the warnings enabled by -Wextra 109 - KBUILD_CFLAGS += -Wno-missing-field-initializers 110 - KBUILD_CFLAGS += -Wno-sign-compare 111 - KBUILD_CFLAGS += -Wno-type-limits 112 - KBUILD_CFLAGS += -Wno-shift-negative-value 113 38 114 39 KBUILD_CPPFLAGS += -Wundef 115 40 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN1 ··· 116 45 117 46 # Some diagnostics enabled by default are noisy. 118 47 # Suppress them by using -Wno... except for W=1. 48 + KBUILD_CFLAGS += $(call cc-disable-warning, unused-but-set-variable) 49 + KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) 50 + KBUILD_CFLAGS += $(call cc-disable-warning, restrict) 51 + KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned) 52 + KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) 53 + KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation) 54 + KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow) 55 + KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation) 119 56 120 57 ifdef CONFIG_CC_IS_CLANG 121 - KBUILD_CFLAGS += -Wno-initializer-overrides 122 58 # Clang before clang-16 would warn on default argument promotions. 123 59 ifneq ($(call clang-min-version, 160000),y) 124 60 # Disable -Wformat ··· 139 61 KBUILD_CFLAGS += -Wformat-insufficient-args 140 62 endif 141 63 endif 142 - KBUILD_CFLAGS += -Wno-sign-compare 143 64 KBUILD_CFLAGS += $(call cc-disable-warning, pointer-to-enum-cast) 144 65 KBUILD_CFLAGS += -Wno-tautological-constant-out-of-range-compare 145 66 KBUILD_CFLAGS += $(call cc-disable-warning, unaligned-access) ··· 160 83 KBUILD_CFLAGS += $(call cc-option, -Wmaybe-uninitialized) 161 84 KBUILD_CFLAGS += $(call cc-option, -Wunused-macros) 162 85 86 + ifdef CONFIG_CC_IS_CLANG 87 + KBUILD_CFLAGS += -Winitializer-overrides 88 + endif 89 + 163 90 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN2 91 + 92 + else 93 + 94 + # The following turn off the warnings enabled by -Wextra 95 + KBUILD_CFLAGS += -Wno-missing-field-initializers 96 + KBUILD_CFLAGS += -Wno-type-limits 97 + KBUILD_CFLAGS += -Wno-shift-negative-value 98 + 99 + ifdef CONFIG_CC_IS_CLANG 100 + KBUILD_CFLAGS += -Wno-initializer-overrides 101 + else 102 + KBUILD_CFLAGS += -Wno-maybe-uninitialized 103 + endif 164 104 165 105 endif 166 106 ··· 199 105 KBUILD_CFLAGS += $(call cc-option, -Wpacked-bitfield-compat) 200 106 201 107 KBUILD_CPPFLAGS += -DKBUILD_EXTRA_WARN3 108 + 109 + else 110 + 111 + # The following turn off the warnings enabled by -Wextra 112 + KBUILD_CFLAGS += -Wno-sign-compare 202 113 203 114 endif 204 115
+50 -5
scripts/Makefile.modinst
··· 9 9 include include/config/auto.conf 10 10 include $(srctree)/scripts/Kbuild.include 11 11 12 + install-y := 13 + 14 + ifeq ($(KBUILD_EXTMOD)$(sign-only),) 15 + 16 + # remove the old directory and symlink 17 + $(shell rm -fr $(MODLIB)/kernel $(MODLIB)/build) 18 + 19 + install-$(CONFIG_MODULES) += $(addprefix $(MODLIB)/, build modules.order) 20 + 21 + $(MODLIB)/build: FORCE 22 + $(call cmd,symlink) 23 + 24 + quiet_cmd_symlink = SYMLINK $@ 25 + cmd_symlink = ln -s $(CURDIR) $@ 26 + 27 + $(MODLIB)/modules.order: modules.order FORCE 28 + $(call cmd,install_modorder) 29 + 30 + quiet_cmd_install_modorder = INSTALL $@ 31 + cmd_install_modorder = sed 's:^\(.*\)\.o$$:kernel/\1.ko:' $< > $@ 32 + 33 + # Install modules.builtin(.modinfo) even when CONFIG_MODULES is disabled. 34 + install-y += $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo) 35 + 36 + $(addprefix $(MODLIB)/, modules.builtin modules.builtin.modinfo): $(MODLIB)/%: % FORCE 37 + $(call cmd,install) 38 + 39 + endif 40 + 12 41 modules := $(call read-file, $(MODORDER)) 13 42 14 43 ifeq ($(KBUILD_EXTMOD),) ··· 56 27 suffix-$(CONFIG_MODULE_COMPRESS_ZSTD) := .zst 57 28 58 29 modules := $(patsubst $(extmod_prefix)%.o, $(dst)/%.ko$(suffix-y), $(modules)) 30 + install-$(CONFIG_MODULES) += $(modules) 59 31 60 - __modinst: $(modules) 32 + __modinst: $(install-y) 61 33 @: 62 34 63 35 # 64 36 # Installation 65 37 # 66 38 quiet_cmd_install = INSTALL $@ 67 - cmd_install = mkdir -p $(dir $@); cp $< $@ 39 + cmd_install = cp $< $@ 68 40 69 41 # Strip 70 42 # ··· 95 65 # Signing 96 66 # Don't stop modules_install even if we can't sign external modules. 97 67 # 98 - ifeq ($(CONFIG_MODULE_SIG_ALL),y) 99 68 ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),) 100 69 sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY) 101 70 else ··· 103 74 quiet_cmd_sign = SIGN $@ 104 75 cmd_sign = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) "$(sig-key)" certs/signing_key.x509 $@ \ 105 76 $(if $(KBUILD_EXTMOD),|| true) 106 - else 77 + 78 + ifeq ($(sign-only),) 79 + 80 + # During modules_install, modules are signed only when CONFIG_MODULE_SIG_ALL=y. 81 + ifndef CONFIG_MODULE_SIG_ALL 107 82 quiet_cmd_sign := 108 83 cmd_sign := : 109 84 endif 110 85 111 - ifeq ($(modules_sign_only),) 86 + # Create necessary directories 87 + $(shell mkdir -p $(sort $(dir $(install-y)))) 112 88 113 89 $(dst)/%.ko: $(extmod_prefix)%.ko FORCE 114 90 $(call cmd,install) 115 91 $(call cmd,strip) 116 92 $(call cmd,sign) 93 + 94 + ifdef CONFIG_MODULES 95 + __modinst: depmod 96 + 97 + PHONY += depmod 98 + depmod: $(install-y) 99 + $(call cmd,depmod) 100 + 101 + quiet_cmd_depmod = DEPMOD $(MODLIB) 102 + cmd_depmod = $(srctree)/scripts/depmod.sh $(KERNELRELEASE) 103 + endif 117 104 118 105 else 119 106
+1
scripts/Makefile.modpost
··· 41 41 MODPOST = scripts/mod/modpost 42 42 43 43 modpost-args = \ 44 + $(if $(CONFIG_MODULES),-M) \ 44 45 $(if $(CONFIG_MODVERSIONS),-m) \ 45 46 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ 46 47 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
+30 -27
scripts/Makefile.package
··· 11 11 samples scripts security sound tools usr virt \ 12 12 .config Makefile \ 13 13 Kbuild Kconfig COPYING $(wildcard localversion*) 14 - MKSPEC := $(srctree)/scripts/package/mkspec 15 14 16 15 quiet_cmd_src_tar = TAR $(2).tar.gz 17 16 cmd_src_tar = \ ··· 65 66 $(linux-tarballs): .tmp_HEAD FORCE 66 67 $(call if_changed,archive) 67 68 68 - # rpm-pkg 69 + # rpm-pkg srcrpm-pkg binrpm-pkg 69 70 # --------------------------------------------------------------------------- 70 - PHONY += rpm-pkg 71 - rpm-pkg: srpm = $(shell rpmspec --srpm --query --queryformat='%{name}-%{VERSION}-%{RELEASE}.src.rpm' kernel.spec) 72 - rpm-pkg: srcrpm-pkg 73 - +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -rb $(srpm) \ 74 - --define='_smp_mflags %{nil}' 75 71 76 - # srcrpm-pkg 77 - # --------------------------------------------------------------------------- 78 - PHONY += srcrpm-pkg 79 - srcrpm-pkg: linux.tar.gz 80 - $(CONFIG_SHELL) $(MKSPEC) >$(objtree)/kernel.spec 81 - +rpmbuild $(RPMOPTS) --target $(UTS_MACHINE)-linux -bs kernel.spec \ 82 - --define='_smp_mflags %{nil}' --define='_sourcedir rpmbuild/SOURCES' --define='_srcrpmdir .' 72 + quiet_cmd_mkspec = GEN $@ 73 + cmd_mkspec = $(srctree)/scripts/package/mkspec > $@ 83 74 84 - # binrpm-pkg 85 - # --------------------------------------------------------------------------- 86 - PHONY += binrpm-pkg 87 - binrpm-pkg: 88 - $(MAKE) -f $(srctree)/Makefile 89 - $(CONFIG_SHELL) $(MKSPEC) prebuilt > $(objtree)/binkernel.spec 90 - +rpmbuild $(RPMOPTS) --define "_builddir $(objtree)" --target \ 91 - $(UTS_MACHINE)-linux -bb $(objtree)/binkernel.spec 75 + kernel.spec: FORCE 76 + $(call cmd,mkspec) 77 + 78 + PHONY += rpm-sources 79 + rpm-sources: linux.tar.gz 80 + $(Q)mkdir -p rpmbuild/SOURCES 81 + $(Q)ln -f linux.tar.gz rpmbuild/SOURCES/linux.tar.gz 82 + $(Q)cp $(KCONFIG_CONFIG) rpmbuild/SOURCES/config 83 + $(Q)$(srctree)/scripts/package/gen-diff-patch rpmbuild/SOURCES/diff.patch 84 + 85 + PHONY += rpm-pkg srcrpm-pkg binrpm-pkg 86 + 87 + rpm-pkg: private build-type := a 88 + srcrpm-pkg: private build-type := s 89 + binrpm-pkg: private build-type := b 90 + 91 + rpm-pkg srcrpm-pkg: rpm-sources 92 + rpm-pkg srcrpm-pkg binrpm-pkg: kernel.spec 93 + +$(strip rpmbuild -b$(build-type) kernel.spec \ 94 + --define='_topdir $(abspath rpmbuild)' \ 95 + $(if $(filter a b, $(build-type)), \ 96 + --target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}' \ 97 + $$(rpm -q rpm >/dev/null 2>&1 || echo --nodeps)) \ 98 + $(if $(filter b, $(build-type)), \ 99 + --without devel) \ 100 + $(RPMOPTS)) 92 101 93 102 # deb-pkg srcdeb-pkg bindeb-pkg 94 103 # --------------------------------------------------------------------------- ··· 148 141 $(if $(findstring source, $(build-type)), \ 149 142 --unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \ 150 143 $(if $(findstring binary, $(build-type)), \ 151 - -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \ 144 + --rules-file='$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \ 152 145 --no-check-builddeps) \ 153 146 $(DPKG_FLAGS)) 154 - 155 - PHONY += intdeb-pkg 156 - intdeb-pkg: 157 - +$(CONFIG_SHELL) $(srctree)/scripts/package/builddeb 158 147 159 148 # snap-pkg 160 149 # ---------------------------------------------------------------------------
+8 -31
scripts/depmod.sh
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 - # A depmod wrapper used by the toplevel Makefile 4 + # A depmod wrapper 5 5 6 - if test $# -ne 2; then 7 - echo "Usage: $0 /sbin/depmod <kernelrelease>" >&2 6 + if test $# -ne 1; then 7 + echo "Usage: $0 <kernelrelease>" >&2 8 8 exit 1 9 9 fi 10 - DEPMOD=$1 11 - KERNELRELEASE=$2 10 + 11 + KERNELRELEASE=$1 12 + 13 + : ${DEPMOD:=depmod} 12 14 13 15 if ! test -r System.map ; then 14 16 echo "Warning: modules_install: missing 'System.map' file. Skipping depmod." >&2 ··· 25 23 exit 0 26 24 fi 27 25 28 - # older versions of depmod require the version string to start with three 29 - # numbers, so we cheat with a symlink here 30 - depmod_hack_needed=true 31 - tmp_dir=$(mktemp -d ${TMPDIR:-/tmp}/depmod.XXXXXX) 32 - mkdir -p "$tmp_dir/lib/modules/$KERNELRELEASE" 33 - if "$DEPMOD" -b "$tmp_dir" $KERNELRELEASE 2>/dev/null; then 34 - if test -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep" -o \ 35 - -e "$tmp_dir/lib/modules/$KERNELRELEASE/modules.dep.bin"; then 36 - depmod_hack_needed=false 37 - fi 38 - fi 39 - rm -rf "$tmp_dir" 40 - if $depmod_hack_needed; then 41 - symlink="$INSTALL_MOD_PATH/lib/modules/99.98.$KERNELRELEASE" 42 - ln -s "$KERNELRELEASE" "$symlink" 43 - KERNELRELEASE=99.98.$KERNELRELEASE 44 - fi 45 - 46 26 set -- -ae -F System.map 47 27 if test -n "$INSTALL_MOD_PATH"; then 48 28 set -- "$@" -b "$INSTALL_MOD_PATH" 49 29 fi 50 - "$DEPMOD" "$@" "$KERNELRELEASE" 51 - ret=$? 52 - 53 - if $depmod_hack_needed; then 54 - rm -f "$symlink" 55 - fi 56 - 57 - exit $ret 30 + exec "$DEPMOD" "$@" "$KERNELRELEASE"
+1 -2
scripts/dummy-tools/gcc
··· 85 85 fi 86 86 87 87 # For arch/powerpc/tools/gcc-check-mprofile-kernel.sh 88 - if arg_contain -m64 "$@" && arg_contain -mlittle-endian "$@" && 89 - arg_contain -mprofile-kernel "$@"; then 88 + if arg_contain -m64 "$@" && arg_contain -mprofile-kernel "$@"; then 90 89 if ! test -t 0 && ! grep -q notrace; then 91 90 echo "_mcount" 92 91 fi
+12 -3
scripts/kconfig/Makefile
··· 93 93 %_defconfig: $(obj)/conf 94 94 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig) 95 95 96 - configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@) 96 + configfiles = $(wildcard $(srctree)/kernel/configs/$(1) $(srctree)/arch/$(SRCARCH)/configs/$(1)) 97 + all-config-fragments = $(call configfiles,*.config) 98 + config-fragments = $(call configfiles,$@) 97 99 98 100 %.config: $(obj)/conf 99 - $(if $(call configfiles),, $(error No configuration exists for this target on this architecture)) 100 - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles) 101 + $(if $(config-fragments),, $(error $@ fragment does not exists on this architecture)) 102 + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(config-fragments) 101 103 $(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig 102 104 103 105 PHONY += tinyconfig ··· 117 115 118 116 # Help text used by make help 119 117 help: 118 + @echo 'Configuration targets:' 120 119 @echo ' config - Update current config utilising a line-oriented program' 121 120 @echo ' nconfig - Update current config utilising a ncurses menu based program' 122 121 @echo ' menuconfig - Update current config utilising a menu based program' ··· 144 141 @echo ' default value without prompting' 145 142 @echo ' tinyconfig - Configure the tiniest possible kernel' 146 143 @echo ' testconfig - Run Kconfig unit tests (requires python3 and pytest)' 144 + @echo '' 145 + @echo 'Configuration topic targets:' 146 + @$(foreach f, $(all-config-fragments), \ 147 + if help=$$(grep -m1 '^# Help: ' $(f)); then \ 148 + printf ' %-25s - %s\n' '$(notdir $(f))' "$${help#*: }"; \ 149 + fi;) 147 150 148 151 # =========================================================================== 149 152 # object files used by all kconfig flavours
+19 -2
scripts/kconfig/confdata.c
··· 349 349 char *p, *p2; 350 350 struct symbol *sym; 351 351 int i, def_flags; 352 + const char *warn_unknown; 353 + const char *werror; 352 354 355 + warn_unknown = getenv("KCONFIG_WARN_UNKNOWN_SYMBOLS"); 356 + werror = getenv("KCONFIG_WERROR"); 353 357 if (name) { 354 358 in = zconf_fopen(name); 355 359 } else { ··· 441 437 if (def == S_DEF_USER) { 442 438 sym = sym_find(line + 2 + strlen(CONFIG_)); 443 439 if (!sym) { 440 + if (warn_unknown) 441 + conf_warning("unknown symbol: %s", 442 + line + 2 + strlen(CONFIG_)); 443 + 444 444 conf_set_changed(true); 445 445 continue; 446 446 } ··· 479 471 480 472 sym = sym_find(line + strlen(CONFIG_)); 481 473 if (!sym) { 482 - if (def == S_DEF_AUTO) 474 + if (def == S_DEF_AUTO) { 483 475 /* 484 476 * Reading from include/config/auto.conf 485 477 * If CONFIG_FOO previously existed in ··· 487 479 * include/config/FOO must be touched. 488 480 */ 489 481 conf_touch_dep(line + strlen(CONFIG_)); 490 - else 482 + } else { 483 + if (warn_unknown) 484 + conf_warning("unknown symbol: %s", 485 + line + strlen(CONFIG_)); 486 + 491 487 conf_set_changed(true); 488 + } 492 489 continue; 493 490 } 494 491 ··· 532 519 } 533 520 free(line); 534 521 fclose(in); 522 + 523 + if (conf_warnings && werror) 524 + exit(1); 525 + 535 526 return 0; 536 527 } 537 528
-1
scripts/kconfig/expr.h
··· 275 275 struct list_head entries; 276 276 size_t offset; 277 277 struct menu *target; 278 - int index; 279 278 }; 280 279 281 280 extern struct file *file_list;
+1
scripts/kconfig/lkc.h
··· 101 101 struct menu *menu_get_parent_menu(struct menu *menu); 102 102 bool menu_has_help(struct menu *menu); 103 103 const char *menu_get_help(struct menu *menu); 104 + int get_jump_key_char(void); 104 105 struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head); 105 106 void menu_get_ext_help(struct menu *menu, struct gstr *help); 106 107
+3 -7
scripts/kconfig/lxdialog/dialog.h
··· 196 196 int dialog_yesno(const char *title, const char *prompt, int height, int width); 197 197 int dialog_msgbox(const char *title, const char *prompt, int height, 198 198 int width, int pause); 199 - 200 - 201 - typedef void (*update_text_fn)(char *buf, size_t start, size_t end, void 202 - *_data); 203 - int dialog_textbox(const char *title, char *tbuf, int initial_height, 204 - int initial_width, int *keys, int *_vscroll, int *_hscroll, 205 - update_text_fn update_text, void *data); 199 + int dialog_textbox(const char *title, const char *tbuf, int initial_height, 200 + int initial_width, int *_vscroll, int *_hscroll, 201 + int (*extra_key_cb)(int, size_t, size_t, void *), void *data); 206 202 int dialog_menu(const char *title, const char *prompt, 207 203 const void *selected, int *s_scroll); 208 204 int dialog_checklist(const char *title, const char *prompt, int height,
+24 -44
scripts/kconfig/lxdialog/textbox.c
··· 10 10 11 11 static int hscroll; 12 12 static int begin_reached, end_reached, page_length; 13 - static char *buf; 14 - static char *page; 13 + static const char *buf, *page; 14 + static size_t start, end; 15 15 16 16 /* 17 17 * Go back 'n' lines in text. Called by dialog_textbox(). ··· 98 98 /* 99 99 * Print a new page of text. 100 100 */ 101 - static void print_page(WINDOW *win, int height, int width, update_text_fn 102 - update_text, void *data) 101 + static void print_page(WINDOW *win, int height, int width) 103 102 { 104 103 int i, passed_end = 0; 105 - 106 - if (update_text) { 107 - char *end; 108 - 109 - for (i = 0; i < height; i++) 110 - get_line(); 111 - end = page; 112 - back_lines(height); 113 - update_text(buf, page - buf, end - buf, data); 114 - } 115 104 116 105 page_length = 0; 117 106 for (i = 0; i < height; i++) { ··· 131 142 * refresh window content 132 143 */ 133 144 static void refresh_text_box(WINDOW *dialog, WINDOW *box, int boxh, int boxw, 134 - int cur_y, int cur_x, update_text_fn update_text, 135 - void *data) 145 + int cur_y, int cur_x) 136 146 { 137 - print_page(box, boxh, boxw, update_text, data); 147 + start = page - buf; 148 + 149 + print_page(box, boxh, boxw); 138 150 print_position(dialog); 139 151 wmove(dialog, cur_y, cur_x); /* Restore cursor position */ 140 152 wrefresh(dialog); 153 + 154 + end = page - buf; 141 155 } 142 156 143 157 /* 144 158 * Display text from a file in a dialog box. 145 159 * 146 160 * keys is a null-terminated array 147 - * update_text() may not add or remove any '\n' or '\0' in tbuf 148 161 */ 149 - int dialog_textbox(const char *title, char *tbuf, int initial_height, 150 - int initial_width, int *keys, int *_vscroll, int *_hscroll, 151 - update_text_fn update_text, void *data) 162 + int dialog_textbox(const char *title, const char *tbuf, int initial_height, 163 + int initial_width, int *_vscroll, int *_hscroll, 164 + int (*extra_key_cb)(int, size_t, size_t, void *), void *data) 152 165 { 153 166 int i, x, y, cur_x, cur_y, key = 0; 154 167 int height, width, boxh, boxw; ··· 230 239 231 240 /* Print first page of text */ 232 241 attr_clear(box, boxh, boxw, dlg.dialog.atr); 233 - refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x, update_text, 234 - data); 242 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 235 243 236 244 while (!done) { 237 245 key = wgetch(dialog); ··· 249 259 begin_reached = 1; 250 260 page = buf; 251 261 refresh_text_box(dialog, box, boxh, boxw, 252 - cur_y, cur_x, update_text, 253 - data); 262 + cur_y, cur_x); 254 263 } 255 264 break; 256 265 case 'G': /* Last page */ ··· 259 270 /* point to last char in buf */ 260 271 page = buf + strlen(buf); 261 272 back_lines(boxh); 262 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 263 - cur_x, update_text, data); 273 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 264 274 break; 265 275 case 'K': /* Previous line */ 266 276 case 'k': ··· 268 280 break; 269 281 270 282 back_lines(page_length + 1); 271 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 272 - cur_x, update_text, data); 283 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 273 284 break; 274 285 case 'B': /* Previous page */ 275 286 case 'b': ··· 277 290 if (begin_reached) 278 291 break; 279 292 back_lines(page_length + boxh); 280 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 281 - cur_x, update_text, data); 293 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 282 294 break; 283 295 case 'J': /* Next line */ 284 296 case 'j': ··· 286 300 break; 287 301 288 302 back_lines(page_length - 1); 289 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 290 - cur_x, update_text, data); 303 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 291 304 break; 292 305 case KEY_NPAGE: /* Next page */ 293 306 case ' ': ··· 295 310 break; 296 311 297 312 begin_reached = 0; 298 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 299 - cur_x, update_text, data); 313 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 300 314 break; 301 315 case '0': /* Beginning of line */ 302 316 case 'H': /* Scroll left */ ··· 310 326 hscroll--; 311 327 /* Reprint current page to scroll horizontally */ 312 328 back_lines(page_length); 313 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 314 - cur_x, update_text, data); 329 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 315 330 break; 316 331 case 'L': /* Scroll right */ 317 332 case 'l': ··· 320 337 hscroll++; 321 338 /* Reprint current page to scroll horizontally */ 322 339 back_lines(page_length); 323 - refresh_text_box(dialog, box, boxh, boxw, cur_y, 324 - cur_x, update_text, data); 340 + refresh_text_box(dialog, box, boxh, boxw, cur_y, cur_x); 325 341 break; 326 342 case KEY_ESC: 327 343 if (on_key_esc(dialog) == KEY_ESC) ··· 333 351 on_key_resize(); 334 352 goto do_resize; 335 353 default: 336 - for (i = 0; keys[i]; i++) { 337 - if (key == keys[i]) { 338 - done = true; 339 - break; 340 - } 354 + if (extra_key_cb && extra_key_cb(key, start, end, data)) { 355 + done = true; 356 + break; 341 357 } 342 358 } 343 359 }
+52 -37
scripts/kconfig/mconf.c
··· 22 22 #include "lkc.h" 23 23 #include "lxdialog/dialog.h" 24 24 25 - #define JUMP_NB 9 26 - 27 25 static const char mconf_readme[] = 28 26 "Overview\n" 29 27 "--------\n" ··· 286 288 static int show_all_options; 287 289 static int save_and_exit; 288 290 static int silent; 291 + static int jump_key_char; 289 292 290 293 static void conf(struct menu *menu, struct menu *active_menu); 291 294 ··· 347 348 set_dialog_subtitles(subtitles); 348 349 } 349 350 350 - static int show_textbox_ext(const char *title, char *text, int r, int c, int 351 - *keys, int *vscroll, int *hscroll, update_text_fn 352 - update_text, void *data) 351 + static int show_textbox_ext(const char *title, const char *text, int r, int c, 352 + int *vscroll, int *hscroll, 353 + int (*extra_key_cb)(int, size_t, size_t, void *), 354 + void *data) 353 355 { 354 356 dialog_clear(); 355 - return dialog_textbox(title, text, r, c, keys, vscroll, hscroll, 356 - update_text, data); 357 + return dialog_textbox(title, text, r, c, vscroll, hscroll, 358 + extra_key_cb, data); 357 359 } 358 360 359 361 static void show_textbox(const char *title, const char *text, int r, int c) 360 362 { 361 - show_textbox_ext(title, (char *) text, r, c, (int []) {0}, NULL, NULL, 362 - NULL, NULL); 363 + show_textbox_ext(title, text, r, c, NULL, NULL, NULL, NULL); 363 364 } 364 365 365 366 static void show_helptext(const char *title, const char *text) ··· 380 381 381 382 struct search_data { 382 383 struct list_head *head; 383 - struct menu **targets; 384 - int *keys; 384 + struct menu *target; 385 385 }; 386 386 387 - static void update_text(char *buf, size_t start, size_t end, void *_data) 387 + static int next_jump_key(int key) 388 + { 389 + if (key < '1' || key > '9') 390 + return '1'; 391 + 392 + key++; 393 + 394 + if (key > '9') 395 + key = '1'; 396 + 397 + return key; 398 + } 399 + 400 + static int handle_search_keys(int key, size_t start, size_t end, void *_data) 388 401 { 389 402 struct search_data *data = _data; 390 403 struct jump_key *pos; 391 - int k = 0; 404 + int index = 0; 405 + 406 + if (key < '1' || key > '9') 407 + return 0; 392 408 393 409 list_for_each_entry(pos, data->head, entries) { 394 - if (pos->offset >= start && pos->offset < end) { 395 - char header[4]; 410 + index = next_jump_key(index); 396 411 397 - if (k < JUMP_NB) { 398 - int key = '0' + (pos->index % JUMP_NB) + 1; 412 + if (pos->offset < start) 413 + continue; 399 414 400 - sprintf(header, "(%c)", key); 401 - data->keys[k] = key; 402 - data->targets[k] = pos->target; 403 - k++; 404 - } else { 405 - sprintf(header, " "); 406 - } 415 + if (pos->offset >= end) 416 + break; 407 417 408 - memcpy(buf + pos->offset, header, sizeof(header) - 1); 418 + if (key == index) { 419 + data->target = pos->target; 420 + return 1; 409 421 } 410 422 } 411 - data->keys[k] = 0; 423 + 424 + return 0; 425 + } 426 + 427 + int get_jump_key_char(void) 428 + { 429 + jump_key_char = next_jump_key(jump_key_char); 430 + 431 + return jump_key_char; 412 432 } 413 433 414 434 static void search_conf(void) ··· 474 456 sym_arr = sym_re_search(dialog_input); 475 457 do { 476 458 LIST_HEAD(head); 477 - struct menu *targets[JUMP_NB]; 478 - int keys[JUMP_NB + 1], i; 479 459 struct search_data data = { 480 460 .head = &head, 481 - .targets = targets, 482 - .keys = keys, 483 461 }; 484 462 struct jump_key *pos, *tmp; 485 463 464 + jump_key_char = 0; 486 465 res = get_relations_str(sym_arr, &head); 487 466 set_subtitle(); 488 467 dres = show_textbox_ext("Search Results", str_get(&res), 0, 0, 489 - keys, &vscroll, &hscroll, &update_text, 490 - &data); 468 + &vscroll, &hscroll, 469 + handle_search_keys, &data); 491 470 again = false; 492 - for (i = 0; i < JUMP_NB && keys[i]; i++) 493 - if (dres == keys[i]) { 494 - conf(targets[i]->parent, targets[i]); 495 - again = true; 496 - } 471 + if (dres >= '1' && dres <= '9') { 472 + assert(data.target != NULL); 473 + conf(data.target->parent, data.target); 474 + again = true; 475 + } 497 476 str_free(&res); 498 477 list_for_each_entry_safe(pos, tmp, &head, entries) 499 478 free(pos);
+19 -11
scripts/kconfig/menu.c
··· 701 701 } 702 702 } 703 703 704 + int __attribute__((weak)) get_jump_key_char(void) 705 + { 706 + return -1; 707 + } 708 + 704 709 static void get_prompt_str(struct gstr *r, struct property *prop, 705 710 struct list_head *head) 706 711 { ··· 735 730 } 736 731 if (head && location) { 737 732 jump = xmalloc(sizeof(struct jump_key)); 738 - 739 733 jump->target = location; 740 - 741 - if (list_empty(head)) 742 - jump->index = 0; 743 - else 744 - jump->index = list_entry(head->prev, struct jump_key, 745 - entries)->index + 1; 746 - 747 734 list_add_tail(&jump->entries, head); 748 735 } 749 736 750 737 str_printf(r, " Location:\n"); 751 - for (j = 4; --i >= 0; j += 2) { 738 + for (j = 0; --i >= 0; j++) { 739 + int jk = -1; 740 + int indent = 2 * j + 4; 741 + 752 742 menu = submenu[i]; 753 - if (jump && menu == location) 743 + if (jump && menu == location) { 754 744 jump->offset = strlen(r->s); 755 - str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu)); 745 + jk = get_jump_key_char(); 746 + } 747 + 748 + if (jk >= 0) { 749 + str_printf(r, "(%c)", jk); 750 + indent -= 3; 751 + } 752 + 753 + str_printf(r, "%*c-> %s", indent, ' ', menu_get_prompt(menu)); 756 754 if (menu->sym) { 757 755 str_printf(r, " (%s [=%s])", menu->sym->name ? 758 756 menu->sym->name : "<choice>",
+103 -10
scripts/kconfig/nconf.c
··· 220 220 "Location:\n" 221 221 " -> Bus options (PCI, PCMCIA, EISA, ISA)\n" 222 222 " -> PCI support (PCI [ = y])\n" 223 - " -> PCI access mode (<choice> [ = y])\n" 223 + "(1) -> PCI access mode (<choice> [ = y])\n" 224 224 "Selects: LIBCRC32\n" 225 225 "Selected by: BAR\n" 226 226 "-----------------------------------------------------------------\n" ··· 231 231 "o The 'Depends on:' line lists symbols that need to be defined for\n" 232 232 " this symbol to be visible and selectable in the menu.\n" 233 233 "o The 'Location:' lines tell, where in the menu structure this symbol\n" 234 - " is located. A location followed by a [ = y] indicates that this is\n" 235 - " a selectable menu item, and the current value is displayed inside\n" 236 - " brackets.\n" 234 + " is located.\n" 235 + " A location followed by a [ = y] indicates that this is\n" 236 + " a selectable menu item, and the current value is displayed inside\n" 237 + " brackets.\n" 238 + " Press the key in the (#) prefix to jump directly to that\n" 239 + " location. You will be returned to the current search results\n" 240 + " after exiting this new menu.\n" 237 241 "o The 'Selects:' line tells, what symbol will be automatically selected\n" 238 242 " if this symbol is selected (y or m).\n" 239 243 "o The 'Selected by' line tells what symbol has selected this symbol.\n" ··· 279 275 280 276 static char *dialog_input_result; 281 277 static int dialog_input_result_len; 278 + static int jump_key_char; 282 279 280 + static void selected_conf(struct menu *menu, struct menu *active_menu); 283 281 static void conf(struct menu *menu); 284 282 static void conf_choice(struct menu *menu); 285 283 static void conf_string(struct menu *menu); ··· 691 685 return 0; 692 686 } 693 687 688 + struct search_data { 689 + struct list_head *head; 690 + struct menu *target; 691 + }; 692 + 693 + static int next_jump_key(int key) 694 + { 695 + if (key < '1' || key > '9') 696 + return '1'; 697 + 698 + key++; 699 + 700 + if (key > '9') 701 + key = '1'; 702 + 703 + return key; 704 + } 705 + 706 + static int handle_search_keys(int key, size_t start, size_t end, void *_data) 707 + { 708 + struct search_data *data = _data; 709 + struct jump_key *pos; 710 + int index = 0; 711 + 712 + if (key < '1' || key > '9') 713 + return 0; 714 + 715 + list_for_each_entry(pos, data->head, entries) { 716 + index = next_jump_key(index); 717 + 718 + if (pos->offset < start) 719 + continue; 720 + 721 + if (pos->offset >= end) 722 + break; 723 + 724 + if (key == index) { 725 + data->target = pos->target; 726 + return 1; 727 + } 728 + } 729 + 730 + return 0; 731 + } 732 + 733 + int get_jump_key_char(void) 734 + { 735 + jump_key_char = next_jump_key(jump_key_char); 736 + 737 + return jump_key_char; 738 + } 694 739 695 740 static void search_conf(void) 696 741 { ··· 749 692 struct gstr res; 750 693 struct gstr title; 751 694 char *dialog_input; 752 - int dres; 695 + int dres, vscroll = 0, hscroll = 0; 696 + bool again; 753 697 754 698 title = str_new(); 755 699 str_printf( &title, "Enter (sub)string or regexp to search for " ··· 779 721 dialog_input += strlen(CONFIG_); 780 722 781 723 sym_arr = sym_re_search(dialog_input); 782 - res = get_relations_str(sym_arr, NULL); 724 + 725 + do { 726 + LIST_HEAD(head); 727 + struct search_data data = { 728 + .head = &head, 729 + .target = NULL, 730 + }; 731 + jump_key_char = 0; 732 + res = get_relations_str(sym_arr, &head); 733 + dres = show_scroll_win_ext(main_window, 734 + "Search Results", str_get(&res), 735 + &vscroll, &hscroll, 736 + handle_search_keys, &data); 737 + again = false; 738 + if (dres >= '1' && dres <= '9') { 739 + assert(data.target != NULL); 740 + selected_conf(data.target->parent, data.target); 741 + again = true; 742 + } 743 + str_free(&res); 744 + } while (again); 783 745 free(sym_arr); 784 - show_scroll_win(main_window, 785 - "Search Results", str_get(&res)); 786 - str_free(&res); 787 746 str_free(&title); 788 747 } 789 748 ··· 1138 1063 1139 1064 static void conf(struct menu *menu) 1140 1065 { 1066 + selected_conf(menu, NULL); 1067 + } 1068 + 1069 + static void selected_conf(struct menu *menu, struct menu *active_menu) 1070 + { 1141 1071 struct menu *submenu = NULL; 1142 1072 struct symbol *sym; 1143 - int res; 1073 + int i, res; 1144 1074 int current_index = 0; 1145 1075 int last_top_row = 0; 1146 1076 struct match_state match_state = { ··· 1160 1080 build_conf(menu); 1161 1081 if (!child_count) 1162 1082 break; 1083 + 1084 + if (active_menu != NULL) { 1085 + for (i = 0; i < items_num; i++) { 1086 + struct mitem *mcur; 1087 + 1088 + mcur = (struct mitem *) item_userptr(curses_menu_items[i]); 1089 + if ((struct menu *) mcur->usrptr == active_menu) { 1090 + current_index = i; 1091 + break; 1092 + } 1093 + } 1094 + active_menu = NULL; 1095 + } 1163 1096 1164 1097 show_menu(menu_get_prompt(menu), menu_instructions, 1165 1098 current_index, &last_top_row);
+32 -5
scripts/kconfig/nconf.gui.c
··· 497 497 refresh(); 498 498 } 499 499 500 - /* layman's scrollable window... */ 501 500 void show_scroll_win(WINDOW *main_window, 502 501 const char *title, 503 502 const char *text) 503 + { 504 + (void)show_scroll_win_ext(main_window, title, (char *)text, NULL, NULL, NULL, NULL); 505 + } 506 + 507 + /* layman's scrollable window... */ 508 + int show_scroll_win_ext(WINDOW *main_window, const char *title, char *text, 509 + int *vscroll, int *hscroll, 510 + extra_key_cb_fn extra_key_cb, void *data) 504 511 { 505 512 int res; 506 513 int total_lines = get_line_no(text); ··· 521 514 WINDOW *win; 522 515 WINDOW *pad; 523 516 PANEL *panel; 517 + bool done = false; 518 + 519 + if (hscroll) 520 + start_x = *hscroll; 521 + if (vscroll) 522 + start_y = *vscroll; 524 523 525 524 getmaxyx(stdscr, lines, columns); 526 525 ··· 562 549 panel = new_panel(win); 563 550 564 551 /* handle scrolling */ 565 - do { 566 - 552 + while (!done) { 567 553 copywin(pad, win, start_y, start_x, 2, 2, text_lines, 568 554 text_cols, 0); 569 555 print_in_middle(win, ··· 605 593 case 'l': 606 594 start_x++; 607 595 break; 596 + default: 597 + if (extra_key_cb) { 598 + size_t start = (get_line(text, start_y) - text); 599 + size_t end = (get_line(text, start_y + text_lines) - text); 600 + 601 + if (extra_key_cb(res, start, end, data)) { 602 + done = true; 603 + break; 604 + } 605 + } 608 606 } 609 - if (res == 10 || res == 27 || res == 'q' || 607 + if (res == 0 || res == 10 || res == 27 || res == 'q' || 610 608 res == KEY_F(F_HELP) || res == KEY_F(F_BACK) || 611 609 res == KEY_F(F_EXIT)) 612 610 break; ··· 628 606 start_x = 0; 629 607 if (start_x >= total_cols-text_cols) 630 608 start_x = total_cols-text_cols; 631 - } while (res); 609 + } 632 610 611 + if (hscroll) 612 + *hscroll = start_x; 613 + if (vscroll) 614 + *vscroll = start_y; 633 615 del_panel(panel); 634 616 delwin(win); 635 617 refresh_all_windows(main_window); 618 + return res; 636 619 }
+5
scripts/kconfig/nconf.h
··· 67 67 68 68 void set_colors(void); 69 69 70 + typedef int (*extra_key_cb_fn)(int, size_t, size_t, void *); 71 + 70 72 /* this changes the windows attributes !!! */ 71 73 void print_in_middle(WINDOW *win, int y, int width, const char *str, int attrs); 72 74 int get_line_length(const char *line); ··· 80 78 const char *title, const char *prompt, 81 79 const char *init, char **resultp, int *result_len); 82 80 void refresh_all_windows(WINDOW *main_window); 81 + int show_scroll_win_ext(WINDOW *main_window, const char *title, char *text, 82 + int *vscroll, int *hscroll, 83 + extra_key_cb_fn extra_key_cb, void *data); 83 84 void show_scroll_win(WINDOW *main_window, 84 85 const char *title, 85 86 const char *text);
+3
scripts/kconfig/preprocess.c
··· 396 396 397 397 p++; 398 398 } 399 + 400 + if (new_argc >= FUNCTION_MAX_ARGS) 401 + pperror("too many function arguments"); 399 402 new_argv[new_argc++] = prev; 400 403 401 404 /*
+18 -7
scripts/kconfig/qconf-cfg.sh
··· 5 5 libs=$2 6 6 bin=$3 7 7 8 - PKG="Qt5Core Qt5Gui Qt5Widgets" 8 + PKG5="Qt5Core Qt5Gui Qt5Widgets" 9 + PKG6="Qt6Core Qt6Gui Qt6Widgets" 9 10 10 11 if [ -z "$(command -v ${HOSTPKG_CONFIG})" ]; then 11 12 echo >&2 "*" ··· 15 14 exit 1 16 15 fi 17 16 18 - if ${HOSTPKG_CONFIG} --exists $PKG; then 19 - ${HOSTPKG_CONFIG} --cflags ${PKG} > ${cflags} 20 - ${HOSTPKG_CONFIG} --libs ${PKG} > ${libs} 17 + if ${HOSTPKG_CONFIG} --exists $PKG6; then 18 + ${HOSTPKG_CONFIG} --cflags ${PKG6} > ${cflags} 19 + # Qt6 requires C++17. 20 + echo -std=c++17 >> ${cflags} 21 + ${HOSTPKG_CONFIG} --libs ${PKG6} > ${libs} 22 + ${HOSTPKG_CONFIG} --variable=libexecdir Qt6Core > ${bin} 23 + exit 0 24 + fi 25 + 26 + if ${HOSTPKG_CONFIG} --exists $PKG5; then 27 + ${HOSTPKG_CONFIG} --cflags ${PKG5} > ${cflags} 28 + ${HOSTPKG_CONFIG} --libs ${PKG5} > ${libs} 21 29 ${HOSTPKG_CONFIG} --variable=host_bins Qt5Core > ${bin} 22 30 exit 0 23 31 fi 24 32 25 33 echo >&2 "*" 26 - echo >&2 "* Could not find Qt5 via ${HOSTPKG_CONFIG}." 27 - echo >&2 "* Please install Qt5 and make sure it's in PKG_CONFIG_PATH" 28 - echo >&2 "* You need $PKG" 34 + echo >&2 "* Could not find Qt6 or Qt5 via ${HOSTPKG_CONFIG}." 35 + echo >&2 "* Please install Qt6 or Qt5 and make sure it's in PKG_CONFIG_PATH" 36 + echo >&2 "* You need $PKG6 for Qt6" 37 + echo >&2 "* You need $PKG5 for Qt5" 29 38 echo >&2 "*" 30 39 exit 1
+26 -14
scripts/kconfig/qconf.cc
··· 5 5 */ 6 6 7 7 #include <QAction> 8 + #include <QActionGroup> 8 9 #include <QApplication> 9 10 #include <QCloseEvent> 10 11 #include <QDebug> 11 - #include <QDesktopWidget> 12 12 #include <QFileDialog> 13 13 #include <QLabel> 14 14 #include <QLayout> ··· 16 16 #include <QMenu> 17 17 #include <QMenuBar> 18 18 #include <QMessageBox> 19 + #include <QRegularExpression> 20 + #include <QScreen> 19 21 #include <QToolBar> 20 22 21 23 #include <stdlib.h> ··· 1128 1126 1129 1127 QString ConfigInfoView::print_filter(const QString &str) 1130 1128 { 1131 - QRegExp re("[<>&\"\\n]"); 1129 + QRegularExpression re("[<>&\"\\n]"); 1132 1130 QString res = str; 1133 1131 for (int i = 0; (i = res.indexOf(re, i)) >= 0;) { 1134 1132 switch (res[i].toLatin1()) { ··· 1324 1322 int width, height; 1325 1323 char title[256]; 1326 1324 1327 - QDesktopWidget *d = configApp->desktop(); 1328 1325 snprintf(title, sizeof(title), "%s%s", 1329 1326 rootmenu.prompt->text, 1330 1327 "" 1331 1328 ); 1332 1329 setWindowTitle(title); 1333 1330 1334 - width = configSettings->value("/window width", d->width() - 64).toInt(); 1335 - height = configSettings->value("/window height", d->height() - 64).toInt(); 1331 + QRect g = configApp->primaryScreen()->geometry(); 1332 + width = configSettings->value("/window width", g.width() - 64).toInt(); 1333 + height = configSettings->value("/window height", g.height() - 64).toInt(); 1336 1334 resize(width, height); 1337 1335 x = configSettings->value("/window x"); 1338 1336 y = configSettings->value("/window y"); ··· 1381 1379 this, &ConfigMainWindow::goBack); 1382 1380 1383 1381 QAction *quitAction = new QAction("&Quit", this); 1384 - quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); 1382 + quitAction->setShortcut(Qt::CTRL | Qt::Key_Q); 1385 1383 connect(quitAction, &QAction::triggered, 1386 1384 this, &ConfigMainWindow::close); 1387 1385 1388 1386 QAction *loadAction = new QAction(QPixmap(xpm_load), "&Load", this); 1389 - loadAction->setShortcut(Qt::CTRL + Qt::Key_L); 1387 + loadAction->setShortcut(Qt::CTRL | Qt::Key_L); 1390 1388 connect(loadAction, &QAction::triggered, 1391 1389 this, &ConfigMainWindow::loadConfig); 1392 1390 1393 1391 saveAction = new QAction(QPixmap(xpm_save), "&Save", this); 1394 - saveAction->setShortcut(Qt::CTRL + Qt::Key_S); 1392 + saveAction->setShortcut(Qt::CTRL | Qt::Key_S); 1395 1393 connect(saveAction, &QAction::triggered, 1396 1394 this, &ConfigMainWindow::saveConfig); 1397 1395 ··· 1405 1403 connect(saveAsAction, &QAction::triggered, 1406 1404 this, &ConfigMainWindow::saveConfigAs); 1407 1405 QAction *searchAction = new QAction("&Find", this); 1408 - searchAction->setShortcut(Qt::CTRL + Qt::Key_F); 1406 + searchAction->setShortcut(Qt::CTRL | Qt::Key_F); 1409 1407 connect(searchAction, &QAction::triggered, 1410 1408 this, &ConfigMainWindow::searchConfig); 1411 1409 singleViewAction = new QAction(QPixmap(xpm_single_view), "Single View", this); ··· 1752 1750 e->accept(); 1753 1751 return; 1754 1752 } 1755 - QMessageBox mb("qconf", "Save configuration?", QMessageBox::Warning, 1756 - QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape); 1757 - mb.setButtonText(QMessageBox::Yes, "&Save Changes"); 1758 - mb.setButtonText(QMessageBox::No, "&Discard Changes"); 1759 - mb.setButtonText(QMessageBox::Cancel, "Cancel Exit"); 1753 + 1754 + QMessageBox mb(QMessageBox::Icon::Warning, "qconf", 1755 + "Save configuration?"); 1756 + 1757 + QPushButton *yb = mb.addButton(QMessageBox::Yes); 1758 + QPushButton *db = mb.addButton(QMessageBox::No); 1759 + QPushButton *cb = mb.addButton(QMessageBox::Cancel); 1760 + 1761 + yb->setText("&Save Changes"); 1762 + db->setText("&Discard Changes"); 1763 + cb->setText("Cancel Exit"); 1764 + 1765 + mb.setDefaultButton(yb); 1766 + mb.setEscapeButton(cb); 1767 + 1760 1768 switch (mb.exec()) { 1761 1769 case QMessageBox::Yes: 1762 1770 if (saveConfig())
+84 -89
scripts/mod/modpost.c
··· 24 24 #include "../../include/linux/license.h" 25 25 #include "../../include/linux/module_symbol.h" 26 26 27 + static bool module_enabled; 27 28 /* Are we using CONFIG_MODVERSIONS? */ 28 29 static bool modversions; 29 30 /* Is CONFIG_MODULE_SRCVERSION_ALL set? */ ··· 762 761 ".fmt_slot*", /* EZchip */ 763 762 ".gnu.lto*", 764 763 ".discard.*", 764 + ".llvm.call-graph-profile", /* call graph */ 765 765 NULL 766 766 }; 767 767 ··· 1244 1242 const char *tosec = sec_name(elf, get_secindex(elf, sym)); 1245 1243 const struct sectioncheck *mismatch; 1246 1244 1247 - if (elf->export_symbol_secndx == fsecndx) { 1245 + if (module_enabled && elf->export_symbol_secndx == fsecndx) { 1248 1246 check_export_symbol(mod, elf, faddr, tosec, sym); 1249 1247 return; 1250 1248 } ··· 1258 1256 tosec, taddr); 1259 1257 } 1260 1258 1261 - static int addend_386_rel(uint32_t *location, Elf_Rela *r) 1259 + static Elf_Addr addend_386_rel(uint32_t *location, unsigned int r_type) 1262 1260 { 1263 - unsigned int r_typ = ELF_R_TYPE(r->r_info); 1264 - 1265 - switch (r_typ) { 1261 + switch (r_type) { 1266 1262 case R_386_32: 1267 - r->r_addend = TO_NATIVE(*location); 1268 - break; 1263 + return TO_NATIVE(*location); 1269 1264 case R_386_PC32: 1270 - r->r_addend = TO_NATIVE(*location) + 4; 1271 - break; 1272 - default: 1273 - r->r_addend = (Elf_Addr)(-1); 1265 + return TO_NATIVE(*location) + 4; 1274 1266 } 1275 - return 0; 1267 + 1268 + return (Elf_Addr)(-1); 1276 1269 } 1277 1270 1278 1271 #ifndef R_ARM_CALL ··· 1311 1314 return (int32_t)(value << shift) >> shift; 1312 1315 } 1313 1316 1314 - static int addend_arm_rel(void *loc, Elf_Sym *sym, Elf_Rela *r) 1317 + static Elf_Addr addend_arm_rel(void *loc, Elf_Sym *sym, unsigned int r_type) 1315 1318 { 1316 - unsigned int r_typ = ELF_R_TYPE(r->r_info); 1317 1319 uint32_t inst, upper, lower, sign, j1, j2; 1318 1320 int32_t offset; 1319 1321 1320 - switch (r_typ) { 1322 + switch (r_type) { 1321 1323 case R_ARM_ABS32: 1322 1324 case R_ARM_REL32: 1323 1325 inst = TO_NATIVE(*(uint32_t *)loc); 1324 - r->r_addend = inst + sym->st_value; 1325 - break; 1326 + return inst + sym->st_value; 1326 1327 case R_ARM_MOVW_ABS_NC: 1327 1328 case R_ARM_MOVT_ABS: 1328 1329 inst = TO_NATIVE(*(uint32_t *)loc); 1329 1330 offset = sign_extend32(((inst & 0xf0000) >> 4) | (inst & 0xfff), 1330 1331 15); 1331 - r->r_addend = offset + sym->st_value; 1332 - break; 1332 + return offset + sym->st_value; 1333 1333 case R_ARM_PC24: 1334 1334 case R_ARM_CALL: 1335 1335 case R_ARM_JUMP24: 1336 1336 inst = TO_NATIVE(*(uint32_t *)loc); 1337 1337 offset = sign_extend32((inst & 0x00ffffff) << 2, 25); 1338 - r->r_addend = offset + sym->st_value + 8; 1339 - break; 1338 + return offset + sym->st_value + 8; 1340 1339 case R_ARM_THM_MOVW_ABS_NC: 1341 1340 case R_ARM_THM_MOVT_ABS: 1342 1341 upper = TO_NATIVE(*(uint16_t *)loc); ··· 1342 1349 ((lower & 0x7000) >> 4) | 1343 1350 (lower & 0x00ff), 1344 1351 15); 1345 - r->r_addend = offset + sym->st_value; 1346 - break; 1352 + return offset + sym->st_value; 1347 1353 case R_ARM_THM_JUMP19: 1348 1354 /* 1349 1355 * Encoding T3: ··· 1363 1371 ((upper & 0x03f) << 12) | 1364 1372 ((lower & 0x07ff) << 1), 1365 1373 20); 1366 - r->r_addend = offset + sym->st_value + 4; 1367 - break; 1374 + return offset + sym->st_value + 4; 1368 1375 case R_ARM_THM_CALL: 1369 1376 case R_ARM_THM_JUMP24: 1370 1377 /* ··· 1389 1398 ((upper & 0x03ff) << 12) | 1390 1399 ((lower & 0x07ff) << 1), 1391 1400 24); 1392 - r->r_addend = offset + sym->st_value + 4; 1393 - break; 1394 - default: 1395 - r->r_addend = (Elf_Addr)(-1); 1401 + return offset + sym->st_value + 4; 1396 1402 } 1397 - return 0; 1403 + 1404 + return (Elf_Addr)(-1); 1398 1405 } 1399 1406 1400 - static int addend_mips_rel(uint32_t *location, Elf_Rela *r) 1407 + static Elf_Addr addend_mips_rel(uint32_t *location, unsigned int r_type) 1401 1408 { 1402 - unsigned int r_typ = ELF_R_TYPE(r->r_info); 1403 1409 uint32_t inst; 1404 1410 1405 1411 inst = TO_NATIVE(*location); 1406 - switch (r_typ) { 1412 + switch (r_type) { 1407 1413 case R_MIPS_LO16: 1408 - r->r_addend = inst & 0xffff; 1409 - break; 1414 + return inst & 0xffff; 1410 1415 case R_MIPS_26: 1411 - r->r_addend = (inst & 0x03ffffff) << 2; 1412 - break; 1416 + return (inst & 0x03ffffff) << 2; 1413 1417 case R_MIPS_32: 1414 - r->r_addend = inst; 1415 - break; 1416 - default: 1417 - r->r_addend = (Elf_Addr)(-1); 1418 + return inst; 1418 1419 } 1419 - return 0; 1420 + return (Elf_Addr)(-1); 1420 1421 } 1421 1422 1422 1423 #ifndef EM_RISCV ··· 1427 1444 #define R_LARCH_SUB32 55 1428 1445 #endif 1429 1446 1447 + static void get_rel_type_and_sym(struct elf_info *elf, uint64_t r_info, 1448 + unsigned int *r_type, unsigned int *r_sym) 1449 + { 1450 + typedef struct { 1451 + Elf64_Word r_sym; /* Symbol index */ 1452 + unsigned char r_ssym; /* Special symbol for 2nd relocation */ 1453 + unsigned char r_type3; /* 3rd relocation type */ 1454 + unsigned char r_type2; /* 2nd relocation type */ 1455 + unsigned char r_type; /* 1st relocation type */ 1456 + } Elf64_Mips_R_Info; 1457 + 1458 + bool is_64bit = (elf->hdr->e_ident[EI_CLASS] == ELFCLASS64); 1459 + 1460 + if (elf->hdr->e_machine == EM_MIPS && is_64bit) { 1461 + Elf64_Mips_R_Info *mips64_r_info = (void *)&r_info; 1462 + 1463 + *r_type = mips64_r_info->r_type; 1464 + *r_sym = TO_NATIVE(mips64_r_info->r_sym); 1465 + return; 1466 + } 1467 + 1468 + if (is_64bit) { 1469 + Elf64_Xword r_info64 = r_info; 1470 + 1471 + r_info = TO_NATIVE(r_info64); 1472 + } else { 1473 + Elf32_Word r_info32 = r_info; 1474 + 1475 + r_info = TO_NATIVE(r_info32); 1476 + } 1477 + 1478 + *r_type = ELF_R_TYPE(r_info); 1479 + *r_sym = ELF_R_SYM(r_info); 1480 + } 1481 + 1430 1482 static void section_rela(struct module *mod, struct elf_info *elf, 1431 1483 Elf_Shdr *sechdr) 1432 1484 { 1433 1485 Elf_Rela *rela; 1434 - Elf_Rela r; 1435 - unsigned int r_sym; 1436 1486 unsigned int fsecndx = sechdr->sh_info; 1437 1487 const char *fromsec = sec_name(elf, fsecndx); 1438 1488 Elf_Rela *start = (void *)elf->hdr + sechdr->sh_offset; ··· 1476 1460 return; 1477 1461 1478 1462 for (rela = start; rela < stop; rela++) { 1479 - r.r_offset = TO_NATIVE(rela->r_offset); 1480 - #if KERNEL_ELFCLASS == ELFCLASS64 1481 - if (elf->hdr->e_machine == EM_MIPS) { 1482 - unsigned int r_typ; 1483 - r_sym = ELF64_MIPS_R_SYM(rela->r_info); 1484 - r_sym = TO_NATIVE(r_sym); 1485 - r_typ = ELF64_MIPS_R_TYPE(rela->r_info); 1486 - r.r_info = ELF64_R_INFO(r_sym, r_typ); 1487 - } else { 1488 - r.r_info = TO_NATIVE(rela->r_info); 1489 - r_sym = ELF_R_SYM(r.r_info); 1490 - } 1491 - #else 1492 - r.r_info = TO_NATIVE(rela->r_info); 1493 - r_sym = ELF_R_SYM(r.r_info); 1494 - #endif 1495 - r.r_addend = TO_NATIVE(rela->r_addend); 1463 + Elf_Addr taddr, r_offset; 1464 + unsigned int r_type, r_sym; 1465 + 1466 + r_offset = TO_NATIVE(rela->r_offset); 1467 + get_rel_type_and_sym(elf, rela->r_info, &r_type, &r_sym); 1468 + 1469 + taddr = TO_NATIVE(rela->r_addend); 1470 + 1496 1471 switch (elf->hdr->e_machine) { 1497 1472 case EM_RISCV: 1498 1473 if (!strcmp("__ex_table", fromsec) && 1499 - ELF_R_TYPE(r.r_info) == R_RISCV_SUB32) 1474 + r_type == R_RISCV_SUB32) 1500 1475 continue; 1501 1476 break; 1502 1477 case EM_LOONGARCH: 1503 1478 if (!strcmp("__ex_table", fromsec) && 1504 - ELF_R_TYPE(r.r_info) == R_LARCH_SUB32) 1479 + r_type == R_LARCH_SUB32) 1505 1480 continue; 1506 1481 break; 1507 1482 } 1508 1483 1509 1484 check_section_mismatch(mod, elf, elf->symtab_start + r_sym, 1510 - fsecndx, fromsec, r.r_offset, r.r_addend); 1485 + fsecndx, fromsec, r_offset, taddr); 1511 1486 } 1512 1487 } 1513 1488 ··· 1506 1499 Elf_Shdr *sechdr) 1507 1500 { 1508 1501 Elf_Rel *rel; 1509 - Elf_Rela r; 1510 - unsigned int r_sym; 1511 1502 unsigned int fsecndx = sechdr->sh_info; 1512 1503 const char *fromsec = sec_name(elf, fsecndx); 1513 1504 Elf_Rel *start = (void *)elf->hdr + sechdr->sh_offset; ··· 1517 1512 1518 1513 for (rel = start; rel < stop; rel++) { 1519 1514 Elf_Sym *tsym; 1515 + Elf_Addr taddr = 0, r_offset; 1516 + unsigned int r_type, r_sym; 1520 1517 void *loc; 1521 1518 1522 - r.r_offset = TO_NATIVE(rel->r_offset); 1523 - #if KERNEL_ELFCLASS == ELFCLASS64 1524 - if (elf->hdr->e_machine == EM_MIPS) { 1525 - unsigned int r_typ; 1526 - r_sym = ELF64_MIPS_R_SYM(rel->r_info); 1527 - r_sym = TO_NATIVE(r_sym); 1528 - r_typ = ELF64_MIPS_R_TYPE(rel->r_info); 1529 - r.r_info = ELF64_R_INFO(r_sym, r_typ); 1530 - } else { 1531 - r.r_info = TO_NATIVE(rel->r_info); 1532 - r_sym = ELF_R_SYM(r.r_info); 1533 - } 1534 - #else 1535 - r.r_info = TO_NATIVE(rel->r_info); 1536 - r_sym = ELF_R_SYM(r.r_info); 1537 - #endif 1538 - r.r_addend = 0; 1519 + r_offset = TO_NATIVE(rel->r_offset); 1520 + get_rel_type_and_sym(elf, rel->r_info, &r_type, &r_sym); 1539 1521 1540 - loc = sym_get_data_by_offset(elf, fsecndx, r.r_offset); 1522 + loc = sym_get_data_by_offset(elf, fsecndx, r_offset); 1541 1523 tsym = elf->symtab_start + r_sym; 1542 1524 1543 1525 switch (elf->hdr->e_machine) { 1544 1526 case EM_386: 1545 - addend_386_rel(loc, &r); 1527 + taddr = addend_386_rel(loc, r_type); 1546 1528 break; 1547 1529 case EM_ARM: 1548 - addend_arm_rel(loc, tsym, &r); 1530 + taddr = addend_arm_rel(loc, tsym, r_type); 1549 1531 break; 1550 1532 case EM_MIPS: 1551 - addend_mips_rel(loc, &r); 1533 + taddr = addend_mips_rel(loc, r_type); 1552 1534 break; 1553 1535 default: 1554 1536 fatal("Please add code to calculate addend for this architecture\n"); 1555 1537 } 1556 1538 1557 1539 check_section_mismatch(mod, elf, tsym, 1558 - fsecndx, fromsec, r.r_offset, r.r_addend); 1540 + fsecndx, fromsec, r_offset, taddr); 1559 1541 } 1560 1542 } 1561 1543 ··· 2264 2272 LIST_HEAD(dump_lists); 2265 2273 struct dump_list *dl, *dl2; 2266 2274 2267 - while ((opt = getopt(argc, argv, "ei:mnT:to:au:WwENd:")) != -1) { 2275 + while ((opt = getopt(argc, argv, "ei:MmnT:to:au:WwENd:")) != -1) { 2268 2276 switch (opt) { 2269 2277 case 'e': 2270 2278 external_module = true; ··· 2273 2281 dl = NOFAIL(malloc(sizeof(*dl))); 2274 2282 dl->file = optarg; 2275 2283 list_add_tail(&dl->list, &dump_lists); 2284 + break; 2285 + case 'M': 2286 + module_enabled = true; 2276 2287 break; 2277 2288 case 'm': 2278 2289 modversions = true;
-22
scripts/mod/modpost.h
··· 50 50 #define ELF_R_TYPE ELF64_R_TYPE 51 51 #endif 52 52 53 - /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */ 54 - typedef struct 55 - { 56 - Elf32_Word r_sym; /* Symbol index */ 57 - unsigned char r_ssym; /* Special symbol for 2nd relocation */ 58 - unsigned char r_type3; /* 3rd relocation type */ 59 - unsigned char r_type2; /* 2nd relocation type */ 60 - unsigned char r_type1; /* 1st relocation type */ 61 - } _Elf64_Mips_R_Info; 62 - 63 - typedef union 64 - { 65 - Elf64_Xword r_info_number; 66 - _Elf64_Mips_R_Info r_info_fields; 67 - } _Elf64_Mips_R_Info_union; 68 - 69 - #define ELF64_MIPS_R_SYM(i) \ 70 - ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) 71 - 72 - #define ELF64_MIPS_R_TYPE(i) \ 73 - ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_type1) 74 - 75 53 #if KERNEL_ELFDATA != HOST_ELFDATA 76 54 77 55 static inline void __endian(const void *src, void *dest, unsigned int size)
+1 -28
scripts/package/builddeb
··· 162 162 163 163 rm -rf $pdir 164 164 165 - ( 166 - cd $srctree 167 - find . arch/$SRCARCH -maxdepth 1 -name Makefile\* 168 - find include scripts -type f -o -type l 169 - find arch/$SRCARCH -name Kbuild.platforms -o -name Platform 170 - find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f 171 - ) > debian/hdrsrcfiles 172 - 173 - { 174 - if is_enabled CONFIG_OBJTOOL; then 175 - echo tools/objtool/objtool 176 - fi 177 - 178 - find arch/$SRCARCH/include Module.symvers include scripts -type f 179 - 180 - if is_enabled CONFIG_GCC_PLUGINS; then 181 - find scripts/gcc-plugins -name \*.so 182 - fi 183 - } > debian/hdrobjfiles 184 - 185 - destdir=$pdir/usr/src/linux-headers-$version 186 - mkdir -p $destdir 187 - tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir 188 - tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir 189 - rm -f debian/hdrsrcfiles debian/hdrobjfiles 190 - 191 - # copy .config manually to be where it's expected to be 192 - cp $KCONFIG_CONFIG $destdir/.config 165 + "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" 193 166 194 167 mkdir -p $pdir/lib/modules/$version/ 195 168 ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
+33
scripts/package/debian/rules
··· 1 + #!/usr/bin/make -f 2 + # SPDX-License-Identifier: GPL-2.0-only 3 + 4 + include debian/rules.vars 5 + 6 + srctree ?= . 7 + 8 + ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))) 9 + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) 10 + MAKEFLAGS += -j$(NUMJOBS) 11 + endif 12 + 13 + .PHONY: binary binary-indep binary-arch 14 + binary: binary-arch binary-indep 15 + binary-indep: build-indep 16 + binary-arch: build-arch 17 + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ 18 + KERNELRELEASE=$(KERNELRELEASE) \ 19 + run-command KBUILD_RUN_COMMAND=+$(srctree)/scripts/package/builddeb 20 + 21 + .PHONY: build build-indep build-arch 22 + build: build-arch build-indep 23 + build-indep: 24 + build-arch: 25 + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) \ 26 + KERNELRELEASE=$(KERNELRELEASE) \ 27 + $(shell $(srctree)/scripts/package/deb-build-option) \ 28 + olddefconfig all 29 + 30 + .PHONY: clean 31 + clean: 32 + rm -rf debian/files debian/linux-* 33 + $(MAKE) -f $(srctree)/Makefile ARCH=$(ARCH) clean
+39
scripts/package/install-extmod-build
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0-only 3 + 4 + set -e 5 + 6 + destdir=${1} 7 + 8 + test -n "${srctree}" 9 + test -n "${SRCARCH}" 10 + 11 + is_enabled() { 12 + grep -q "^$1=y" include/config/auto.conf 13 + } 14 + 15 + mkdir -p "${destdir}" 16 + 17 + ( 18 + cd "${srctree}" 19 + echo Makefile 20 + find "arch/${SRCARCH}" -maxdepth 1 -name 'Makefile*' 21 + find include scripts -type f -o -type l 22 + find "arch/${SRCARCH}" -name Kbuild.platforms -o -name Platform 23 + find "$(find "arch/${SRCARCH}" -name include -o -name scripts -type d)" -type f 24 + ) | tar -c -f - -C "${srctree}" -T - | tar -xf - -C "${destdir}" 25 + 26 + { 27 + if is_enabled CONFIG_OBJTOOL; then 28 + echo tools/objtool/objtool 29 + fi 30 + 31 + find "arch/${SRCARCH}/include" Module.symvers include scripts -type f 32 + 33 + if is_enabled CONFIG_GCC_PLUGINS; then 34 + find scripts/gcc-plugins -name '*.so' 35 + fi 36 + } | tar -c -f - -T - | tar -xf - -C "${destdir}" 37 + 38 + # copy .config manually to be where it's expected to be 39 + cp "${KCONFIG_CONFIG}" "${destdir}/.config"
+117
scripts/package/kernel.spec
··· 1 + # _arch is undefined if /usr/lib/rpm/platform/*/macros was not included. 2 + %{!?_arch: %define _arch dummy} 3 + %{!?make: %define make make} 4 + %define makeflags %{?_smp_mflags} ARCH=%{ARCH} 5 + %define __spec_install_post /usr/lib/rpm/brp-compress || : 6 + %define debug_package %{nil} 7 + 8 + Name: kernel 9 + Summary: The Linux Kernel 10 + Version: %(echo %{KERNELRELEASE} | sed -e 's/-/_/g') 11 + Release: %{pkg_release} 12 + License: GPL 13 + Group: System Environment/Kernel 14 + Vendor: The Linux Community 15 + URL: https://www.kernel.org 16 + Source0: linux.tar.gz 17 + Source1: config 18 + Source2: diff.patch 19 + Provides: kernel-%{KERNELRELEASE} 20 + BuildRequires: bc binutils bison dwarves 21 + BuildRequires: (elfutils-libelf-devel or libelf-devel) flex 22 + BuildRequires: gcc make openssl openssl-devel perl python3 rsync 23 + 24 + %description 25 + The Linux Kernel, the operating system core itself 26 + 27 + %package headers 28 + Summary: Header files for the Linux kernel for use by glibc 29 + Group: Development/System 30 + Obsoletes: kernel-headers 31 + Provides: kernel-headers = %{version} 32 + %description headers 33 + Kernel-headers includes the C header files that specify the interface 34 + between the Linux kernel and userspace libraries and programs. The 35 + header files define structures and constants that are needed for 36 + building most standard programs and are also needed for rebuilding the 37 + glibc package. 38 + 39 + %if %{with_devel} 40 + %package devel 41 + Summary: Development package for building kernel modules to match the %{version} kernel 42 + Group: System Environment/Kernel 43 + AutoReqProv: no 44 + %description -n kernel-devel 45 + This package provides kernel headers and makefiles sufficient to build modules 46 + against the %{version} kernel package. 47 + %endif 48 + 49 + %prep 50 + %setup -q -n linux 51 + cp %{SOURCE1} .config 52 + patch -p1 < %{SOURCE2} 53 + 54 + %build 55 + %{make} %{makeflags} KERNELRELEASE=%{KERNELRELEASE} KBUILD_BUILD_VERSION=%{release} 56 + 57 + %install 58 + mkdir -p %{buildroot}/boot 59 + %ifarch ia64 60 + mkdir -p %{buildroot}/boot/efi 61 + cp $(%{make} %{makeflags} -s image_name) %{buildroot}/boot/efi/vmlinuz-%{KERNELRELEASE} 62 + ln -s efi/vmlinuz-%{KERNELRELEASE} %{buildroot}/boot/ 63 + %else 64 + cp $(%{make} %{makeflags} -s image_name) %{buildroot}/boot/vmlinuz-%{KERNELRELEASE} 65 + %endif 66 + %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} modules_install 67 + %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install 68 + cp System.map %{buildroot}/boot/System.map-%{KERNELRELEASE} 69 + cp .config %{buildroot}/boot/config-%{KERNELRELEASE} 70 + ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEASE}/build 71 + ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEASE}/source 72 + %if %{with_devel} 73 + %{make} %{makeflags} run-command KBUILD_RUN_COMMAND='${srctree}/scripts/package/install-extmod-build %{buildroot}/usr/src/kernels/%{KERNELRELEASE}' 74 + %endif 75 + 76 + %clean 77 + rm -rf %{buildroot} 78 + 79 + %post 80 + if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KERNELRELEASE} -a -r /boot/System.map-%{KERNELRELEASE} ]; then 81 + cp /boot/vmlinuz-%{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm 82 + cp /boot/System.map-%{KERNELRELEASE} /boot/.System.map-%{KERNELRELEASE}-rpm 83 + rm -f /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE} 84 + /sbin/installkernel %{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm 85 + rm -f /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm 86 + fi 87 + 88 + %preun 89 + if [ -x /sbin/new-kernel-pkg ]; then 90 + new-kernel-pkg --remove %{KERNELRELEASE} --rminitrd --initrdfile=/boot/initramfs-%{KERNELRELEASE}.img 91 + elif [ -x /usr/bin/kernel-install ]; then 92 + kernel-install remove %{KERNELRELEASE} 93 + fi 94 + 95 + %postun 96 + if [ -x /sbin/update-bootloader ]; then 97 + /sbin/update-bootloader --remove %{KERNELRELEASE} 98 + fi 99 + 100 + %files 101 + %defattr (-, root, root) 102 + /lib/modules/%{KERNELRELEASE} 103 + %exclude /lib/modules/%{KERNELRELEASE}/build 104 + %exclude /lib/modules/%{KERNELRELEASE}/source 105 + /boot/* 106 + 107 + %files headers 108 + %defattr (-, root, root) 109 + /usr/include 110 + 111 + %if %{with_devel} 112 + %files devel 113 + %defattr (-, root, root) 114 + /usr/src/kernels/%{KERNELRELEASE} 115 + /lib/modules/%{KERNELRELEASE}/build 116 + /lib/modules/%{KERNELRELEASE}/source 117 + %endif
+5 -28
scripts/package/mkdebian
··· 263 263 EOF 264 264 fi 265 265 266 - cat <<EOF > debian/rules 267 - #!$(command -v $MAKE) -f 268 - 269 - srctree ?= . 270 - KERNELRELEASE = ${KERNELRELEASE} 271 - 272 - .PHONY: clean build build-arch build-indep binary binary-arch binary-indep 273 - 274 - build-indep: 275 - build-arch: 276 - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \ 277 - KERNELRELEASE=\$(KERNELRELEASE) \ 278 - \$(shell \$(srctree)/scripts/package/deb-build-option) \ 279 - olddefconfig all 280 - 281 - build: build-arch 282 - 283 - binary-indep: 284 - binary-arch: build-arch 285 - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} \ 286 - KERNELRELEASE=\$(KERNELRELEASE) intdeb-pkg 287 - 288 - clean: 289 - rm -rf debian/files debian/linux-* 290 - \$(MAKE) -f \$(srctree)/Makefile ARCH=${ARCH} clean 291 - 292 - binary: binary-arch 266 + cat <<EOF > debian/rules.vars 267 + ARCH := ${ARCH} 268 + KERNELRELEASE := ${KERNELRELEASE} 293 269 EOF 294 - chmod +x debian/rules 270 + 271 + cp "${srctree}/scripts/package/debian/rules" debian/ 295 272 296 273 exit 0
+8 -140
scripts/package/mkspec
··· 9 9 # Patched for non-x86 by Opencon (L) 2002 <opencon@rio.skydome.net> 10 10 # 11 11 12 - # how we were called determines which rpms we build and how we build them 13 - if [ "$1" = prebuilt ]; then 14 - S=DEL 15 - MAKE="$MAKE -f $srctree/Makefile" 16 - else 17 - S= 18 - 19 - mkdir -p rpmbuild/SOURCES 20 - cp linux.tar.gz rpmbuild/SOURCES 21 - cp "${KCONFIG_CONFIG}" rpmbuild/SOURCES/config 22 - "${srctree}/scripts/package/gen-diff-patch" rpmbuild/SOURCES/diff.patch 23 - fi 24 - 25 12 if grep -q CONFIG_MODULES=y include/config/auto.conf; then 26 - M= 13 + echo '%define with_devel %{?_without_devel: 0} %{?!_without_devel: 1}' 27 14 else 28 - M=DEL 15 + echo '%define with_devel 0' 29 16 fi 30 17 31 - __KERNELRELEASE=$(echo $KERNELRELEASE | sed -e "s/-/_/g") 32 - EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \ 33 - --exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \ 34 - --exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s" 35 - 36 - # We can label the here-doc lines for conditional output to the spec file 37 - # 38 - # Labels: 39 - # $S: this line is enabled only when building source package 40 - # $M: this line is enabled only when CONFIG_MODULES is enabled 41 - sed -e '/^DEL/d' -e 's/^\t*//' <<EOF 42 - Name: kernel 43 - Summary: The Linux Kernel 44 - Version: $__KERNELRELEASE 45 - Release: $(cat .version 2>/dev/null || echo 1) 46 - License: GPL 47 - Group: System Environment/Kernel 48 - Vendor: The Linux Community 49 - URL: https://www.kernel.org 50 - $S Source0: linux.tar.gz 51 - $S Source1: config 52 - $S Source2: diff.patch 53 - Provides: kernel-$KERNELRELEASE 54 - $S BuildRequires: bc binutils bison dwarves 55 - $S BuildRequires: (elfutils-libelf-devel or libelf-devel) flex 56 - $S BuildRequires: gcc make openssl openssl-devel perl python3 rsync 57 - 58 - # $UTS_MACHINE as a fallback of _arch in case 59 - # /usr/lib/rpm/platform/*/macros was not included. 60 - %define _arch %{?_arch:$UTS_MACHINE} 61 - %define __spec_install_post /usr/lib/rpm/brp-compress || : 62 - %define debug_package %{nil} 63 - 64 - %description 65 - The Linux Kernel, the operating system core itself 66 - 67 - %package headers 68 - Summary: Header files for the Linux kernel for use by glibc 69 - Group: Development/System 70 - Obsoletes: kernel-headers 71 - Provides: kernel-headers = %{version} 72 - %description headers 73 - Kernel-headers includes the C header files that specify the interface 74 - between the Linux kernel and userspace libraries and programs. The 75 - header files define structures and constants that are needed for 76 - building most standard programs and are also needed for rebuilding the 77 - glibc package. 78 - 79 - $S$M %package devel 80 - $S$M Summary: Development package for building kernel modules to match the $__KERNELRELEASE kernel 81 - $S$M Group: System Environment/Kernel 82 - $S$M AutoReqProv: no 83 - $S$M %description -n kernel-devel 84 - $S$M This package provides kernel headers and makefiles sufficient to build modules 85 - $S$M against the $__KERNELRELEASE kernel package. 86 - $S$M 87 - $S %prep 88 - $S %setup -q -n linux 89 - $S cp %{SOURCE1} .config 90 - $S patch -p1 < %{SOURCE2} 91 - $S 92 - $S %build 93 - $S $MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release} 94 - $S 95 - %install 96 - mkdir -p %{buildroot}/boot 97 - %ifarch ia64 98 - mkdir -p %{buildroot}/boot/efi 99 - cp \$($MAKE -s image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE 100 - ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ 101 - %else 102 - cp \$($MAKE -s image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE 103 - %endif 104 - $M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install 105 - $MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install 106 - cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE 107 - cp .config %{buildroot}/boot/config-$KERNELRELEASE 108 - $S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build 109 - $S$M rm -f %{buildroot}/lib/modules/$KERNELRELEASE/source 110 - $S$M mkdir -p %{buildroot}/usr/src/kernels/$KERNELRELEASE 111 - $S$M tar cf - $EXCLUDES . | tar xf - -C %{buildroot}/usr/src/kernels/$KERNELRELEASE 112 - $S$M cd %{buildroot}/lib/modules/$KERNELRELEASE 113 - $S$M ln -sf /usr/src/kernels/$KERNELRELEASE build 114 - $S$M ln -sf /usr/src/kernels/$KERNELRELEASE source 115 - 116 - %clean 117 - rm -rf %{buildroot} 118 - 119 - %post 120 - if [ -x /sbin/installkernel -a -r /boot/vmlinuz-$KERNELRELEASE -a -r /boot/System.map-$KERNELRELEASE ]; then 121 - cp /boot/vmlinuz-$KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm 122 - cp /boot/System.map-$KERNELRELEASE /boot/.System.map-$KERNELRELEASE-rpm 123 - rm -f /boot/vmlinuz-$KERNELRELEASE /boot/System.map-$KERNELRELEASE 124 - /sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm 125 - rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm 126 - fi 127 - 128 - %preun 129 - if [ -x /sbin/new-kernel-pkg ]; then 130 - new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img 131 - elif [ -x /usr/bin/kernel-install ]; then 132 - kernel-install remove $KERNELRELEASE 133 - fi 134 - 135 - %postun 136 - if [ -x /sbin/update-bootloader ]; then 137 - /sbin/update-bootloader --remove $KERNELRELEASE 138 - fi 139 - 140 - %files 141 - %defattr (-, root, root) 142 - $M /lib/modules/$KERNELRELEASE 143 - $M %exclude /lib/modules/$KERNELRELEASE/build 144 - $M %exclude /lib/modules/$KERNELRELEASE/source 145 - /boot/* 146 - 147 - %files headers 148 - %defattr (-, root, root) 149 - /usr/include 150 - $S$M 151 - $S$M %files devel 152 - $S$M %defattr (-, root, root) 153 - $S$M /usr/src/kernels/$KERNELRELEASE 154 - $S$M /lib/modules/$KERNELRELEASE/build 155 - $S$M /lib/modules/$KERNELRELEASE/source 18 + cat<<EOF 19 + %define ARCH ${ARCH} 20 + %define KERNELRELEASE ${KERNELRELEASE} 21 + %define pkg_release $("${srctree}/init/build-version") 156 22 EOF 23 + 24 + cat "${srctree}/scripts/package/kernel.spec"
+2
scripts/remove-stale-files
··· 37 37 rm -rf include/ksym 38 38 39 39 find . -name '*.usyms' | xargs rm -f 40 + 41 + rm -f binkernel.spec
+27 -11
scripts/setlocalversion
··· 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # 4 4 # This scripts adds local version information from the version 5 - # control systems git, mercurial (hg) and subversion (svn). 5 + # control system git. 6 6 # 7 7 # If something goes wrong, send a mail the kernel build mailinglist 8 8 # (see MAINTAINERS) and CC Nico Schottelius ··· 57 57 return 58 58 fi 59 59 60 - # If a localversion*' file and the corresponding annotated tag exist, 61 - # use it. This is the case in linux-next. 60 + # mainline kernel: 6.2.0-rc5 -> v6.2-rc5 61 + # stable kernel: 6.1.7 -> v6.1.7 62 + version_tag=v$(echo "${KERNELVERSION}" | sed -E 's/^([0-9]+\.[0-9]+)\.0(.*)$/\1\2/') 63 + 64 + # If a localversion* file exists, and the corresponding 65 + # annotated tag exists and is an ancestor of HEAD, use 66 + # it. This is the case in linux-next. 62 67 tag=${file_localversion#-} 63 - tag=$(git describe --exact-match --match=$tag $tag 2>/dev/null) 68 + desc= 69 + if [ -n "${tag}" ]; then 70 + desc=$(git describe --match=$tag 2>/dev/null) 71 + fi 72 + 73 + # Otherwise, if a localversion* file exists, and the tag 74 + # obtained by appending it to the tag derived from 75 + # KERNELVERSION exists and is an ancestor of HEAD, use 76 + # it. This is e.g. the case in linux-rt. 77 + if [ -z "${desc}" ] && [ -n "${file_localversion}" ]; then 78 + tag="${version_tag}${file_localversion}" 79 + desc=$(git describe --match=$tag 2>/dev/null) 80 + fi 64 81 65 82 # Otherwise, default to the annotated tag derived from KERNELVERSION. 66 - # mainline kernel: 6.2.0-rc5 -> v6.2-rc5 67 - # stable kernel: 6.1.7 -> v6.1.7 68 - if [ -z "${tag}" ]; then 69 - tag=v$(echo "${KERNELVERSION}" | sed -E 's/^([0-9]+\.[0-9]+)\.0(.*)$/\1\2/') 83 + if [ -z "${desc}" ]; then 84 + tag="${version_tag}" 85 + desc=$(git describe --match=$tag 2>/dev/null) 70 86 fi 71 87 72 88 # If we are at the tagged commit, we ignore it because the version is 73 89 # well-defined. 74 - if [ -z "$(git describe --exact-match --match=$tag 2>/dev/null)" ]; then 90 + if [ "${tag}" != "${desc}" ]; then 75 91 76 92 # If only the short version is requested, don't bother 77 93 # running further git commands ··· 97 81 fi 98 82 # If we are past the tagged commit, we pretty print it. 99 83 # (like 6.1.0-14595-g292a089d78d3) 100 - if atag="$(git describe --match=$tag 2>/dev/null)"; then 101 - echo "$atag" | awk -F- '{printf("-%05d", $(NF-1))}' 84 + if [ -n "${desc}" ]; then 85 + echo "${desc}" | awk -F- '{printf("-%05d", $(NF-1))}' 102 86 fi 103 87 104 88 # Add -g and exactly 12 hex chars.