HowToMeegoFennecDraft: Difference between revisions

mNo edit summary
mNo edit summary
 
(52 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== What this is About  ==
== What this is About  ==


This is a WIP document about "How to build Mobile Firefox for Meego Platform". Its not yet working, understand this page as open documentation and feel free to improve the steps.
This document explains "How to build Mobile Firefox for Meego Netbook Platform".<br>  
 
<br>  


== Versions  ==
== Versions  ==
Line 9: Line 7:
This is written for Meego 1.1 SDK. Target Device is the Lenovo Ideapad. Target Platform is the Intel Netbook Release.  
This is written for Meego 1.1 SDK. Target Device is the Lenovo Ideapad. Target Platform is the Intel Netbook Release.  


== Current State ==
== Setup your Netbook ==


Build Fails on missing GLIB Dependency
I use a Lenovo Ideapad S10-3t supporting multitouch. This is the recommended target device of Intel. [http://meego.com/devices/netbook/installing-meego-your-netbook Follow Instructions]


== Steps ==
== Presteps, Install the SDK on your System<br> ==


#Get MeegoSDK<br>Follow the steps from the [http://wiki.meego.com/SDK/Docs/1.1/Getting_started_with_the_MeeGo_SDK_for_Linux official Meego Website]. '''Stop at the point "Install MeeGo Runtime"''', we will continue from this point on.&nbsp;<br>
Add the package respository of the SDK to your system: [http://wiki.meego.com/SDK/Docs/1.1/Getting_started_with_the_MeeGo_SDK_for_Linux#Configuring_distributions_package_manager (see source for more)]<br>  
#Download and install the [http://wiki.meego.com/SDK/Docs/1.1/Configuring_QEMU_runtimes Runtime]<br>sudo mad-admin create -f -e meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime <br>
#Mount the SDK<br>It is important to know that it is not a good idea to use Qemu and the Meego SDK. This is because of:<br>a) In case Qemu crash once, you can not start it again, everything is gone.<br>b) Qemu is very slow on compiling<br>c) For mounting working directories into Qemu you need to use nfs which is possible but increase complexity<br>d) The Image Partitions for netbook and handset are just to small in order to hold the mozilla sources<br><br>Steps:<br>1. Create mount point on your HOST Storage whereever you like it best<br>(ie. mkdir ~/meegoSDK)<br><br>2. Create a working directory on your HOST Storage whereever you like it best<br>(ie. mkdir ~/meegoWorkingDirectory)<br><br>3. Create a mount point within the meegoSDK Directory<br>(ie. mkdir ~/meegoSDK/meegoWorkingDirectory)<br><br>4. Mount the SDK Image into your Host System<br>(ie. mount -o loop,offset=512 /usr/lib/madde/linux-i686/runtimes/meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime/meego-netbook-ia32-qemu-1.1.20101031.2037-sda.raw ~/meegoSDK <br><br>5. Bind Mount your external Working Directory into the SDK Working Directory<br>(ie. mount --bind ~/meegoWorkingDirectory ~/meegoSDK/meegoWorkingDirectory)<br>
#ChangeRoot into MeegoSDK<br>1. Copy the changeroot script from this page (see section "Scripts"<br> 2. Use this script by calling<br>sdk-changeroot ~/meegoSDK<br>
#Download and install dependencies / needed packages<br><br>zypper in python-devel docutils libidl-devel libcontentaction-devel alsa-lib-devel gst-plugins-base-devel libffi-devel python sharutils bc quilt yasm wget<br><br>
#Get and Compile Mercurial<br>MeegoSDK is missing Mercurial packages, we need to download, compile and install them by our own.<br><br>cd /meegoWorkingDirectory<br>wget http://mercurial.selenic.com/release/mercurial-1.7.2.tar.gz<br>tar -xzf mercurial-1.7.2.tar.gz<br>cd mercurial-1.7.2.tar.gz<br>make install<br>cd ..<br>
#Get Xulrunner Sources from Meego Developer Preview Repository (based on Firefox Mobile Beta 2)<br>cd /meegoWorkingDirectory<br>hg clone http://hg.meego.com/mozilla-central<br>hg update -C PRC1 <br><br>
#Compile<br>The checkout there is still debian based, this needs to be adjusted. For now its good enough to use the mozconfig provided in the bottom of this page.<br><br>make -f client.mk build<br><br><br><br>


7. Get it on your Device<br>8. Run it<br>
==== On Ubuntu or Debian  ====


<br>  
<!-- Replaced '#' with <li> so that multi-line <pre> statements would appear in a single block -->  


<br>
#Add the following line to <code>/etc/apt/sources.list.d/meego-sdk.list</code>.<br> Replace ${distribution}/${version} with one of the following: "debian/5.0", "ubuntu/09.10", "ubuntu/10.04" or "ubuntu/10.10". <pre>deb http://repo.meego.com/MeeGo/sdk/host/repos/${distribution}/${version}/ / </pre>
#Add the repository public key: <pre>$ gpg --keyserver pgpkeys.mit.edu --recv 0BC7BEC479FC1F8A</pre><pre>$ gpg --export --armor 0BC7BEC479FC1F8A | sudo apt-key add -</pre>
#Update the packages database: <pre>$ sudo apt-get update</pre>
#To check that the MeeGo repository has been correctly added, run the following command. The details of the MADDE package should be printed. <pre>$ apt-cache policy madde</pre>


= Scripts<br> =
*Install <pre>$ sudo apt-get install meego-sdk</pre>


== The SDK-Change-Root-Script ==
==== On openSUSE ====
<pre># Copyright 2010, Intel Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


# Authors:
*To add the MeeGo repository, run the following command. <br> Replace ${distribution}/${version} with one of the following values: "opensuse/11.2" or "opensuse/11.3". <pre>$ sudo zypper addrepo -f http://repo.meego.com/MeeGo/sdk/host/repos/${distribution}/${version}/meego-sdk.repo</pre>
# Haitao Feng &lt;haitao.feng@intel.com&gt;
# Jackie Wu &lt;jackie.wu@intel.com&gt;


CHROOT_NAME=$0
*Install <pre>$ sudo zypper install meego-sdk</pre>


usage()
== Configure SDK  ==
{
echo Usage: "$CHROOT_NAME NEWROOT [COMMAND [ARG]...]"
echo " or: $CHROOT_NAME OPTION"
echo "Run COMMAND with root directory set to NEWROOT."
echo
echo " OPTIONS:"
echo " --help display this help and exit"
echo
echo "If no command is given, run ``${SHELL} -i''"
}


reference_increase()
Download the mozilla-meego-assistant script from this website.
{
if [ -f $1 ]; then
count=`cat $1`
if [ "X$count" != "X" ]; then
count=`expr $count + 1`
echo $count &gt; $1
fi
fi
}


reference_decrease()
#Download [[Image:Mozilla-meego-sdk-helper.tar.gz]]<br>
{
#untar the tarbal <br><br>''(the meego-assistant script, will create a mount point and a working directory in the local directory!) you can edit the place by changing the variables in the script.)''<br>
if [ -f $1 ]; then
#<pre>sudo ./meego-assistant install</pre>
count=`cat $1`
if [ "X$count" != "X" ] &amp;&amp; [ $count -gt 0 ]; then
count=`expr $count - 1`
echo $count &gt; $1
fi
fi
}


reference_print()
== Steps  ==
{
if [ -f $1 ]; then
count=`cat $1`
if [ "X$count" != "X" ]; then
echo "The reference count of [$1]: $count"
fi
fi
}


setup()
*<pre>sudo ./meego-assistant login</pre>''During first start this finish the configuration of the image. Follow the instructions on screen.<br>''
{
*Get Mozilla Sources and apply Meego Developer Patches on it<br>
chroot=$1
<pre>cd /meegoWorkingDirectory
# normal preparation for chroot
hg clone http://hg.mozilla.org/mozilla-central
echo mount --bind /proc $chroot/proc
cd mozilla-central
mount --bind /proc $chroot/proc
hg clone http://hg.mozilla.org/mobile-browser mobile
echo mount --bind /sys $chroot/sys
cd mobile/.hg
mount --bind /sys $chroot/sys
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/workbase_prc2 patches
echo mount --bind /dev $chroot/dev
cd patches
mount --bind /dev $chroot/dev
hg update -C mobile-browser
echo mount --bind /dev/pts $chroot/dev/pts
cd ../../../.hg/  
mount --bind /dev/pts $chroot/dev/pts
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/workbase_prc2 patches
cd ../  
hg qpush --all
cd mobile
hg qpush --all
cd ..
</pre>
*Download Mozconfig and start building.
<pre>wget https://wiki.mozilla.org/images/7/7c/Mozconfig.tar.gz
tar -xzf Mozconfig.tar.gz
make -f client.mk build
</pre>


# preparation for X
== Known Issues  ==
# X sockets are at /tmp/.X11-unix
# echo mount --bind /tmp $chroot/tmp
# mount --bind /tmp $chroot/tmp


# preparation for dbus
=== Crash on Start  ===
# echo mount --bind /var/lib/dbus $chroot/var/lib/dbus
# mount --bind /var/lib/dbus $chroot/var/lib/dbus
# echo mount --bind /var/run/dbus $chroot/var/run/dbus
# mount --bind /var/run/dbus $chroot/var/run/dbus


# preparation for network
Issues with Mesa Drivers. Starting in EGL accelerated version does not work. Fennec is crashing with:
echo cp /etc/resolv.conf $chroot/etc/resolv.conf
<pre>Mesa 7.9 implementation error: glIndexPointer should be mapped to 336, not 314
cp /etc/resolv.conf $chroot/etc/resolv.conf
Please report at bugzilla.freedesktop.org
}
Mesa 7.9 implementation error: glUniformMatrix4fv should be mapped to 337, not 485
Please report at bugzilla.freedesktop.org
</pre>
Solution: Disable hardware acceleration within mobile.js


cleanup()
=== Multitouch  ===
{
chroot=$1
#clean up processes using chroot
pid_set=$( ps ax | awk '{ print $1 }')
for pid in $pid_set
do
if [ -h /proc/$pid/root ]; then
ps=$( ls -l /proc/$pid/root 2&gt;/dev/null | grep $chroot)
if [ "X$ps" != "X" ]; then
kill $pid
fi
fi
done


sleep 3
Multitouch is not working in meego.com release TBI


# umount directories
=== Flash Renderspeed  ===
echo umount $chroot/proc
umount $chroot/proc
echo umount $chroot/sys
umount $chroot/sys
echo umount $chroot/dev/pts
umount $chroot/dev/pts
echo umount $chroot/dev
umount $chroot/dev


echo umount $chroot/tmp
For some people the Renderspeed with native is really slow, it seems to get better when using this for starting fennec:  
umount $chroot/tmp
<pre> MOZ_QT_GRAPHICSSYSTEM=meego ./fennec -graphicssystem meego </pre>
 
echo umount $chroot/var/lib/dbus
umount $chroot/var/lib/dbus
echo umount $chroot/var/run/dbus
umount $chroot/var/run/dbus
}
 
if test "x$1" = "x"
then
echo "$CHROOT_NAME: missing operand";
echo "Try '$CHROOT_NAME --help' for more information";
exit;
fi
 
if [ -e $1 ]; then
CHROOT=$(readlink -f $1)
if [ -e $CHROOT/proc ] &amp;&amp; [ -e $CHROOT/sys ] &amp;&amp; [ -e $CHROOT/dev ] &amp;&amp; [ -e $CHROOT/dev/pts ]; then
chroot_reference_count=`echo $CHROOT | sed 's/\//_/g'`
chroot_reference_count=/tmp/meego_chroot$chroot_reference_count.ref_count
chroot_mount=$( mount | grep $CHROOT/proc )
if [ "X$chroot_mount" = "X" ]; then
touch $chroot_reference_count
echo 0 &gt; $chroot_reference_count
reference_increase $chroot_reference_count
 
setup $CHROOT
else
if [ "x$2" != "x" ]; then
if [ $2 = "force-clean" ]; then
echo "$CHROOT_NAME: clean up meego chroot $CHROOT"
cleanup $CHROOT
exit;
fi
fi
reference_increase $chroot_reference_count
fi
 
#patch from Graham Cobb, see bug #3156 for detail
unset DBUS_SESSION_BUS_ADDRESS
 
export HOME=/root
export PWD=/root
export CHROOTFROM=$CHROOT
export DISPLAY=:0.0
 
#perform the command in chroot
chroot $@
 
reference_decrease $chroot_reference_count
count=`cat $chroot_reference_count`
if [ "X$count" != "X" ] &amp;&amp; [ $count -eq 0 ]; then
cleanup $CHROOT
else
echo "$CHROOT_NAME: warning: The housekeeping is not done. There might be other meego-chroot running."
fi
else
echo "$CHROOT_NAME: invalid meego chroot directory: $CHROOT";
exit;
fi
else
if [ $1 = "--help" ]; then
usage;
else
echo "$CHROOT_NAME: invalid meego chroot directory: $CHROOT";
echo "Try '$CHROOT_NAME --help' for more information";
fi
fi
</pre>

Latest revision as of 10:00, 13 January 2011

What this is About

This document explains "How to build Mobile Firefox for Meego Netbook Platform".

Versions

This is written for Meego 1.1 SDK. Target Device is the Lenovo Ideapad. Target Platform is the Intel Netbook Release.

Setup your Netbook

I use a Lenovo Ideapad S10-3t supporting multitouch. This is the recommended target device of Intel. Follow Instructions

Presteps, Install the SDK on your System

Add the package respository of the SDK to your system: (see source for more)

On Ubuntu or Debian

  1. Add the following line to /etc/apt/sources.list.d/meego-sdk.list.
    Replace ${distribution}/${version} with one of the following: "debian/5.0", "ubuntu/09.10", "ubuntu/10.04" or "ubuntu/10.10".
    deb http://repo.meego.com/MeeGo/sdk/host/repos/${distribution}/${version}/ / 
  2. Add the repository public key:
    $ gpg --keyserver pgpkeys.mit.edu --recv 0BC7BEC479FC1F8A
    $ gpg --export --armor 0BC7BEC479FC1F8A | sudo apt-key add -
  3. Update the packages database:
    $ sudo apt-get update
  4. To check that the MeeGo repository has been correctly added, run the following command. The details of the MADDE package should be printed.
    $ apt-cache policy madde
  • Install
    $ sudo apt-get install meego-sdk

On openSUSE

  • To add the MeeGo repository, run the following command.
    Replace ${distribution}/${version} with one of the following values: "opensuse/11.2" or "opensuse/11.3".
    $ sudo zypper addrepo -f http://repo.meego.com/MeeGo/sdk/host/repos/${distribution}/${version}/meego-sdk.repo
  • Install
    $ sudo zypper install meego-sdk

Configure SDK

Download the mozilla-meego-assistant script from this website.

  1. Download File:Mozilla-meego-sdk-helper.tar.gz
  2. untar the tarbal

    (the meego-assistant script, will create a mount point and a working directory in the local directory!) you can edit the place by changing the variables in the script.)
  3. sudo ./meego-assistant install

Steps

  • sudo ./meego-assistant login
    During first start this finish the configuration of the image. Follow the instructions on screen.
  • Get Mozilla Sources and apply Meego Developer Patches on it
cd /meegoWorkingDirectory 
hg clone http://hg.mozilla.org/mozilla-central 
cd mozilla-central 
hg clone http://hg.mozilla.org/mobile-browser mobile 
cd mobile/.hg 
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/workbase_prc2 patches 
cd patches 
hg update -C mobile-browser 
cd ../../../.hg/ 
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/workbase_prc2 patches 
cd ../ 
hg qpush --all 
cd mobile 
hg qpush --all 
cd ..
  • Download Mozconfig and start building.
wget https://wiki.mozilla.org/images/7/7c/Mozconfig.tar.gz
tar -xzf Mozconfig.tar.gz
make -f client.mk build 

Known Issues

Crash on Start

Issues with Mesa Drivers. Starting in EGL accelerated version does not work. Fennec is crashing with:

Mesa 7.9 implementation error: glIndexPointer should be mapped to 336, not 314
Please report at bugzilla.freedesktop.org
Mesa 7.9 implementation error: glUniformMatrix4fv should be mapped to 337, not 485
Please report at bugzilla.freedesktop.org

Solution: Disable hardware acceleration within mobile.js

Multitouch

Multitouch is not working in meego.com release TBI

Flash Renderspeed

For some people the Renderspeed with native is really slow, it seems to get better when using this for starting fennec:

 MOZ_QT_GRAPHICSSYSTEM=meego ./fennec -graphicssystem meego