[Dextrose] Problem with olpc-os-builder: ZD image of 20 MB

Bernie Innocenti bernie at codewiz.org
Wed Oct 6 09:24:48 EDT 2010


On Wed, 2010-10-06 at 09:42 -0200, Daniel Castelo wrote:
> Hi! We could generate XO 1.5 images (dextrose images) with olpc os
> builder, but sometimes we get a strange behaviour: at the end of the
> process olpc os builder give us this error message:
> 
> /home/latu/olpc-os-builder-1.1.0.dextrose.uy_4Oct/modules/sd_card_image/image.50.makefs.sh: line 54: * 512: syntax error: operand expected (error token is "* 512")
> 
> and the size of the ZD image generated is just 20 MB. 
> 
> Have you ever seen this behaviour?

I've never seen it myself. Here's the relevant code:

 48  local img_sectors=$(sfdisk -uS -l $img | grep img2 | awk '{print $4}')
 49  echo "(1 losetup error is normal here)"
 50  losetup -d /dev/loop6 || :
 51  losetup -o $((8192 * $BLOCK_SIZE)) --sizelimit $((131072 * $BLOCK_SIZE)) /dev/loop6 $img
 52  echo "(1 losetup error is normal here)"
 53  losetup -d /dev/loop7 || :
 54  losetup -o $(((8192 + 131072) * $BLOCK_SIZE)) --sizelimit $(($img_sectors * $BLOCK_SIZE)) /dev/loop7 $img

The error probably occurs because $img_sectors is uninitialized. Try
adding some debug stamennts just after line 48. For example:

 echo '*** BEGIN DEBUG ***'
 sfdisk -uS -l $img
 echo '---'
 sfdisk -uS -l $img | grep img2
 echo '---'
 sfdisk -uS -l $img | grep img2 | awk '{print $4}'
 echo '*** END DEBUG ***'

-- 
   // Bernie Innocenti - http://codewiz.org/
 \X/  Sugar Labs       - http://sugarlabs.org/




More information about the Devel mailing list