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: http://lists.debian.org/debian-arm/2013/05/msg00094.html
prepare u-boot with ramdisk memory-booting support
git clone git://github.com/linux-sunxi/u-boot-sunxi.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 https://github.com/hno/miniroot - 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 fi
add a telnetd startup script
add lib/debian-installer-startup.d/S98telnetd:
/sbin/telnetd -l /bin/telnet-console
add bin/telnet-console:
#!/bin/sh set -e ARCHDETECT="$(archdetect)" case "$ARCHDETECT" in mipsel/cobalt) # Clear the LCD kill `pidof paneld` || true paneld -d ;; esac export TERM=linux export TERM_TYPE=network exec /sbin/debian-installer /bin/telnet-console-menu
add bin/telnet-console-menu:
#!/bin/sh 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 fi TEMPLATE_ROOT=network-console db_input critical $TEMPLATE_ROOT/login db_go 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 # WORKAROUND export UDPKG_QUIET=1 exec udpkg --configure --force-configure di-utils-shell fi
build initramfs:
#!/bin/sh (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