Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (spelling)
 
(39 intermediate revisions by 17 users not shown)
Line 1: Line 1:
== Overview ==
+
{{Languages|Gentoo}}
Gentoo armv4tl-softfloat-linux-gnueabi optimalized for Openmoko (-Os -march=armv4t -mtune=arm920t) on 2008.0/arm profile (glibc based, sane bootstrapable toolchain)<br>
+
(embedded uclibc/arm profile armv4tl-softfloat-linux-uclibcgnueabi in plans)
+
  
 +
= Gentoo on Openmoko phones =
  
== Read first ==
+
Gentoo project on Openmoko phones has its own homepage: [http://gentoo.mindzoo.de/ http://gentoo.mindzoo.de/]
'''http://www.gentoo.org/doc/en/handbook/handbook-arm.xml''' (Skip points 2 and 3)
+
  
 +
We have a portage overlay and some Openmoko packages like Xglamo, Illume or Zhone already have their ebuilds and many more will follow !
  
== Needed things ==
+
== Ways to work with Gentoo ==
 +
Currently, there are 3 ways to install Gentoo, each having their own advantages and disadvantages:
  
*Gentoo stage: http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/
+
* [http://gentoo.mindzoo.de/index.cgi/wiki/cross-compiling Cross compile approach], where you use another machine to compile your whole phone system. (Requires a Gentoo machine)
*Portage snapshot: look for mirror on: http://www.gentoo.org/main/en/mirrors2.xml and get snapshots/portage-DATE.tar.bz2
+
*Kernel and modules
+
*Any working Openmoko distro
+
  
 +
* [http://gentoo.mindzoo.de/index.cgi/wiki/native-compiling Native compilation approach], where you work with Gentoo on phone as with a normal system fully capable of installing its own packages.
  
== Installation ==
+
* [http://gentoo.mindzoo.de/index.cgi/wiki/qemu-user qemu-user emulated native compilation], where you use another machine 'chroot' into a gentoo filesystem (created by either of the methods above) and execute ARM binaries as if they were native executables.
*Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
+
:<tt>e.g.</tt> <pre>fdisk /dev/mmcblk0</pre>
+
*Make ext2 or ext3 filesystem
+
:<tt>e.g.</tt> <pre>mkfs.ext2 /dev/mmcblk0p1</pre>
+
*Mount partition
+
:<tt>e.g.</tt> <pre>mount /dev/mmcblk0p1 /media/card</pre>
+
*Copy stage and portage from host to moko
+
:<tt>e.g. (on localhost)</tt> <pre>scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card</pre>
+
*Unpack stage and portage
+
:<tt>e.g.</tt>
+
<pre>
+
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
+
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
+
</pre>
+
*Cleanup removing tar.bz2
+
:<tt>e.g.</tt> <pre>rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2</pre>
+
*Chroot
+
:<tt>e.g.</tt> <pre>chroot /media/card /bin/bash</pre>
+
*Update chroot environment
+
:<tt>e.g.</tt> <pre>source /etc/profiles; env-update</pre>
+
*Set timezone
+
:<tt>e.g.</tt> <pre>cp /usr/zoneinfo/YOURZONE /etc/localtime</pre>
+
*Set hostname
+
:<tt>e.g.</tt> <pre>nano /etc/conf.d/hostname</pre>
+
*Remove console font changing (small is beautiful ;])
+
:<tt>e.g.</tt> <pre>nano /etc/conf.d/consolefont</pre> (hash consolefont= line)
+
*Setup fstab
+
:<tt>e.g.</tt> <pre>nano /etc/fstab</pre>
+
*Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
+
:<tt>e.g.</tt> <pre>nano /etc/inittab</pre>
+
*Setup usb networking
+
:<tt>e.g.</tt>
+
<pre>
+
ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
+
echo "config_usb0=( \"192.168.0.202 netmask 255.255.255.0\" )" > /etc/conf,d/net
+
echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
+
echo "nameserver 192.168.0.200" > /etc/resolv.conf
+
</pre>
+
*Enable sshd
+
:<tt>e.g.</tt> <pre>rc-update add sshd default</pre>
+
*Change root password
+
:<tt>e.g.</tt> <pre>passwd</pre>
+
*Leave chroot
+
:<tt>e.g.</tt> <pre>exit</pre>
+
*Copy kernel
+
*Copy modules
+
*Setup uboot for booting from sd card
+
*Reboot
+
*Setup/emerge rest of the system
+
  
 +
{{Note|
 +
Many thanks go to 'torindel' who apparently started the effort and made a stage tarball we are using even today for the native approach and to Tuxxx who contributed strongly to the cross compilation efforts on gentoo for openmoko phones.
 +
}}
  
== Emerging binary packages ==
+
== Getting Started ==
*Add PORTAGE_BINHOST to make.conf
+
* Read instructions on the project [http://gentoo.mindzoo.de/ homepage]
:<tt>e.g.</tt> <pre>echo "PORTAGE_BINHOST=http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All" >> /etc/make.conf</pre>
+
* Visit the project overlay page [http://overlays.gentoo.org/proj/embedded overlay page]
*Update environment
+
:<tt>e.g.</tt> <pre>source /etc/profiles; env-update</pre>
+
*Setup install mask if you don't want compiler headers/docs etc (mask headers only if you'll be always using binary packages)
+
:<tt>e.g.</tt> <pre>export INSTALL_MASK="*.h"</pre>
+
*Emerge packages with -kG
+
:<tt>e.g.</tt> <pre>emerge -kG syslog-ng</pre>
+
  
 +
== Community Support ==
 +
If you wish to get (or provide) volunteer support for Gentoo on openmoko phones, please try one of the following.
  
== Binary package wishlist ==
+
=== IRC ===
As i'll be adding some packages to ftp above you might want to ask for some package here: [[GentooPackageWishList]]<br>
+
<nowiki>#</nowiki>gentoo-openmoko on [http://freenode.net/ Freenode]
Overlay with moko things and more packages coming soon.
+
 
[[category:Technical]]
+
=== Mailing List ===
 +
Send an e-mail with the subject 'Subscribe' to [mailto:gentoo-embedded-request@lists.gentoo.org gentoo-embedded-request@lists.gentoo.org]
 +
 
 +
=== Bug Reports ===
 +
You can submit bug reports on the project [http://gentoo.mindzoo.de/index.cgi/newticket Trac] page.
 +
 
 +
[[Category:Gentoo| ]]

Latest revision as of 10:12, 15 August 2009


Contents

[edit] Gentoo on Openmoko phones

Gentoo project on Openmoko phones has its own homepage: http://gentoo.mindzoo.de/

We have a portage overlay and some Openmoko packages like Xglamo, Illume or Zhone already have their ebuilds and many more will follow !

[edit] Ways to work with Gentoo

Currently, there are 3 ways to install Gentoo, each having their own advantages and disadvantages:

  • Cross compile approach, where you use another machine to compile your whole phone system. (Requires a Gentoo machine)
  • Native compilation approach, where you work with Gentoo on phone as with a normal system fully capable of installing its own packages.
  • qemu-user emulated native compilation, where you use another machine 'chroot' into a gentoo filesystem (created by either of the methods above) and execute ARM binaries as if they were native executables.
NOTE:

Many thanks go to 'torindel' who apparently started the effort and made a stage tarball we are using even today for the native approach and to Tuxxx who contributed strongly to the cross compilation efforts on gentoo for openmoko phones.


[edit] Getting Started

[edit] Community Support

If you wish to get (or provide) volunteer support for Gentoo on openmoko phones, please try one of the following.

[edit] IRC

#gentoo-openmoko on Freenode

[edit] Mailing List

Send an e-mail with the subject 'Subscribe' to gentoo-embedded-request@lists.gentoo.org

[edit] Bug Reports

You can submit bug reports on the project Trac page.

Personal tools

Overview

Gentoo armv4tl-softfloat-linux-gnueabi optimalized for Openmoko (-Os -march=armv4t -mtune=arm920t) on 2008.0/arm profile (glibc based, sane bootstrapable toolchain)
(embedded uclibc/arm profile armv4tl-softfloat-linux-uclibcgnueabi in plans)


Read first

http://www.gentoo.org/doc/en/handbook/handbook-arm.xml (Skip points 2 and 3)


Needed things


Installation

  • Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted)
e.g.
fdisk /dev/mmcblk0
  • Make ext2 or ext3 filesystem
e.g.
mkfs.ext2 /dev/mmcblk0p1
  • Mount partition
e.g.
mount /dev/mmcblk0p1 /media/card
  • Copy stage and portage from host to moko
e.g. (on localhost)
scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
  • Unpack stage and portage
e.g.
tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
  • Cleanup removing tar.bz2
e.g.
rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
  • Chroot
e.g.
chroot /media/card /bin/bash
  • Update chroot environment
e.g.
source /etc/profiles; env-update
  • Set timezone
e.g.
cp /usr/zoneinfo/YOURZONE /etc/localtime
  • Set hostname
e.g.
nano /etc/conf.d/hostname
  • Remove console font changing (small is beautiful ;])
e.g.
nano /etc/conf.d/consolefont
(hash consolefont= line)
  • Setup fstab
e.g.
nano /etc/fstab
  • Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines)
e.g.
nano /etc/inittab
  • Setup usb networking
e.g.
ln -s /etc/init.d/net.lo /etc/init.d/net.usb0
echo "config_usb0=( \"192.168.0.202 netmask 255.255.255.0\" )" > /etc/conf,d/net
echo "routes_usb0=\"default via 192.168.0.200\"" >> /etc/conf.d/net
echo "nameserver 192.168.0.200" > /etc/resolv.conf
  • Enable sshd
e.g.
rc-update add sshd default
  • Change root password
e.g.
passwd
  • Leave chroot
e.g.
exit
  • Copy kernel
  • Copy modules
  • Setup uboot for booting from sd card
  • Reboot
  • Setup/emerge rest of the system


Emerging binary packages

  • Add PORTAGE_BINHOST to make.conf
e.g.
echo "PORTAGE_BINHOST=http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All" >> /etc/make.conf
  • Update environment
e.g.
source /etc/profiles; env-update
  • Setup install mask if you don't want compiler headers/docs etc (mask headers only if you'll be always using binary packages)
e.g.
export INSTALL_MASK="*.h"
  • Emerge packages with -kG
e.g.
emerge -kG syslog-ng


Binary package wishlist

As i'll be adding some packages to ftp above you might want to ask for some package here: GentooPackageWishList
Overlay with moko things and more packages coming soon.