HowToMeegoFennecDraft: Difference between revisions
Jump to navigation
Jump to search
Scripts
mNo edit summary |
mNo edit summary |
||
| 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. | |||
<br> | |||
== Current State == | == Versions == | ||
Build Fails on missing GLIB Dependency | |||
This is written for Meego 1.1 SDK. Target Device is the Lenovo Ideapad. Target Platform is the Intel Netbook Release. | |||
== Current State == | |||
Build Fails on missing GLIB Dependency | |||
== Steps == | == Steps == | ||
| Line 18: | Line 21: | ||
2. Mount SDK<br>3. Get Dependencies<br>4. Get and Compile Mercurial<br>5. Get Meego Mobile Firefox Developer Preview Code<br>6. Compile<br>7. Get it on your Device<br>8. Run it<br> | 2. Mount SDK<br>3. Get Dependencies<br>4. Get and Compile Mercurial<br>5. Get Meego Mobile Firefox Developer Preview Code<br>6. Compile<br>7. Get it on your Device<br>8. Run it<br> | ||
<br> | <br> | ||
<br> | <br> | ||
= Scripts<br> = | = Scripts<br> = | ||
== The SDK-Change-Root-Script == | == The SDK-Change-Root-Script == | ||
<pre># Copyright 2010, Intel Inc. | |||
# | |||
# This program is free software; you can redistribute it and/or modify | # 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 | # it under the terms of the GNU General Public License as published by | ||
| Line 215: | Line 219: | ||
fi | fi | ||
</pre> | </pre> | ||
Revision as of 10:51, 18 December 2010
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.
Versions
This is written for Meego 1.1 SDK. Target Device is the Lenovo Ideapad. Target Platform is the Intel Netbook Release.
Current State
Build Fails on missing GLIB Dependency
Steps
- Get MeegoSDK
Follow the steps from the official Meego Website. Stop at the point "Install MeeGo Runtime", we will continue from this point on. - Download and install the Runtime
sudo mad-admin create -f -e meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime - Mount the SDK
It is important to know that it is not a good idea to use Qemu and the Meego SDK. This is because of:
a) In case Qemu crash once, you can not start it again, everything is gone.
b) Qemu is very slow on compiling
c) For mounting working directories into Qemu you need to use nfs which is possible but increase complexity
d) The Image Partitions for netbook and handset are just to small in order to hold the mozilla sources
2. Mount SDK
3. Get Dependencies
4. Get and Compile Mercurial
5. Get Meego Mobile Firefox Developer Preview Code
6. Compile
7. Get it on your Device
8. Run it
Scripts
The SDK-Change-Root-Script
# 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:
# Haitao Feng <haitao.feng@intel.com>
# Jackie Wu <jackie.wu@intel.com>
CHROOT_NAME=$0
usage()
{
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()
{
if [ -f $1 ]; then
count=`cat $1`
if [ "X$count" != "X" ]; then
count=`expr $count + 1`
echo $count > $1
fi
fi
}
reference_decrease()
{
if [ -f $1 ]; then
count=`cat $1`
if [ "X$count" != "X" ] && [ $count -gt 0 ]; then
count=`expr $count - 1`
echo $count > $1
fi
fi
}
reference_print()
{
if [ -f $1 ]; then
count=`cat $1`
if [ "X$count" != "X" ]; then
echo "The reference count of [$1]: $count"
fi
fi
}
setup()
{
chroot=$1
# normal preparation for chroot
echo mount --bind /proc $chroot/proc
mount --bind /proc $chroot/proc
echo mount --bind /sys $chroot/sys
mount --bind /sys $chroot/sys
echo mount --bind /dev $chroot/dev
mount --bind /dev $chroot/dev
echo mount --bind /dev/pts $chroot/dev/pts
mount --bind /dev/pts $chroot/dev/pts
# preparation for X
# X sockets are at /tmp/.X11-unix
# echo mount --bind /tmp $chroot/tmp
# mount --bind /tmp $chroot/tmp
# preparation for dbus
# 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
echo cp /etc/resolv.conf $chroot/etc/resolv.conf
cp /etc/resolv.conf $chroot/etc/resolv.conf
}
cleanup()
{
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>/dev/null | grep $chroot)
if [ "X$ps" != "X" ]; then
kill $pid
fi
fi
done
sleep 3
# umount directories
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
umount $chroot/tmp
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 ] && [ -e $CHROOT/sys ] && [ -e $CHROOT/dev ] && [ -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 > $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" ] && [ $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