kirkwood: fix compatible string in ib62x0 dts
[openwrt/openwrt.git] / target / linux / kirkwood / base-files / lib / kirkwood.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2014 OpenWrt.org
4 #
5
6 KIRKWOOD_BOARD_NAME=
7 KIRKWOOD_MODEL=
8
9 kirkwood_board_detect() {
10 local machine
11 local name
12
13 machine=$(cat /proc/device-tree/model)
14
15 case "$machine" in
16 "Seagate FreeAgent Dockstar")
17 name="dockstar"
18 ;;
19
20 "Seagate GoFlex Home")
21 name="goflexhome"
22 ;;
23
24 "Seagate GoFlex Net")
25 name="goflexnet"
26 ;;
27
28 "Iomega Iconnect")
29 name="iconnect"
30 ;;
31
32 "RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
33 name="ib62x0"
34 ;;
35
36 "Cisco Systems ON100")
37 name="on100"
38 ;;
39
40 "Cloud Engines Pogoplug E02")
41 name="pogo_e02"
42 ;;
43
44 "Linksys Audi (EA3500)")
45 name="linksys-audi"
46 ;;
47
48 "Linksys Viper (E4200v2 / EA4500)")
49 name="linksys-viper"
50 ;;
51
52 "ZyXEL NSA310b")
53 name="nsa310b"
54 ;;
55
56 "ZyXEL NSA325")
57 name="nsa325"
58 ;;
59
60 *)
61 name="generic"
62 ;;
63 esac
64
65 [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name"
66 [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine"
67
68 [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
69
70 echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name
71 echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model
72 }