History

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

Pull Kbuild updates from Masahiro Yamada: - detect missing include guard in UAPI headers - do not create orphan built-in.a or obj-y objects - generate modules.builtin more simply, and drop tristate.conf - simplify built-in initramfs creation - make linux-headers deb package thinner - optimize the deb package build script - misc cleanups * tag 'kbuild-v5.6' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (34 commits) builddeb: split libc headers deployment out into a function builddeb: split kernel headers deployment out into a function builddeb: remove redundant make for ARCH=um builddeb: avoid invoking sub-shells where possible builddeb: remove redundant $objtree/ builddeb: match temporary directory name to the package name builddeb: remove unneeded files in hdrobjfiles for headers package kbuild: use -S instead of -E for precise cc-option test in Kconfig builddeb: allow selection of .deb compressor kbuild: remove 'Building modules, stage 2.' log kbuild: remove *.tmp file when filechk fails kbuild: remove PYTHON2 variable modpost: assume STT_SPARC_REGISTER is defined gen_initramfs.sh: remove intermediate cpio_list on errors initramfs: refactor the initramfs build rules gen_initramfs.sh: always output cpio even without -o option initramfs: add default_cpio_list, and delete -d option support initramfs: generate dependency list and cpio at the same time initramfs: specify $(src)/gen_initramfs.sh as a prerequisite in Makefile initramfs: make initramfs compression choice non-optional ...

Linus Torvalds committed 6 years ago

Commit 368d0602 parents acd7750 451dff320 files · +281 −449Browse files

Unified · Split

20 files
  1. Documentation/kbuild/kconfig.rst +0 −5
  2. Makefile +6 −18
  3. include/linux/module.h +11 −1
  4. scripts/Kbuild.include +11 −14
  5. scripts/Kconfig.include +1 −1
  6. scripts/Makefile.build +2 −2
  7. scripts/Makefile.lib +14 −7
  8. scripts/Makefile.modbuiltin +0 −57
  9. scripts/Makefile.modpost +0 −1
  10. scripts/kconfig/confdata.c +2 −43
  11. scripts/link-vmlinux.sh +4 −0
  12. scripts/mod/modpost.c +1 −7
  13. scripts/package/builddeb +63 −43
  14. usr/.gitignore +1 −7
  15. usr/Kconfig +0 −26
  16. usr/Makefile +61 −36
  17. usr/default_cpio_list +6 −0
  18. usr/gen_initramfs.sh +43 −124
  19. usr/include/Makefile +54 −53
  20. usr/initramfs_data.S +1 −4
Documentation/kbuild/kconfig.rst+0−5
@@ -154,11 +154,6 @@ KCONFIG_AUTOCONFIG · 153 unmodified lines
154This environment variable can be set to specify the path & name of the154This environment variable can be set to specify the path & name of the
155"auto.conf" file. Its default value is "include/config/auto.conf".155"auto.conf" file. Its default value is "include/config/auto.conf".
156 156
157KCONFIG_TRISTATE
158----------------
159This environment variable can be set to specify the path & name of the
160"tristate.conf" file. Its default value is "include/config/tristate.conf".
161
162KCONFIG_AUTOHEADER157KCONFIG_AUTOHEADER
163------------------158------------------
164This environment variable can be set to specify the path & name of the159This environment variable can be set to specify the path & name of the
Makefile+6−18
@@ -423,7 +423,6 @@ INSTALLKERNEL := installkernel · 422 unmodified lines
423DEPMOD = /sbin/depmod423DEPMOD = /sbin/depmod
424PERL = perl424PERL = perl
425PYTHON = python425PYTHON = python
426PYTHON2 = python2
427PYTHON3 = python3426PYTHON3 = python3
428CHECK = sparse427CHECK = sparse
429BASH = bash428BASH = bash
@@ -474,7 +473,7 @@ CLANG_FLAGS := · 44 unmodified lines
474 473
475export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC474export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE AS LD CC
476export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL475export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
477export PERL PYTHON PYTHON2 PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX476export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
478export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE477export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
479 478
480export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS479export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
@@ -674,7 +673,7 @@ $(KCONFIG_CONFIG): · 193 unmodified lines
674#673#
675# This exploits the 'multi-target pattern rule' trick.674# This exploits the 'multi-target pattern rule' trick.
676# The syncconfig should be executed only once to make all the targets.675# The syncconfig should be executed only once to make all the targets.
677%/auto.conf %/auto.conf.cmd %/tristate.conf: $(KCONFIG_CONFIG)676%/auto.conf %/auto.conf.cmd: $(KCONFIG_CONFIG)
678 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig677 $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
679else # !may-sync-config678else # !may-sync-config
680# External modules and some install targets need include/generated/autoconf.h679# External modules and some install targets need include/generated/autoconf.h
@@ -1278,24 +1277,13 @@ all: modules · 597 unmodified lines
1278# using awk while concatenating to the final file.1277# using awk while concatenating to the final file.
1279 1278
1280PHONY += modules1279PHONY += modules
1281modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order modules.builtin1280modules: $(if $(KBUILD_BUILTIN),vmlinux) modules.order
1282 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost1281 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
1283 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh1282 $(Q)$(CONFIG_SHELL) $(srctree)/scripts/modules-check.sh
1284 1283
1285modules.order: descend1284modules.order: descend
1286 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@1285 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
1287 1286
1288modbuiltin-dirs := $(addprefix _modbuiltin_, $(build-dirs))
1289
1290modules.builtin: $(modbuiltin-dirs)
1291 $(Q)$(AWK) '!x[$$0]++' $(addsuffix /$@, $(build-dirs)) > $@
1292
1293PHONY += $(modbuiltin-dirs)
1294# tristate.conf is not included from this Makefile. Add it as a prerequisite
1295# here to make it self-healing in case somebody accidentally removes it.
1296$(modbuiltin-dirs): include/config/tristate.conf
1297 $(Q)$(MAKE) $(modbuiltin)=$(patsubst _modbuiltin_%,%,$@)
1298
1299# Target to prepare building external modules1287# Target to prepare building external modules
1300PHONY += modules_prepare1288PHONY += modules_prepare
1301modules_prepare: prepare1289modules_prepare: prepare
@@ -1315,7 +1303,7 @@ _modinst_: · 13 unmodified lines
1315 ln -s $(CURDIR) $(MODLIB)/build ; \1303 ln -s $(CURDIR) $(MODLIB)/build ; \
1316 fi1304 fi
1317 @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order1305 @sed 's:^:kernel/:' modules.order > $(MODLIB)/modules.order
1318 @sed 's:^:kernel/:' modules.builtin > $(MODLIB)/modules.builtin1306 @cp -f modules.builtin $(MODLIB)/
1319 @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/1307 @cp -f $(objtree)/modules.builtin.modinfo $(MODLIB)/
1320 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst1308 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst
1321 1309
@@ -1357,7 +1345,7 @@ endif # CONFIG_MODULES · 35 unmodified lines
1357 1345
1358# Directories & files removed with 'make clean'1346# Directories & files removed with 'make clean'
1359CLEAN_DIRS += include/ksym1347CLEAN_DIRS += include/ksym
1360CLEAN_FILES += modules.builtin.modinfo modules.nsdeps1348CLEAN_FILES += modules.builtin modules.builtin.modinfo modules.nsdeps
1361 1349
1362# Directories & files removed with 'make mrproper'1350# Directories & files removed with 'make mrproper'
1363MRPROPER_DIRS += include/config include/generated \1351MRPROPER_DIRS += include/config include/generated \
@@ -1712,7 +1700,7 @@ clean: $(clean-dirs) · 348 unmodified lines
1712 -o -name '*.lex.c' -o -name '*.tab.[ch]' \1700 -o -name '*.lex.c' -o -name '*.tab.[ch]' \
1713 -o -name '*.asn1.[ch]' \1701 -o -name '*.asn1.[ch]' \
1714 -o -name '*.symtypes' -o -name 'modules.order' \1702 -o -name '*.symtypes' -o -name 'modules.order' \
1715 -o -name modules.builtin -o -name '.tmp_*.o.*' \1703 -o -name '.tmp_*.o.*' \
1716 -o -name '*.c.[012]*.*' \1704 -o -name '*.c.[012]*.*' \
1717 -o -name '*.ll' \1705 -o -name '*.ll' \
1718 -o -name '*.gcno' \) -type f -print | xargs rm -f1706 -o -name '*.gcno' \) -type f -print | xargs rm -f
include/linux/module.h+11−1
@@ -169,6 +169,16 @@ extern void cleanup_module(void); · 168 unmodified lines
169 */169 */
170#define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep)170#define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep)
171 171
172/*
173 * MODULE_FILE is used for generating modules.builtin
174 * So, make it no-op when this is being built as a module
175 */
176#ifdef MODULE
177#define MODULE_FILE
178#else
179#define MODULE_FILE MODULE_INFO(file, KBUILD_MODFILE);
180#endif
181
172/*182/*
173 * The following license idents are currently accepted as indicating free183 * The following license idents are currently accepted as indicating free
174 * software modules184 * software modules
@@ -213,7 +223,7 @@ extern void cleanup_module(void); · 38 unmodified lines
213 * 2. So the community can ignore bug reports including proprietary modules223 * 2. So the community can ignore bug reports including proprietary modules
214 * 3. So vendors can do likewise based on their own policies224 * 3. So vendors can do likewise based on their own policies
215 */225 */
216#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)226#define MODULE_LICENSE(_license) MODULE_FILE MODULE_INFO(license, _license)
217 227
218/*228/*
219 * Author(s), use "Name <email>" or just "Name", for multiple229 * Author(s), use "Name <email>" or just "Name", for multiple
scripts/Kbuild.include+11−14
@@ -32,6 +32,10 @@ real-prereqs = $(filter-out $(PHONY), $^) · 31 unmodified lines
32# Escape single quote for use in echo statements32# Escape single quote for use in echo statements
33escsq = $(subst $(squote),'\$(squote)',$1)33escsq = $(subst $(squote),'\$(squote)',$1)
34 34
35###
36# Quote a string to pass it to C files. foo => '"foo"'
37stringify = $(squote)$(quote)$1$(quote)$(squote)
38
35###39###
36# Easy method for doing a status message40# Easy method for doing a status message
37 kecho := :41 kecho := :
@@ -55,14 +59,13 @@ kecho := $($(quiet)kecho) · 17 unmodified lines
55# - stdin is piped in from the first prerequisite ($<) so one has59# - stdin is piped in from the first prerequisite ($<) so one has
56# to specify a valid file as first prerequisite (often the kbuild file)60# to specify a valid file as first prerequisite (often the kbuild file)
57define filechk61define filechk
58 $(Q)set -e; \62 $(Q)set -e; \
59 mkdir -p $(dir $@); \63 mkdir -p $(dir $@); \
60 { $(filechk_$(1)); } > $@.tmp; \64 trap "rm -f $(dot-target).tmp" EXIT; \
61 if [ -r $@ ] && cmp -s $@ $@.tmp; then \65 { $(filechk_$(1)); } > $(dot-target).tmp; \
62 rm -f $@.tmp; \66 if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \
63 else \67 $(kecho) ' UPD $@'; \
64 $(kecho) ' UPD $@'; \68 mv -f $(dot-target).tmp $@; \
65 mv -f $@.tmp $@; \
66 fi69 fi
67endef70endef
68 71
@@ -159,12 +162,6 @@ ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) · 90 unmodified lines
159# $(Q)$(MAKE) $(build)=dir162# $(Q)$(MAKE) $(build)=dir
160build := -f $(srctree)/scripts/Makefile.build obj163build := -f $(srctree)/scripts/Makefile.build obj
161 164
162###
163# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
164# Usage:
165# $(Q)$(MAKE) $(modbuiltin)=dir
166modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
167
168###165###
169# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=166# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=
170# Usage:167# Usage:
scripts/Kconfig.include+1−1
@@ -25,7 +25,7 @@ failure = $(if-success,$(1),n,y) · 24 unmodified lines
25 25
26# $(cc-option,<flag>)26# $(cc-option,<flag>)
27# Return y if the compiler supports <flag>, n otherwise27# Return y if the compiler supports <flag>, n otherwise
28cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -E -x c /dev/null -o /dev/null)28cc-option = $(success,$(CC) -Werror $(CLANG_FLAGS) $(1) -S -x c /dev/null -o /dev/null)
29 29
30# $(ld-option,<flag>)30# $(ld-option,<flag>)
31# Return y if the linker supports <flag>, n otherwise31# Return y if the linker supports <flag>, n otherwise
scripts/Makefile.build+2−2
@@ -66,7 +66,7 @@ lib-target := $(obj)/lib.a · 65 unmodified lines
66real-obj-y += $(obj)/lib-ksyms.o66real-obj-y += $(obj)/lib-ksyms.o
67endif67endif
68 68
69ifneq ($(strip $(real-obj-y) $(need-builtin)),)69ifdef need-builtin
70builtin-target := $(obj)/built-in.a70builtin-target := $(obj)/built-in.a
71endif71endif
72 72
@@ -372,7 +372,7 @@ $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler · 299 unmodified lines
372# ---------------------------------------------------------------------------372# ---------------------------------------------------------------------------
373 373
374# To build objects in subdirs, we need to descend into the directories374# To build objects in subdirs, we need to descend into the directories
375$(sort $(subdir-obj-y)): $(subdir-ym) ;375$(obj)/%/built-in.a: $(obj)/% ;
376 376
377#377#
378# Rule to compile a set of .o files into one .a file (without symbol table)378# Rule to compile a set of .o files into one .a file (without symbol table)
scripts/Makefile.lib+14−7
@@ -35,7 +35,11 @@ __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) · 34 unmodified lines
35subdir-y += $(__subdir-y)35subdir-y += $(__subdir-y)
36__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))36__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
37subdir-m += $(__subdir-m)37subdir-m += $(__subdir-m)
38ifdef need-builtin
38obj-y := $(patsubst %/, %/built-in.a, $(obj-y))39obj-y := $(patsubst %/, %/built-in.a, $(obj-y))
40else
41obj-y := $(filter-out %/, $(obj-y))
42endif
39obj-m := $(filter-out %/, $(obj-m))43obj-m := $(filter-out %/, $(obj-m))
40 44
41# Subdirectories we need to descend into45# Subdirectories we need to descend into
@@ -80,12 +84,14 @@ multi-used-m := $(addprefix $(obj)/,$(multi-used-m)) · 38 unmodified lines
80subdir-ym := $(addprefix $(obj)/,$(subdir-ym))84subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
81 85
82# Finds the multi-part object the current object will be linked into.86# Finds the multi-part object the current object will be linked into.
83# If the object belongs to two or more multi-part objects, all of them are87# If the object belongs to two or more multi-part objects, list them all.
84# concatenated with a colon separator.88modname-multi = $(sort $(foreach m,$(multi-used),\
85modname-multi = $(subst $(space),:,$(sort $(foreach m,$(multi-used),\89 $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
86 $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=)))))90
91__modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
87 92
88modname = $(if $(modname-multi),$(modname-multi),$(basetarget))93modname = $(subst $(space),:,$(__modname))
94modfile = $(addprefix $(obj)/,$(__modname))
89 95
90# target with $(obj)/ and its suffix stripped96# target with $(obj)/ and its suffix stripped
91target-stem = $(basename $(patsubst $(obj)/%,%,$@))97target-stem = $(basename $(patsubst $(obj)/%,%,$@))
@@ -93,9 +99,10 @@ target-stem = $(basename $(patsubst $(obj)/%,%,$@)) · 1 unmodified line
93# These flags are needed for modversions and compiling, so we define them here99# These flags are needed for modversions and compiling, so we define them here
94# $(modname_flags) defines KBUILD_MODNAME as the name of the module it will100# $(modname_flags) defines KBUILD_MODNAME as the name of the module it will
95# end up in (or would, if it gets compiled in)101# end up in (or would, if it gets compiled in)
96name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst -,_,$1))$(quote)$(squote)102name-fix = $(call stringify,$(subst $(comma),_,$(subst -,_,$1)))
97basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))103basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
98modname_flags = -DKBUILD_MODNAME=$(call name-fix,$(modname))104modname_flags = -DKBUILD_MODNAME=$(call name-fix,$(modname))
105modfile_flags = -DKBUILD_MODFILE=$(call stringify,$(modfile))
99 106
100orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \107orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \
101 $(ccflags-y) $(CFLAGS_$(target-stem).o)108 $(ccflags-y) $(CFLAGS_$(target-stem).o)
@@ -154,7 +161,7 @@ quiet_modtag = $(if $(part-of-module),[M], ) · 52 unmodified lines
154modkern_cflags = \161modkern_cflags = \
155 $(if $(part-of-module), \162 $(if $(part-of-module), \
156 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \163 $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
157 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))164 $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL) $(modfile_flags))
158 165
159modkern_aflags = $(if $(part-of-module), \166modkern_aflags = $(if $(part-of-module), \
160 $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \167 $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \
scripts/Makefile.modbuiltin+0−57
@@ -1,57 +0,0 @@
1# SPDX-License-Identifier: GPL-2.0
2# ==========================================================================
3# Generating modules.builtin
4# ==========================================================================
5
6src := $(obj)
7
8PHONY := __modbuiltin
9__modbuiltin:
10
11include include/config/auto.conf
12# tristate.conf sets tristate variables to uppercase 'Y' or 'M'
13# That way, we get the list of built-in modules in obj-Y
14include include/config/tristate.conf
15
16include scripts/Kbuild.include
17
18ifdef building_out_of_srctree
19# Create output directory if not already present
20_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
21endif
22
23# The filename Kbuild has precedence over Makefile
24kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
25kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
26include $(kbuild-file)
27
28include scripts/Makefile.lib
29__subdir-Y := $(patsubst %/,%,$(filter %/, $(obj-Y)))
30subdir-Y += $(__subdir-Y)
31subdir-ym := $(sort $(subdir-y) $(subdir-Y) $(subdir-m))
32subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
33obj-Y := $(addprefix $(obj)/,$(obj-Y))
34
35modbuiltin-subdirs := $(patsubst %,%/modules.builtin, $(subdir-ym))
36modbuiltin-mods := $(filter %.ko, $(obj-Y:.o=.ko))
37modbuiltin-target := $(obj)/modules.builtin
38
39__modbuiltin: $(modbuiltin-target) $(subdir-ym)
40 @:
41
42$(modbuiltin-target): $(subdir-ym) FORCE
43 $(Q)(for m in $(modbuiltin-mods); do echo $$m; done; \
44 cat /dev/null $(modbuiltin-subdirs)) > $@
45
46PHONY += FORCE
47
48FORCE:
49
50# Descending
51# ---------------------------------------------------------------------------
52
53PHONY += $(subdir-ym)
54$(subdir-ym):
55 $(Q)$(MAKE) $(modbuiltin)=$@
56
57.PHONY: $(PHONY)
scripts/Makefile.modpost+0−1
@@ -90,7 +90,6 @@ quiet_cmd_modpost = MODPOST $(words $(modules)) modules · 89 unmodified lines
90 cmd_modpost = sed 's/ko$$/o/' $(MODORDER) | $(MODPOST)90 cmd_modpost = sed 's/ko$$/o/' $(MODORDER) | $(MODPOST)
91 91
92__modpost:92__modpost:
93 @$(kecho) ' Building modules, stage 2.'
94 $(call cmd,modpost)93 $(call cmd,modpost)
95ifneq ($(KBUILD_MODPOST_NOFINAL),1)94ifneq ($(KBUILD_MODPOST_NOFINAL),1)
96 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal95 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modfinal
scripts/kconfig/confdata.c+2−43
@@ -710,25 +710,6 @@ static struct conf_printer header_printer_cb = · 709 unmodified lines
710 .print_comment = header_print_comment,710 .print_comment = header_print_comment,
711};711};
712 712
713/*
714 * Tristate printer
715 *
716 * This printer is used when generating the `include/config/tristate.conf' file.
717 */
718static void
719tristate_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
720{
721
722 if (sym->type == S_TRISTATE && *value != 'n')
723 fprintf(fp, "%s%s=%c\n", CONFIG_, sym->name, (char)toupper(*value));
724}
725
726static struct conf_printer tristate_printer_cb =
727{
728 .print_symbol = tristate_print_symbol,
729 .print_comment = kconfig_print_comment,
730};
731
732static void conf_write_symbol(FILE *fp, struct symbol *sym,713static void conf_write_symbol(FILE *fp, struct symbol *sym,
733 struct conf_printer *printer, void *printer_arg)714 struct conf_printer *printer, void *printer_arg)
734{715{
@@ -1062,7 +1043,7 @@ int conf_write_autoconf(int overwrite) · 327 unmodified lines
1062 struct symbol *sym;1043 struct symbol *sym;
1063 const char *name;1044 const char *name;
1064 const char *autoconf_name = conf_get_autoconfig_name();1045 const char *autoconf_name = conf_get_autoconfig_name();
1065 FILE *out, *tristate, *out_h;1046 FILE *out, *out_h;
1066 int i;1047 int i;
1067 1048
1068 if (!overwrite && is_present(autoconf_name))1049 if (!overwrite && is_present(autoconf_name))
@@ -1077,23 +1058,13 @@ int conf_write_autoconf(int overwrite) · 8 unmodified lines
1077 if (!out)1058 if (!out)
1078 return 1;1059 return 1;
1079 1060
1080 tristate = fopen(".tmpconfig_tristate", "w");
1081 if (!tristate) {
1082 fclose(out);
1083 return 1;
1084 }
1085
1086 out_h = fopen(".tmpconfig.h", "w");1061 out_h = fopen(".tmpconfig.h", "w");
1087 if (!out_h) {1062 if (!out_h) {
1088 fclose(out);1063 fclose(out);
1089 fclose(tristate);
1090 return 1;1064 return 1;
1091 }1065 }
1092 1066
1093 conf_write_heading(out, &kconfig_printer_cb, NULL);1067 conf_write_heading(out, &kconfig_printer_cb, NULL);
1094
1095 conf_write_heading(tristate, &tristate_printer_cb, NULL);
1096
1097 conf_write_heading(out_h, &header_printer_cb, NULL);1068 conf_write_heading(out_h, &header_printer_cb, NULL);
1098 1069
1099 for_all_symbols(i, sym) {1070 for_all_symbols(i, sym) {
@@ -1101,15 +1072,11 @@ int conf_write_autoconf(int overwrite) · 1 unmodified line
1101 if (!(sym->flags & SYMBOL_WRITE) || !sym->name)1072 if (!(sym->flags & SYMBOL_WRITE) || !sym->name)
1102 continue;1073 continue;
1103 1074
1104 /* write symbol to auto.conf, tristate and header files */1075 /* write symbols to auto.conf and autoconf.h */
1105 conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);1076 conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);
1106
1107 conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);
1108
1109 conf_write_symbol(out_h, sym, &header_printer_cb, NULL);1077 conf_write_symbol(out_h, sym, &header_printer_cb, NULL);
1110 }1078 }
1111 fclose(out);1079 fclose(out);
1112 fclose(tristate);
1113 fclose(out_h);1080 fclose(out_h);
1114 1081
1115 name = getenv("KCONFIG_AUTOHEADER");1082 name = getenv("KCONFIG_AUTOHEADER");
@@ -1120,14 +1087,6 @@ int conf_write_autoconf(int overwrite) · 4 unmodified lines
1120 if (rename(".tmpconfig.h", name))1087 if (rename(".tmpconfig.h", name))
1121 return 1;1088 return 1;
1122 1089
1123 name = getenv("KCONFIG_TRISTATE");
1124 if (!name)
1125 name = "include/config/tristate.conf";
1126 if (make_parent_dir(name))
1127 return 1;
1128 if (rename(".tmpconfig_tristate", name))
1129 return 1;
1130
1131 if (make_parent_dir(autoconf_name))1090 if (make_parent_dir(autoconf_name))
1132 return 1;1091 return 1;
1133 /*1092 /*
scripts/link-vmlinux.sh+4−0
@@ -250,6 +250,10 @@ ${MAKE} -f "${srctree}/scripts/Makefile.modpost" MODPOST_VMLINUX=1 · 249 unmodified lines
250 250
251info MODINFO modules.builtin.modinfo251info MODINFO modules.builtin.modinfo
252${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo252${OBJCOPY} -j .modinfo -O binary vmlinux.o modules.builtin.modinfo
253info GEN modules.builtin
254# The second line aids cases where multiple modules share the same object.
255tr '\0' '\n' < modules.builtin.modinfo | sed -n 's/^[[:alnum:]:_]*\.file=//p' |
256 tr ' ' '\n' | uniq | sed -e 's:^:kernel/:' -e 's/$/.ko/' > modules.builtin
253 257
254btf_vmlinux_bin_o=""258btf_vmlinux_bin_o=""
255if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then259if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
scripts/mod/modpost.c+1−7
@@ -12,6 +12,7 @@ · 11 unmodified lines
12 */12 */
13 13
14#define _GNU_SOURCE14#define _GNU_SOURCE
15#include <elf.h>
15#include <stdio.h>16#include <stdio.h>
16#include <ctype.h>17#include <ctype.h>
17#include <string.h>18#include <string.h>
@@ -729,12 +730,6 @@ static void handle_symbol(struct module *mod, struct elf_info *info, · 711 unmodified lines
729 break;730 break;
730 if (ignore_undef_symbol(info, symname))731 if (ignore_undef_symbol(info, symname))
731 break;732 break;
732/* cope with newer glibc (2.3.4 or higher) STT_ definition in elf.h */
733#if defined(STT_REGISTER) || defined(STT_SPARC_REGISTER)
734/* add compatibility with older glibc */
735#ifndef STT_SPARC_REGISTER
736#define STT_SPARC_REGISTER STT_REGISTER
737#endif
738 if (info->hdr->e_machine == EM_SPARC ||733 if (info->hdr->e_machine == EM_SPARC ||
739 info->hdr->e_machine == EM_SPARCV9) {734 info->hdr->e_machine == EM_SPARCV9) {
740 /* Ignore register directives. */735 /* Ignore register directives. */
@@ -747,7 +742,6 @@ static void handle_symbol(struct module *mod, struct elf_info *info, · 6 unmodified lines
747 symname = munged;742 symname = munged;
748 }743 }
749 }744 }
750#endif
751 745
752 mod->unres = alloc_symbol(symname,746 mod->unres = alloc_symbol(symname,
753 ELF_ST_BIND(sym->st_info) == STB_WEAK,747 ELF_ST_BIND(sym->st_info) == STB_WEAK,
scripts/package/builddeb+63−43
@@ -43,17 +43,66 @@ create_package() { · 42 unmodified lines
43 43
44 # Create the package44 # Create the package
45 dpkg-gencontrol -p$pname -P"$pdir"45 dpkg-gencontrol -p$pname -P"$pdir"
46 dpkg --build "$pdir" ..46 dpkg-deb ${KDEB_COMPRESS:+-Z$KDEB_COMPRESS} --build "$pdir" ..
47}
48
49deploy_kernel_headers () {
50 pdir=$1
51
52 rm -rf $pdir
53
54 (
55 cd $srctree
56 find . arch/$SRCARCH -maxdepth 1 -name Makefile\*
57 find include scripts -type f -o -type l
58 find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform
59 find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f
60 ) > debian/hdrsrcfiles
61
62 {
63 if is_enabled CONFIG_STACK_VALIDATION; then
64 echo tools/objtool/objtool
65 fi
66
67 find arch/$SRCARCH/include Module.symvers include scripts -type f
68
69 if is_enabled CONFIG_GCC_PLUGINS; then
70 find scripts/gcc-plugins -name \*.so
71 fi
72 } > debian/hdrobjfiles
73
74 destdir=$pdir/usr/src/linux-headers-$version
75 mkdir -p $destdir
76 tar -c -f - -C $srctree -T debian/hdrsrcfiles | tar -xf - -C $destdir
77 tar -c -f - -T debian/hdrobjfiles | tar -xf - -C $destdir
78 rm -f debian/hdrsrcfiles debian/hdrobjfiles
79
80 # copy .config manually to be where it's expected to be
81 cp $KCONFIG_CONFIG $destdir/.config
82
83 mkdir -p $pdir/lib/modules/$version/
84 ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
85}
86
87deploy_libc_headers () {
88 pdir=$1
89
90 rm -rf $pdir
91
92 $MAKE -f $srctree/Makefile headers
93 $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH=$pdir/usr
94
95 # move asm headers to /usr/include/<libc-machine>/asm to match the structure
96 # used by Debian-based distros (to support multi-arch)
97 host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
98 mkdir $pdir/usr/include/$host_arch
99 mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/
47}100}
48 101
49version=$KERNELRELEASE102version=$KERNELRELEASE
50tmpdir="$objtree/debian/tmp"103tmpdir=debian/linux-image
51kernel_headers_dir="$objtree/debian/hdrtmp"104dbg_dir=debian/linux-image-dbg
52libc_headers_dir="$objtree/debian/headertmp"
53dbg_dir="$objtree/debian/dbgtmp"
54packagename=linux-image-$version105packagename=linux-image-$version
55kernel_headers_packagename=linux-headers-$version
56libc_headers_packagename=linux-libc-dev
57dbg_packagename=$packagename-dbg106dbg_packagename=$packagename-dbg
58 107
59if [ "$ARCH" = "um" ] ; then108if [ "$ARCH" = "um" ] ; then
@@ -77,15 +126,13 @@ esac · 17 unmodified lines
77BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)126BUILD_DEBUG=$(if_enabled_echo CONFIG_DEBUG_INFO Yes)
78 127
79# Setup the directory structure128# Setup the directory structure
80rm -rf "$tmpdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files129rm -rf "$tmpdir" "$dbg_dir" debian/files
81mkdir -m 755 -p "$tmpdir/DEBIAN"130mkdir -m 755 -p "$tmpdir/DEBIAN"
82mkdir -p "$tmpdir/lib" "$tmpdir/boot"131mkdir -p "$tmpdir/lib" "$tmpdir/boot"
83mkdir -p "$kernel_headers_dir/lib/modules/$version/"
84 132
85# Build and install the kernel133# Install the kernel
86if [ "$ARCH" = "um" ] ; then134if [ "$ARCH" = "um" ] ; then
87 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" "$tmpdir/usr/share/doc/$packagename"135 mkdir -p "$tmpdir/usr/lib/uml/modules/$version" "$tmpdir/usr/bin" "$tmpdir/usr/share/doc/$packagename"
88 $MAKE linux
89 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"136 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map"
90 cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"137 cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config"
91 gzip "$tmpdir/usr/share/doc/$packagename/config"138 gzip "$tmpdir/usr/share/doc/$packagename/config"
@@ -129,16 +176,6 @@ if is_enabled CONFIG_MODULES; then · 37 unmodified lines
129 fi176 fi
130fi177fi
131 178
132if [ "$ARCH" != "um" ]; then
133 $MAKE -f $srctree/Makefile headers
134 $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr"
135 # move asm headers to /usr/include/<libc-machine>/asm to match the structure
136 # used by Debian-based distros (to support multi-arch)
137 host_arch=$(dpkg-architecture -a$(cat debian/arch) -qDEB_HOST_MULTIARCH)
138 mkdir $libc_headers_dir/usr/include/$host_arch
139 mv $libc_headers_dir/usr/include/asm $libc_headers_dir/usr/include/$host_arch/
140fi
141
142# Install the maintainer scripts179# Install the maintainer scripts
143# Note: hook scripts under /etc/kernel are also executed by official Debian180# Note: hook scripts under /etc/kernel are also executed by official Debian
144# kernel packages, as well as kernel packages built using make-kpkg.181# kernel packages, as well as kernel packages built using make-kpkg.
@@ -164,29 +201,12 @@ EOF · 19 unmodified lines
164 chmod 755 "$tmpdir/DEBIAN/$script"201 chmod 755 "$tmpdir/DEBIAN/$script"
165done202done
166 203
167# Build kernel header package
168(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
169(cd $srctree; find arch/*/include include scripts -type f -o -type l) >> "$objtree/debian/hdrsrcfiles"
170(cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles"
171(cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles"
172if is_enabled CONFIG_STACK_VALIDATION; then
173 (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles"
174fi
175(cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles"
176if is_enabled CONFIG_GCC_PLUGINS; then
177 (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
178fi
179destdir=$kernel_headers_dir/usr/src/linux-headers-$version
180mkdir -p "$destdir"
181(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
182(cd $objtree; tar -c -f - -T -) < "$objtree/debian/hdrobjfiles" | (cd $destdir; tar -xf -)
183(cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
184ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
185rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
186
187if [ "$ARCH" != "um" ]; then204if [ "$ARCH" != "um" ]; then
188 create_package "$kernel_headers_packagename" "$kernel_headers_dir"205 deploy_kernel_headers debian/linux-headers
189 create_package "$libc_headers_packagename" "$libc_headers_dir"206 create_package linux-headers-$version debian/linux-headers
207
208 deploy_libc_headers debian/linux-libc-dev
209 create_package linux-libc-dev debian/linux-libc-dev
190fi210fi
191 211
192create_package "$packagename" "$tmpdir"212create_package "$packagename" "$tmpdir"
usr/.gitignore+1−7
@@ -1,9 +1,3 @@
1#
2# Generated files
3#
4gen_init_cpio1gen_init_cpio
5initramfs_data.cpio2initramfs_data.cpio
6initramfs_data.cpio.gz3/initramfs_inc_data
7initramfs_data.cpio.bz2
8initramfs_data.cpio.lzma
9initramfs_list
usr/Kconfig+0−26
@@ -54,7 +54,6 @@ config INITRAMFS_ROOT_GID · 53 unmodified lines
54 54
55config RD_GZIP55config RD_GZIP
56 bool "Support initial ramdisk/ramfs compressed using gzip"56 bool "Support initial ramdisk/ramfs compressed using gzip"
57 depends on BLK_DEV_INITRD
58 default y57 default y
59 select DECOMPRESS_GZIP58 select DECOMPRESS_GZIP
60 help59 help
@@ -64,7 +63,6 @@ config RD_GZIP · 3 unmodified lines
64config RD_BZIP263config RD_BZIP2
65 bool "Support initial ramdisk/ramfs compressed using bzip2"64 bool "Support initial ramdisk/ramfs compressed using bzip2"
66 default y65 default y
67 depends on BLK_DEV_INITRD
68 select DECOMPRESS_BZIP266 select DECOMPRESS_BZIP2
69 help67 help
70 Support loading of a bzip2 encoded initial ramdisk or cpio buffer68 Support loading of a bzip2 encoded initial ramdisk or cpio buffer
@@ -73,7 +71,6 @@ config RD_BZIP2 · 2 unmodified lines
73config RD_LZMA71config RD_LZMA
74 bool "Support initial ramdisk/ramfs compressed using LZMA"72 bool "Support initial ramdisk/ramfs compressed using LZMA"
75 default y73 default y
76 depends on BLK_DEV_INITRD
77 select DECOMPRESS_LZMA74 select DECOMPRESS_LZMA
78 help75 help
79 Support loading of a LZMA encoded initial ramdisk or cpio buffer76 Support loading of a LZMA encoded initial ramdisk or cpio buffer
@@ -81,7 +78,6 @@ config RD_LZMA · 1 unmodified line
81 78
82config RD_XZ79config RD_XZ
83 bool "Support initial ramdisk/ramfs compressed using XZ"80 bool "Support initial ramdisk/ramfs compressed using XZ"
84 depends on BLK_DEV_INITRD
85 default y81 default y
86 select DECOMPRESS_XZ82 select DECOMPRESS_XZ
87 help83 help
@@ -91,7 +87,6 @@ config RD_XZ · 3 unmodified lines
91config RD_LZO87config RD_LZO
92 bool "Support initial ramdisk/ramfs compressed using LZO"88 bool "Support initial ramdisk/ramfs compressed using LZO"
93 default y89 default y
94 depends on BLK_DEV_INITRD
95 select DECOMPRESS_LZO90 select DECOMPRESS_LZO
96 help91 help
97 Support loading of a LZO encoded initial ramdisk or cpio buffer92 Support loading of a LZO encoded initial ramdisk or cpio buffer
@@ -100,7 +95,6 @@ config RD_LZO · 2 unmodified lines
100config RD_LZ495config RD_LZ4
101 bool "Support initial ramdisk/ramfs compressed using LZ4"96 bool "Support initial ramdisk/ramfs compressed using LZ4"
102 default y97 default y
103 depends on BLK_DEV_INITRD
104 select DECOMPRESS_LZ498 select DECOMPRESS_LZ4
105 help99 help
106 Support loading of a LZ4 encoded initial ramdisk or cpio buffer100 Support loading of a LZ4 encoded initial ramdisk or cpio buffer
@@ -108,8 +102,6 @@ config RD_LZ4 · 1 unmodified line
108 102
109choice103choice
110 prompt "Built-in initramfs compression mode"104 prompt "Built-in initramfs compression mode"
111 depends on INITRAMFS_SOURCE!=""
112 optional
113 help105 help
114 This option allows you to decide by which algorithm the builtin106 This option allows you to decide by which algorithm the builtin
115 initramfs will be compressed. Several compression algorithms are107 initramfs will be compressed. Several compression algorithms are
@@ -215,21 +207,3 @@ config INITRAMFS_COMPRESSION_LZ4 · 99 unmodified lines
215 by default which could cause a build failure.207 by default which could cause a build failure.
216 208
217endchoice209endchoice
218
219config INITRAMFS_COMPRESSION
220 depends on INITRAMFS_SOURCE!=""
221 string
222 default "" if INITRAMFS_COMPRESSION_NONE
223 default ".gz" if INITRAMFS_COMPRESSION_GZIP
224 default ".bz2" if INITRAMFS_COMPRESSION_BZIP2
225 default ".lzma" if INITRAMFS_COMPRESSION_LZMA
226 default ".xz" if INITRAMFS_COMPRESSION_XZ
227 default ".lzo" if INITRAMFS_COMPRESSION_LZO
228 default ".lz4" if INITRAMFS_COMPRESSION_LZ4
229 default ".gz" if RD_GZIP
230 default ".lz4" if RD_LZ4
231 default ".lzo" if RD_LZO
232 default ".xz" if RD_XZ
233 default ".lzma" if RD_LZMA
234 default ".bz2" if RD_BZIP2
235 default ""
usr/Makefile+61−36
@@ -3,61 +3,86 @@ · 2 unmodified lines
3# kbuild file for usr/ - including initramfs image3# kbuild file for usr/ - including initramfs image
4#4#
5 5
6klibcdirs:;6# cmd_bzip2, cmd_lzma, cmd_lzo, cmd_lz4 from scripts/Makefile.lib appends the
7PHONY += klibcdirs7# size at the end of the compressed file, which unfortunately does not work
8# with unpack_to_rootfs(). Make size_append no-op.
9override size_append := :
8 10
9suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION))11compress-$(CONFIG_INITRAMFS_COMPRESSION_NONE) := shipped
10datafile_y = initramfs_data.cpio$(suffix_y)12compress-$(CONFIG_INITRAMFS_COMPRESSION_GZIP) := gzip
11datafile_d_y = .$(datafile_y).d13compress-$(CONFIG_INITRAMFS_COMPRESSION_BZIP2) := bzip2
12AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/$(datafile_y)"14compress-$(CONFIG_INITRAMFS_COMPRESSION_LZMA) := lzma
15compress-$(CONFIG_INITRAMFS_COMPRESSION_XZ) := xzmisc
16compress-$(CONFIG_INITRAMFS_COMPRESSION_LZO) := lzo
17compress-$(CONFIG_INITRAMFS_COMPRESSION_LZ4) := lz4
13 18
14# clean rules do not have CONFIG_INITRAMFS_COMPRESSION. So clean up after all
15# possible compression formats.
16clean-files += initramfs_data.cpio*
17
18# Generate builtin.o based on initramfs_data.o
19obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o19obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o
20 20
21# initramfs_data.o contains the compressed initramfs_data.cpio image.21$(obj)/initramfs_data.o: $(obj)/initramfs_inc_data
22# The image is included using .incbin, a dependency which is not22
23# tracked automatically.23ramfs-input := $(strip $(shell echo $(CONFIG_INITRAMFS_SOURCE)))
24$(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE24cpio-data :=
25
26# If CONFIG_INITRAMFS_SOURCE is empty, generate a small initramfs with the
27# default contents.
28ifeq ($(ramfs-input),)
29ramfs-input := $(srctree)/$(src)/default_cpio_list
30endif
31
32ifeq ($(words $(ramfs-input)),1)
33
34# If CONFIG_INITRAMFS_SOURCE specifies a single file, and it is suffixed with
35# .cpio, use it directly as an initramfs.
36ifneq ($(filter %.cpio,$(ramfs-input)),)
37cpio-data := $(ramfs-input)
38endif
39
40# If CONFIG_INITRAMFS_SOURCE specifies a single file, and it is suffixed with
41# .cpio.*, use it directly as an initramfs, and avoid double compression.
42ifeq ($(words $(subst .cpio.,$(space),$(ramfs-input))),2)
43cpio-data := $(ramfs-input)
44compress-y := shipped
45endif
46
47endif
48
49# For other cases, generate the initramfs cpio archive based on the contents
50# specified by CONFIG_INITRAMFS_SOURCE.
51ifeq ($(cpio-data),)
25 52
26#####53cpio-data := $(obj)/initramfs_data.cpio
27# Generate the initramfs cpio archive
28 54
29hostprogs-y := gen_init_cpio55hostprogs-y := gen_init_cpio
30initramfs := $(CONFIG_SHELL) $(srctree)/$(src)/gen_initramfs_list.sh56
31ramfs-input := $(if $(filter-out "",$(CONFIG_INITRAMFS_SOURCE)), \57# .initramfs_data.cpio.d is used to identify all files included
32 $(shell echo $(CONFIG_INITRAMFS_SOURCE)),-d)
33ramfs-args := \
34 $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
35 $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID))
36
37# $(datafile_d_y) is used to identify all files included
38# in initramfs and to detect if any files are added/removed.58# in initramfs and to detect if any files are added/removed.
39# Removed files are identified by directory timestamp being updated59# Removed files are identified by directory timestamp being updated
40# The dependency list is generated by gen_initramfs.sh -l60# The dependency list is generated by gen_initramfs.sh -l
41ifneq ($(wildcard $(obj)/$(datafile_d_y)),)61-include $(obj)/.initramfs_data.cpio.d
42 include $(obj)/$(datafile_d_y)
43endif
44
45quiet_cmd_initfs = GEN $@
46 cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input)
47
48targets := $(datafile_y)
49 62
50# do not try to update files included in initramfs63# do not try to update files included in initramfs
51$(deps_initramfs): ;64$(deps_initramfs): ;
52 65
53$(deps_initramfs): klibcdirs66quiet_cmd_initfs = GEN $@
67 cmd_initfs = \
68 $(CONFIG_SHELL) $< -o $@ -l $(obj)/.initramfs_data.cpio.d \
69 $(if $(CONFIG_INITRAMFS_ROOT_UID), -u $(CONFIG_INITRAMFS_ROOT_UID)) \
70 $(if $(CONFIG_INITRAMFS_ROOT_GID), -g $(CONFIG_INITRAMFS_ROOT_GID)) \
71 $(ramfs-input)
72
54# We rebuild initramfs_data.cpio if:73# We rebuild initramfs_data.cpio if:
55# 1) Any included file is newer than initramfs_data.cpio74# 1) Any included file is newer than initramfs_data.cpio
56# 2) There are changes in which files are included (added or deleted)75# 2) There are changes in which files are included (added or deleted)
57# 3) If gen_init_cpio are newer than initramfs_data.cpio76# 3) If gen_init_cpio are newer than initramfs_data.cpio
58# 4) Arguments to gen_initramfs.sh changes77# 4) Arguments to gen_initramfs.sh changes
59$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs78$(obj)/initramfs_data.cpio: $(src)/gen_initramfs.sh $(obj)/gen_init_cpio $(deps_initramfs) FORCE
60 $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y)
61 $(call if_changed,initfs)79 $(call if_changed,initfs)
62 80
81endif
82
83$(obj)/initramfs_inc_data: $(cpio-data) FORCE
84 $(call if_changed,$(compress-y))
85
86targets += initramfs_data.cpio initramfs_inc_data
87
63subdir-$(CONFIG_UAPI_HEADER_TEST) += include88subdir-$(CONFIG_UAPI_HEADER_TEST) += include
usr/default_cpio_list+6−0
@@ -0,0 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0-only
2# This is a very simple, default initramfs
3
4dir /dev 0755 0 0
5nod /dev/console 0600 0 0 c 5 1
6dir /root 0700 0 0
usr/gen_initramfs.shrenamed from usr/gen_initramfs_list.sh+43−124
@@ -5,8 +5,7 @@ · 4 unmodified lines
5# Released under the terms of the GNU GPL5# Released under the terms of the GNU GPL
6#6#
7# Generate a cpio packed initramfs. It uses gen_init_cpio to generate7# Generate a cpio packed initramfs. It uses gen_init_cpio to generate
8# the cpio archive, and then compresses it.8# the cpio archive.
9# The script may also be used to generate the inputfile used for gen_init_cpio
10# This script assumes that gen_init_cpio is located in usr/ directory9# This script assumes that gen_init_cpio is located in usr/ directory
11 10
12# error out on errors11# error out on errors
@@ -15,9 +14,9 @@ set -e · 2 unmodified lines
15usage() {14usage() {
16cat << EOF15cat << EOF
17Usage:16Usage:
18$0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ...17$0 [-o <file>] [-l <dep_list>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ...
19 -o <file> Create compressed initramfs file named <file> using18 -o <file> Create initramfs file named <file> by using gen_init_cpio
20 gen_init_cpio and compressor depending on the extension19 -l <dep_list> Create dependency list named <dep_list>
21 -u <uid> User ID to map to user ID 0 (root).20 -u <uid> User ID to map to user ID 0 (root).
22 <uid> is only meaningful if <cpio_source> is a21 <uid> is only meaningful if <cpio_source> is a
23 directory. "squash" forces all files to uid 0.22 directory. "squash" forces all files to uid 0.
@@ -27,7 +26,6 @@ $0 [-o <file>] [-u <uid>] [-g <gid>] {-d | <cpio_source>} ... · 3 unmodified lines
27 <cpio_source> File list or directory for cpio archive.26 <cpio_source> File list or directory for cpio archive.
28 If <cpio_source> is a .cpio file it will be used27 If <cpio_source> is a .cpio file it will be used
29 as direct input to initramfs.28 as direct input to initramfs.
30 -d Output the default cpio list.
31 29
32All options except -o and -l may be repeated and are interpreted30All options except -o and -l may be repeated and are interpreted
33sequentially and immediately. -u and -g states are preserved across31sequentially and immediately. -u and -g states are preserved across
@@ -42,23 +40,6 @@ field() { · 8 unmodified lines
42 shift $1 ; echo $140 shift $1 ; echo $1
43}41}
44 42
45list_default_initramfs() {
46 # echo usr/kinit/kinit
47 :
48}
49
50default_initramfs() {
51 cat <<-EOF >> ${output}
52 # This is a very simple, default initramfs
53
54 dir /dev 0755 0 0
55 nod /dev/console 0600 0 0 c 5 1
56 dir /root 0700 0 0
57 # file /kinit usr/kinit/kinit 0755 0 0
58 # slink /init kinit 0755 0 0
59 EOF
60}
61
62filetype() {43filetype() {
63 local argv1="$1"44 local argv1="$1"
64 45
@@ -81,10 +62,6 @@ filetype() { · 16 unmodified lines
81 return 062 return 0
82}63}
83 64
84list_print_mtime() {
85 :
86}
87
88print_mtime() {65print_mtime() {
89 local my_mtime="0"66 local my_mtime="0"
90 67
@@ -92,15 +69,15 @@ print_mtime() { · 1 unmodified line
92 my_mtime=$(find "$1" -printf "%T@\n" | sort -r | head -n 1)69 my_mtime=$(find "$1" -printf "%T@\n" | sort -r | head -n 1)
93 fi70 fi
94 71
95 echo "# Last modified: ${my_mtime}" >> ${output}72 echo "# Last modified: ${my_mtime}" >> $cpio_list
96 echo "" >> ${output}73 echo "" >> $cpio_list
97}74}
98 75
99list_parse() {76list_parse() {
100 if [ -L "$1" ]; then77 if [ -z "$dep_list" -o -L "$1" ]; then
101 return78 return
102 fi79 fi
103 echo "$1" | sed 's/:/\\:/g; s/$/ \\/'80 echo "$1" | sed 's/:/\\:/g; s/$/ \\/' >> $dep_list
104}81}
105 82
106# for each file print a line in following format83# for each file print a line in following format
@@ -146,7 +123,7 @@ parse() { · 39 unmodified lines
146 ;;123 ;;
147 esac124 esac
148 125
149 echo "${str}" >> ${output}126 echo "${str}" >> $cpio_list
150 127
151 return 0128 return 0
152}129}
@@ -161,58 +138,47 @@ unknown_option() { · 8 unmodified lines
161 exit 1138 exit 1
162}139}
163 140
164list_header() {
165 :
166}
167
168header() {141header() {
169 printf "\n#####################\n# $1\n" >> ${output}142 printf "\n#####################\n# $1\n" >> $cpio_list
170}143}
171 144
172# process one directory (incl sub-directories)145# process one directory (incl sub-directories)
173dir_filelist() {146dir_filelist() {
174 ${dep_list}header "$1"147 header "$1"
175 148
176 srcdir=$(echo "$1" | sed -e 's://*:/:g')149 srcdir=$(echo "$1" | sed -e 's://*:/:g')
177 dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LANG=C sort)150 dirlist=$(find "${srcdir}" -printf "%p %m %U %G\n" | LANG=C sort)
178 151
179 # If $dirlist is only one line, then the directory is empty152 # If $dirlist is only one line, then the directory is empty
180 if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then153 if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then
181 ${dep_list}print_mtime "$1"154 print_mtime "$1"
182 155
183 echo "${dirlist}" | \156 echo "${dirlist}" | \
184 while read x; do157 while read x; do
185 ${dep_list}parse ${x}158 list_parse $x
159 parse $x
186 done160 done
187 fi161 fi
188}162}
189 163
190# if only one file is specified and it is .cpio file then use it direct as fs
191# if a directory is specified then add all files in given direcotry to fs
192# if a regular file is specified assume it is in gen_initramfs format
193input_file() {164input_file() {
194 source="$1"165 source="$1"
195 if [ -f "$1" ]; then166 if [ -f "$1" ]; then
196 ${dep_list}header "$1"167 # If a regular file is specified, assume it is in
197 is_cpio="$(echo "$1" | sed 's/^.*\.cpio\(\..*\)\{0,1\}/cpio/')"168 # gen_init_cpio format
198 if [ $2 -eq 0 -a ${is_cpio} = "cpio" ]; then169 header "$1"
199 cpio_file=$1170 print_mtime "$1" >> $cpio_list
200 echo "$1" | grep -q '^.*\.cpio\..*' && is_cpio_compressed="compressed"171 cat "$1" >> $cpio_list
201 [ ! -z ${dep_list} ] && echo "$1"172 if [ -n "$dep_list" ]; then
202 return 0173 echo "$1 \\" >> $dep_list
203 fi
204 if [ -z ${dep_list} ]; then
205 print_mtime "$1" >> ${output}
206 cat "$1" >> ${output}
207 else
208 echo "$1 \\"
209 cat "$1" | while read type dir file perm ; do174 cat "$1" | while read type dir file perm ; do
210 if [ "$type" = "file" ]; then175 if [ "$type" = "file" ]; then
211 echo "$file \\";176 echo "$file \\" >> $dep_list
212 fi177 fi
213 done178 done
214 fi179 fi
215 elif [ -d "$1" ]; then180 elif [ -d "$1" ]; then
181 # If a directory is specified then add all files in it to fs
216 dir_filelist "$1"182 dir_filelist "$1"
217 else183 else
218 echo " ${prog}: Cannot open '$1'" >&2184 echo " ${prog}: Cannot open '$1'" >&2
@@ -224,51 +190,24 @@ prog=$0 · 5 unmodified lines
224root_uid=0190root_uid=0
225root_gid=0191root_gid=0
226dep_list=192dep_list=
227cpio_file=193cpio_list=$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)
228cpio_list=
229output="/dev/stdout"194output="/dev/stdout"
230output_file=""
231is_cpio_compressed=
232compr="gzip -n -9 -f"
233 195
234arg="$1"196trap "rm -f $cpio_list" EXIT
235case "$arg" in197
236 "-l") # files included in initramfs - used by kbuild
237 dep_list="list_"
238 echo "deps_initramfs := $0 \\"
239 shift
240 ;;
241 "-o") # generate compressed cpio image named $1
242 shift
243 output_file="$1"
244 cpio_list="$(mktemp ${TMPDIR:-/tmp}/cpiolist.XXXXXX)"
245 output=${cpio_list}
246 echo "$output_file" | grep -q "\.gz$" \
247 && [ -x "`which gzip 2> /dev/null`" ] \
248 && compr="gzip -n -9 -f"
249 echo "$output_file" | grep -q "\.bz2$" \
250 && [ -x "`which bzip2 2> /dev/null`" ] \
251 && compr="bzip2 -9 -f"
252 echo "$output_file" | grep -q "\.lzma$" \
253 && [ -x "`which lzma 2> /dev/null`" ] \
254 && compr="lzma -9 -f"
255 echo "$output_file" | grep -q "\.xz$" \
256 && [ -x "`which xz 2> /dev/null`" ] \
257 && compr="xz --check=crc32 --lzma2=dict=1MiB"
258 echo "$output_file" | grep -q "\.lzo$" \
259 && [ -x "`which lzop 2> /dev/null`" ] \
260 && compr="lzop -9 -f"
261 echo "$output_file" | grep -q "\.lz4$" \
262 && [ -x "`which lz4 2> /dev/null`" ] \
263 && compr="lz4 -l -9 -f"
264 echo "$output_file" | grep -q "\.cpio$" && compr="cat"
265 shift
266 ;;
267esac
268while [ $# -gt 0 ]; do198while [ $# -gt 0 ]; do
269 arg="$1"199 arg="$1"
270 shift200 shift
271 case "$arg" in201 case "$arg" in
202 "-l") # files included in initramfs - used by kbuild
203 dep_list="$1"
204 echo "deps_initramfs := \\" > $dep_list
205 shift
206 ;;
207 "-o") # generate cpio image named $1
208 output="$1"
209 shift
210 ;;
272 "-u") # map $1 to uid=0 (root)211 "-u") # map $1 to uid=0 (root)
273 root_uid="$1"212 root_uid="$1"
274 [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0)213 [ "$root_uid" = "-1" ] && root_uid=$(id -u || echo 0)
@@ -279,10 +218,6 @@ while [ $# -gt 0 ]; do · 4 unmodified lines
279 [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0)218 [ "$root_gid" = "-1" ] && root_gid=$(id -g || echo 0)
280 shift219 shift
281 ;;220 ;;
282 "-d") # display default initramfs list
283 default_list="$arg"
284 ${dep_list}default_initramfs
285 ;;
286 "-h")221 "-h")
287 usage222 usage
288 exit 0223 exit 0
@@ -293,36 +228,20 @@ while [ $# -gt 0 ]; do · 4 unmodified lines
293 unknown_option228 unknown_option
294 ;;229 ;;
295 *) # input file/dir - process it230 *) # input file/dir - process it
296 input_file "$arg" "$#"231 input_file "$arg"
297 ;;232 ;;
298 esac233 esac
299 ;;234 ;;
300 esac235 esac
301done236done
302 237
303# If output_file is set we will generate cpio archive and compress it238# If output_file is set we will generate cpio archive
304# we are careful to delete tmp files239# we are careful to delete tmp files
305if [ ! -z ${output_file} ]; then240timestamp=
306 if [ -z ${cpio_file} ]; then241if test -n "$KBUILD_BUILD_TIMESTAMP"; then
307 timestamp=242 timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"
308 if test -n "$KBUILD_BUILD_TIMESTAMP"; then243 if test -n "$timestamp"; then
309 timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" +%s || :)"244 timestamp="-t $timestamp"
310 if test -n "$timestamp"; then
311 timestamp="-t $timestamp"
312 fi
313 fi
314 cpio_tfile="$(mktemp ${TMPDIR:-/tmp}/cpiofile.XXXXXX)"
315 usr/gen_init_cpio $timestamp ${cpio_list} > ${cpio_tfile}
316 else
317 cpio_tfile=${cpio_file}
318 fi
319 rm ${cpio_list}
320 if [ "${is_cpio_compressed}" = "compressed" ]; then
321 cat ${cpio_tfile} > ${output_file}
322 else
323 (cat ${cpio_tfile} | ${compr} - > ${output_file}) \
324 || (rm -f ${output_file} ; false)
325 fi245 fi
326 [ -z ${cpio_file} ] && rm ${cpio_tfile}
327fi246fi
328exit 0247usr/gen_init_cpio $timestamp $cpio_list > $output
usr/include/Makefile+54−53
@@ -16,87 +16,88 @@ override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -I$(objtree)/usr/include · 15 unmodified lines
16# Please consider to fix the header first.16# Please consider to fix the header first.
17#17#
18# Sorted alphabetically.18# Sorted alphabetically.
19header-test- += asm/shmbuf.h19no-header-test += asm/shmbuf.h
20header-test- += asm/signal.h20no-header-test += asm/signal.h
21header-test- += asm/ucontext.h21no-header-test += asm/ucontext.h
22header-test- += drm/vmwgfx_drm.h22no-header-test += drm/vmwgfx_drm.h
23header-test- += linux/am437x-vpfe.h23no-header-test += linux/am437x-vpfe.h
24header-test- += linux/android/binder.h24no-header-test += linux/android/binder.h
25header-test- += linux/android/binderfs.h25no-header-test += linux/android/binderfs.h
26header-test- += linux/coda.h26no-header-test += linux/coda.h
27header-test- += linux/elfcore.h27no-header-test += linux/elfcore.h
28header-test- += linux/errqueue.h28no-header-test += linux/errqueue.h
29header-test- += linux/fsmap.h29no-header-test += linux/fsmap.h
30header-test- += linux/hdlc/ioctl.h30no-header-test += linux/hdlc/ioctl.h
31header-test- += linux/ivtv.h31no-header-test += linux/ivtv.h
32header-test- += linux/kexec.h32no-header-test += linux/kexec.h
33header-test- += linux/matroxfb.h33no-header-test += linux/matroxfb.h
34header-test- += linux/nfc.h34no-header-test += linux/nfc.h
35header-test- += linux/omap3isp.h35no-header-test += linux/omap3isp.h
36header-test- += linux/omapfb.h36no-header-test += linux/omapfb.h
37header-test- += linux/patchkey.h37no-header-test += linux/patchkey.h
38header-test- += linux/phonet.h38no-header-test += linux/phonet.h
39header-test- += linux/reiserfs_xattr.h39no-header-test += linux/reiserfs_xattr.h
40header-test- += linux/sctp.h40no-header-test += linux/sctp.h
41header-test- += linux/signal.h41no-header-test += linux/signal.h
42header-test- += linux/sysctl.h42no-header-test += linux/sysctl.h
43header-test- += linux/usb/audio.h43no-header-test += linux/usb/audio.h
44header-test- += linux/v4l2-mediabus.h44no-header-test += linux/v4l2-mediabus.h
45header-test- += linux/v4l2-subdev.h45no-header-test += linux/v4l2-subdev.h
46header-test- += linux/videodev2.h46no-header-test += linux/videodev2.h
47header-test- += linux/vm_sockets.h47no-header-test += linux/vm_sockets.h
48header-test- += sound/asequencer.h48no-header-test += sound/asequencer.h
49header-test- += sound/asoc.h49no-header-test += sound/asoc.h
50header-test- += sound/asound.h50no-header-test += sound/asound.h
51header-test- += sound/compress_offload.h51no-header-test += sound/compress_offload.h
52header-test- += sound/emu10k1.h52no-header-test += sound/emu10k1.h
53header-test- += sound/sfnt_info.h53no-header-test += sound/sfnt_info.h
54header-test- += xen/evtchn.h54no-header-test += xen/evtchn.h
55header-test- += xen/gntdev.h55no-header-test += xen/gntdev.h
56header-test- += xen/privcmd.h56no-header-test += xen/privcmd.h
57 57
58# More headers are broken in some architectures58# More headers are broken in some architectures
59 59
60ifeq ($(SRCARCH),arc)60ifeq ($(SRCARCH),arc)
61header-test- += linux/bpf_perf_event.h61no-header-test += linux/bpf_perf_event.h
62endif62endif
63 63
64ifeq ($(SRCARCH),ia64)64ifeq ($(SRCARCH),ia64)
65header-test- += asm/setup.h65no-header-test += asm/setup.h
66header-test- += asm/sigcontext.h66no-header-test += asm/sigcontext.h
67header-test- += asm/perfmon.h67no-header-test += asm/perfmon.h
68header-test- += asm/perfmon_default_smpl.h68no-header-test += asm/perfmon_default_smpl.h
69header-test- += linux/if_bonding.h69no-header-test += linux/if_bonding.h
70endif70endif
71 71
72ifeq ($(SRCARCH),mips)72ifeq ($(SRCARCH),mips)
73header-test- += asm/stat.h73no-header-test += asm/stat.h
74endif74endif
75 75
76ifeq ($(SRCARCH),powerpc)76ifeq ($(SRCARCH),powerpc)
77header-test- += asm/stat.h77no-header-test += asm/stat.h
78header-test- += linux/bpf_perf_event.h78no-header-test += linux/bpf_perf_event.h
79endif79endif
80 80
81ifeq ($(SRCARCH),riscv)81ifeq ($(SRCARCH),riscv)
82header-test- += linux/bpf_perf_event.h82no-header-test += linux/bpf_perf_event.h
83endif83endif
84 84
85ifeq ($(SRCARCH),sparc)85ifeq ($(SRCARCH),sparc)
86header-test- += asm/stat.h86no-header-test += asm/stat.h
87header-test- += asm/uctx.h87no-header-test += asm/uctx.h
88header-test- += asm/fbio.h88no-header-test += asm/fbio.h
89endif89endif
90 90
91# asm-generic/*.h is used by asm/*.h, and should not be included directly91# asm-generic/*.h is used by asm/*.h, and should not be included directly
92header-test- += asm-generic/%92no-header-test += asm-generic/%
93 93
94extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))94extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null))
95 95
96# Include the header to detect missing include guard.
96quiet_cmd_hdrtest = HDRTEST $<97quiet_cmd_hdrtest = HDRTEST $<
97 cmd_hdrtest = \98 cmd_hdrtest = \
98 $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \99 $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
99 $(if $(filter-out $(header-test-), $*.h), -include $<); \100 $(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
100 $(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \101 $(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
101 touch $@102 touch $@
102 103
usr/initramfs_data.S+1−4
@@ -22,12 +22,9 @@ · 21 unmodified lines
22 in the ELF header, as required by certain architectures.22 in the ELF header, as required by certain architectures.
23*/23*/
24 24
25#include <linux/stringify.h>
26#include <asm-generic/vmlinux.lds.h>
27
28.section .init.ramfs,"a"25.section .init.ramfs,"a"
29__irf_start:26__irf_start:
30.incbin __stringify(INITRAMFS_IMAGE)27.incbin "usr/initramfs_inc_data"
31__irf_end:28__irf_end:
32.section .init.ramfs.info,"a"29.section .init.ramfs.info,"a"
33.globl __initramfs_size30.globl __initramfs_size

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t