Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
1,150 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
  • 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 1500 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Here, we have shared an easy step by step tutorial on how to download instagram images and videos on PC, Android Mobile and iOS mobile.
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

877 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