Solved

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

Posted on 2009-05-14
4
1,126 Views
Last Modified: 2013-11-15
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"
0
Comment
Question by:marietto2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 2

Author Comment

by:marietto2008
ID: 24389082
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
 
LVL 40

Accepted Solution

by:
noci earned 500 total points
ID: 24392882
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
 
LVL 2

Author Comment

by:marietto2008
ID: 24427970
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
 
LVL 2

Author Closing Comment

by:marietto2008
ID: 31581426
fixed restarting everything from the beginning.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi Firemonkey : user drawing in window 3 56
DB2 9.7 Grant Execute SP 4 60
What to monitor when using VCenter Server Linux Appliance ? 2 100
Droid 5 5 12
This is an explanation of a simple data model to help parse a JSON feed
A short article about problems I had with the new location API and permissions in Marshmallow
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to moveā€¦
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question