;;
esac
-# live-initramfs header
+# live-boot header
if [ -n "${NONETWORKING}" ]
then
. /scripts/live-functions
-log_begin_msg "Preconfiguring networking..."
+log_begin_msg "Preconfiguring networking"
-# live-initramfs script
+# live-boot script
IFFILE="/root/etc/network/interfaces"
EOF
-udevtrigger
-udevsettle
+udevadm trigger
+udevadm settle
if [ -z "${NETBOOT}" -a -n "${STATICIP}" -a "${STATICIP}" != "frommedia" ]
then
- parsed=$(echo "${STATICIP}" | sed -e 's/:/ /g')
+ parsed=$(echo "${STATICIP}" | sed -e 's/,/ /g')
for ifline in ${parsed}
do
- ifname="$(echo ${ifline} | cut -f1 -d ',')"
- ifaddress="$(echo ${ifline} | cut -f2 -d ',')"
- ifnetmask="$(echo ${ifline} | cut -f3 -d ',')"
- ifgateway="$(echo ${ifline} | cut -f4 -d ',')"
+ ifname="$(echo ${ifline} | cut -f1 -d ':')"
+ ifaddress="$(echo ${ifline} | cut -f2 -d ':')"
+ ifnetmask="$(echo ${ifline} | cut -f3 -d ':')"
+ ifgateway="$(echo ${ifline} | cut -f4 -d ':')"
cat >> "${IFFILE}" << EOF
-auto ${ifname}
+allow-hotplug ${ifname}
iface ${ifname} inet static
address ${ifaddress}
netmask ${ifnetmask}
+EOF
+
+if [ -n "${ifgateway}" ]
+then
+
+cat >> "${IFFILE}" << EOF
gateway ${ifgateway}
EOF
+fi
+
done
else
- if [ -z "${NETBOOT}" ]
+ if [ -z "${NETBOOT}" ] || [ -n "${DHCP}" ]
then
# default, dhcp assigned
method="dhcp"
method="manual"
fi
- # iterate the physical interfaces and add them to the interfaces list
- if [ "${method}" != dhcp ] || [ ! -x /root/usr/sbin/NetworkManager ]
+ # iterate the physical interfaces and add them to the interfaces list and also add when ethdevice= called on cmdline
+ if [ "${method}" != dhcp ] || ([ ! -x /root/usr/sbin/NetworkManager ] && [ ! -x /root/usr/sbin/wicd ]) || [ ! -z "${ETHDEVICE}" ]
then
for interface in /sys/class/net/eth* /sys/class/net/ath* /sys/class/net/wlan*
do
i="$(basename ${interface})"
cat >> "${IFFILE}" << EOF
-auto ${i}
+allow-hotplug ${i}
iface ${i} inet ${method}
EOF
cat > /root/etc/resolv.conf << EOF
# /etc/resolv.conf
-# Autogenerated by live-initramfs
+# Autogenerated by live-boot
search ${rc_search}
domain ${rc_search}
${rc_server0}
# grep -q "iface ${i}" ${IFFILE} && continue
#
#cat >> "${IFFILE}" << EOF
-#auto ${i}
+#allow-hotplug ${i}
#iface ${i} inet dhcp
#
#EOF