All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: Michal Marek <mmarek@suse.cz>
Cc: Michael Tokarev <mjt@tls.msk.ru>, Sam Ravnborg <sam@ravnborg.org>,
	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: Mon, 21 Dec 2009 14:50:06 +0100	[thread overview]
Message-ID: <m2pr68e8s1.fsf@igel.home> (raw)
In-Reply-To: <4B2F68AA.2020102@suse.cz> (Michal Marek's message of "Mon, 21 Dec 2009 13:23:06 +0100")

Michal Marek <mmarek@suse.cz> writes:

> Andreas Schwab napsal(a):
>> Does dash's printf support %b?  Then this should work.
>
> Good idea. %b is specified by posix, so there is hope :).

Actually you don't need it anyway.  (Still untested though.)

Andreas.

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index cd815ac..7173c0c 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -213,14 +213,16 @@ 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 = printf $(shell						\
+size_append = printf $$(						\
 dec_size=0;								\
 for F in $1; do								\
 	fsize=$$(stat -c "%s" $$F);					\
 	dec_size=$$(expr $$dec_size + $$fsize);				\
 done;									\
-printf "%08x" $$dec_size |						\
-	sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g'	\
+for i in 1 2 3 4; do							\
+	printf '\\%03o' $$(expr $$dec_size % 256);			\
+  	dec_size=$$(expr $$dec_size / 256);				\
+done									\
 )
 
 quiet_cmd_bzip2 = BZIP2   $@

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2009-12-21 13:50 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
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 [this message]
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=m2pr68e8s1.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --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 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.