+++ /dev/null
-ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"
-ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
inst "$moddir/dhclient.conf" "/etc/dhclient.conf"
instmods ecb arc4
-inst_rules "$moddir/60-net.rules"
+inst_hook pre-udev 60 "$moddir/net-genrules.sh"
inst_hook cmdline 91 "$moddir/dhcp-root.sh"
inst_hook cmdline 99 "$moddir/parse-ip-opts.sh"
inst_hook pre-pivot 10 "$moddir/kill-dhclient.sh"
--- /dev/null
+#!/bin/sh
+
+# Don't continue if we don't need network
+[ -z "$netroot" ] && return;
+
+# Write udev rules
+{
+ printf 'ACTION=="add", SUBSYSTEM=="net", RUN+="/sbin/ifup $env{INTERFACE}"\n'
+ printf 'ACTION=="online", SUBSYSTEM=="net", RUN+="/sbin/netroot $env{INTERFACE}"\n'
+} > /etc/udev/rules.d/60-net.rules
esac
}
+# Check if ip= lines should be used
+if getarg ip= >/dev/null ; then
+ if [ -z "$netroot" ] ; then
+ echo "Warning: No netboot configured, ignoring ip= lines"
+ return;
+ fi
+fi
+
# Warn if defaulting to ip=dhcp
if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] ; then
warn "No ip= argument(s) for netroot provided, defaulting to DHCP"