Instructions and notes for building and modifying Debian Netboot initrd

This project aims to allow debian to be installed using debian netboot installer over USB networking (g_ether, usbnet) onto Allwinner A10/20 devices.

The goals and aims of this project are outlined in more detail here:

prepare u-boot with ramdisk memory-booting support

git clone git://
cd u-boot-sunxi
git checkout sunxi-current
make 'eoma68' CROSS_COMPILE=arm-linux-gnueabi-

unpack initrd:

dd if=uInitrd of=ramdisk.uImage skip=64 bs=1
cat ./ramdisk.uImage| gzip -d > ramdisk.uImage.raw
mkdir initramfs
(cd initramfs && cpio -i --no-absolute-filenames < ../ramdisk.uImage.raw)

prepare and install kernel modules

use standard cross-compile build, set INSTALL_MOD_PATH to point to the initramfs directory. remember also to run 'find . -name "*.ko" | xargs strip'

add busybox (for telnetd)

compile up busybox - see - and use [[debian_netboot/busybox.config]

copy over busybox and also add telnetd to the initramfs directory.

add g_ether detection

find the section marked "S3C2410 (Openmoko)" and add the following after it:

# Load the ethernet gadget network driver (g_ether) on Allwinner A10
if [ -d /sys/devices/platform/sw_usb_udc/gadget -o \
    -d /sys/devices/platform/sw_usb_udc/gadget ] ; then
    db_subst hw-detect/load_progress_step CARDNAME "Allwinner A10 SoC"
    db_subst hw-detect/load_progress_step MODULE "g_ether"
    db_progress INFO hw-detect/load_progress_step

    log "Detected Allwinner A10 SoC, loading g_ether"
    load_module g_ether
    register-module g_ether

add a telnetd startup script

add lib/debian-installer-startup.d/S98telnetd:

/sbin/telnetd -l /bin/telnet-console

add bin/telnet-console:

set -e


case "$ARCHDETECT" in
        # Clear the LCD
        kill `pidof paneld` || true
        paneld -d

export TERM=linux
export TERM_TYPE=network
exec /sbin/debian-installer /bin/telnet-console-menu

add bin/telnet-console-menu:

set -e

. /usr/share/debconf/confmodule

# Although main-menu now does the same, this is still needed as this script is
# run *before* main-menu and might not be in the correct language without it.
if db_get debconf/language && [ "$RET" ] ; then
        db_set debconf/language $RET


db_input critical $TEMPLATE_ROOT/login
db_get $TEMPLATE_ROOT/login

if [ "$RET" = 'Start installer' ]; then
    exec main-menu
elif [ "$RET" = 'Start installer (expert mode)' ]; then
    db_set debconf/priority low
    exec main-menu
elif [ "$RET" = 'Start shell' ]; then
    export UDPKG_QUIET=1
    exec udpkg --configure --force-configure di-utils-shell

build initramfs:

(cd initramfs && find . | \
                 cpio --quiet -R 0:0 -o -H newc | \
                 gzip -9 > ../initramfs.gz)
mkimage -A ARM -C none -T ramdisk -d initramfs.gz initramfsnet.img
rm initramfs.gz