File tree 3 files changed +60
-0
lines changed
openwrt/trunk/package/iapps/gobi_loader
3 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 33
33
define Package/$(PKG_NAME)/install
34
34
$(INSTALL_DIR ) $(1 ) /usr/bin
35
35
$(INSTALL_BIN ) $(PKG_BUILD_DIR ) /$(PKG_NAME ) $(1 ) /usr/bin
36
+ $(INSTALL_DIR ) $(1 ) /etc/init.d
37
+ $(INSTALL_BIN ) ./files/gobi-loader.init $(1 ) /etc/init.d/gobi-loader
38
+ $(INSTALL_DIR ) $(1 ) /etc/config
39
+ $(INSTALL_DATA ) ./files/gobi-loader.config $(1 ) /etc/config/gobi-loader
36
40
endef
37
41
38
42
# pre-install script
Original file line number Diff line number Diff line change
1
+ config gobi-loader 'core'
2
+ option enabled '1'
3
+ option type 'gobi2000'
4
+ option device '/dev/ttyUSB0'
5
+ option firmware '/mnt/openwrt/gobi2k/firmware/Images/HP/gsm/'
Original file line number Diff line number Diff line change
1
+ #! /bin/sh /etc/rc.common
2
+ # Copyright (C) 2009-2014 OpenWrt.org
3
+
4
+ START=96
5
+
6
+ PROG=/usr/bin/gobi_loader
7
+
8
+ error () {
9
+ echo " ${initscript} :" " $@ " 1>&2
10
+ }
11
+
12
+ start_instance () {
13
+ local s=" $1 "
14
+
15
+ config_get_bool enabled " $1 " ' enabled' 0
16
+ [ $enabled -eq 0 ] && return
17
+
18
+ config_get device " $s " ' device'
19
+ if [ -z " $device " ]; then
20
+ error " in section '$s ' option device is missing"
21
+ return 1
22
+ elif [ ! -c " $device " ]; then
23
+ error " device '$device ' does not exist"
24
+ return 1
25
+ fi
26
+
27
+ config_get firmware " $s " ' firmware'
28
+ if [ -z " $firmware " ]; then
29
+ error " in section '$s ' option firmware is missing"
30
+ return 1
31
+ elif [ ! -d " $firmware " ]; then
32
+ error " firmware '$firmware ' does not exist"
33
+ return 1
34
+ fi
35
+
36
+ config_get type " $s " ' type'
37
+
38
+ local type_arg
39
+ if [ " x$type " = ' xgobi2000' ]; then
40
+ type_arg=' -2000'
41
+ else
42
+ type_arg=' '
43
+ fi
44
+
45
+ " $PROG " " $type_arg " " $device " " $firmware "
46
+ }
47
+
48
+ start () {
49
+ config_load ' gobi-loader'
50
+ config_foreach start_instance ' gobi-loader'
51
+ }
You can’t perform that action at this time.
0 commit comments