Deploying Debian 5 GNU/Linux with Insight Control for Linux Version 6.0 and 6.1

9
chapter titled “Configuring network parameters for virtual media” in the HP Insight Control for
Linux User Guide.
c) To install any additional .udeb packages that are absent in the netboot initrd and
might be needed to support the hardware, such as SATA and CD-ROM drivers, for example.
The init script, called init_script, will be contained in a special auxiliary RAM disk named
iram1.gz. The procedure is:
1. Change to the Debian5-i386Boot directory:
# cd /opt/repository/boot/Debian5-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 init_script.
4. Copy the following bash script and paste it into the text editor’s buffer.
#!/bin/bash
# Get the device name for the specified MAC address.
get_device() {
# Convert to all lowercase.
MAC=`echo $1 | tr [A-Z] [a-z]`
ip addr | while read LINE
do
DEV=`echo "$LINE" | grep "^[0-9]*:" | tr -d ' ' | cut -d':' -f2`
if [ ! -z "$DEV" ]
then
read LINE
HWADDR=`echo "$LINE" | grep "link/ether" | tr -s ' ' | cut -d' ' -
f2`
if [ ! -z "$HWADDR" ] && [ "$MAC" == "$HWADDR" ]
then
echo $DEV
return
fi
fi
done
}
# 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=`get_device $mac`
# find the preseed url in kernel args
url=`expr "$(cat /proc/cmdline)" : ".*preseed=\([^ ]*\)"`
echo "-----------------------------------"
echo "Hewlett Packard - DEBN5 init script"
echo "-----------------------------------"
echo "mac = $mac"
echo "eth = $eth"
echo "url = $url"
echo "-----------------------------------"
#########################################################################
# locale
#########################################################################
echo "d-i debian-installer/locale string en_US" >> preseed.cfg