2020-03-03 13:35:59 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2005-10-18 15:26:15 +00:00
|
|
|
#
|
|
|
|
# NOTE! Don't add files that are generated in specific
|
|
|
|
# subdirectories here. Add them in the ".gitignore" file
|
|
|
|
# in that subdirectory instead.
|
|
|
|
#
|
2022-12-29 07:43:09 +00:00
|
|
|
# NOTE! Please use 'git ls-files -i -c --exclude-per-directory=.gitignore'
|
2008-06-26 07:54:34 +00:00
|
|
|
# command after changing this file, to see if there are
|
|
|
|
# any tracked files which get ignored after the change.
|
|
|
|
#
|
2017-10-30 15:33:45 +00:00
|
|
|
# Normal rules (sorted alphabetically)
|
2005-10-18 15:26:15 +00:00
|
|
|
#
|
|
|
|
.*
|
2017-10-30 15:33:45 +00:00
|
|
|
*.a
|
2018-03-23 13:04:37 +00:00
|
|
|
*.asn1.[ch]
|
2017-10-30 15:33:45 +00:00
|
|
|
*.bin
|
|
|
|
*.bz2
|
|
|
|
*.c.[012]*.*
|
2018-09-06 18:26:07 +00:00
|
|
|
*.dt.yaml
|
2017-10-30 15:33:46 +00:00
|
|
|
*.dtb
|
2021-01-29 07:24:08 +00:00
|
|
|
*.dtbo
|
2017-10-30 15:33:46 +00:00
|
|
|
*.dtb.S
|
2022-11-14 20:59:39 +00:00
|
|
|
*.dtbo.S
|
2017-10-30 15:33:45 +00:00
|
|
|
*.dwo
|
|
|
|
*.elf
|
|
|
|
*.gcno
|
2024-08-06 15:38:07 +00:00
|
|
|
*.gcda
|
2017-10-30 15:33:45 +00:00
|
|
|
*.gz
|
|
|
|
*.i
|
|
|
|
*.ko
|
2018-03-23 13:04:30 +00:00
|
|
|
*.lex.c
|
2017-10-30 15:33:45 +00:00
|
|
|
*.ll
|
|
|
|
*.lst
|
|
|
|
*.lz4
|
|
|
|
*.lzma
|
|
|
|
*.lzo
|
kbuild: create *.mod with full directory path and remove MODVERDIR
While descending directories, Kbuild produces objects for modules,
but do not link final *.ko files; it is done in the modpost.
To keep track of modules, Kbuild creates a *.mod file in $(MODVERDIR)
for every module it is building. Some post-processing steps read the
necessary information from *.mod files. This avoids descending into
directories again. This mechanism was introduced in 2003 or so.
Later, commit 551559e13af1 ("kbuild: implement modules.order") added
modules.order. So, we can simply read it out to know all the modules
with directory paths. This is easier than parsing the first line of
*.mod files.
$(MODVERDIR) has a flat directory structure, that is, *.mod files
are named only with base names. This is based on the assumption that
the module name is unique across the tree. This assumption is really
fragile.
Stephen Rothwell reported a race condition caused by a module name
conflict:
https://lkml.org/lkml/2019/5/13/991
In parallel building, two different threads could write to the same
$(MODVERDIR)/*.mod simultaneously.
Non-unique module names are the source of all kind of troubles, hence
commit 3a48a91901c5 ("kbuild: check uniqueness of module names")
introduced a new checker script.
However, it is still fragile in the build system point of view because
this race happens before scripts/modules-check.sh is invoked. If it
happens again, the modpost will emit unclear error messages.
To fix this issue completely, create *.mod with full directory path
so that two threads never attempt to write to the same file.
$(MODVERDIR) is no longer needed.
Since modules with directory paths are listed in modules.order, Kbuild
is still able to find *.mod files without additional descending.
I also killed cmd_secanalysis; scripts/mod/sumversion.c computes MD4 hash
for modules with MODULE_VERSION(). When CONFIG_DEBUG_SECTION_MISMATCH=y,
it occurs not only in the modpost stage, but also during directory
descending, where sumversion.c may parse stale *.mod files. It would emit
'No such file or directory' warning when an object consisting a module is
renamed, or when a single-obj module is turned into a multi-obj module or
vice versa.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
2019-07-17 06:17:57 +00:00
|
|
|
*.mod
|
2017-10-30 15:33:45 +00:00
|
|
|
*.mod.c
|
2005-10-18 15:26:15 +00:00
|
|
|
*.o
|
2007-07-31 07:37:25 +00:00
|
|
|
*.o.*
|
2017-10-30 15:33:45 +00:00
|
|
|
*.patch
|
2021-07-03 14:42:57 +00:00
|
|
|
*.rmeta
|
2022-12-26 18:54:44 +00:00
|
|
|
*.rpm
|
2021-07-03 14:42:57 +00:00
|
|
|
*.rsi
|
2005-10-18 15:26:15 +00:00
|
|
|
*.s
|
2006-01-05 17:10:52 +00:00
|
|
|
*.so
|
2007-10-19 18:35:02 +00:00
|
|
|
*.so.dbg
|
2017-10-30 15:33:45 +00:00
|
|
|
*.su
|
2006-09-16 19:15:44 +00:00
|
|
|
*.symtypes
|
2018-03-23 13:04:30 +00:00
|
|
|
*.tab.[ch]
|
2015-04-16 19:49:24 +00:00
|
|
|
*.tar
|
2011-02-22 09:48:06 +00:00
|
|
|
*.xz
|
2020-07-30 19:08:40 +00:00
|
|
|
*.zst
|
2014-04-14 06:56:15 +00:00
|
|
|
Module.symvers
|
2024-01-09 12:07:34 +00:00
|
|
|
dtbs-list
|
2019-08-19 04:18:07 +00:00
|
|
|
modules.order
|
2005-10-18 15:26:15 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Top-level generic files
|
|
|
|
#
|
2010-03-13 00:30:23 +00:00
|
|
|
/linux
|
2021-03-25 18:54:09 +00:00
|
|
|
/modules-only.symvers
|
2010-03-13 00:30:23 +00:00
|
|
|
/vmlinux
|
2015-04-24 17:27:40 +00:00
|
|
|
/vmlinux.32
|
2021-03-05 09:27:07 +00:00
|
|
|
/vmlinux.map
|
modpost: generate vmlinux.symvers and reuse it for the second modpost
The full build runs modpost twice, first for vmlinux.o and second for
modules.
The first pass dumps all the vmlinux symbols into Module.symvers, but
the second pass parses vmlinux again instead of reusing the dump file,
presumably because it needs to avoid accumulating stale symbols.
Loading symbol info from a dump file is faster than parsing an ELF object.
Besides, modpost deals with various issues to parse vmlinux in the second
pass.
A solution is to make the first pass dumps symbols into a separate file,
vmlinux.symvers. The second pass reads it, and parses module .o files.
The merged symbol information is dumped into Module.symvers in the same
way as before.
This makes further modpost cleanups possible.
Also, it fixes the problem of 'make vmlinux', which previously overwrote
Module.symvers, throwing away module symbols.
I slightly touched scripts/link-vmlinux.sh so that vmlinux is re-linked
when you cross this commit. Otherwise, vmlinux.symvers would not be
generated.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2020-06-01 05:57:11 +00:00
|
|
|
/vmlinux.symvers
|
2015-02-17 21:47:38 +00:00
|
|
|
/vmlinux-gdb.py
|
2010-03-13 00:30:23 +00:00
|
|
|
/vmlinuz
|
|
|
|
/System.map
|
|
|
|
/Module.markers
|
2021-04-25 06:24:05 +00:00
|
|
|
/modules.builtin
|
2019-04-29 16:11:14 +00:00
|
|
|
/modules.builtin.modinfo
|
kbuild: generate offset range data for builtin modules
Create file module.builtin.ranges that can be used to find where
built-in modules are located by their addresses. This will be useful for
tracing tools to find what functions are for various built-in modules.
The offset range data for builtin modules is generated using:
- modules.builtin: associates object files with module names
- vmlinux.map: provides load order of sections and offset of first member
per section
- vmlinux.o.map: provides offset of object file content per section
- .*.cmd: build cmd file with KBUILD_MODFILE
The generated data will look like:
.text 00000000-00000000 = _text
.text 0000baf0-0000cb10 amd_uncore
.text 0009bd10-0009c8e0 iosf_mbi
...
.text 00b9f080-00ba011a intel_skl_int3472_discrete
.text 00ba0120-00ba03c0 intel_skl_int3472_discrete intel_skl_int3472_tps68470
.text 00ba03c0-00ba08d6 intel_skl_int3472_tps68470
...
.data 00000000-00000000 = _sdata
.data 0000f020-0000f680 amd_uncore
For each ELF section, it lists the offset of the first symbol. This can
be used to determine the base address of the section at runtime.
Next, it lists (in strict ascending order) offset ranges in that section
that cover the symbols of one or more builtin modules. Multiple ranges
can apply to a single module, and ranges can be shared between modules.
The CONFIG_BUILTIN_MODULE_RANGES option controls whether offset range data
is generated for kernel modules that are built into the kernel image.
How it works:
1. The modules.builtin file is parsed to obtain a list of built-in
module names and their associated object names (the .ko file that
the module would be in if it were a loadable module, hereafter
referred to as <kmodfile>). This object name can be used to
identify objects in the kernel compile because any C or assembler
code that ends up into a built-in module will have the option
-DKBUILD_MODFILE=<kmodfile> present in its build command, and those
can be found in the .<obj>.cmd file in the kernel build tree.
If an object is part of multiple modules, they will all be listed
in the KBUILD_MODFILE option argument.
This allows us to conclusively determine whether an object in the
kernel build belong to any modules, and which.
2. The vmlinux.map is parsed next to determine the base address of each
top level section so that all addresses into the section can be
turned into offsets. This makes it possible to handle sections
getting loaded at different addresses at system boot.
We also determine an 'anchor' symbol at the beginning of each
section to make it possible to calculate the true base address of
a section at runtime (i.e. symbol address - symbol offset).
We collect start addresses of sections that are included in the top
level section. This is used when vmlinux is linked using vmlinux.o,
because in that case, we need to look at the vmlinux.o linker map to
know what object a symbol is found in.
And finally, we process each symbol that is listed in vmlinux.map
(or vmlinux.o.map) based on the following structure:
vmlinux linked from vmlinux.a:
vmlinux.map:
<top level section>
<included section> -- might be same as top level section)
<object> -- built-in association known
<symbol> -- belongs to module(s) object belongs to
...
vmlinux linked from vmlinux.o:
vmlinux.map:
<top level section>
<included section> -- might be same as top level section)
vmlinux.o -- need to use vmlinux.o.map
<symbol> -- ignored
...
vmlinux.o.map:
<section>
<object> -- built-in association known
<symbol> -- belongs to module(s) object belongs to
...
3. As sections, objects, and symbols are processed, offset ranges are
constructed in a straight-forward way:
- If the symbol belongs to one or more built-in modules:
- If we were working on the same module(s), extend the range
to include this object
- If we were working on another module(s), close that range,
and start the new one
- If the symbol does not belong to any built-in modules:
- If we were working on a module(s) range, close that range
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Alan Maguire <alan.maguire@oracle.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Tested-by: Sam James <sam@gentoo.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Tested-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2024-09-06 14:45:03 +00:00
|
|
|
/modules.builtin.ranges
|
2019-10-29 12:38:07 +00:00
|
|
|
/modules.nsdeps
|
2010-03-13 00:30:23 +00:00
|
|
|
|
2017-09-30 01:10:10 +00:00
|
|
|
#
|
|
|
|
# RPM spec file (make rpm-pkg)
|
|
|
|
#
|
2023-03-15 15:50:17 +00:00
|
|
|
/rpmbuild/
|
2017-09-30 01:10:10 +00:00
|
|
|
|
2011-06-30 23:42:50 +00:00
|
|
|
#
|
|
|
|
# Debian directory (make deb-pkg)
|
|
|
|
#
|
|
|
|
/debian/
|
|
|
|
|
scripts/package: snap-pkg target
Following in footsteps of other targets like 'deb-pkg, 'rpm-pkg' and 'tar-pkg',
this patch adds a 'snap-pkg' target for the creation of a Linux kernel snap
package using the kbuild infrastructure.
A snap, in its general form, is a self contained, sandboxed, universal package
and it is intended to work across multiple distributions and/or devices. A snap
package is distributed as a single compressed squashfs filesystem.
A kernel snap is a snap package carrying the Linux kernel, kernel modules,
accessory files (DTBs, System.map, etc) and a manifesto file. The purpose of a
kernel snap is to carry the Linux kernel during the creation of a system image,
eg. Ubuntu Core, and its subsequent upgrades.
For more information on snap packages: https://snapcraft.io/docs/
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2017-11-27 11:07:34 +00:00
|
|
|
#
|
|
|
|
# Snap directory (make snap-pkg)
|
|
|
|
#
|
|
|
|
/snap/
|
|
|
|
|
2015-02-12 23:01:19 +00:00
|
|
|
#
|
|
|
|
# tar directory (make tar*-pkg)
|
|
|
|
#
|
|
|
|
/tar-install/
|
|
|
|
|
2024-07-20 09:18:12 +00:00
|
|
|
#
|
|
|
|
# pacman files (make pacman-pkg)
|
|
|
|
#
|
|
|
|
/PKGBUILD
|
|
|
|
/pacman/
|
|
|
|
|
2010-03-13 00:30:23 +00:00
|
|
|
#
|
2019-05-11 03:13:54 +00:00
|
|
|
# We don't want to ignore the following even if they are dot-files
|
2010-03-13 00:30:23 +00:00
|
|
|
#
|
2019-05-11 03:13:54 +00:00
|
|
|
!.clang-format
|
2024-09-04 20:43:39 +00:00
|
|
|
!.clippy.toml
|
2019-05-11 03:13:54 +00:00
|
|
|
!.cocciconfig
|
Add .editorconfig file for basic formatting
EditorConfig is a specification to define the most basic code formatting
stuff, and it's supported by many editors and IDEs, either directly or
via plugins, including VSCode/VSCodium, Vim, emacs and more.
It allows to define formatting style related to indentation, charset,
end of lines and trailing whitespaces. It also allows to apply different
formats for different files based on wildcards, so for example it is
possible to apply different configs to *.{c,h}, *.py and *.rs.
In linux project, defining a .editorconfig might help to those people
that work on different projects with different indentation styles, so
they cannot define a global style. Now they will directly see the
correct indentation on every fresh clone of the project.
See https://editorconfig.org
Co-developed-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Íñigo Huguet <ihuguet@redhat.com>
Acked-by: Mickaël Salaün <mic@digikod.net>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Tested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-01 07:53:33 +00:00
|
|
|
!.editorconfig
|
2019-05-11 03:13:54 +00:00
|
|
|
!.get_maintainer.ignore
|
|
|
|
!.gitattributes
|
2007-10-16 07:22:21 +00:00
|
|
|
!.gitignore
|
2023-01-27 14:57:08 +00:00
|
|
|
!.kunitconfig
|
2008-06-26 07:54:34 +00:00
|
|
|
!.mailmap
|
2022-08-04 10:54:09 +00:00
|
|
|
!.rustfmt.toml
|
2005-10-18 15:26:15 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Generated include files
|
|
|
|
#
|
2019-04-29 15:17:53 +00:00
|
|
|
/include/config/
|
|
|
|
/include/generated/
|
|
|
|
/arch/*/include/generated/
|
2005-10-18 15:26:15 +00:00
|
|
|
|
2006-02-27 03:07:24 +00:00
|
|
|
# stgit generated dirs
|
|
|
|
patches-*
|
2006-07-17 05:37:06 +00:00
|
|
|
|
|
|
|
# quilt's files
|
|
|
|
patches
|
|
|
|
series
|
2006-12-22 09:07:32 +00:00
|
|
|
|
2021-04-25 06:24:04 +00:00
|
|
|
# ctags files
|
|
|
|
tags
|
2024-11-25 08:37:36 +00:00
|
|
|
!tags/
|
2021-04-25 06:24:04 +00:00
|
|
|
TAGS
|
|
|
|
|
2006-12-22 09:07:32 +00:00
|
|
|
# cscope files
|
|
|
|
cscope.*
|
2008-05-22 01:23:10 +00:00
|
|
|
ncscope.*
|
2007-07-16 06:41:52 +00:00
|
|
|
|
2009-06-11 09:21:47 +00:00
|
|
|
# gnu global files
|
|
|
|
GPATH
|
|
|
|
GRTAGS
|
|
|
|
GSYMS
|
|
|
|
GTAGS
|
|
|
|
|
2015-04-16 21:02:41 +00:00
|
|
|
# id-utils files
|
|
|
|
ID
|
|
|
|
|
2008-03-04 22:28:59 +00:00
|
|
|
*~
|
|
|
|
\#*#
|
2012-09-26 09:09:50 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Leavings from module signing
|
|
|
|
#
|
|
|
|
extra_certificates
|
2015-07-20 20:16:30 +00:00
|
|
|
signing_key.pem
|
2012-09-26 09:09:50 +00:00
|
|
|
signing_key.priv
|
|
|
|
signing_key.x509
|
|
|
|
x509.genkey
|
2014-02-10 22:25:45 +00:00
|
|
|
|
|
|
|
# Kconfig presets
|
2019-05-07 12:48:46 +00:00
|
|
|
/all.config
|
|
|
|
/alldef.config
|
|
|
|
/allmod.config
|
|
|
|
/allno.config
|
|
|
|
/allrandom.config
|
|
|
|
/allyes.config
|
2014-11-25 16:42:54 +00:00
|
|
|
|
2020-07-02 11:12:00 +00:00
|
|
|
# Kconfig savedefconfig output
|
|
|
|
/defconfig
|
|
|
|
|
2014-11-25 16:42:54 +00:00
|
|
|
# Kdevelop4
|
|
|
|
*.kdev4
|
2019-07-24 00:22:33 +00:00
|
|
|
|
|
|
|
# Clang's compilation database file
|
|
|
|
/compile_commands.json
|
2020-09-09 14:10:32 +00:00
|
|
|
|
|
|
|
# Documentation toolchain
|
|
|
|
sphinx_*/
|
2021-07-03 15:26:15 +00:00
|
|
|
|
|
|
|
# Rust analyzer configuration
|
|
|
|
/rust-project.json
|