kbuild: really fix bzImage build with non-bash sh
authorJonathan Nieder <jrnieder@gmail.com>
Mon, 28 Dec 2009 19:38:27 +0000 (19:38 +0000)
committerMichal Marek <mmarek@suse.cz>
Wed, 13 Jan 2010 12:27:24 +0000 (13:27 +0100)
commit1373411ae4cd0caf2e1a35fb801dd9a00b64dea2
tree37acd3331e8a4683f0232ed4458ecf3921485270
parent7284ce6c9f6153d1777df5f310c959724d1bd446
kbuild: really fix bzImage build with non-bash sh

In an x86 build with CONFIG_KERNEL_LZMA enabled and dash as sh,
arch/x86/boot/compressed/vmlinux.bin.lzma ends with
'\xf0\x7d\x39\x00' (16 bytes) instead of the 4 bytes intended and
the resulting vmlinuz fails to boot.  This improves on the
previous behavior, in which the file contained the characters
'-ne ' as well, but not by much.

Previous commits replaced "echo -ne" first with "/bin/echo -ne",
then "printf" in the hope of improving portability, but none of
these commands is guaranteed to support hexadecimal escapes on
POSIX systems.  So use the shell to convert from hexadecimal to
octal.

With this change, an LZMA-compressed kernel built with dash as sh
boots correctly again.

Reported-by: Sebastian Dalfuß <sd@sedf.de>
Reported-by: Oliver Hartkopp <oliver@hartkopp.net>
Reported-by: Michael Guntsche <mike@it-loops.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Cc: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alek Du <alek.du@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
scripts/Makefile.lib