English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Contents of /branches/freewrt_1_0/package/busybox/files/vlan.pre-up

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2766 - (show annotations) (download)
Mon Jun 11 23:24:02 2007 UTC (6 years, 8 months ago) by tha
File size: 1444 byte(s)
fixed a lot of startup or shutdown related problems
- added start/stop logik to S10boot, S20jggsclean & S98done
- fixed check for empty variable in vlan.pre-up (ugly erros in log)
- aiccu only gets killed when it was really running before
  (otherwise it logs ugly messages to syslog)
- ntpclient packages now has an init.d script and some
  reasonable default flags. if present, the serverhost comes
  from /etc/ntpd.conf
- removed hotplug ntpclient script, I think it never worked
  correctly
- ntpclient & openntpd are waiting 15 seconds in autostart
  mode before they are executed. in bridging-wlan/lan-mode
  this seems to be neccessary, because otherwise ntp(client)
  cannot sync (network not really up?)
- shorewall only executes "shorewall stop" if it was started
  before.
- fixed rcK script: the -k2 option was useless in our case (thx tg)


1 #!/bin/sh
2
3 case "$IFACE" in
4 vlan0*)
5 vconfig set_name_type VLAN_PLUS_VID
6 VLANID=`echo $IFACE|sed "s/vlan0*//"`
7 ;;
8 vlan*)
9 vconfig set_name_type VLAN_PLUS_VID_NO_PAD
10 VLANID=`echo $IFACE|sed "s/vlan*//"`
11 ;;
12 eth*.0?*)
13 vconfig set_name_type DEV_PLUS_VID
14 VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.0*//g"`
15 IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
16 ;;
17 eth*.*)
18 vconfig set_name_type DEV_PLUS_VID_NO_PAD
19 VLANID=`echo $IFACE|sed "s/eth[0-9][0-9]*\.*//g"`
20 IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(eth[0-9][0-9]*\)\..*/\1/"`
21 ;;
22 *) exit 0
23 ;;
24 esac
25
26 if [ "$IF_VLAN_RAW_DEVICE" != "" ]
27 then
28 [ -x /sbin/vconfig ] || exit 0
29 if ! grep -q "$IF_VLAN_RAW_DEVICE" /proc/net/dev
30 then
31 echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE"
32 exit 1
33 fi
34
35 # enable vlan
36 if [ -d /proc/switch/$IF_VLAN_RAW_DEVICE ]
37 then
38 echo 1 > /proc/switch/$IF_VLAN_RAW_DEVICE/enable_vlan
39 fi
40 ip link set up dev $IF_VLAN_RAW_DEVICE
41 vconfig add $IF_VLAN_RAW_DEVICE $VLANID
42 # change mac link layer address
43 if [ "$IF_MAC_ADDRESS" != "" ]
44 then
45 ip link set $IF_VLAN_RAW_DEVICE.$VLANID address $IF_MAC_ADDRESS
46 fi
47 ip link set up dev $IF_VLAN_RAW_DEVICE.$VLANID
48
49 # configure switch ports
50 if [ "$IF_SWITCH_PORTS" != "" ]
51 then
52 echo "$IF_SWITCH_PORTS" > /proc/switch/$IF_VLAN_RAW_DEVICE/vlan/$VLANID/ports
53 fi
54 fi

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20