return 0
}
+add_ip_to_resolv_conf ()
+{
+ if [ ! -z ${1} ]
+ then
+ echo "nameserver $1" >> /etc/resolv.conf
+ fi
+}
+
+setup_static_ip ()
+{
+ ifconfig lo 127.0.0.1 up
+ ifconfig "${DEVICE}" up
+ local myip=`echo ${STATICIP} | cut -d: -f1`
+ local mynm=`echo ${STATICIP} | cut -d: -f4`
+ local mygw=`echo ${STATICIP} | cut -d: -f3`
+ echo "myip=${myip} mynm=${mynm} mygw=${mygw}"
+ ifconfig "${DEVICE}" "${myip}" netmask "${mynm}"
+ ifconfig "${DEVICE}"
+ route add default gw "${mygw}"
+ return 0
+}
+
+setup_static_dns ()
+{
+ if [ -z ${DNSIP} ]
+ then
+ add_ip_to_resolv_conf "4.2.2.2"
+ add_ip_to_resolv_conf "128.255.1.3"
+ else
+ for x in $( echo "${DNS}" | sed 's/,/ /g')
+ do
+ add_ip_to_resolv_conf ${x}
+ done
+ fi
+ return 0
+}
+
+
do_netmount() {
rc=1
/sbin/udevadm trigger
/sbin/udevadm settle
- ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config
+ if [ -z ${BOOTIP} ]
+ then
+ ipconfig ${DEVICE} /tmp/net-${DEVICE}.conf | tee /netboot.config
+
+ # Adding DNS Entry
+ local ipconf_dnsip=`cat /netboot.config | grep dns0 | cut -d':' -f3 | cut -d' ' -f2`
+ if [ -z ${ipconf_dnsip}] || [ ${ipconf_dnsip} == '0.0.0.0']
+ then
+ setup_static_dns
+ else
+ add_ip_to_resolv_conf ${ipconf_dnsip}
+ fi
+ # source relevant ipconfig output
+ OLDHOSTNAME=${HOSTNAME}
+ . /tmp/net-${DEVICE}.conf
+ [ -z ${HOSTNAME} ] && HOSTNAME=${OLDHOSTNAME}
+ export HOSTNAME
+
+ else
+ setup_static_ip
+ setup_static_dns
+ fi
+
if [ "${NFSROOT}" = "auto" ]; then
NFSROOT=${ROOTSERVER}:${ROOTPATH}
return ${rc}
}
+
+
do_nfsmount() {
rc=1
modprobe "${MP_QUIET}" nfs
nfsroot=*)
NFSROOT="${x#nfsroot=}"
;;
+ httpfs=*)
+ HTTPFS="${x#httpfs=}"
+ ;;
+ iscsifs=*)
+ ISCSIFS="${x#iscsifs=}"
+ ;;
+ target=*)
+ TARGET="${x#target=}"
+ ;;
netboot=*)
NETBOOT="${x#netboot=}"
;;
unset debug
fi
+# because of some reasons, I dont understand, resolv.conf is not being set
+# that is why I am copying this manually into actual filesystem. -- pravin
+cp /etc/resolv.conf /root/etc/resolv.conf
+
+
# Chain to real filesystem
maybe_break init
exec run-init ${rootmnt} ${init} "$@" <${rootmnt}/dev/console >${rootmnt}/dev/console 2>&1
FILE_TO_COPY=/bko/live/debian/initmod/initrd1.img
scp $LOCAL_BKO_LOCATION/$FILE_TO_COPY $REMOTE_BKO_LOCATION/$FILE_TO_COPY
-echo "uploading ubuntu initramfs"
+echo "uploading ubuntu-9.10 initramfs"
+FILE_TO_COPY=/bko/live/ubuntu/U9.10/initrd.lz
+scp $LOCAL_BKO_LOCATION/$FILE_TO_COPY $REMOTE_BKO_LOCATION/$FILE_TO_COPY
+
+echo "uploading ubuntu-9.04 initramfs"
FILE_TO_COPY=/bko/live/ubuntu/U9/initrd.gz
scp $LOCAL_BKO_LOCATION/$FILE_TO_COPY $REMOTE_BKO_LOCATION/$FILE_TO_COPY