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
;;
28 # Returns the mtd device with the specified name (without leading /dev)
29 # $1 = name of mtd device
31 grep "\"$1\"*$" /proc
/mtd | cut
-d : -f 1
34 # Returns the mtd block device with the specified name (without leading /dev)
35 # $1 = name of mtd device
37 echo $
(get_mtd
"$1") |
sed 's/mtd/mtdblock/'
41 [ -e /etc
/config
/network
] && exit 0
48 sysconf
=$
(find_mtd_part
"SysConf")
52 sysconf
=$
(find_mtd_part
"sysconfig")
56 echo model
=$
(machine
) ;;
59 function p(cfgname, name) {
60 if (c[name] != "") print " option " cfgname " \"" c[name] "\""
71 print "#### Loopback configuration"
72 print "config interface loopback"
73 print " option ifname \"lo\""
74 print " option proto static"
75 print " option ipaddr 127.0.0.1"
76 print " option netmask 255.0.0.0"
79 print "#### LAN configuration"
80 print "config interface lan"
81 print " option ifname eth0"
82 if ((model == "nslu2") || (model == "nas100d")) {
83 p("proto", "bootproto")
84 p("ipaddr", "ip_addr")
85 p("netmask", "netmask")
86 p("gateway", "gateway")
87 p("dns", "dns_server1")
88 p("hostname", "disk_server_name")
91 print " option proto dhcp"
93 }' > /etc
/config
/network
This page took 0.063094 seconds and 5 git commands to generate.