Differences between revisions 12 and 13
Revision 12 as of 2013-05-19 06:15:25
Size: 5096
Editor: ?NeilStockbridge
Comment:
Revision 13 as of 2013-05-19 06:17:09
Size: 5083
Editor: ?NeilStockbridge
Comment:
Deletions are marked like this. Additions are marked like this.
Line 114: Line 114:
    key <UP>>-{ type[Group1] = "FOUR_LEVEL", symbols[Group1] = [ Up, Page_Up, bar, Escape ] };
    key <LEFT>>-{ type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Left, Home ] };
    key <DOWN>>-{ type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Down, Page_Down ] };
    key <RGHT>>-{ type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Right, End ] };
    key <UP>   { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Up, Page_Up ] };
    key <LEFT> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Left, Home ] };
    key <DOWN> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Down, Page_Down ] };
    key <RGHT> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Right, End ] };

This is an account of installing Debian wheezy armhf on a Nokia N900. Notes are abridged assuming that you've read MaemoAndSqueeze already.

I still haven't got the special keys ( like "-"!) on the keyboard working in the console yet, so this install revolves around getting SSH working first.

Prepare the root file system

EDITOR=vim # ..or your favourite
PACKAGES="module-init-tools,udev,netbase,ifupdown,openssh-server,$EDITOR,locales,whiptail"
sudo debootstrap --arch=armhf --variant=minbase --include=$PACKAGES --foreign  wheezy  /tmp/wheezy-armhf/  http://mirror:9999/debian
# Copy these files to the SD card

# Need these scripts because don't have "-" on the keyboard ( amongst other things)
cat <<'.' > bin/fn
#!/bin/sh
debootstrap/debootstrap --second-stage
.
cat <<'.' > bin/rb
#!/bin/sh
mount -o remount,ro /
reboot -f
.
chmod +x  bin/fn  bin/rb
cat <<'.' > etc/fstab  # so that "mount -o remount,ro" prior to reboot works if you need it
#
# /etc/fstab: static file system information.
#
# pass: 0: do not check, 1: before mounting root, 2: after mounting root
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#                                                               pass,
# ,file system    ,mount point  ,type  ,options               dump, |
# |               |             |      |                          | |
  /dev/mmcblk1p4  /             ext4   errors=remount-ro,noatime  0 0
  proc            /proc         proc   nodev,noexec,nosuid        0 0
  none            /tmp          tmpfs  noatime                    0 0
.
echo N900 > etc/hostname
$EDITOR etc/shadow # and set root's password to something
cat <<'.' >> etc/modules
g_nokia
.
cat <<'.' > etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# loopback
auto lo
iface lo inet loopback

# usb
auto usb0
iface usb0 inet static
  address  10.3.3.1
  netmask  255.255.255.0
  gateway  10.3.3.254
.
echo nameserver 10.3.3.254 > etc/resolv.conf

Building the kernel

# Needs at least 2.3G of disc space
git clone git://gitorious.org/linux-n900/linux-n900.git
git checkout v3.8-rc3-n900
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make rx51_defconfig
# unchecked CONFIG_SYSFS_DEPRECATED
# Change the configuration to include ext2 and the TWL4030 watchdog:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make xconfig
# Comment out line 1040 of arch/arm/mach-omap2/board-rx51-peripherals.c
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- nice -19 make -j 5 
INSTALL_MOD_PATH=/tmp ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make modules_install
sudo rsync --archive /tmp/lib/ 10.3.3.1:/mnt/lib/
sudo flasher-3.5 -l -k arch/arm/boot/zImage -b"vram=12M console=tty0 rootdelay=1 rootwait root=/dev/mmcblk0p4 init=/bin/bash"

Once at the bash prompt, run fn to finish the debootstrap process then rb to reboot and use the same command line but without an explicit init= parameter to boot normal init.

Routing via workstation

# Configure usb0 with 10.3.3.254, then:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.3.3.0/24 -o wlan0 -j MASQUERADE

U-Boot

Use version 2013.04-1 of u-boot-flasher in Maemo because earlier versions boot some kernels but reset the CPU instead of booting others.

X

Video driver

Both xserver-xorg-video-omap3 and xserver-xorg-video-omapfb segfaulted for me. xserver-xorg-video-fbdev works though.

Keyboard

To get support for the special characters printed on the keys, edit /etc/default/keyboard:

XKBMODEL="nokiarx51"
XKBLAYOUT="us"

To add other characters, edit /usr/share/X11/xkb/symbols/nokia_vndr/rx-51:

    key <UP>   { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Up, Page_Up ] };
    key <LEFT> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Left, Home ] };
    key <DOWN> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Down, Page_Down ] };
    key <RGHT> { type[Group1] = "PC_FN_LEVEL2", symbols[Group1] = [ Right, End ] };

..then to reload the keymap:

setxkbmap us

Some useful keys not available by default: Escape Tab Page_Up Page_Down Home End Insert Delete less greater bracketleft bracketright braceleft braceright grave percent asciicircum asciitilde bar F2

Touchscreen

The Y axis of the touchscreen was inverted. xinput --list shows a line like:

TSC2005 touchscreen                       id=6

xinput --list-props 6 shows:

Evdev Axis Inversion (239)

..and then xinput --set-prop --type=int 6 239 0 1 flipped the axis for me. It also needed some calibration:

xinput --set-prop --type=float 6 113  1.10 0.00 -0.05  0.00 1.18 -0.10  0.00 0.00 1.00