Deploying Debian 5 GNU/Linux with Insight Control for Linux Version 6.0 and 6.1
10
echo "d-i console-keymaps-at/keymap select us" >> preseed.cfg
#########################################################################
# network
#########################################################################
echo "d-i netcfg/wireless_wep string" >> preseed.cfg
# 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
# Is the static IP address specified?
ip=`expr "$(cat /proc/cmdline)" : ".*ip=\([^ ]*\)"`
# If the "ip=" kernel boot parameter is specified,
# then we're using a static
# IP address and disabling DHCP.
if [ ! -z $ip ] && [ $ip != "dhcp" ] # Using static IP address
then
netmask=`expr "$(cat /proc/cmdline)" : ".*netmask=\([^ ]*\)"`
gateway=`expr "$(cat /proc/cmdline)" : ".*gateway=\([^ ]*\)"`
nameserver=`expr "$(cat /proc/cmdline)" : ".*nameserver=\([^ ]*\)"`
domain=`expr "$(cat /proc/cmdline)" : ".*domain=\([^ ]*\)"`
hostname=`expr "$(cat /proc/cmdline)" : ".*hostname=\([^ ]*\)"`
echo "ip=$ip"
echo "nameserver=$nameserver"
echo "netmask=$netmask"
echo "gateway=$gateway"
echo "domain=$domain"
echo "hostname=$hostname"
echo "----------------------------------"
echo "d-i netcfg/disable_dhcp boolean true" >> preseed.cfg
echo "d-i netcfg/get_nameservers string $nameserver" >> preseed.cfg
echo "d-i netcfg/get_ipaddress string $ip" >> preseed.cfg
echo "d-i netcfg/get_netmask string $netmask" >> preseed.cfg
echo "d-i netcfg/get_gateway string $gateway" >> preseed.cfg
echo "d-i netcfg/get_domain string $domain" >> preseed.cfg
echo "d-i netcfg/get_hostname string $hostname" >> preseed.cfg
echo "d-i netcfg/confirm_static boolean true" >> preseed.cfg
else # Using DHCP
echo "d-i netcfg/get_hostname string" >> preseed.cfg
echo "d-i netcfg/get_domain string" >> preseed.cfg
echo "d-i netcfg/get_nameservers string" >> preseed.cfg
echo "d-i netcfg/dhcp_timeout text 60" >> preseed.cfg
fi
# These kernel modules are needed for SATA disk support.
# When the hardware is detected, these kernel modules
# will be automatically loaded.
/usr/bin/udpkg -i ata-modules-2.6.26-2-486-di_1.76lenny5_i386.udeb
/usr/bin/udpkg -i sata-modules-2.6.26-2-486-di_1.76lenny5_i386.udeb
# reset the init cmd
init='busybox init'
# start the original initrd init process
exec $init
5. Save the init_script file and exit the text editor.
6. Extend executable permission to the init_script file:
# chmod +x init_script
7. Remain in the iram directory and create a directory named lib/firmware.
# mkdir -p lib/firmware