apt-get install kernel-wedge
 cd ~/download
 svn co debian-installer http://alioth.debian.org/...
 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 in this file:
 #   ~/work/d-i/packages_kernel_linux-kernel-di-i386-2.6.patch
 # 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 libgcc_s.so.1, "retrieving libc6-udeb" fails.  Perhaps, this
 # dependency is not recognized automatically because apt-ftparchive below
 # re-writes dpkg files.
 cp -a /lib/libgcc_s.so.1 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 -

 cd ~/work/d-i/release
 vi config # according to http://wiki.debian.org/DebianInstaller/Modify
 apt-ftparchive generate config
 cd -   # Back to /var/tmp/di.

 cp -a /root/driver .  
 # 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/boot.cat 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$n.so.0:
 cd /lib
 ln -s libparted*.so.1 libparted$n.so.0
 # Go back to the d-i menu and choose "Detect hard disks" again.