Skip to content

Commit 083cad7

Browse files
committed
kbuild: fix "cat: .version: No such file or directory"
Since commit 2df8220 ("kbuild: build init/built-in.a just once"), the .version file is not touched at all when KBUILD_BUILD_VERSION is given. If KBUILD_BUILD_VERSION is specified and the .version file is missing (for example right after 'make mrproper'), "No such file or director" is shown. Even if the .version exists, it is irrelevant to the version of the current build. $ make -j$(nproc) KBUILD_BUILD_VERSION=100 mrproper defconfig all [ snip ] BUILD arch/x86/boot/bzImage cat: .version: No such file or directory Kernel: arch/x86/boot/bzImage is ready (#) Show KBUILD_BUILD_VERSION if it is given. Fixes: 2df8220 ("kbuild: build init/built-in.a just once") Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
1 parent 534bd70 commit 083cad7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/microblaze/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ linux.bin.ub linux.bin.gz: linux.bin
6767
linux.bin: vmlinux
6868
linux.bin linux.bin.gz linux.bin.ub:
6969
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
70-
@echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')'
70+
@echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
7171

7272
PHONY += simpleImage.$(DTB)
7373
simpleImage.$(DTB): vmlinux
7474
$(Q)$(MAKE) $(build)=$(boot) $(addprefix $(boot)/$@., ub unstrip strip)
75-
@echo 'Kernel: $(boot)/$@ is ready' ' (#'`cat .version`')'
75+
@echo 'Kernel: $(boot)/$@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
7676

7777
define archhelp
7878
echo '* linux.bin - Create raw binary'

arch/x86/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
8383

8484
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
8585
$(call if_changed,image)
86-
@$(kecho) 'Kernel: $@ is ready' ' (#'`cat .version`')'
86+
@$(kecho) 'Kernel: $@ is ready' ' (#'$(or $(KBUILD_BUILD_VERSION),`cat .version`)')'
8787

8888
OBJCOPYFLAGS_vmlinux.bin := -O binary -R .note -R .comment -S
8989
$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE

0 commit comments

Comments
 (0)