summaryrefslogtreecommitdiff
path: root/packages/openslug-init/openslug-init-0.10/sysconfsetup
blob: 533354b71f77a82e5c7f8d40585708b918a20603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
if [ ! -e /etc/linksysconf ]
then

#  Ok this may be a little hack for now
#  but Make sure the kernel module info is updated
#  So the driver can actually load the first time
   /usr/sbin/update-modules

   dd if=/dev/mtdblock1 of=/etc/linksysconf
   cat <<EOF > /etc/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
EOF

   strings /etc/linksysconf | grep ip_addr >> /etc/interfaces
   strings /etc/linksysconf | grep ^netmask >> /etc/interfaces
   strings /etc/linksysconf | grep hw_addr >> /etc/interfaces
   sed -i -e 's/ip_addr=/        address /' /etc/interfaces
   sed -i -e 's/netmask=/        netmask /' /etc/interfaces
   sed -i -e 's/hw_addr=/        hwaddress ether /' /etc/interfaces

   mv /etc/network/interfaces /etc/network/interfaces.old
   cp /etc/interfaces /etc/network/interfaces
#   mv /etc/interfaces /etc/network/interfaces
   echo "Configured /etc/network/interfaces with IP Static linksysconf Information"
fi

modprobe ixp425_eth
modprobe ehci-hcd