forked from glidernet/ogn-rf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
debian: Update patches from PR glidernet#25
- Loading branch information
Showing
4 changed files
with
75 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
From 2d5ae0932b8421d0b9cbd1d61bcc93cce7536aae Mon Sep 17 00:00:00 2001 | ||
From 228440e319b06bcc3f4c300b5bba8f6d1094a54b Mon Sep 17 00:00:00 2001 | ||
From: "Fabian P. Schmidt" <[email protected]> | ||
Date: Thu, 16 Feb 2017 09:38:26 +0100 | ||
Subject: [PATCH] Add systemd units for ogn-decode and ogn-rf | ||
Subject: [PATCH 1/3] Add systemd units for ogn-decode and ogn-rf | ||
|
||
--- | ||
scripts/ogn-decode.service | 11 +++++++++++ | ||
|
@@ -12,22 +12,26 @@ Subject: [PATCH] Add systemd units for ogn-decode and ogn-rf | |
create mode 100644 scripts/ogn-decode.socket | ||
create mode 100644 scripts/ogn-rf.service | ||
|
||
diff --git a/scripts/ogn-decode.service b/scripts/ogn-decode.service | ||
new file mode 100644 | ||
index 0000000..f2374e3 | ||
--- /dev/null | ||
+++ b/scripts/ogn-decode.service | ||
@@ -0,0 +1,13 @@ | ||
@@ -0,0 +1,11 @@ | ||
+[Unit] | ||
+Description=Decode ogn/flarm data given by a fifo and forward it to glidernet.org | ||
+After=network.target time-sync.target | ||
+ | ||
+[Service] | ||
+StandardInput=tty | ||
+StandardOutput=journal | ||
+User=ogn | ||
+ExecStart=/usr/bin/ogn-decode /etc/rtlsdr-ogn.conf | ||
+Restart=on-failure | ||
+ | ||
+[Install] | ||
+WantedBy=multi-user.target | ||
diff --git a/scripts/ogn-decode.socket b/scripts/ogn-decode.socket | ||
new file mode 100644 | ||
index 0000000..5ad1405 | ||
--- /dev/null | ||
+++ b/scripts/ogn-decode.socket | ||
@@ -0,0 +1,6 @@ | ||
|
@@ -37,6 +41,9 @@ Subject: [PATCH] Add systemd units for ogn-decode and ogn-rf | |
+ | ||
+[Install] | ||
+WantedBy=sockets.target | ||
diff --git a/scripts/ogn-rf.service b/scripts/ogn-rf.service | ||
new file mode 100644 | ||
index 0000000..5066056 | ||
--- /dev/null | ||
+++ b/scripts/ogn-rf.service | ||
@@ -0,0 +1,11 @@ | ||
|
@@ -51,3 +58,6 @@ Subject: [PATCH] Add systemd units for ogn-decode and ogn-rf | |
+ | ||
+[Install] | ||
+WantedBy=multi-user.target | ||
-- | ||
2.1.4 | ||
|
31 changes: 31 additions & 0 deletions
31
debian/patches/0002-ogn-decode.service-Set-StandardInput-to-tty.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From ee4e7ce325556925f3ddff8faeab273c1513bbb2 Mon Sep 17 00:00:00 2001 | ||
From: "Fabian P. Schmidt" <[email protected]> | ||
Date: Sun, 19 Feb 2017 23:43:34 +0100 | ||
Subject: [PATCH 2/3] ogn-decode.service: Set StandardInput to tty | ||
|
||
This is a workaround for #11: Version 0.2.5 crashs with SEGV if invoked by systemd, | ||
since ogn-decode exits when it gets an EOF via stdin. | ||
--- | ||
scripts/ogn-decode.service | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/scripts/ogn-decode.service b/scripts/ogn-decode.service | ||
index f2374e3..cc0448b 100644 | ||
--- a/scripts/ogn-decode.service | ||
+++ b/scripts/ogn-decode.service | ||
@@ -3,6 +3,12 @@ Description=Decode ogn/flarm data given by a fifo and forward it to glidernet.or | ||
After=network.target time-sync.target | ||
|
||
[Service] | ||
+# Using a tty as StandardInput is needed as a workaround, | ||
+# since ogn-decode requires an interactive tty (as in: 'doesn't return EOF'), | ||
+# see also: https://github.com/glidernet/ogn-rf/issues/11 | ||
+StandardInput=tty-fail | ||
+StandardOutput=journal | ||
+TTYPath=/dev/tty3 | ||
User=ogn | ||
ExecStart=/usr/bin/ogn-decode /etc/rtlsdr-ogn.conf | ||
Restart=on-failure | ||
-- | ||
2.1.4 | ||
|
27 changes: 27 additions & 0 deletions
27
debian/patches/0003-ogn-rf.service-Execute-ogn-rf-as-root.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From 04e0b051e83a3f3b5c69fc47b3be2ef36eea6708 Mon Sep 17 00:00:00 2001 | ||
From: "Fabian P. Schmidt" <[email protected]> | ||
Date: Wed, 15 Mar 2017 14:07:05 +0100 | ||
Subject: [PATCH 3/3] ogn-rf.service: Execute ogn-rf as root | ||
|
||
The gpu support on the raspberry pi requires access to /dev/vcio and | ||
/dev/kmem, thus ogn-rf needs to be run as root. | ||
--- | ||
scripts/ogn-rf.service | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/scripts/ogn-rf.service b/scripts/ogn-rf.service | ||
index 5066056..2737f62 100644 | ||
--- a/scripts/ogn-rf.service | ||
+++ b/scripts/ogn-rf.service | ||
@@ -3,7 +3,7 @@ Description=Receive ogn/flarm data and write the raw data to a fifo | ||
After=network.target time-sync.target | ||
|
||
[Service] | ||
-User=ogn | ||
+User=root | ||
ExecStart=/usr/bin/ogn-rf /etc/rtlsdr-ogn.conf | ||
Restart=on-failure | ||
|
||
-- | ||
2.1.4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters