This is a sample lengthy procedure of integrating a third party network driver with DebianInstaller's netinst. See the question on driver disk in the DebianInstaller/FAQ and the TODO list referred to by DebianInstaller/Contrib.

Supplying a floppy disk with the network driver is already implemented in netinst. One has to select the "another driver" option in the list of network drivers shown by the installer and insert the floppy disk. The installer will be expecting a pre-compiled driver on the floppy under /lib/modules/.

Compiling a driver disk can be confusing because the installer doesn't currently ship its own kernel headers on the CD. The procedure below will re-package the installer with the running Debian kernel from the development machine and the third party driver compiled against that kernel.

The author of the procedure below believes it should be thrown away in favour of automatic install time compilation of the driver's source code by the installer against its kernel headers. When implementing this better approach, existing tools such as module-assistant might be of benefit.

 apt-get install kernel-wedge
 cd ~/download
 svn co debian-installer
 cd debian-installer
 cd packages/kernel/linux-kernel-di-i386-2.6

 # Add the third party module and its dependent modules such as
 # ieee80211, ieee80211_crypt, ieee80211_crypt_wep, arc4 and so on.
 # It is implied that the third party module is already compiled
 # against the current kernel.
 vi modules/i386/nic-modules

 vi kernel-versions     # Update the version and flavour.
 # See a sample list of modifications under the "Sample Netinst Patch"
 # section below.
 # To apply the patch, run "patch -i FILE.patch".
 kernel-wedge gen-control > debian/control
 kernel-wedge build-all
 # If the above command fails on "kernel-wedge copy-modules ...", edit the
 # respective file under modules/i386/ until kernel-wedge copy-modules
 # succeeds.  Then restart kernel-wedge build-all.

 cd /var/tmp
   mount -o loop,ro ~/download/debian-net-install.iso /mnt
   cp -a /mnt .
   mv mnt di
   chown -R USER di
   chmod -R u+rw di
   umount /mnt
 mkdir di-rd ; cd di-rd
 gzip -dc ../di/install/2.6/initrd.gz | cpio -ivd

 cd lib/modules
 mkdir -p 2.6.$NEW/kernel
 cd 2.6.$OLD/kernel
 find -type f | \
     while read f ; do \
        n="${f##*/}" ; \
        d="${f%/*}" ; \
        k="/lib/modules/2.6.$NEW/kernel/$f" ; \
        test -f "${k}" && { \
           cp -av "${k}" \
            "../../../../../di-rd/lib/modules/2.6.$NEW/kernel/${d}/" ; \
        } || echo "-- ${f}" ; \

 cd ../..
 rm -rf 2.6.$OLD
 cd ../..
 vi var/lib/dpkg/status  # Replace 2.6.$OLD with 2.6.$NEW.

 # Without, "retrieving libc6-udeb" fails.  Perhaps, this
 # dependency is not recognized automatically because apt-ftparchive below
 # re-writes dpkg files.
 cp -a /lib/ lib/

 # Now create the new compressed RAM disk image.
 # find . -depth -print0 | cpio -0 -H newc -ov | gzip -c > ../di/install/2.6/initrd.gz
 # The -depth option is to specify restrictive permissions.  It prevents
 # the Linux kernel from mounting the image.  For testing, try 
 #   cpio -iv < /tmp/initrd 
 # without the "d" option.  A cpio image created without the find -depth 
 # option will create a full tree while the one created with -depth will
 # generate file creation errors.
 find . -print0 | cpio -0 -H newc -ov | gzip -c > ../di/install/2.6/initrd.gz

 cd ../di
 cd pool/main/l/linux-kernel-di-i386-2.6/
 # Copy .udeb's created in ~/download/debian-installer/packages/kernel.
 # Delete kernel-image-2.6.$OLD and respective module .udeb's.
 cd -

 mkdir ~/work/d-i/dpkg
 cd ~/work/d-i/dpkg
 # Set up a config file for apt-ftparchive to update the package list.
 # See the section "Sample apt-ftparchive Config" below and 
 # DebianInstaller/Modify.
 vi config
 apt-ftparchive generate config
 cd -   # Back to /var/tmp/di.

 cp -a /root/driver .  
 # Important: keep the third party driver's source code on CD to compile 
 # it later against the installed kernel headers.

 # Update md5sums.txt and Packages.
 md5sum $(find -follow -type f) > md5sum.txt

 vi md5sum.txt  # Remove the line with md5sum.txt (?)
 cd ..
 mkisofs -o test.iso -r -J -no-emul-boot -boot-load-size 4 \
   -boot-info-table -b isolinux/isolinux.bin -c isolinux/ di
 qemu -net user -cdrom test.iso
 # For serial emulation, run Linux from isolinux prompt with
 #   install console=ttyS0
 # Then switch to the serial console with Ctrl-Alt-3.

 sudo cdrecord -dev /dev/cdrw -v test.iso  # Burn this to a CD-RW or CD-R.

 # Boot the real computer from the new image, pause between
 # the dialogs, press Alt-2 and Enter to start the shell.
 # Check if the disk is already mounted by running "mount".
 # If it is, the mount point will be /cdrom.  Otherwise, mount the disk:
 mount -o ro -t iso9660 /dev/hdb /mnt/
 udpkg -i /mnt/pool/main/l/linux-kernel-di-i386-2.6/crypto-modules*.udeb
 modprobe arc4   # or insmod /lib/modules/*/kernel/crypto/arc4.ko
 modprobe ieee80211_crypt_wep
 modprobe adm8211
 # Similarly, make sure iwconfig can be launched.  If not, install
 # libiw*.udeb from w/wireless-tools.
 iwconfig eth0 key s:XXXXXXXXXXXXX
 iwconfig eth0 key open
 iwconfig eth0 channel 6
 ifconfig eth0 up
 ifconfig eth0 A.B.C.D  # Assign an unused address from the LAN.
 udpkg -i /...l/linux-kernel-di-i386-2.6/sata-modules*.udeb
 modprobe ahci  # For SATA AHCI drives.
 modprobe sata-uli  # Or another driver for the SATA controller according
                    # to the list in lspci.

 # In case the "Detect hard disk" or "Partition the disk" steps of d-i fail,
 # one should load an appropriate driver.
 ls -la /proc/ide /proc/scsi
 udpkg -i /.../p/parted/libparted*.udeb
 parted /dev/sda print
 # If parted complains about the missing library libparted$
 cd /lib
 ln -s libparted*.so.1 libparted$
 # Go back to the d-i menu and choose "Detect hard disks" again.

Sample Netinst Patch

Here, a wireless driver adm8211 is added to the nic-modules udeb. Modules ieee* and arc4 are required by adm8211. Other changes are due to the difference in modules available through the regular Debian linux-image package.

Index: kernel-versions
--- kernel-versions     (revision 37792)
+++ kernel-versions     (working copy)
@@ -1,2 +1,2 @@
 # arch   version  flavour       installedname        suffix build-depends
-i386     2.6.16-2 486           2.6.16-2-486         -      linux-image-2.6.16-2-486
+i386     2.6.16-2 k7           2.6.16-2-k7         -      linux-image-2.6.16-2-k7
Index: modules/i386/nic-modules
--- modules/i386/nic-modules    (revision 37792)
+++ modules/i386/nic-modules    (working copy)
@@ -1,3 +1,8 @@
 #include <nic-modules>
 # And 2.6 has ethernet over firewire.
Index: modules/i386/crypto-modules
--- modules/i386/crypto-modules (revision 37792)
+++ modules/i386/crypto-modules (working copy)
@@ -1 +1,3 @@
 #include <crypto-modules>
Index: modules/i386/scsi-modules
--- modules/i386/scsi-modules   (revision 37792)
+++ modules/i386/scsi-modules   (working copy)
@@ -1,4 +1,6 @@
 #include <scsi-modules>
+aha1740 -
+sim710 -
 # And some that are new in 2.6:
Index: modules/i386/nic-extra-modules
--- modules/i386/nic-extra-modules      (revision 37792)
+++ modules/i386/nic-extra-modules      (working copy)
@@ -1,4 +1,10 @@
 #include <nic-extra-modules>
+3c523 -
+3c527 -
+es3210 -
+lne390 -
+ne2 -
+smc-ultra32 -
 # Others that are only here in 2.6:
@@ -10,7 +16,7 @@
+# ne3210

Sample apt-ftparchive Config

Here is a sample content of ~/work/d-i/dpkg/config for apt-ftparchive to update the d-i package list. The text is borrowed from DebianInstaller/Modify. The apt-ftparchive tool seems to require the "override" and "override.extra" files downloaded into the OverrideDir ~/work/d-i/dpkg/indices/. Interpolating between sarge and etch, one can believe that netinst-etch would need overrides from and .

Dir {
    ArchiveDir "/var/tmp/di";
    OverrideDir "indices";
    CacheDir "indices";
TreeDefault {
    Directory "pool/";
BinDirectory "pool/main" {
    Packages "dists/etch/main/debian-installer/binary-i386/Packages";
    BinOverride "override";
    ExtraOverride "override.extra";
Default {
    Packages {
        Extensions ".udeb";