From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?SsOhbiBPTkRSRUogKFNBTCk=?= Subject: Re: [PATCH] unbreak booting with virtio Date: Sat, 1 Aug 2009 09:04:55 +0200 Message-ID: <20090801070455.GD2701@salstar.sk> References: <1249064349-799-1-git-send-email-glommer@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Glauber Costa , "kvm@vger.kernel.org" , "avi@redhat.com" To: Alexander Graf Return-path: Received: from work.salstar.sk ([158.197.240.41]:59790 "EHLO work.salstar.sk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbZHAHE4 (ORCPT ); Sat, 1 Aug 2009 03:04:56 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jul 31, 2009 at 09:55:39PM +0200, Alexander Graf wrote: > > On 31.07.2009, at 20:19, Glauber Costa wrote: > >> Since commit 89e671e3, extboot is broken due to wrong checksum >> >> The problem is that printf "\\$sum" syntax will require an octal >> representation, so the fix I'm proposing is to convert it first. > > Is there no easy way to tell printf we're on decimal? I don't have a > Linux system handy atm, but I thought \90 was in fact a 90. > > Either way, my only complaint would be to introduce a dependency on bc. >> cp "$1" "$2" >> +sum=$(echo "obase=8; $sum" | bc) >> printf "\\$sum" | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/ >> dev/null May be it's better to use awk: echo $sum | awk '{ printf("%c", $1) }' \ | dd of="$2" bs=1 count=1 seek=$size conv=notrunc 2>/dev/null This version accepts decimal $sum, does not need conversion to octal. SAL