public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Willy Tarreau <w@1wt.eu>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.cz>,
	Michael Guntsche <mike@it-loops.com>,
	Oliver Hartkopp <oliver@hartkopp.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kbuild: correct size calculation of bzImgae / fix x86 boot
Date: Sun, 20 Dec 2009 14:09:52 +0100	[thread overview]
Message-ID: <20091220130952.GD9719@1wt.eu> (raw)
In-Reply-To: <4B2E00B1.9010009@msgid.tls.msk.ru>

On Sun, Dec 20, 2009 at 01:47:13PM +0300, Michael Tokarev wrote:
> Willy Tarreau wrote:
> > On Sun, Dec 20, 2009 at 11:03:44AM +0100, Sam Ravnborg wrote:
> >> We use ... printf \x ... when calculating the size of the
> >> compressed kernel.
> >> Unfortunately dash built-in printf does not support this notation
> >> resulting in a non-bootable kernel.
> >>
> >> Fix this by always using the external version of printf.
> > 
> > Do we really want to workaround shells bugs ? I mean, either
> 
> There's no bugs in dash, as far as I can see.  According to
> POSIX, a) echo does not need to interpret _any_ escape sequences
> at all, and b) printf is not required to interpret \x sequences.

Interesting.

> Ref:
> 
> http://www.opengroup.org/onlinepubs/000095399/utilities/echo.html
> ...
>   string
>     A string to be written to standard output. If the first operand is -n,
>     or if any of the operands contain a backslash ( '\' ) character,
>    the results are implementation-defined.
> 
>     [XSI] On XSI-conformant systems, [..] the following character sequences
>     shall be recognized on XSI-conformant systems within any of the arguments:
> 
>     \a \b \c \f \n \r \t \v \\
>     \0num
>         Write an 8-bit value that is the zero, one, two, or three-digit octal
>         number num.
> 
> http://www.opengroup.org/onlinepubs/000095399/utilities/printf.html
> 
>  In addition to the escape sequences shown in the Base Definitions volume of IEEE
>  Std 1003.1-2001, Chapter 5, File Format Notation ( '\\', '\a', '\b', '\f', '\n',
>  '\r', '\t', '\v' ), "\ddd", where ddd is a one, two, or three-digit octal number,
>  shall be written as a byte with the numeric value specified by the octal number.

OK so the bug will not be fixed by calling /usr/bin/printf. It
will still work by pure luck when a the proper printf utility
will be there, but not when we use a posix-compliant one. The
proper fix then consists in writing octal chars in the form
of "\ddd" instead of "\xhh". And if dash is posix-compliant,
no need for the absolute path.

Willy


  reply	other threads:[~2009-12-20 13:10 UTC|newest]

Thread overview: 25+ 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
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 [this message]
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

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=20091220130952.GD9719@1wt.eu \
    --to=w@1wt.eu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike@it-loops.com \
    --cc=mjt@tls.msk.ru \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox