linux/scripts
Alexey Gladkov 898490c010 moduleparam: Save information about built-in modules in separate file
Problem:

When a kernel module is compiled as a separate module, some important
information about the kernel module is available via .modinfo section of
the module.  In contrast, when the kernel module is compiled into the
kernel, that information is not available.

Information about built-in modules is necessary in the following cases:

1. When it is necessary to find out what additional parameters can be
passed to the kernel at boot time.

2. When you need to know which module names and their aliases are in
the kernel. This is very useful for creating an initrd image.

Proposal:

The proposed patch does not remove .modinfo section with module
information from the vmlinux at the build time and saves it into a
separate file after kernel linking. So, the kernel does not increase in
size and no additional information remains in it. Information is stored
in the same format as in the separate modules (null-terminated string
array). Because the .modinfo section is already exported with a separate
modules, we are not creating a new API.

It can be easily read in the userspace:

$ tr '\0' '\n' < modules.builtin.modinfo
ext4.softdep=pre: crc32c
ext4.license=GPL
ext4.description=Fourth Extended Filesystem
ext4.author=Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others
ext4.alias=fs-ext4
ext4.alias=ext3
ext4.alias=fs-ext3
ext4.alias=ext2
ext4.alias=fs-ext2
md_mod.alias=block-major-9-*
md_mod.alias=md
md_mod.description=MD RAID framework
md_mod.license=GPL
md_mod.parmtype=create_on_open:bool
md_mod.parmtype=start_dirty_degraded:int
...

Co-Developed-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Signed-off-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Acked-by: Jessica Yu <jeyu@kernel.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-05-07 21:50:24 +09:00
..
atomic locking/atomics: Check atomic headers with sha1sum 2019-02-13 08:07:31 +01:00
basic
coccinelle scripts: coccinelle: Fix description of badty.cocci 2019-03-28 23:46:56 +09:00
dtc of: add dtc annotations functionality to dtx_diff 2019-02-28 11:40:48 -06:00
gcc-plugins increased structleak coverage 2019-03-09 09:06:15 -08:00
gdb kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build 2019-04-02 23:28:04 +09:00
genksyms
kconfig kconfig/[mn]conf: handle backspace (^H) key 2019-03-29 22:48:01 +09:00
ksymoops
mod kbuild: modversions: Fix relative CRC byte order interpretation 2019-03-28 23:46:56 +09:00
package kbuild: deb-pkg: avoid implicit effects 2019-03-17 12:56:23 +09:00
selinux
tracing
.gitignore
adjust_autoksyms.sh kbuild: source include/config/auto.conf instead of ${KCONFIG_CONFIG} 2019-03-14 02:39:11 +09:00
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_helpers_doc.py
cc-can-link.sh
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: add %pt as a valid vsprintf extension 2019-03-29 10:01:37 -07:00
checkstack.pl
checksyscalls.sh checksyscalls: fix up mq_timedreceive and stat exceptions 2019-02-19 21:27:53 +01:00
checkversion.pl
clang-version.sh kbuild: update comment block of scripts/clang-version.sh 2019-03-04 22:34:54 +09:00
cleanfile
cleanpatch
coccicheck
config
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace.sh: handle RIP address with segment 2019-03-05 21:07:13 -08:00
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh kbuild: clean up scripts/gcc-version.sh 2019-03-04 22:35:04 +09:00
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_compile_commands.py
gen_ksymdeps.sh
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
insert-sys-cert.c
kallsyms.c Kbuild updates for v5.1 2019-03-10 17:48:21 -07:00
Kbuild.include kbuild: remove cc-version macro 2019-03-04 22:34:59 +09:00
Kconfig.include kbuild: clean up scripts/gcc-version.sh 2019-03-04 22:35:04 +09:00
kernel-doc
ld-version.sh
leaking_addresses.pl leaking_addresses: Completely remove --version flag 2019-03-07 08:53:18 +11:00
Lindent
link-vmlinux.sh moduleparam: Save information about built-in modules in separate file 2019-05-07 21:50:24 +09:00
Makefile scripts/gdb: do not descend into scripts/gdb from scripts 2019-02-27 21:40:09 +09:00
Makefile.asm-generic kbuild: force all architectures except um to include mandatory-y 2019-03-17 12:56:32 +09:00
Makefile.build kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build 2019-04-02 23:28:04 +09:00
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins gcc-plugins: structleak: Generalize to all variable types 2019-03-04 09:29:41 -08:00
Makefile.headersinst
Makefile.host kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build 2019-04-02 23:28:04 +09:00
Makefile.kasan kasan: remove use after scope bugs detection. 2019-03-05 21:07:13 -08:00
Makefile.kcov
Makefile.lib kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build 2019-04-02 23:28:04 +09:00
Makefile.modbuiltin kbuild: use $(srctree) instead of KBUILD_SRC to check out-of-tree build 2019-04-02 23:28:04 +09:00
Makefile.modinst Revert "modsign: Abort modules_install when signing fails" 2019-03-17 12:56:31 +09:00
Makefile.modpost modpost: make KBUILD_MODPOST_WARN also configurable for external modules 2019-04-11 23:11:51 +09:00
Makefile.modsign
Makefile.ubsan
makelst
markup_oops.pl
mkcompile_h kbuild: remove unnecessary in-subshell execution 2019-01-28 09:11:17 +09:00
mkmakefile kbuild: mkmakefile: generate a simple wrapper of top Makefile 2019-04-02 23:27:38 +09:00
mksysmap
mkuboot.sh
module-common.lds
namespace.pl
objdiff
parse-maintainers.pl
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl scripts: override locale from environment when running recordmcount.pl 2019-05-03 23:05:01 +09:00
setlocalversion
show_delta
sign-file.c
sortextable.c
sortextable.h
spdxcheck-test.sh
spdxcheck.py scripts/spdxcheck.py: fix C++ comment style detection 2019-02-22 08:47:05 -07:00
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2019-03-07 18:31:59 -08:00
sphinx-pre-install
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: fix direct execution of scripts/tags.sh 2019-05-03 23:05:01 +09:00
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh