Howto install Debian/armel with a custom kernel
In this doc, we show howto use Debian-installer on platforms not supported officially in Debian.
- Hardware requirements
These are the normal Debian Requirements:
Installation space can be hard drive, usb mass storage, SD/other memory card or even a nfs space.
Some kind of installation media support is needed as well - ethernet network, hard drive or cd/dvd-rom.
- working kernel
Generally it is preferable to have a kernel that is as close to mainline (Linus's kernel) as possible. Theoretically 2.6.16 is the oldest kernel that can run Debian/armel, but kernels newer than 2.6.24 are recommended. For the method outlined here, There is a bunch of drivers you will need compiled _into_ the kernel, not as modules:
- installation media support
This means you need to have support both for the media installed from, as well as to the installation target.
- networking support
Unless you opt support only installation from DVD/usb stick, the kernel needs to have all networking (built-in ethernet or usb-ethernet) compiled into the kernel.
ext3 is the default filesystem for Debian. Whatever filesystem you intend to use as boot media, you will need to compile the support _into_ the kernel (not a as a module). For initramfs tmpfs support is needed.
- bootloader that can load kernel and initramfs
At least the following bootloaders are known to be sufficient.
Case example for Marvell 78x00 developer platform
First, we build a kernel suitable for installer:
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- mv78xx0_defconfig
mv78xx0_defconfig doesn't have initrd support, so use menuconfig to change that. Also we check that filesystems (ext3,tmpfs), sata and network drivers are enabled.
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- mkimage -A arm -O linux -T kernel -C none -a 0x200000 -e 0x200000 -n "Linux" -d vmlinux uImage.db78x00_bp
Convert the initrd into uboot uimage format:
wget http://ftp.fi.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/initrd.gz mkimage -A arm -O linux -T ramdisk -C gzip -n "netboot image" -a 0x300000 -e 0x300000 -d initrd.gz uImage.db78x00_initrd
Now we copy these files to a tftp server. Alternatively these files can be loaded anywhere uBoot's ext2load or fatload commands can read the files from.
For the tftp method, if you have ip and tftp host already set up, enter on u-boot console:
tftpboot 0x2000000 uImage.db78x00_bp tftpboot 0x3000000 uImage.db78x00_initrd bootm 0x2000000 0x3000000
The magic numbers are the memory locations of kernel and initramfs.
You can also load these file using a usb key, file must be present on the first partition with a fat (vfat should work) filesystems. Enter on u-boot console :
usb reset; fatload usb 0:1 0x2000000 uImage.db78x00_bp; fatload usb 0:1 0x3000000 uImage.db78x00_initrd; usb stop;
The installation follows in general the normal Debian-installer guide.
Due to the lack of kernel udebs and some platform code in d-i, the installer will show some error messages:
- Continue the install without loading kernel modules? Yes
- This partitioner doesn't have information about the default type of partition tables: yes - msdos
- Continue without installing the kernel: Yes
The first one would need kernel module udebs. Second one is fixable, third one can be fixed by vendor by providing a kernel package and a Debian repository from where to download it from.
These errors will cause d-i to drop into "expert" mode, where it will ask more questions than a regular install.
Tips and tricks
If you install from a local storage media (instead of tftp), you can put a Debian-installer .iso file to the same media and the installer will use them (instead of network )
You can use preseed fileto give default answers to questions asked by installer. Or even make the install fully automatic!
The main thing left is setting up the bootloader to load the kernel, and pass proper root= flag to kernel. You will want to make sure interesting stuff is installed before rebooting. So, in the D-I install complete screen:
install complete -> back -> shell
chroot /target apt-get install openssh-server # and anything else you want
Also you'll want to enable serial console by default, in /etc/inittab
T0:23:respawn:/sbin/getty -L ttyS0 115200 linux
urn to di, reboot, and enter uboot, and boot this time without the ramdisk.