Gentoo

From Openmoko

(Difference between revisions)
Jump to: navigation, search
m (spelling)
 
(25 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{Languages|Gentoo}}
 
{{Languages|Gentoo}}
== Overview ==
 
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)
 
  
[http://img46.imageshack.us/img46/646/80330048oy9.jpg Screenshot (hosted at ImageShack)]
+
= 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:
  
*At least 2GB SD card
+
* [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)
*Gentoo stage: http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/
+
*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.
<ol>
+
<li>Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted): </li>
+
  fdisk /dev/mmcblk0
+
  
<li>Make ext2 or ext3 filesystem: </li>
+
{{Note|
  mkfs.ext2 /dev/mmcblk0p1
+
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.
 +
}}
  
<li>Mount partition: </li>
+
== Getting Started ==
  mount /dev/mmcblk0p1 /media/card
+
* Read instructions on the project [http://gentoo.mindzoo.de/ homepage]
 +
* Visit the project overlay page [http://overlays.gentoo.org/proj/embedded overlay page]
  
<li>Copy stage and portage from host to moko (e.g. on localhost): </li>
+
== Community Support ==
  scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
+
If you wish to get (or provide) volunteer support for Gentoo on openmoko phones, please try one of the following.
  
<li>Unpack stage and portage: </li>  
+
=== IRC ===
  tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
+
<nowiki>#</nowiki>gentoo-openmoko on [http://freenode.net/ Freenode]
  tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
+
  
<li>Cleanup removing tar.bz2: </li>
+
=== Mailing List ===
  rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
+
Send an e-mail with the subject 'Subscribe' to [mailto:gentoo-embedded-request@lists.gentoo.org gentoo-embedded-request@lists.gentoo.org]
  
<li>Chroot: </li>
+
=== Bug Reports ===
  chroot /media/card /bin/bash
+
You can submit bug reports on the project [http://gentoo.mindzoo.de/index.cgi/newticket Trac] page.
  
<li>Update chroot environment: </li>
+
[[Category:Gentoo| ]]
  source /etc/profile; env-update
+
 
+
<li>Set timezone: </li>
+
  cp /usr/share/zoneinfo/YOURZONE /etc/localtime
+
 
+
<li>Set hostname: </li>
+
  nano /etc/conf.d/hostname
+
 
+
<li>Remove console font changing (small is beautiful ;]): </li>
+
  rc-update del consolefont boot
+
 
+
<li>Setup fstab: </li>
+
  nano /etc/fstab
+
 
+
<li>Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines): </li>
+
  nano /etc/inittab
+
 
+
<li>Setup usb networking: </li>
+
  echo "modules=\"g_ether\"" >> /etc/conf.d/modules
+
  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
+
 
+
<li>Enable sshd: </li>
+
  rc-update add sshd default
+
 
+
<li>Change root password: </li>
+
  passwd
+
 
+
<li>Leave chroot: </li>
+
  exit
+
 
+
<li>Copy kernel. </li>
+
  cp /boot/uImage-2.6.24 /media/card/boot/
+
 
+
<li>Copy modules. </li>
+
  cp -rpf /lib/modules /media/card/lib/
+
 
+
<li>Setup uboot for booting from sd card. </li>
+
<li>Reboot. </li>
+
<li>Setup/emerge rest of the system. </li>
+
 
+
== Emerging binary packages ==
+
*Binary package sites
+
:http://tinderbox.dev.gentoo.org/embedded/openmoko/armv4tl-softfloat-linux-gnueabi/
+
:http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All
+
*Add PORTAGE_BINHOST to make.conf
+
:<tt>e.g.</tt> <pre>echo "PORTAGE_BINHOST=\"http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All\"" >> /etc/make.conf</pre>
+
*Update environment
+
:<tt>e.g.</tt> <pre>source /etc/profile; 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>
+
*Add the following line to make.conf to tell portage to always use binary packages. <pre>EMERGE_DEFAULT_OPTS="-gK"</pre>
+
 
+
== Binary package wishlist ==
+
As i'll be adding some packages to ftp above you might want to ask for some package here: [[GentooPackageWishList]]<br>
+
Overlay with moko things and more packages coming soon.
+
 
+
[[category:Distributions]]
+

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)

Screenshot (hosted at ImageShack)

Read first

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


Needed things


Installation

  1. Partition your sd card if needed (don`t make swap partitions, ensure card isn't mounted):
  2.  fdisk /dev/mmcblk0
    
  3. Make ext2 or ext3 filesystem:
  4.  mkfs.ext2 /dev/mmcblk0p1
    
  5. Mount partition:
  6.  mount /dev/mmcblk0p1 /media/card
    
  7. Copy stage and portage from host to moko (e.g. on localhost):
  8.  scp stage3-armv4tl-*.tar.bz2 portage-*.tar.bz2 root@openmoko:/media/card
    
  9. Unpack stage and portage:
  10.  tar -xjpf /media/card/stage3-armv4tl-*.tar.bz2 -C /media/card
     tar -xjpf /media/card/portage-*.tar.bz2 -C /media/card/usr
    
  11. Cleanup removing tar.bz2:
  12.  rm /media/card/stage3-armv4tl-*.tar.bz2 /media/card/portage-*.tar.bz2
    
  13. Chroot:
  14.  chroot /media/card /bin/bash
    
  15. Update chroot environment:
  16.  source /etc/profile; env-update
    
  17. Set timezone:
  18.  cp /usr/share/zoneinfo/YOURZONE /etc/localtime
    
  19. Set hostname:
  20.  nano /etc/conf.d/hostname
    
  21. Remove console font changing (small is beautiful ;]):
  22.  rc-update del consolefont boot
    
  23. Setup fstab:
  24.  nano /etc/fstab
    
  25. Edit inittab (hash out c3, c4, c5, c6, s0, s1 lines):
  26.  nano /etc/inittab
    
  27. Setup usb networking:
  28.  echo "modules=\"g_ether\"" >> /etc/conf.d/modules
     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
    
  29. Enable sshd:
  30.  rc-update add sshd default
    
  31. Change root password:
  32.  passwd
    
  33. Leave chroot:
  34.  exit
    
  35. Copy kernel.
  36.  cp /boot/uImage-2.6.24 /media/card/boot/
    
  37. Copy modules.
  38.  cp -rpf /lib/modules /media/card/lib/
    
  39. Setup uboot for booting from sd card.
  40. Reboot.
  41. Setup/emerge rest of the system.
  42. Emerging binary packages

    • Binary package sites
    http://tinderbox.dev.gentoo.org/embedded/openmoko/armv4tl-softfloat-linux-gnueabi/
    http://torindel.sezamkowa.net/openmoko/armv4tl-softfloat-linux-gnueabi/~arm/packages/All
    • 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/profile; 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"
    • Add the following line to make.conf to tell portage to always use binary packages.
      EMERGE_DEFAULT_OPTS="-gK"

    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.

    </div>