Browse Source

dump1090: update to latest version, add init script and config.

Signed-off-by: Roger D <rogerdammit@gmail.com>
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Álvaro Fernández Rojas 10 years ago
parent
commit
c778155fff
3 changed files with 142 additions and 5 deletions
  1. 9
    5
      utils/dump1090/Makefile
  2. 42
    0
      utils/dump1090/files/dump1090.config
  3. 91
    0
      utils/dump1090/files/dump1090.init

+ 9
- 5
utils/dump1090/Makefile View File

@@ -8,13 +8,13 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=dump1090
11
-PKG_VERSION:=2014-08-22
11
+PKG_VERSION:=2014-10-25
12 12
 PKG_RELEASE:=$(PKG_SOURCE_VERSION)
13 13
 
14 14
 PKG_SOURCE_PROTO:=git
15 15
 PKG_SOURCE_URL:=git://github.com/MalcolmRobb/dump1090.git
16 16
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
17
-PKG_SOURCE_VERSION:=a82df07c0c0a750d58610bf3c3ece77482f3a58c
17
+PKG_SOURCE_VERSION:=65751ed6e9e20dcd6ab4e693cc5c80c698664da8
18 18
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
19 19
 PKG_MAINTAINER:=Álvaro Fernández Rojas <noltari@gmail.com>
20 20
 
@@ -23,7 +23,7 @@ PKG_LICENSE:=BSD-3c
23 23
 PKG_CONFIG_DEPENDS:= \
24 24
 	CONFIG_DUMP1090_DUMP \
25 25
 	CONFIG_DUMP1090_WWW \
26
-	CONFIG_DUMP1090_VIEW \
26
+	CONFIG_DUMP1090_VIEW
27 27
 
28 28
 include $(INCLUDE_DIR)/package.mk
29 29
 
@@ -52,14 +52,18 @@ define Package/dump1090/install
52 52
 	$(INSTALL_DIR) $(1)/usr/bin
53 53
 
54 54
 ifneq ($(CONFIG_DUMP1090_DUMP),)
55
-	$(CP) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
55
+	$(INSTALL_DIR) $(1)/etc/init.d
56
+	$(INSTALL_BIN) files/dump1090.init $(1)/etc/init.d/dump1090
57
+	$(INSTALL_DIR) $(1)/etc/config
58
+	$(INSTALL_CONF) files/dump1090.config $(1)/etc/config/dump1090
59
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/dump1090 $(1)/usr/bin
56 60
 ifneq ($(CONFIG_DUMP1090_WWW),)
57 61
 	$(INSTALL_DIR) $(1)/usr/share/dump1090
58 62
 	$(CP) $(PKG_BUILD_DIR)/public_html/* $(1)/usr/share/dump1090
59 63
 endif
60 64
 endif
61 65
 ifneq ($(CONFIG_DUMP1090_VIEW),)
62
-	$(CP) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
66
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/view1090 $(1)/usr/bin
63 67
 endif
64 68
 endef
65 69
 

+ 42
- 0
utils/dump1090/files/dump1090.config View File

@@ -0,0 +1,42 @@
1
+config dump1090 main
2
+	option disabled '1'
3
+	option device_index ''
4
+	option gain ''
5
+	option enable_agc '0'
6
+	option freq ''
7
+	option ifile ''
8
+	option interactive '0'
9
+	option interactive_rows ''
10
+	option interactive_ttl ''
11
+	option interactive_rtl1090 '0'
12
+	option raw '0'
13
+	option net '1'
14
+	option modeac '0'
15
+	option net_beast '0'
16
+	option net_only '0'
17
+	option net_http_port '8080'
18
+	option net_ri_port ''
19
+	option net_ro_port ''
20
+	option net_sbs_port ''
21
+	option net_bi_port ''
22
+	option net_bo_port ''
23
+	option net_ro_size ''
24
+	option net_ro_rate ''
25
+	option net_heartbeat ''
26
+	option net_buffer ''
27
+	option lat ''
28
+	option lon ''
29
+	option fix '0'
30
+	option no_fix '0'
31
+	option no_crc_check '0'
32
+	option phase_enhance '0'
33
+	option agressive '0'
34
+	option mlat '0'
35
+	option stats '0'
36
+	option stats_every ''
37
+	option onlyaddr '0'
38
+	option metric '0'
39
+	option snip ''
40
+	option debug ''
41
+	option quiet '1'
42
+	option ppm ''

+ 91
- 0
utils/dump1090/files/dump1090.init View File

@@ -0,0 +1,91 @@
1
+#!/bin/sh /etc/rc.common
2
+# Copyright (C) 2014 OpenWrt.org
3
+
4
+START=90
5
+STOP=10
6
+USE_PROCD=1
7
+
8
+append_arg() {
9
+	local cfg="$1"
10
+	local var="$2"
11
+	local opt="$3"
12
+	local def="$4"
13
+	local val
14
+
15
+	config_get val "$cfg" "$var"
16
+	[ -n "$val" -o -n "$def" ] && procd_append_param command $opt "${val:-$def}"
17
+}
18
+
19
+append_bool() {
20
+	local cfg="$1"
21
+	local var="$2"
22
+	local opt="$3"
23
+	local def="$4"
24
+	local val
25
+
26
+	config_get_bool val "$cfg" "$var" "$def"
27
+	[ "$val" = 1 ] && procd_append_param command "$opt"
28
+}
29
+
30
+start_instance() {
31
+	local cfg="$1"
32
+
33
+	config_get_bool disabled "$cfg" 'disabled' '0'
34
+	[ "$disabled" = 1 ] && return 1
35
+
36
+	procd_open_instance
37
+
38
+	procd_set_param command /usr/bin/dump1090
39
+
40
+	append_arg "$cfg" device_index "--device-index"
41
+	append_arg "$cfg" gain "--gain"
42
+	append_bool "$cfg" enable_agc "--enable-agc"
43
+	append_arg "$cfg" freq "--freq"
44
+	append_arg "$cfg" ifile "--ifile"
45
+	append_bool "$cfg" interactive "--interactive"
46
+	append_arg "$cfg" interactive_rows "--interactive-rows"
47
+	append_arg "$cfg" interactive_ttl "--interactive-ttl"
48
+	append_bool "$cfg" interactive_rtl1090 "--interactive-rtl1090"
49
+	append_bool "$cfg" raw "--raw"
50
+	append_bool "$cfg" net "--net"
51
+	append_bool "$cfg" modeac "--modeac"
52
+	append_bool "$cfg" net_beast "--net-beast"
53
+	append_bool "$cfg" net_only "--net-only"
54
+	append_arg "$cfg" net_http_port "--net-http-port"
55
+	append_arg "$cfg" net_ri_port "--net-ri-port"
56
+	append_arg "$cfg" net_ro_port "--net-ro-port"
57
+	append_arg "$cfg" net_sbs_port "--net-sbs-port"
58
+	append_arg "$cfg" net_bi_port "--net-bi-port"
59
+	append_arg "$cfg" net_bo_port "--net-bo-port"
60
+	append_arg "$cfg" net_ro_size "--net-ro-size"
61
+	append_arg "$cfg" net_ro_rate "--net-ro-rate"
62
+	append_arg "$cfg" net_heartbeat "--net-heartbeat"
63
+	append_arg "$cfg" net_buffer "--net-buffer"
64
+	append_arg "$cfg" lat "--lat"
65
+	append_arg "$cfg" lon "--lon"
66
+	append_bool "$cfg" fix "--fix"
67
+	append_bool "$cfg" no_fix "--no-fix"
68
+	append_bool "$cfg" no_crc_check "--no-crc-check"
69
+	append_bool "$cfg" phase_enhance "--phase-enhance"
70
+	append_bool "$cfg" agressive "--agressive"
71
+	append_bool "$cfg" mlat "--mlat"
72
+	append_bool "$cfg" stats "--stats"
73
+	append_arg "$cfg" stats_every "--stats-every"
74
+	append_bool "$cfg" onlyaddr "--onlyaddr"
75
+	append_bool "$cfg" metric "--metric"
76
+	append_arg "$cfg" snip "--snip"
77
+	append_arg "$cfg" debug "--debug"
78
+	append_bool "$cfg" quiet "--quiet"
79
+	append_arg "$cfg" ppm "--ppm"
80
+
81
+	procd_close_instance
82
+}
83
+
84
+service_triggers() { 
85
+	procd_add_reload_trigger "dump1090" 
86
+} 
87
+
88
+start_service() {
89
+	config_load dump1090
90
+	config_foreach start_instance dump1090
91
+}