Editing Gentoo/N900

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
This is the official page for the unofficial port of Gentoo to N900 internet tablets.
This is the official page for the unofficial port of Gentoo to N900 internet tablets.
-
If you have any questions/troubles, you can find ''me'' (probably luke-jr) on freenode [irc://chat.freenode.net/maemo #maemo] and [irc://chat.freenode.net/gentoo-embededded #gentoo-embedded] ([http://webchat.freenode.net/?channels=%23Maemo,%23Gentoo-Embedded webchat]).
+
If you have any questions/troubles, you can find me on freenode [irc://chat.freenode.net/maemo #maemo] and [irc://chat.freenode.net/gentoo-embededded #gentoo-embedded] ([http://webchat.freenode.net/?channels=%23Maemo,%23Gentoo-Embedded webchat]).
'''Bootable with X, WiFi, SMS, and GPRS'''
'''Bootable with X, WiFi, SMS, and GPRS'''
Line 62: Line 62:
  /dev/mmcblk0p4 : start=  4194368, size= 52436992, Id= 5
  /dev/mmcblk0p4 : start=  4194368, size= 52436992, Id= 5
  /dev/mmcblk0p5 : start=  4194384, size= 20971568, Id=83
  /dev/mmcblk0p5 : start=  4194384, size= 20971568, Id=83
-
  /dev/mmcblk0p6 : start= 25165968, size= 31465392, Id=83
+
  /dev/mmcblk0p6 : start= 25165968, size= 31465392, Id=83</blockquote>
If you're more conforable with standard Linux fdisk, [https://garage.maemo.org/plugins/wiki/index.php?RepartitionInstructions&id=1382&type=g supposedly] [http://archive.debian.org/debian/pool/main/u/util-linux/util-linux_2.13.1.1-1_armel.deb the deb from Debian Lenny] works.
If you're more conforable with standard Linux fdisk, [https://garage.maemo.org/plugins/wiki/index.php?RepartitionInstructions&id=1382&type=g supposedly] [http://archive.debian.org/debian/pool/main/u/util-linux/util-linux_2.13.1.1-1_armel.deb the deb from Debian Lenny] works.
Line 70: Line 70:
Since you are installing on a SSD that may very well queue its writes out of order, ext3 and other journaling filesystems designed for magnetic/write-in-order drives are generally a bad idea and may be very dangerous to use.
Since you are installing on a SSD that may very well queue its writes out of order, ext3 and other journaling filesystems designed for magnetic/write-in-order drives are generally a bad idea and may be very dangerous to use.
-
If you're using an old kernel, such as the original Fremantle kernel, you'll have to stick to ext2. If you are using a recent "power" kernel (or modern kernel), you can use ext4 without journal support (but possibly these do not have ext4 ACLs/xattrs enabled).
+
If you're using an old kernel, such as the original Fremantle kernel, you'll have to stick to ext2. If you are using a recent "power" kernel (or modern kernel), you can use ext4 without journal support.
I recommend making swap on an external MicroSD so when you destroy it, it can be replaced (unlike the internal one).
I recommend making swap on an external MicroSD so when you destroy it, it can be replaced (unlike the internal one).
Line 84: Line 84:
Be sure your system clock is correct before proceeding. Weird things happen when it's not.
Be sure your system clock is correct before proceeding. Weird things happen when it's not.
-
Download [http://distfiles.gentoo.org/experimental/arm/musl/ the latest *vanilla* armv7a_hardfp musl stage3 from Gentoo].
+
Download [http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a_hardfp/ the latest armv7a_hardfp stage3 from Gentoo], or, if you want to run the softfp ABI (still hardware-accelerated) for some reason (like better binary compatibility with Maemo), you can use [http://distfiles.gentoo.org/releases/arm/autobuilds/current-stage3-armv7a/ the armv7a stage3]. Note that I only run hardfp, so can't support problems specific to the softfp ABI and don't provide prebuilt binary packages for it.
-
Note that standard glibc stage3 will no longer work as it includes glibc 2.20, which is incompatible with the older kernels needed for N900.
+
-
You could try uclibc instead, but nobody has tried that thus far, so you're on your own.
+
Just in case, download the .DIGESTS file too, and verify your download with:
Just in case, download the .DIGESTS file too, and verify your download with:
-
  grep -A1 SHA512 stage3-*DIGESTS | sha512sum -c
+
  sha1sum -c *.DIGEST
Now, proceed to unpack the stage3:
Now, proceed to unpack the stage3:
Line 95: Line 93:
  tar xvjpf stage3-*.tar.bz2
  tar xvjpf stage3-*.tar.bz2
-
Configure your compile options (/media/gentoo/etc/portage/make.conf) next.
+
Configure your compile options (/media/gentoo/etc/make.conf) next.
-
Recommended (only safe to use unmodified for musl hardfp ABI!):
+
Recommended (only safe to use unmodified for hardfp ABI!):
-
  CHOST="armv7a-hardfloat-linux-musleabi"
+
  CHOST="armv7a-hardfloat-linux-gnueabi"
-
# WARNING: -mthumb -mthumb-interwork require a Thumb-safe kernel! Remove them otherwise.
+
  CFLAGS="-O2 -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
-
  CFLAGS="-O2 -pipe -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mthumb -mthumb-interwork"
+
  CXXFLAGS="${CFLAGS}"
  CXXFLAGS="${CFLAGS}"
-
  ASFLAGS="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard -mthumb -mthumb-interwork"
+
  ASFLAGS="-mcpu=cortex-a8 -mfpu=neon -mfloat-abi=hard"
   
   
  # Distcc is a good idea, if you [http://www.gentoo.org/doc/en/cross-compiling-distcc.xml setup a cross-compiler on another Gentoo system]
  # Distcc is a good idea, if you [http://www.gentoo.org/doc/en/cross-compiling-distcc.xml setup a cross-compiler on another Gentoo system]
Line 111: Line 108:
  # Since the N900 doesn't have a lot of RAM, you'll probably need to sacrifice some CPU time to minimize memory usage
  # Since the N900 doesn't have a lot of RAM, you'll probably need to sacrifice some CPU time to minimize memory usage
  LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
  LDFLAGS="${LDFLAGS} -Wl,--no-keep-memory -Wl,--reduce-memory-overheads"
-
# The following thing increased building times of some packages (paludis and cryptography, for instance) insanely and the man page suggests it is of questionable utility
 
  CFLAGS="${CFLAGS} --param ggc-min-expand=0 --param ggc-min-heapsize=32768"
  CFLAGS="${CFLAGS} --param ggc-min-expand=0 --param ggc-min-heapsize=32768"
   
   
  PORTAGE_NICENESS="10"
  PORTAGE_NICENESS="10"
  PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
  PORTAGE_IONICE_COMMAND="ionice -c 3 -p \${PID}"
 +
 +
PORTAGE_BINHOST="http://luke.dashjr.org/programs/gentoo-n900/packages/hardfp/gcc45/"
 +
EMERGE_DEFAULT_OPTS="--getbinpkg y"
===Chroot===
===Chroot===
Line 129: Line 128:
===Install and configure the Portage tree, with N900 overlay===
===Install and configure the Portage tree, with N900 overlay===
  emerge --sync --quiet
  emerge --sync --quiet
-
  USE='-* git curl ssl curl_ssl_openssl python_targets_python2_7' emerge layman
+
  USE='-* git' emerge layman
-
  # be sure to follow layman post-install instructions to edit make.conf
+
  layman -a n900
-
  layman -fa n900
+
rm /etc/make.profile
-
eselect profile set n900:n900/armv7a-hardfloat-linux-musleabi
+
  ln -s /var/lib/layman/n900/profiles/default/linux/arm/10.0/n900/ /etc/make.profile
-
layman -a musl
+
===Configure timezone===
===Configure timezone===
-
USE=-nls emerge -1 timezone-data<!-- timezone-data[nls] broken in current musl stage3 as of 2015-07-21 -->
 
  ls /usr/share/zoneinfo
  ls /usr/share/zoneinfo
 +
cp /usr/share/zoneinfo/UTC /etc/localtime
  echo "UTC" > /etc/timezone
  echo "UTC" > /etc/timezone
-
emerge --config timezone-data
+
 
==Booting==
==Booting==
===Configuring your kernel===
===Configuring your kernel===
-
If you just want to use your Maemo kernel, simply copy /lib/modules/* from your Maemo partition into Gentoo (you'll need to exit the chroot first) and emerge the appropriate kernel sources: fremantle-sources, fremantle-power-sources, and meego-sources are available.
+
If you just want to use your Maemo kernel, simply copy /lib/modules/* from your Maemo partition into Gentoo (you'll need to exit the chroot first).
However, if you want to build one yourself (required for any custom kernel modules, or non-X11 console), follow these steps:
However, if you want to build one yourself (required for any custom kernel modules, or non-X11 console), follow these steps:
-
  emerge fremantle-power-sources
+
  emerge fremantle-power-sources # regular fremantle-sources is also available
  cd /usr/src/linux
  cd /usr/src/linux
  make menuconfig
  make menuconfig
Line 156: Line 154:
Note that this kernel will not boot Maemo without setting up the modules on the Maemo partition. I believe this is as simple as copying the directory and running depmod on that side, but I'll have to review it before I'm sure.
Note that this kernel will not boot Maemo without setting up the modules on the Maemo partition. I believe this is as simple as copying the directory and running depmod on that side, but I'll have to review it before I'm sure.
-
===Configuring your system etc===
+
You can skip the compiling (but you still need to install the sources!) if you want, by using [http://luke.dashjr.org/programs/gentoo-n900/kernels/ one of my prebuilt kernels].
-
All of these are optional if you just want a chroot.
+
 +
===Configuring your system etc===
The following steps from Gentoo's official handbook are just fine here:
The following steps from Gentoo's official handbook are just fine here:
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Filesystem_information Filesystem information]
+
* [http://www.gentoo.org/doc/en/handbook/handbook-arm.xml?part=1&chap=8 Configuring your System]
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Networking_information Networking information]
+
* [http://www.gentoo.org/doc/en/handbook/handbook-arm.xml?part=1&chap=9 Installing Necessary System Tools]
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#System_information System information]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#System_logger System logger]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Optional:_Cron_daemon Optional: Cron daemon]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Optional:_File_indexing Optional: File indexing]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Optional:_Remote_access Optional: Remote access]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Filesystem_tools Filesystem tools]
+
-
* [https://wiki.gentoo.org/wiki/Handbook:X86/Full/Installation#Networking_tools Networking tools]
+
===Installing N900-required stuff===
===Installing N900-required stuff===
Line 272: Line 263:
I've reverse engineered the cellmo GPS protocols, and written [http://luke.dashjr.org/tmp/code/gps3.c a NMEA proxy] that mostly works with gpsd. When I get to properly integrating GPS support, I plan to write an actual gpsd driver so a proxy isn't needed.
I've reverse engineered the cellmo GPS protocols, and written [http://luke.dashjr.org/tmp/code/gps3.c a NMEA proxy] that mostly works with gpsd. When I get to properly integrating GPS support, I plan to write an actual gpsd driver so a proxy isn't needed.
-
==Known problems==
+
==Known issues==
===Webkit linking memory usage===
===Webkit linking memory usage===
WebKit requires an absurd amount of memory to link. I build binary packages inside qemu when it needs to be bumped. I suggest you use them.
WebKit requires an absurd amount of memory to link. I build binary packages inside qemu when it needs to be bumped. I suggest you use them.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)