Novena/Debian History

From Studio Kousagi Wiki
Revision as of 00:21, 3 February 2013 by Bnewbold (talk | contribs) (Notes: armel)
Jump to: navigation, search

Porting

Debian would be a great linux distro to port to the Novena because of the large number of derivative distros (Ubuntu, gNewSense, TAILS, etc). The DFSG also set a high bar for "libre-ness".

As of January 2013 this may be pre-mature as there is no finalized application-specific Novena hardware. Nonetheless, it would be nice to get the ball rolling and clear any blockers to having debian run on generic Freescale i.mx6-based devices.

bnewbold will try to hand-hold this process. He will target the wheezy release, which is currently testing but will hopefully be released as stable in the next few months.

Device-specific debian support for Novena would be similar to the device-specific support for the Marvell Dreamplug device used by the FreedomBox project. Ian Campbell seems to have led upstreaming efforts for that device, here are some of the patches and emails from that process:

Subj: include DTB in linux-image files on armel
http://osdir.com/ml/debian-kernel/2012-04/msg00475.html
Subj: ARM: backporting dreamplug patches for Wheezy
Date: Thu, 01 Mar 2012
From: Ian Campbell <ijc@hellion.org.uk>
https://lists.debian.org/debian-kernel/2012/03/msg00006.html
Subj: flash-kernel: Please add support for Dreamplug / Marvell Kirkwood FDT
Date: April 05th, 2012
From: Ian Campbell
http://us.generation-nt.com/answer/bug-667681-flash-kernel-please-add-support-dreamplug-marvell-kirkwood-fdt-help-207026612.html#r
Mainline linux patches:
ARM: kirkwood: add dreamplug (fdt) support.
http://git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=commit;h=3d468b6d6052293ad3b8538b8277077981c28286
ARM: kirkwood: convert uart0 to devicetree.
http://git.kernel.org/?p=linux/kernel/git/arm/arm-soc.git;a=commit;h=759a45185ac0e4dfaf8bbfcb390ec73aca4b7a34

What does it mean to "run vanilla debian on the Novena hardware"?

  • All of the software, files, and drivers for the board to boot and run come from .deb packages which are accepted into the debian.org repositories.
  • Being able to build a binary image using debian tools would be nice, but not necessary.
  • Being able to upgrade the kernel and bootloader using the apt-get mechanism would be nice and is a long term goal, but probably isn't worth biting off in the first whack at porting.

So what needs to be done to "run vanilla debian on the Novena hardware"?

For basic (headless?) functionality the vanilla/mainline linux 3.7 kernel works fine because of patches already applied for the Sabre Lite i.mx6 development board. A Novena-specific device tree file needs to be applied to the kernel image to boot properly; this step happens at kernel installation/upgrade time (the flash-kernel package in debian?).

I need to clarify here what exactly device tree files are, where they live (kernel sources? linux-image package? flash-kernel package? u-boot?), and where Novena-specific ones might need to be upstream-ed to.

Customizations to the u-boot booatloader are more extensive and (at the moment) volatile. The way u-boot is installed (written to an offset on the SD card) is fairly unique and there is no "debian way" to do this at the moment. This operation is a bit risky and maybe should only be done by an image build script and not by an automatic u-boot-tools apt-get command? As of January 2013 the debian version of the u-boot package is also out of date; the Novena customizations are on top of the more recent 2012.10 version.

Kosagi.com

  • build a Novena binary SD card image from scratch using debian tools
  • export device tree file (./arch/arm/boot/dts/imx6q-novena.dts?)
  • stabilize Novena-specific u-boot tweaks
  • write an image building script/process
  • (potentially) extend ``flash-kernel`` package to apply device tree file, allowing apt-get kernel updates

Debian.org

  • update u-boot and u-boot-tools packages to 2012.10 or newer
  • merge custom Novena-specific u-boot tweaks

Kernel.org

  • merge device tree (sabre lite one might be acceptable?)

Toolchain

There are many ways to set up cross-compiling on an x86 linux host targeting ARM devices like Novena. These directions for a debian host are pretty simple and up to date as of January 2013; note that you will need to add squeeze apt repositories to your host's /etc/apt/sources.list if you run wheezy or sid: Cross-compiling an Allwinner A10 ARM Linux kernel on Debian AMD64

Ultimately, of course, the Novena will be self-hosting and new kernels and packages could be built locally.

Notes

There is an 'mx5' flavor of the Debian armhf kernel (eg, wheezy/linux-image-mx5). A '-mx6' flavor might be created, or a '-mx' flavor might combine the two.

The Freescale i.mx6 would use the armhf architecture. armel binaries will run just fine, even with armhf kernel (confirmed).

Set serial login on ttymxc1; append to /etc/inittab:

3:23:respawn:/sbin/getty 115200 ttymxc1

Set mac address; insert in /etc/network/interfaces:

hwaddress ether 00:1f:16:33:aa:aa