1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
7 # the 'Hardware' string from cpuinfo
9 sed -n 's!^Hardware *: !!p' /proc/cpuinfo
13 # outputs an identifier of the current machine - i.e. the board
14 # slugos is running on.
19 *NAS?100d*) echo nas100d;;
20 *DSM?G600*) echo dsmg600;;
23 *Gateway?7001*) echo gateway7001;;
29 [ -e /etc/config/network ] && exit 0
36 sysconf=$(find_mtd_part "SysConf")
40 sysconf=$(find_mtd_part "sysconfig")
44 echo model=$(machine) ;;
47 function p(cfgname, name) {
48 if (c[name] != "") print " option " cfgname " \"" c[name] "\""
58 print "#### Loopback configuration"
59 print "config interface loopback"
60 print " option ifname \"lo\""
61 print " option proto static"
62 print " option ipaddr 127.0.0.1"
63 print " option netmask 255.0.0.0"
66 print "#### LAN configuration"
67 print "config interface lan"
68 print " option ifname \"eth0\""
69 if ((c["model"] == "nslu2") || (c["model"] == "nas100d")) {
70 p("proto", "bootproto")
71 p("ipaddr", "ip_addr")
72 p("netmask", "netmask")
73 p("gateway", "gateway")
74 p("dns", "dns_server1")
75 p("hostname", "disk_server_name")
78 print " option proto dhcp"
80 }' > /etc/config/network