in the static IP option
specify also the domain name and the nameservers IP
in the form
export
STATICIP="eth0,address,netmask,gateway,domainname,nameserver1,nameserver2:eth1,address1,netmask1,gateway1,domainname1,nameserver11,nameserver21:..."
domainname and nameservers are optional parameters
diff -Naur initrd-110-7-orig.txt/scripts/live-bottom/23networking initrd.txt/scripts/live-bottom/23networking
--- initrd-110-7-orig.txt/scripts/live-bottom/23networking 2007-11-19 10:58:26.000000000 +0100
+++ initrd.txt/scripts/live-bottom/23networking 2007-11-19 12:24:02.000000000 +0100
@@ -1,6 +1,6 @@
#!/bin/sh
-#set -e
+[ -n "${DEBUG}" ] && set -x
# initramfs-tools header
@@ -20,7 +20,7 @@
# live-initramfs header
-if [ -n "${NONETWORKING}" ]
+if [ "${NONETWORKING}" = "Yes" ]
then
exit 0
fi
@@ -52,6 +52,10 @@
if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
then
parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+ rc_domain=
+ rc_search=
+ rc_server0=
+ rc_server1=
for ifline in ${parsed}
do
@@ -68,8 +72,31 @@
gateway ${ifgateway}
EOF
+ if_domain="$(echo ${ifline} | cut -f5 -d ',')"
+ if_server0="$(echo ${ifline} | cut -f6 -d ',')"
+ if_server1="$(echo ${ifline} | cut -f7 -d ',')"
+ [ -n "${if_domain}" -a -z "${rc_domain}" ] && rc_domain="${if_domain}"
+ [ -n "${if_domain}" ] && rc_search="${rc_search}${if_domain} "
+ if [ -n "${if_server0}" ]; then
+ if [ -z "${rc_server0}" ]; then
+ rc_server0="${if_server0}"
+ else
+ [ -z "${rc_server1}" ] && rc_server1="${if_server0}"
+ fi
+ fi
+ [ -n "${if_server1}" -a -z "${rc_server1}" ] && rc_server1="${if_server1}"
+ [ -z "${rc_server0}" ] && rc_server0="${ifgateway}"
done
+ if [ ! -f /root/etc/resolv.conf ]; then
+ echo "# /etc/resolv.conf" > /root/etc/resolv.conf
+ echo "# Autogenerated by live-initramfs" >> /root/etc/resolv.conf
+ [ -n "${rc_search}" ] && echo "search ${rc_search}" >> /root/etc/resolv.conf
+ [ -n "${rc_domain}" ] && echo "domain ${rc_domain}" >> /root/etc/resolv.conf
+ [ -n "${rc_server0}" ] && echo "nameserver ${rc_server0}" >> /root/etc/resolv.conf
+ [ -n "${rc_server1}" ] && echo "nameserver ${rc_server1}" >> /root/etc/resolv.conf
+ sed -i -e "s/127.0.0.1.*/127.0.0.1 localhost ${HOSTNAME}.${rc_domain} ${HOSTNAME}/" /root/etc/hosts
+ fi
else
if [ -z "${NETBOOT}" ]
then
_______________________________________________
debian-live-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel