Deploying Debian GNU/Linux with ICE-Linux

8
# wget http://http.us.debian.org/debian/dists/etch/main/installer-
i386/current/images/netboot/gtk/debian-installer/i386/linux
# wget http://http.us.debian.org/debian/dists/etch/main/installer-
i386/current/images/netboot/gtk/debian-installer/i386/initrd.gz
Step 5: Enable the Debian Installer to Accept a MAC Address
Typically, a server has many network interfaces. The Debian installer expects a kernel name for the
Ethernet interface to use for installation. The kernel does not always give the same kernel name to an
Ethernet interface from one boot cycle to the next. MACs for Ethernet interfaces are used to
distinguish one Ethernet interface from another consistently across boot cycles. To enable the Debian
Installer to accept a MAC address for the network interface to use for installation, create a special file
called iram1.gz; the procedure follows:
1. Change to the Debian4-i386Boot directory:
# cd /opt/repository/boot/Debian4-i386Boot
2. Create a directory named iram and change to it:
# mkdir iram ; cd iram
3. Invoke the text editor of your choice to create a file named macfinder.
4. Copy the following bash script and paste it into the text editor’s buffer.
#!/bin/bash
# find the mac address in kernel args
mac=`expr "$(cat /proc/cmdline)" : ".*xdevice=\([^ ]*\)"`
# load the net drivers
for i in pcnet32 e1000 bnx2 tg3
do
modprobe $i
done
# find the device with the mac address
eth=`ifconfig -a | grep -i $mac | cut -d" " -f1`
# find the preseed url in kernel args
url=`expr "$(cat /proc/cmdline)" : ".*preseed=\([^ ]*\)"`
echo "----------------------------------"
echo "Hewlett Packard - DEBN4 mac finder"
echo "----------------------------------"
echo "mac = $mac"
echo "eth = $eth"
echo "url = $url"
echo "----------------------------------"
# set the interface to use
echo "d-i netcfg/choose_interface select $eth" >> preseed.cfg
# fetch network preseed cfg
echo "d-i preseed/url string $url" >> preseed.cfg
# reset the init cmd
init='busybox init'
# start the original initrd init process