fixed 40network module
parent
f360cabf1f
commit
32f32c14b6
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
exec >> /ifup.log 2>&1
|
||||||
|
|
||||||
# bail immediatly if the interface is already up
|
# bail immediatly if the interface is already up
|
||||||
[ -f "/net.$1.up" ] && exit 0
|
[ -f "/net.$1.up" ] && exit 0
|
||||||
|
|
||||||
|
@ -12,13 +16,13 @@
|
||||||
|
|
||||||
# spin through the kernel command line, looking for ip= lines
|
# spin through the kernel command line, looking for ip= lines
|
||||||
for p in $(cat /proc/cmdline); do
|
for p in $(cat /proc/cmdline); do
|
||||||
[ "${p%ip=*}" ] || continue
|
[ "${p%%=*}" = "ip" ] || continue
|
||||||
p=${p#ip=}
|
ip=${p#ip=}
|
||||||
case $p in
|
case $ip in
|
||||||
none|off) exit 0;; # we were told to not configure anything
|
none|off) exit 0;; # we were told to not configure anything
|
||||||
dhcp|on|any) >/net.$1.dhcp; exit 0;;
|
dhcp|on|any) >/net.$1.dhcp; exit 0;;
|
||||||
bootp|rarp|both) exit 0;; #dunno how to do this
|
bootp|rarp|both) exit 0;; #dunno how to do this
|
||||||
*) echo ${ip#ip=} | \
|
*) echo ${ip} | \
|
||||||
(IFS=':' read client server gw netmask hostname device autoconf
|
(IFS=':' read client server gw netmask hostname device autoconf
|
||||||
if [ -z "$device" -o "$device" = "$1" ]; then
|
if [ -z "$device" -o "$device" = "$1" ]; then
|
||||||
case $autoconf in
|
case $autoconf in
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
dracut_install ip dhclient
|
dracut_install ip dhclient grep
|
||||||
instmods ${modules:-=net}
|
instmods ${modules:-=net}
|
||||||
inst "$moddir/ifup" "/sbin/ifup"
|
inst "$moddir/ifup" "/sbin/ifup"
|
||||||
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
inst "$moddir/dhclient-script" "/sbin/dhclient-script"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
for i in /net.*.dhcp; do
|
for i in /net.*.dhcp; do
|
||||||
[ "$dev" = "/net.*.dhcp" ] && break
|
[ "$dev" = '/net.*.dhcp' ] && break
|
||||||
dev=${i#net.}; dev=${i%.dhcp}
|
dev=${i#/net.}; dev=${dev%.dhcp}
|
||||||
[ -f "/net.$dev.up" ] && continue
|
[ -f "/net.$dev.up" ] && continue
|
||||||
dhclient -1 -q $dev &
|
dhclient -R 'subnet-mask,broadcast-address,time-offset,routers,domain-name,domain-name-servers,host-name,nis-domain,nis-servers,ntp-servers,root-path' -1 -q $dev &
|
||||||
done
|
done
|
||||||
wait
|
wait
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue