Skip to contentSkip to conversation

Makefile: Fix size_append issue for bzip2/lzma kernel

PATCH Applied Alek Du 3 participants 5 messages Aug 19, 2009 – Sep 27, 2009 Kbuild

lore
Share & tools
lore

Alek Du

author
#0 lore raw

PATCH 1/1 Makefile: Fix size_append issue for bzip2/lzma kernel

From 6d755cbd7a136a4314f6976275aaa6c9d10bf3e4 Mon Sep 17 00:00:00 2001
From: Alek Du <[email protected]>
Date: Wed, 19 Aug 2009 17:18:39 +0800
Subject: [PATCH] Makefile: Fix size_append issue for bzip2/lzma kernel

The Makefile.lib will call "echo -ne" to append uncompressed kernel size to bzip2/lzma kernel image. The "echo" here depends on the shell that /bin/sh pointing to. On Ubuntu system, the /bin/sh is pointing to dash, which does not support "echo -e" at all. Use /bin/echo instead of shell echo should always be safe.

---
 scripts/Makefile.lib |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/Makefile.lib +1 -1
index 7a77787..c63c941 100644
@@ -208,7 +208,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
 
 # Bzip2 and LZMA do not include size in file... so we have to fake that;
 # append the size as a 32-bit littleendian number as gzip does.
-size_append = echo -ne $(shell						\
+size_append = /bin/echo -ne $(shell						\
 dec_size=0;								\
 for F in $1; do								\
 	fsize=$$(stat -c "%s" $$F);					\
Signature · 1 line
1.6.0.4
Acked-by on v1 1/1
#1 lore raw

On Wed, Aug 19, 2009 at 05:38:54PM +0800, Alek Du wrote:
From 6d755cbd7a136a4314f6976275aaa6c9d10bf3e4 Mon Sep 17 00:00:00 2001

Quoted 10 lines

From: Alek Du <[email protected]>
Date: Wed, 19 Aug 2009 17:18:39 +0800
Subject: [PATCH] Makefile: Fix size_append issue for bzip2/lzma kernel

The Makefile.lib will call "echo -ne" to append uncompressed kernel size to bzip2/lzma kernel image. The "echo" here depends on the shell that /bin/sh pointing to. On Ubuntu system, the /bin/sh is pointing to dash, which does not support "echo -e" at all. Use /bin/echo instead of shell echo should always be safe.

Agree.

Quoted 24 lines

---
scripts/Makefile.lib | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
scripts/Makefile.lib +1 -1
index 7a77787..c63c941 100644
@@ -208,7 +208,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
 
 # Bzip2 and LZMA do not include size in file... so we have to fake that;
 # append the size as a 32-bit littleendian number as gzip does.
-size_append = echo -ne $(shell						\
+size_append = /bin/echo -ne $(shell						\
 dec_size=0;								\
 for F in $1; do								\
 	fsize=$$(stat -c "%s" $$F);					\
Signature · 6 lines
1.6.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw

PATCH 1/1 scripts: use non-builtin echo for '-e'

In reply to Alek Du

Alek reported that on Ubuntu, where dash is used, 'echo -e' can't work, so let's use non-builtin echo in this case.

---

scripts/Kbuild.include +1 -1
index c29be8f..bace250 100644
@@ -99,7 +99,7 @@ as-option = $(call try-run,\
 # Usage: cflags-y += $(call as-instr,instr,option1,option2)
 
 as-instr = $(call try-run,\
-	echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
+	/bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3))
 
 # cc-option
 # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
scripts/checkkconfigsymbols.sh +2 -2
index 39677c8..46be3c5 100755
@@ -9,7 +9,7 @@ paths="$@"
 # Doing this once at the beginning saves a lot of time, on a cache-hot tree.
 Kconfigs="`find . -name 'Kconfig' -o -name 'Kconfig*[^~]'`"
 
-echo -e "File list \tundefined symbol used"
+/bin/echo -e "File list \tundefined symbol used"
 find $paths -name '*.[chS]' -o -name 'Makefile' -o -name 'Makefile*[^~]'| while read i
 do
 	# Output the bare Kconfig variable and the filename; the _MODULE part at
@@ -54,6 +54,6 @@ while read symb files; do
 	# beyond the purpose of this script.
 	symb_bare=`echo $symb | sed -e 's/_MODULE//'`
 	if ! grep -q "\<$symb_bare\>" $Kconfigs; then
-		echo -e "$files: \t$symb"
+		/bin/echo -e "$files: \t$symb"
 	fi
 done|sort
Applied
#4 lore raw
In reply to Alek Du
Quoted 11 lines · Alek Du

From 6d755cbd7a136a4314f6976275aaa6c9d10bf3e4 Mon Sep 17 00:00:00 2001
From: Alek Du <[email protected]>
Date: Wed, 19 Aug 2009 17:18:39 +0800
Subject: [PATCH] Makefile: Fix size_append issue for bzip2/lzma kernel

The Makefile.lib will call "echo -ne" to append uncompressed kernel size to bzip2/lzma kernel image. The "echo" here depends on the shell that /bin/sh pointing to. On Ubuntu system, the /bin/sh is pointing to dash, which does not support "echo -e" at all. Use /bin/echo instead of shell echo should always be safe.

Applied.