From: Michael Tokarev <mjt@tls.msk.ru>
To: Johannes Stezenbach <js@sig21.net>
Cc: Sam Ravnborg <sam@ravnborg.org>,
Michael Guntsche <mike@it-loops.com>,
Oliver Hartkopp <oliver@hartkopp.net>,
linux-kernel <linux-kernel@vger.kernel.org>,
mmarek@suse.cz
Subject: Re: 2.6.33-rc1 Reboot right after bootloader
Date: Sun, 20 Dec 2009 13:38:47 +0300 [thread overview]
Message-ID: <4B2DFEB7.4080507@msgid.tls.msk.ru> (raw)
In-Reply-To: <20091220091019.GA20246@sig21.net>
[-- Attachment #1: Type: text/plain, Size: 2136 bytes --]
Johannes Stezenbach wrote:
> On Sun, Dec 20, 2009 at 09:46:56AM +0100, Sam Ravnborg wrote:
>> On Sun, Dec 20, 2009 at 12:34:57AM +0100, Michael Guntsche wrote:
>>> I took me some time but I tracked down my reboot problem. The culprit is
>>> commit
>>>
>>> 4a2ff67c88211026afcbdbc190c13f705dae1b59: kbuild: fix bzImage build for
>>> x86
>> Just to check what is going wrong here could you try to execute the following two commands:
>> printf \\xa8\\x51\\x37\\x00 > x ; hexdump x
>> /usr/bin/printf \\xa8\\x51\\x37\\x00 > x ; hexdump x
>> echo -ne \\xa8\\x51\\x37\\x00 > x ; hexdump x
>>
>> Please try as above and also with full path to printf (/usr/bin/printf)
>
> Debian dash has a built-in printf which doesn't support \x.
> /usr/bin/printf works fine.
So it looks like I was wrong with the last patch here.
I changed `/bin/echo -ne' to printf. And while it worked
for me at that time, apparently it does not work for others.
Now I wonder why it worked for me. I can confirm that
in current debian testing (dash-0.5.5.1-3) and in debian
stable (dash-0.5.4-12) dash's built-in printf does not
interpret \x escape sequence. I sure verified the fix
I proposed, rebuilding kernels in a freshly-installed
debian testing with /bin/sh pointing to dash. I'll try
to investigate this. (Side note: since the time this
issue first hit me, I carry 4a2ff67c88211026afcbdbc190c13f705dae1b59
locally.)
It is even more interesting. I re-read POSIX description
of printf, see
http://www.opengroup.org/onlinepubs/000095399/utilities/printf.html
And this one, too, does NOT mention \x at all. Printf is
still "better" than echo because for echo _no_ interpretation
of escape sequences is mandated -- see
http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
but that does not help much since for printf, while \-sequences
are mandated, particular \x is not, so \x is a {GNU|common sense|...}
extension.
What the...
So now I don't know what to do. According to the standard, there's
no utility that will work here. ;) Maybe the attached (together
with 4a2ff67c88211026afcbdbc190c13f705dae1b59) will make everyone happy?
/mjt
[-- Attachment #2: use-printf-octal.diff --]
[-- Type: text/x-patch, Size: 423 bytes --]
--- a/scripts/Makefile.lib.orig 2009-12-19 18:36:01.944153109 +0300
+++ a/scripts/Makefile.lib 2009-12-20 13:36:04.014530573 +0300
@@ -215,6 +215,6 @@
dec_size=$$(expr $$dec_size + $$fsize); \
done; \
-printf "%08x" $$dec_size | \
- sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g' \
+printf "%012o" $$dec_size | \
+ sed 's/\(...\)\(...\)\(...\)\(...\)/\\\\4\\\\3\\\\2\\\\1/g' \
)
next prev parent reply other threads:[~2009-12-20 10:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-19 23:34 2.6.33-rc1 Reboot right after bootloader Michael Guntsche
2009-12-20 8:46 ` Sam Ravnborg
2009-12-20 9:10 ` Johannes Stezenbach
2009-12-20 10:38 ` Michael Tokarev [this message]
2009-12-20 11:10 ` Michael Tokarev
2009-12-20 11:38 ` Michael Tokarev
2009-12-20 9:11 ` Michael Guntsche
2009-12-20 10:03 ` [PATCH] kbuild: correct size calculation of bzImgae / fix x86 boot Sam Ravnborg
2009-12-20 10:20 ` Oliver Hartkopp
2009-12-20 10:28 ` Willy Tarreau
2009-12-20 10:47 ` Michael Tokarev
2009-12-20 13:09 ` Willy Tarreau
2009-12-20 11:19 ` Michael Tokarev
2009-12-20 12:02 ` Andreas Schwab
2009-12-20 12:18 ` Sam Ravnborg
2009-12-21 12:23 ` Michal Marek
2009-12-21 13:50 ` Andreas Schwab
2009-12-20 14:11 ` Sam Ravnborg
2009-12-21 14:17 ` Michal Marek
2009-12-21 16:28 ` Michael Guntsche
2009-12-21 19:53 ` Michael Tokarev
2009-12-21 20:48 ` Michael Guntsche
2009-12-21 18:28 ` H. Peter Anvin
2009-12-21 19:09 ` H. Peter Anvin
2009-12-20 13:50 ` Arkadiusz Miskiewicz
-- strict thread matches above, loose matches on Subject: below --
2009-12-18 14:06 2.6.33-rc1 Reboot right after bootloader Michael Guntsche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B2DFEB7.4080507@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=js@sig21.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mike@it-loops.com \
--cc=mmarek@suse.cz \
--cc=oliver@hartkopp.net \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.