diff mbox series

use bash instead of sh to run mkcompile_h

Message ID 1577253483-24358-1-git-send-email-fanliangcai9@gmail.com (mailing list archive)
State New, archived
Headers show
Series use bash instead of sh to run mkcompile_h | expand

Commit Message

Liangcai Fan Dec. 25, 2019, 5:58 a.m. UTC
From: Liangcai Fan <liangcai.fan@unisoc.com>

Use sh to run mkcompile_h, compilation would fail if whoami contains
backslash, since sh uses dash. The reason is that the echo command would
interpret backslash to escapes, so the LINUX_COMPILE_BY definition was
incorrect.

Parse mkcompile_h with bash, the echo command would not see backslash as
escapes, then there is no error with the definition of LINUX_COMPILE_BY.

Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
Signed-off-by: Liangcai Fan <fanliangcai9@gmail.com>
---
 init/Makefile       | 2 +-
 scripts/mkcompile_h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Masahiro Yamada Dec. 26, 2019, 9:25 a.m. UTC | #1
On Wed, Dec 25, 2019 at 2:58 PM Liangcai Fan <fanliangcai9@gmail.com> wrote:
>
> From: Liangcai Fan <liangcai.fan@unisoc.com>
>
> Use sh to run mkcompile_h, compilation would fail if whoami contains
> backslash, since sh uses dash. The reason is that the echo command would
> interpret backslash to escapes, so the LINUX_COMPILE_BY definition was
> incorrect.
>
> Parse mkcompile_h with bash, the echo command would not see backslash as
> escapes, then there is no error with the definition of LINUX_COMPILE_BY.
>
> Signed-off-by: Liangcai Fan <liangcai.fan@unisoc.com>
> Signed-off-by: Liangcai Fan <fanliangcai9@gmail.com>
> ---

This problem was fixed by
commit c8f3dea90e38194dae542c5d56e05d30447e58cb
diff mbox series

Patch

diff --git a/init/Makefile b/init/Makefile
index 6246a06..9348d17 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -33,6 +33,6 @@  $(obj)/version.o: include/generated/compile.h
 silent_chk_compile.h = :
 include/generated/compile.h: FORCE
 	@$($(quiet)chk_compile.h)
-	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@	\
+	$(Q)$(BASH) $(srctree)/scripts/mkcompile_h $@	\
 	"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)"	\
 	"$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)"
diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index 3a5a4b2..cfc2e2a 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -1,4 +1,4 @@ 
-#!/bin/sh
+#!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
 TARGET=$1