"Could not stat file: system.img " error trying to generate a boot-able image for Android on x86

Hello,

I'm using the script called make_boot_img.sh to generate a boot-able image for Android on x86 platforms. It doesn't works due this error message :

number of inodes too low, increasing to 10
Updated boot length to be 8192KB
Updated cache length to be 8192KB
Could not stat file: system.img
installed.img is ready if you don't see any error messages

the file has been created,but it is too small. I think that's damaged because it's not possible to convert it from img to vdi format,as you can see :

vboxmanage convertfromraw -static -format vdi installed.img installed.vdi

VirtualBox Command Line Management Interface Version 2.1.4_OSE
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Converting from raw image file="installed.img" to file="installed.vdi"...
Creating fixed image with size 79328 bytes (1MB)...
Error while creating the disk image "installed.vdi": VERR_INVALID_PARAMETER

this is the script :

#!/bin/sh
#
# This script is based on ChenYang (sunsetyang@gmail.com)'s instructions
# posted in Android porting group.
# This script is mainly used to generate a boot-able image for Android on
# x86 platforms. The image can be easily converted into a image for wmware
# or virtualbox
#

EXECPATH="out/target/product/eee_701"
BINPATH="../../../../out/host/linux-x86/bin/"
CP=cp
ECHO=echo
GZIP=gzip
RM=rm
MKDIR=mkdir
SED=sed
MKBOOTFS=${BINPATH}/mkbootfs
GENEXT2FS=${BINPATH}/genext2fs
EDITDISKLBL=${BINPATH}/editdisklbl

cd $(dirname $0)
DEFDISKCONF=$PWD/disk_img.conf

DISKCONF=${1:-$DEFDISKCONF}

cd ../../../$EXECPATH
if [ $? -ne 0 -o ! -e grub -o ! -e root -o ! -e data -o ! -e system -o
! -e ${BINPATH} ]; then
   ${ECHO} "Can not find prebuilt directories"
   ${ECHO} "Please run TARGET_ARCH=x86 TARGET_PRODUCT=eee_701
DISABLE_DEXPREOPT=true make -j4 installer_img first"
   exit
fi

if [ ! -e kernel ];
then
   ${ECHO} "Can not find kernel image, please build kernel image first"
   exit
fi
if [ -e bootimg ];
then
   ${RM} -rf bootimg
fi

if [ -e rootimg ];
then
   ${RM} -rf rootimg
fi

if [ ! -e dummy ];
then
   ${MKDIR} dummy
fi

${MKDIR} bootimg
${CP} grub/grub.bin installed.img
${CP} -raf root rootimg
${SED} -e 's/ext3/ext2/'<root/init.rc>rootimg/init.rc
${MKBOOTFS} rootimg | ${GZIP} -9 > bootimg/ramdisk
${ECHO} "console=tty0 console=ttyS1,115200n8 console=tty0
androidboot.hardware=eee_701 vga=788" > bootimg/cmdline
${CP} kernel bootimg/kernel
${GENEXT2FS} -b 8192 -m 0 -d bootimg boot.img
${GENEXT2FS} -b 8192 -m 0 -N 8 -d dummy dummy.img
${GENEXT2FS} -b 81920 -d data -N 512 -m 0 data.img
${EDITDISKLBL} -l ${DISKCONF} -i installed.img  boot=boot.img
cache=dummy.img system=system.img third_party=dummy.img data=data.img

${ECHO} "installed.img is ready if you don't see any error messages"
LVL 2
marietto2008Asked:
Who is Participating?
 
nociConnect With a Mentor Software EngineerCommented:
The inode error probably is issued by genext2 and not disklabel.
I have no android env. but -N 8 seems to indicate the number of inodes and it is forced to 10 at least.
If there are LESS then 10 files (incl. root directory) on a disk image it should fit.
I dont think it is an issue here.

The "could not stat " is equivalent to "could not find file".
The stat()  function is used to give statistics about a file (size, create/modify date, ownership, protection etc.) the question is that it needs a system.img file and cannot find one.

If you are sure your disk is not full during this action then you need to findout why the disk image is not created.
0
 
marietto2008Author Commented:
problem is here :

${EDITDISKLBL} -l ${DISKCONF} -i installed.img  boot=boot.img cache=dummy.img system=system.img third_party=dummy.img data=data.img

because I have no system.img file and I don't know where and who should create it.
0
 
marietto2008Author Commented:
I've tried to boot the Android kernel in VirtualBox 2.10,but it didn't work. This is what I've done :

Started VirtualBox and pushed F12 key when it said : "Press F12 to
select boot device" in virtualbox window.
Selected IDE Primary Master
Booted to "std_boot"

but I see only a black screen. Can you tell me why ? These are the size of the image files :

installed.img --->  531.267.584 byte
installed.vdi   ---> 439.369.728 byte

Very Thanks.
0
 
marietto2008Author Commented:
fixed restarting everything from the beginning.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.