Openmoko under QEMU on MacOSX

From Openmoko

Revision as of 13:20, 12 July 2007 by Cayco (Talk | contribs)

Jump to: navigation, search

Warning: this is draft!

I try to put here my notes on setting up OpenMoko environment (Qemu and MokoMakefile) on Mac OS X.

Contents

Introduction

Some time ago I ask if anyone has ever set up OpenMoko environment on MacOS X. No one has answered that he did but several people were interested. So I deceided to wrote some directions on how to do that.

As for now I was not successful but I am still trying ;)

Setting up environment

Prequisites

Install fink and darwinports (both have neccesary packages).

Follow instructions on: http://www.openembedded.org/wiki/BuildOnOSX to set up OE environment.

It is neccessary to create new disk image, just as BuildOnOSX says.

If you're compiilng something connected with X11 be sure to install X11devel package from your MacOS X CD1.

You can get mentioned packages using darwinports:

sudo port install quilt
sudo port install py-psyco
sudo port install cogito
sudo port install gawk
fink install sed

Then get Q[kju] project: http://www.kju-app.org/proj/wiki/CompilingQ into /Volumes/OE/Q but do not compile it yet (run only "prepare the sources"). This will be needed for compiling Neo1973 emulator.

Set up environment as described in MokoMakefile:

cd /Volumes/OE
mkdir moko; cd moko
wget http://www.rwhitby.net/files/openmoko/Makefile

make setup

Making developers image

make openmoko-devel-image

I had problems with bitbake - it does not run correctly with psyco (I got "Illegal instruction error" and make exited with error 132) so I had to disable it: I run bitbake -d openmoko-devel-image in MokoMakefile.

Also, I ended up with:

ERROR: Error in executing: /Volumes/OE/moko/openembedded/packages/quilt/quilt-native_0.45.bb
ERROR: Exception:exceptions.UnboundLocalError Message:local variable 'md5data' referenced before assignment

I found out that I did not have md5sum which is used by bitbake. I found it in testutils packages from fink. Installing it did not help... I got pissed and temporarily changed

vim /Volumes/OE/moko/bitbake/lib/bb/fetch/wget.py +114

so it look like this

#           supposedly complete.. write out md5sum
            md5data = ""
            if bb.which(data.getVar('PATH', d), 'md5sum'):
                try:
                    md5pipe = os.popen('md5sum ' + dl)
                    md5data = (md5pipe.readline().split() or [ "" ])[0]
                    md5pipe.close()
                except OSError:
                    md5data = ""

            # verify the md5sum
            #if not verify_md5sum(wanted_md5sum, md5data):
            #    raise MD5SumError(uri)

As you can see there I disabled md5sum verification.

If you have error like this


| checking for sed... /usr/bin/sed
| checking whether /usr/bin/sed understands (foo|bar)... no
| configure: error:
| Sorry, you have a version of sed which doesn't understand constructs
| of the form (foo|bar).  quilt needs it.  If you have access to
| a version of sed which does understand such constructs, you can supply
| its path with the '--with-sed=' option.


Install GNU sed from fink.

Now I have:

| libbb.h:53:22: error: features.h: No such file or directory

while compiling ipkg

Patching qemu-neo1973

The main idea is to get patches for gcc-4.x from Q project and apply it to qemu-neo1973 branch. I'm still working on it.

Building emulator

TODO

Personal tools

Warning: this is draft!

I try to put here my notes on setting up OpenMoko environment (Qemu and MokoMakefile) on Mac OS X.

Introduction

Some time ago I ask if anyone has ever set up OpenMoko environment on MacOS X. No one has answered that he did but several people were interested. So I deceided to wrote some directions on how to do that.

As for now I was not successful but I am still trying ;)

Setting up environment

Prequisites

Install fink and darwinports (both have neccesary packages).

Follow instructions on: http://www.openembedded.org/wiki/BuildOnOSX to set up OE environment.

It is neccessary to create new disk image, just as BuildOnOSX says.

If you're compiilng something connected with X11 be sure to install X11devel package from your MacOS X CD1.

You can get mentioned packages using darwinports:

sudo port install quilt
sudo port install py-psyco
sudo port install cogito
sudo port install gawk
fink install sed

Then get Q[kju] project: http://www.kju-app.org/proj/wiki/CompilingQ into /Volumes/OE/Q but do not compile it yet (run only "prepare the sources"). This will be needed for compiling Neo1973 emulator.

Set up environment as described in MokoMakefile:

cd /Volumes/OE
mkdir moko; cd moko
wget http://www.rwhitby.net/files/openmoko/Makefile

make setup

Making developers image

make openmoko-devel-image

I had problems with bitbake - it does not run correctly with psyco (I got "Illegal instruction error" and make exited with error 132) so I had to disable it: I run bitbake -d openmoko-devel-image in MokoMakefile.

Also, I ended up with:

ERROR: Error in executing: /Volumes/OE/moko/openembedded/packages/quilt/quilt-native_0.45.bb
ERROR: Exception:exceptions.UnboundLocalError Message:local variable 'md5data' referenced before assignment

I found out that I did not have md5sum which is used by bitbake. I found it in testutils packages from fink. Installing it did not help... I got pissed and temporarily changed

vim /Volumes/OE/moko/bitbake/lib/bb/fetch/wget.py +114

so it look like this

#           supposedly complete.. write out md5sum
            md5data = ""
            if bb.which(data.getVar('PATH', d), 'md5sum'):
                try:
                    md5pipe = os.popen('md5sum ' + dl)
                    md5data = (md5pipe.readline().split() or [ "" ])[0]
                    md5pipe.close()
                except OSError:
                    md5data = ""

            # verify the md5sum
            #if not verify_md5sum(wanted_md5sum, md5data):
            #    raise MD5SumError(uri)

As you can see there I disabled md5sum verification.

If you have error like this


| checking for sed... /usr/bin/sed
| checking whether /usr/bin/sed understands (foo|bar)... no
| configure: error:
| Sorry, you have a version of sed which doesn't understand constructs
| of the form (foo|bar).  quilt needs it.  If you have access to
| a version of sed which does understand such constructs, you can supply
| its path with the '--with-sed=' option.


Install GNU sed from fink.

Now I have:

| libbb.h:53:22: error: features.h: No such file or directory

while compiling ipkg

Patching qemu-neo1973

The main idea is to get patches for gcc-4.x from Q project and apply it to qemu-neo1973 branch. I'm still working on it.

Building emulator

TODO