About

This is incomplete but gives a general idea of the process.

This HOWTO outlines the procedure for recompiling the kernel for a Nokia N810 Internet Tablet. Unfortunately Nokia has not made it possible to run mainline Linux on the N810. Consequently, kernel recompilation (in order to modify some kernel options or patch the kernel) is not as simple as what Linux desktop users might be familiar with.

I recompiled the kernel to enable cryptsetup support and to disable USB support (USB went flaky on my N810: it would randomly mutter about an unsupported USB device when no USB device was connected, even after a stock reflash).

This was tested using Debian squeeze.

Howto

  1. Install required packages (if your system supports hardware virtualization, use qemu-kvm instead of qemu)

    # aptitude install qemu qemu-utils
  2. Get a Debian qemu image

    $ wget \
      "http://people.debian.org/~aurel32/qemu/i386/debian_squeeze_i386_standard.qcow2"
    $ mv debian_squeeze_i386_standard.qcow2 scratchbox.qcow2
  3. Run Debian from image (again, you may want to use kvm instead of qemu)

    $ qemu -hda scratchbox.qcow2 -nographic \
      -net nic,vlan=0 -net user,vlan=0

    Long lines at prompts are not handled well sometimes, but it seems to work okay if you go ahead and type blind.

    1. Log in as root with password root, install scratchbox, add scratchbox user

      # wget \
        "http://repository.maemo.org/stable/diablo/maemo-scratchbox-install_4.1.2.sh"
      # echo 'vm.vdso_enabled = 0' >> /etc/sysctl.conf
      # echo 'vm.mmap_min_addr = 0' >> /etc/sysctl.conf
      # sysctl -p
      # sh maemo-scratchbox-install_4.1.2.sh
      # /scratchbox/sbin/sbox_adduser user yes
    2. Exit root shell and login as user with password user, install ARMEL target

      $ scratchbox
      > sb-conf setup DIABLO_ARMEL -c cs2005q3.2-glibc2.5-arm \
        -d perl:debian-etch:maemo3-tools:cputransp -t qemu-arm-0.8.2-sb2

    It is normal for sb-conf to return No current target.

        > sb-conf select DIABLO_ARMEL
        > wget \
          "http://repository.maemo.org/stable/diablo/armel/maemo-sdk-rootstrap_4.1.2_armel.tgz"
        > sb-conf rs maemo-sdk-rootstrap_4.1.2_armel.tgz
        > sb-conf install --etc --devkits --fakeroot
        > ? fakeroot apt-get install maemo-sdk-dev
    1. Get kernel sources

      > apt-get update
      > apt-get source kernel-source-diablo
      > cd kernel-source-diablo-2.6.21/kernel-source/
      > make nokia_2420_defconfig
    2. If you want to use menuconfig:

      > fakeroot apt-get install libncurses5-dev
      > nano scripts/kconfig/lxdialog/check-lxdialog.sh

    Comment out (prepend a # to) lines 12, 13, and 16.

        $ make menuconfig
    1. Configure/patch and now: build kernel

      > make zImage
  4. Flash to N810

    The zImage file is located at /scratchbox/users/user/home/user/kernel-source-diablo-2.6.21/kernel-source/arch/arm/zImage

See also