Compare commits

...

15 Commits

Author SHA1 Message Date
Pau Espin 4f81666c78 Update Osmocom recipes to latest tags (release 202309) 2023-09-13 14:18:12 +02:00
Oliver Smith 62233ca068 openvpn: bring back "openvpn@.service"
Restore "openvpn@.service" from packaging of openvpn 2.3.6, so we can
start the sysmocom vpn the same way as currently described in the
manuals.

Previous patch 8439e71a99 already
attempted to do this, but only brought back "openvpn.service" and not
"openvpn@.service".

Fixes: 8439e71a ("openvpn: bring back openvpn.service file")
Related: SYS#6303
Change-Id: I28a7f491d74690409f815555743679c69e31b518
2023-06-12 13:06:13 +02:00
Oliver Smith 9c9857bc26 dropbear: depend on sftp-server
Related: SYS#6403
Change-Id: Ieb8d386d92e47cd37174e4d816c3a2126174ce72
2023-05-03 16:59:51 +02:00
Oliver Smith cc8ad7cde7 dropbear: do not disable root login
Related: SYS#6402
Change-Id: Ie9ef36f3008c6f8054f4e8164000a2e9e80c53d9
2023-05-03 16:59:05 +02:00
Oliver Smith fc7d6d4ae2 dropbear: fix build with our OE version
* Replace : with _
* Remove "virtual/crypt" from depends

Related: SYS#6402
Change-Id: Iebeb013ed2829e5008388eed7f8794eb5ae6dad0
2023-05-03 16:58:29 +02:00
Oliver Smith ce45a5bc79 dropbear: import 2022.83 from upstream OE
Import current packaging of dropbear from openembedded-core.git, commit
0defbb5925e309799162e221285e4cfb2e2c2ca5.

Related: SYS#6402
Change-Id: I431934b0558350931bb9571b0fa6efff8ba45387
2023-05-03 16:38:33 +02:00
Oliver Smith 7b7e522ccf recipes-fixes/dropbear: remove
Remove this directory to prepare to upgrade dropbear in following
patches. The directory made changes to the sysvinit script that was
used by pre-201705 systems (SYS#691). 201705 uses systemd services
instead.

On a side note, all customizations made to the init script had been
upstreamed into OE.

Related: SYS#6402
Change-Id: Icb65a68091aff43c5c94ba961a650865a2784b65
2023-05-03 15:30:56 +02:00
Oliver Smith 3140454c3c sftp-server: new package
Package OpenSSH's sftp-server program, so we can install it as
dependency of dropbear in a future patch. Once sftp-server is installed,
the scp tool from OpenSSH can be used with the SFTP protocol, without
enabling the legacy flag for the legacy SCP protocol.

The sftp-server binary is 126K in size.

After packaging this, I realized that we could also have used
the openssh-sftp-server package from poky:
https://gitea.sysmocom.de/sysmo-bts/generic-poky/src/branch/pyro/meta/recipes-connectivity/openssh
But let's use this extra package now, it uses the most recent OpenSSH
source and doesn't build the rest of OpenSSH which we don't need.

Related: SYS#6403
Change-Id: I376bc31413935f7a560afd916a623228550dc6fe
2023-05-03 15:30:56 +02:00
Oliver Smith 7588bee7fa gpsd: fix gpsd.hotplug udev rules
Adjust the bundled udev rules to use gpsd.hotplug instead of
gpsd.hotplug.wrapper, as the wrapper has been removed upstream.

Fix for:
systemd-udevd[1004]: failed to execute '/lib/udev/gpsd.hotplug.wrapper' '/lib/udev/gpsd.hotplug.wrapper': No such file or directory

Fixes: 6a8f914b ("gpsd: upgrade to 3.24")
Related: 711a3f8412
Related: SYS#6222
Change-Id: I95c9d1537a9a7090b1239aecef14f25f8d7ca554
2023-05-03 14:02:59 +02:00
Oliver Smith d69834d507 openvpn: bring back openvpn.service file
Restore the openvpn.service file from packaging of openvpn 2.3.6, so we
can still start it the same way (as currently described in manuals).

Related: SYS#6303
Change-Id: I2cf96bc1ecca79ae98be1181fbd3c15edad15ca8
2023-05-03 13:57:29 +02:00
Oliver Smith 89f6d2b1f0 sysmocom-openvpn-config: update config
Related: SYS#6303
Change-Id: If13ef523b13e15d3b1930396ae67a729a080a3b7
2023-05-03 13:56:52 +02:00
Harald Welte d950005138 openvpn: upgrade openvpn from 2.3.6 to 2.5.8
Our openvpn server has meanwhile been migrated to 2.5.x, and
establishing backwards compatibility with 2.3.x means we have to
disable ciphers + tls versions that are no longer considered secure.

Related: SYS#6303
2023-05-03 13:56:42 +02:00
Oliver Smith fae46a5d5a gpsdate: upgrade to fix build against new gpsd
Upgrade gpsdate to the latest commit, where the build against newer gpsd
was fixed.

Related: SYS#6222
Change-Id: Ia83008933a1e94e556b6908903ad7b63759fc1e3
2023-05-03 13:56:32 +02:00
Oliver Smith 0543e7992b gpsd: upgrade to 3.24
Usually when upgrading packages, we just copy the upstream package and
adjust it slightly. I've looked at the upstream package here:
https://git.openembedded.org/meta-openembedded/tree/meta-oe/recipes-navigation/gpsd
(HEAD at f3d14d41ad60d2d52a0ea795ae10fe0882146ed1)

But as I compared both packaging trees, I found ours is quite different
than upstream. We have a lot of additional patches, still use python2 and
have these extra files:

├── gpsd
│   ├── 60-gpsd.rules
│   ├── gpsd
│   ├── gpsd-default
│   ├── gpsd.service
│   ├── oc2g
│   │   ├── gpsd-default
│   │   └── gpsd.service
│   ├── sysmobts2100
│   │   └── gpsd-default
│   ├── sysmobts-v2
│   │   └── gpsd-default
│   └── sysmocom-idu
│       └── gpsd-default

Therefore I didn't start with the upstream packaging but instead
increased the gpsd version in our packaging and went through each patch
to see if it can be dropped or needs to be forward ported.

Change the version by renaming the .bb file. Reset the version of the
recipe (PR) back to "r0" again, as it is common practice after changing
the package version. The previous value "r3.20" looked a bit like a
package version, but it's not that.

Rebase patches:
* 0001-gps2udp-Add-a-label-timestamp-and-mac-address-to-eac.patch
* 0002-gps2udp-leave-argv-untouched.patch (leave-argv-untouched.patch)
* 0003-tsip-configure-and-enable-1PPS.patch (gpsd-tsip-pps.patch)

Add build fixes:
* 0004-SConscript-force-use-of-pthread.patch

Drop patches:
* 0001-SConstruct-prefix-includepy-with-sysroot-and-drop-sy.patch:
  unused in previous version
* 0001-SConstruct-disable-html-and-man-docs-building-becaus.patch:
  doesn't apply, instead disable docs building via manbuild='no'
* 0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch:
  not needed anymore (no splintopts line in 3.24)
* gpsd-3.3-ldflags.patch:
  fixed upstream
* no-rpath-please.patch:
  doesn't apply, not needed anymore (see 5df2de36 in gpsd.git)

Related: https://docs.yoctoproject.org/bitbake/2.2/bitbake-user-manual/bitbake-user-manual-ref-variables.html#term-PR
Related: SYS#6222
Change-Id: I2debe481c5f1cc4ee8290ad0dc883d6a4ea73741
2023-05-03 13:56:23 +02:00
Oliver Smith f9db945110 gpsd: cosmetic fixes in SRC_URI, EXTRA_OESCONS
Change-Id: Ic5af4db7bbce6ba0bf55387265fdfc95a1761230
2023-05-03 13:56:09 +02:00
39 changed files with 916 additions and 644 deletions

View File

@ -1,12 +1,12 @@
#OpenVPN client conf
tls-client
client
ns-cert-type server
remote-cert-tls server
dev tun
proto udp
tun-mtu 1500
remote admin.sysmocom.de
remote vpn.sysmocom.de
comp-lzo
pkcs12 sysmocom-client-cert.p12
cipher BF-CBC
cipher AES-256-CBC
nobind

View File

@ -5,7 +5,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
SRC_URI = "file://sysmocom-vpn.conf"
PR = "r6"
PR = "r7"
CONFFILES_${PN} = "${sysconfdir}/openvpn/sysmocom-vpn.conf"
PACKAGE_ARCH = "all"

View File

@ -0,0 +1,23 @@
Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
Upstream-Status: Inappropriate [configuration]
---
default_options.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/default_options.h b/default_options.h
index 349338c..5ffac25 100644
--- a/default_options.h
+++ b/default_options.h
@@ -289,7 +289,7 @@ group1 in Dropbear server too */
/* The command to invoke for xauth when using X11 forwarding.
* "-q" for quiet */
-#define XAUTH_COMMAND "/usr/bin/xauth -q"
+#define XAUTH_COMMAND "xauth -q"
/* If you want to enable running an sftp server (such as the one included with
--
2.25.1

View File

@ -0,0 +1,41 @@
From b8cece92ba19aa77ac013ea161bfe4c7147747c9 Mon Sep 17 00:00:00 2001
From: Jussi Kukkonen <jussi.kukkonen@intel.com>
Date: Wed, 2 Dec 2015 11:36:02 +0200
Subject: Enable pam
We need modify file default_options.h besides enabling pam in
configure if we want dropbear to support pam.
Upstream-Status: Pending
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
default_options.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/default_options.h b/default_options.h
index 0e3d027..349338c 100644
--- a/default_options.h
+++ b/default_options.h
@@ -210,7 +210,7 @@ group1 in Dropbear server too */
/* Authentication Types - at least one required.
RFC Draft requires pubkey auth, and recommends password */
-#define DROPBEAR_SVR_PASSWORD_AUTH 1
+#define DROPBEAR_SVR_PASSWORD_AUTH 0
/* Note: PAM auth is quite simple and only works for PAM modules which just do
* a simple "Login: " "Password: " (you can edit the strings in svr-authpam.c).
@@ -218,7 +218,7 @@ group1 in Dropbear server too */
* but there's an interface via a PAM module. It won't work for more complex
* PAM challenge/response.
* You can't enable both PASSWORD and PAM. */
-#define DROPBEAR_SVR_PAM_AUTH 0
+#define DROPBEAR_SVR_PAM_AUTH 1
/* ~/.ssh/authorized_keys authentication.
* You must define DROPBEAR_SVR_PUBKEY_AUTH in order to use plugins. */
--
2.25.1

View File

@ -0,0 +1,33 @@
From e3a5db1b6d3f6382a15b2266458c26c645a10f18 Mon Sep 17 00:00:00 2001
From: Mingli Yu <Mingli.Yu@windriver.com>
Date: Thu, 6 Sep 2018 15:54:00 +0800
Subject: [PATCH] dropbear configuration file
dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Maxin B. John <maxin.john@enea.com>
Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
svr-authpam.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/svr-authpam.c b/svr-authpam.c
index d201bc9..165ec5c 100644
--- a/svr-authpam.c
+++ b/svr-authpam.c
@@ -223,7 +223,7 @@ void svr_auth_pam(int valid_user) {
}
/* Init pam */
- if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s",
rc, pam_strerror(pamHandlep, rc));
goto cleanup;
--
2.7.4

View File

@ -0,0 +1,4 @@
#%PAM-1.0
auth include common-auth
account include common-account

View File

@ -0,0 +1,31 @@
From c347ece05a7fdbf50d76cb136b9ed45caed333f6 Mon Sep 17 00:00:00 2001
From: Joseph Reynolds <joseph.reynolds1@ibm.com>
Date: Thu, 20 Jun 2019 16:29:15 -0500
Subject: [PATCH] dropbear: new feature: disable-weak-ciphers
This feature disables all CBC, SHA1, and diffie-hellman group1 ciphers
in the dropbear ssh server and client since they're considered weak ciphers
and we want to support the stong algorithms.
Upstream-Status: Inappropriate [configuration]
Signed-off-by: Joseph Reynolds <joseph.reynolds1@ibm.com>
---
default_options.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/default_options.h b/default_options.h
index d417588..bc5200f 100644
--- a/default_options.h
+++ b/default_options.h
@@ -180,7 +180,7 @@ IMPORTANT: Some options will require "make clean" after changes */
* Small systems should generally include either curve25519 or ecdh for performance.
* curve25519 is less widely supported but is faster
*/
-#define DROPBEAR_DH_GROUP14_SHA1 1
+#define DROPBEAR_DH_GROUP14_SHA1 0
#define DROPBEAR_DH_GROUP14_SHA256 1
#define DROPBEAR_DH_GROUP16 0
#define DROPBEAR_CURVE25519 1
--
2.25.1

View File

@ -0,0 +1,2 @@
# Disallow root logins by default
DROPBEAR_EXTRA_ARGS="-w"

View File

@ -0,0 +1,10 @@
[Unit]
Conflicts=dropbear.service
[Socket]
ListenStream=22
Accept=yes
[Install]
WantedBy=sockets.target
Also=dropbearkey.service

View File

@ -0,0 +1,12 @@
[Unit]
Description=SSH Per-Connection Server
Wants=dropbearkey.service
After=syslog.target dropbearkey.service
[Service]
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
EnvironmentFile=-/etc/default/dropbear
ExecStart=-@SBINDIR@/dropbear -i -r ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
StandardInput=socket
KillMode=process

View File

@ -0,0 +1,14 @@
[Unit]
Description=SSH Key Generation
RequiresMountsFor=/var /var/lib
ConditionPathExists=!/etc/dropbear/dropbear_rsa_host_key
ConditionPathExists=!/var/lib/dropbear/dropbear_rsa_host_key
[Service]
Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear"
EnvironmentFile=-/etc/default/dropbear
Type=oneshot
ExecStart=@BASE_BINDIR@/mkdir -p ${DROPBEAR_RSAKEY_DIR}
ExecStart=@SBINDIR@/dropbearkey -t rsa -f ${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key
RemainAfterExit=yes
Nice=10

View File

@ -0,0 +1,79 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $remote_fs $syslog $networking
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Dropbear Secure Shell server
### END INIT INFO
#
# Do not configure this file. Edit /etc/default/dropbear instead!
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dropbear
NAME=dropbear
DESC="Dropbear SSH server"
PIDFILE=/var/run/dropbear.pid
# These values may be replaced by those from /etc/default/dropbear
DROPBEAR_RSAKEY_DIR="/etc/dropbear"
DROPBEAR_PORT=22
DROPBEAR_EXTRA_ARGS=
DROPBEAR_RSAKEY_ARGS=
NO_START=0
set -e
test ! -r /etc/default/dropbear || . /etc/default/dropbear
test "$NO_START" = "0" || exit 0
test -x "$DAEMON" || exit 0
test ! -h /var/service/dropbear || exit 0
test -z "$DROPBEAR_BANNER" || \
DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
test -n "$DROPBEAR_RSAKEY" || \
DROPBEAR_RSAKEY="${DROPBEAR_RSAKEY_DIR}/dropbear_rsa_host_key"
gen_keys() {
if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
rm $DROPBEAR_RSAKEY || true
fi
if [ ! -f "$DROPBEAR_RSAKEY" ]; then
mkdir -p ${DROPBEAR_RSAKEY%/*}
dropbearkey -t rsa -f $DROPBEAR_RSAKEY $DROPBEAR_RSAKEY_ARGS
fi
}
case "$1" in
start)
echo -n "Starting $DESC: "
gen_keys
start-stop-daemon -S -p $PIDFILE \
-x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
sleep 1
start-stop-daemon -S -p $PIDFILE \
-x "$DAEMON" -- -r $DROPBEAR_RSAKEY \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

View File

@ -0,0 +1,11 @@
# Not provided in our OE packages
DEPENDS_remove = "virtual/crypt"
# Install sftp-server so scp works with the SFTP protocol, which is the default
# in recent OpenSSH versions (SYS#6403)
RDEPENDS_${PN}_append = " sftp-server"
do_install_append() {
# Do not disable root login by default
echo "" > ${D}${sysconfdir}/default/dropbear
}

View File

@ -0,0 +1,133 @@
SUMMARY = "A lightweight SSH and SCP implementation"
HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
DESCRIPTION = "Dropbear is a relatively small SSH server and client. It runs on a variety of POSIX-based platforms. Dropbear is open source software, distributed under a MIT-style license. Dropbear is particularly useful for "embedded"-type Linux (or other Unix) systems, such as wireless routers."
SECTION = "console/network"
# some files are from other projects and have others license terms:
# public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=25cf44512b7bc8966a48b6b1a9b7605f"
DEPENDS = "zlib virtual/crypt"
RPROVIDES_${PN} = "ssh sshd"
RCONFLICTS_${PN} = "openssh-sshd openssh"
SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
file://0001-urandom-xauth-changes-to-options.h.patch \
file://init \
file://dropbearkey.service \
file://dropbear@.service \
file://dropbear.socket \
file://dropbear.default \
${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
${@bb.utils.contains('PACKAGECONFIG', 'disable-weak-ciphers', 'file://dropbear-disable-weak-ciphers.patch', '', d)} \
"
SRC_URI[sha256sum] = "bc5a121ffbc94b5171ad5ebe01be42746d50aa797c9549a4639894a16749443b"
PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
file://0006-dropbear-configuration-file.patch \
file://dropbear"
PAM_PLUGINS = "libpam-runtime \
pam-plugin-deny \
pam-plugin-permit \
pam-plugin-unix \
"
inherit autotools update-rc.d systemd
CVE_PRODUCT = "dropbear_ssh"
INITSCRIPT_NAME = "dropbear"
INITSCRIPT_PARAMS = "defaults 10"
SYSTEMD_SERVICE_${PN} = "dropbear.socket"
SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
BINCOMMANDS = "dbclient ssh scp"
EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
PACKAGECONFIG ?= "disable-weak-ciphers ${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam,${PAM_PLUGINS}"
PACKAGECONFIG[system-libtom] = "--disable-bundled-libtom,--enable-bundled-libtom,libtommath libtomcrypt"
PACKAGECONFIG[disable-weak-ciphers] = ""
PACKAGECONFIG[enable-x11-forwarding] = ""
# This option appends to CFLAGS and LDFLAGS from OE
# This is causing [textrel] QA warning
EXTRA_OECONF += "--disable-harden"
# musl does not implement wtmp/logwtmp APIs
EXTRA_OECONF_append_libc-musl = " --disable-wtmp --disable-lastlog"
do_configure_append() {
echo "/* Dropbear features */" > ${B}/localoptions.h
if ${@bb.utils.contains('PACKAGECONFIG', 'enable-x11-forwarding', 'true', 'false', d)}; then
echo "#define DROPBEAR_X11FWD 1" >> ${B}/localoptions.h
fi
}
do_install() {
install -d ${D}${sysconfdir} \
${D}${sysconfdir}/init.d \
${D}${sysconfdir}/default \
${D}${sysconfdir}/dropbear \
${D}${bindir} \
${D}${sbindir} \
${D}${localstatedir}
install -m 0644 ${WORKDIR}/dropbear.default ${D}${sysconfdir}/default/dropbear
install -m 0755 dropbearmulti ${D}${sbindir}/
for i in ${BINCOMMANDS}
do
# ssh and scp symlinks are created by update-alternatives
if [ $i = ssh ] || [ $i = scp ]; then continue; fi
ln -s ${sbindir}/dropbearmulti ${D}${bindir}/$i
done
for i in ${SBINCOMMANDS}
do
ln -s ./dropbearmulti ${D}${sbindir}/$i
done
sed -e 's,/etc,${sysconfdir},g' \
-e 's,/usr/sbin,${sbindir},g' \
-e 's,/var,${localstatedir},g' \
-e 's,/usr/bin,${bindir},g' \
-e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
chmod 755 ${D}${sysconfdir}/init.d/dropbear
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
install -d ${D}${sysconfdir}/pam.d
install -m 0644 ${WORKDIR}/dropbear ${D}${sysconfdir}/pam.d/
fi
# deal with systemd unit files
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_system_unitdir}
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
-e 's,@BINDIR@,${bindir},g' \
-e 's,@SBINDIR@,${sbindir},g' \
${D}${systemd_system_unitdir}/dropbear.socket ${D}${systemd_system_unitdir}/*.service
}
inherit update-alternatives
ALTERNATIVE_PRIORITY = "20"
ALTERNATIVE_${PN} = "${@bb.utils.filter('BINCOMMANDS', 'scp ssh', d)}"
ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
pkg_postrm_${PN} () {
if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
fi
if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
rm ${sysconfdir}/dropbear/dropbear_dss_host_key
fi
}
CONFFILES_${PN} = "${sysconfdir}/default/dropbear"
FILES_${PN} += "${bindir}"

View File

@ -1,46 +0,0 @@
From ca1a781afbd68697ef2f573557f1f93ec7ab8d3c Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Sun, 29 Apr 2012 00:05:59 +0200
Subject: [PATCH] SConstruct: disable html and man docs building because
xmlto-native from OE is broken
It will try to load dtd and fail:
| xmlto man gpsctl.xml; mv `basename gpsctl.1` gpsctl.1
| xmlto: /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml does not validate (status 3)
| xmlto: Fix document syntax or use --skip-validation option
| I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
| /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml:8: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
| "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
| ^
| I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd
| warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
| validity error : Could not load the external subset "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
| Document /var/lib/jenkins/jobs/shr-core-branches/workspace/shr-core/tmp-eglibc/work/armv4t-oe-linux-gnueabi/gpsd-3.4-r2/gpsd-3.4/gpsctl.xml does not validate
| mv: cannot stat `gpsctl.1': No such file or directory
| scons: *** [gpsctl.1] Error 1
| scons: building terminated because of errors.
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
SConstruct | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: gpsd-3.10/SConstruct
===================================================================
--- gpsd-3.10.orig/SConstruct
+++ gpsd-3.10/SConstruct
@@ -704,12 +704,12 @@ size_t strlcpy(/*@out@*/char *dst, /*@in
manbuilder = mangenerator = htmlbuilder = None
if env['manbuild']:
- if config.CheckXsltproc():
+ if False and config.CheckXsltproc():
mangenerator = 'xsltproc'
build = "xsltproc --nonet %s $SOURCE >$TARGET"
htmlbuilder = build % docbook_html_uri
manbuilder = build % docbook_man_uri
- elif WhereIs("xmlto"):
+ elif False and WhereIs("xmlto"):
mangenerator = 'xmlto'
xmlto = "xmlto %s $SOURCE || mv `basename $TARGET` `dirname $TARGET`"
htmlbuilder = xmlto % "html-nochunks"

View File

@ -1,72 +0,0 @@
From dd3ca38b27cce93f7e932abaa27b41371234fa90 Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 24 Apr 2012 18:45:14 +0200
Subject: [PATCH] SConstruct: prefix includepy with sysroot and drop sysroot
from python_lib_dir
* without PYTHONPATH, distutil's sysconfig returns INCLUDEPY without sysroot prefix
and with PYTHONPATH from OE it's pointing to native python dir
$ export PYTHONPATH=/OE/shr-core/tmp-eglibc/sysroots/om-gta02/usr/lib/python2.7/
$ python
Python 2.7.2 (default, Apr 18 2012, 09:19:59)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils import sysconfig
>>> sysconfig.get_config_vars('INCLUDEPY')
['/OE/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/python2.7']
>>>
$ unset PYTHONPATH
$ python
Python 2.7.2 (default, Apr 18 2012, 09:19:59)
[GCC 4.6.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils import sysconfig
>>> sysconfig.get_config_vars('INCLUDEPY')
['/python2.7']
>>> import sysconfig
>>> sysconfig.get_config_vars('INCLUDEPY')
['/OE/shr-core/tmp-eglibc/sysroots/x86_64-linux/usr/include/python2.7']
* python_lib_dir = python_lib_dir.replace(env['sysroot'], '')
returns path to target sysroot
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
SConstruct | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/SConstruct b/SConstruct
index 3c919fc..8478181 100644
--- a/SConstruct
+++ b/SConstruct
@@ -932,6 +932,12 @@ else:
if vars[i] is None:
vars[i] = []
(cc, cxx, opt, basecflags, ccshared, ldshared, so_ext, includepy, ldflags) = vars
+
+ if env['sysroot']:
+ print "Prefixing includepy '%s' with sysroot prefix" % includepy
+ includepy = os.path.normpath("%s/%s/%s/%s" % (env['sysroot'], env['prefix'], env['includedir'], includepy))
+ print "'%s'" % includepy
+
# in case CC/CXX was set to the scan-build wrapper,
# ensure that we build the python modules with scan-build, too
if env['CC'] is None or env['CC'].find('scan-build') < 0:
@@ -1165,11 +1171,14 @@ if not env['python']:
python_install = []
else:
python_lib_dir = sysconfig.get_python_lib(plat_specific=1)
+ python_lib_dir = python_lib_dir.replace(env['sysroot'], '')
python_module_dir = python_lib_dir + os.sep + 'gps'
python_extensions_install = python_env.Install( DESTDIR + python_module_dir,
python_built_extensions)
if not env['debug'] and not env['profiling'] and env['strip']:
python_env.AddPostAction(python_extensions_install, '$STRIP $TARGET')
+ env.AddPostAction(python_extensions_install, '$CHRPATH -r "%s" "$TARGET"' \
+ % (python_lib_dir, ))
python_modules_install = python_env.Install( DESTDIR + python_module_dir,
python_modules)
--
1.7.8.5

View File

@ -1,140 +0,0 @@
From 19a55075d4e60e07d03d49937cd2a4d9239d00a4 Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <hfreyther@sysmocom.de>
Date: Fri, 22 Aug 2014 09:55:19 +0200
Subject: [PATCH] gps2udp: Add a label, timestamp and mac address to each
report
---
gps2udp.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 60 insertions(+), 2 deletions(-)
diff --git a/gps2udp.c b/gps2udp.c
index 313ef36..e1bed05 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -38,6 +38,8 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
#endif /* S_SPLINT_S */
#define MAX_TIME_LEN 80
@@ -56,6 +58,9 @@ static struct fixsource_t gpsd_source;
static unsigned int flags;
static int debug = 0;
static bool aisonly = false;
+static const char *label;
+static const char *mac;
+static char *mac_string;
/*@-statictrans@*/
/*@observer@*/static char* time2string(void)
@@ -80,6 +85,7 @@ static bool aisonly = false;
static int send_udp (char *nmeastring, size_t ind)
{
+ char output[1024];
char message[255];
char *buffer;
int channel;
@@ -105,12 +111,23 @@ static int send_udp (char *nmeastring, size_t ind)
buffer[ind] = '\r'; ind++;
buffer[ind] = '\0';
+ /* copy once more for the label */
+ if (label)
+ snprintf(output, 1024, "%s,%llu,%s,%s",
+ label, (unsigned long long ) time(NULL), mac_string, buffer);
+ else
+ snprintf(output, 1024, "%s", buffer);
+
+ output[1023] = '\0';
+ ind = strlen(output);
+
+
/* send message on udp channel */
/*@-type@*/
for (channel=0; channel < udpchannel; channel ++) {
ssize_t status;
status = sendto(sock[channel],
- buffer,
+ output,
ind,
0,
&remote[channel],
@@ -182,6 +199,8 @@ static void usage(void)
"-c [count] exit after count packets.\n"
"-b Run in background as a daemon.\n"
"-d [0-2] 1 display sent packets, 2 ignored packets.\n"
+ "-l [NAME] A label to be used for the output\n"
+ "-m [IF_NAME] The interface to extract the mac from\n"
"-v Print version and exit.\n\n"
"You must specify one, or more, of -r, -R, or -w\n"
);
@@ -356,7 +375,7 @@ int main(int argc, char **argv)
char *udphostport[MAX_UDP_DEST];
flags = WATCH_ENABLE;
- while ((option = getopt(argc, argv, "?habnjcvl:u:d:")) != -1)
+ while ((option = getopt(argc, argv, "?habnjcvl:u:d:l:m:")) != -1)
{
switch (option) {
case 'd':
@@ -390,6 +409,12 @@ int main(int argc, char **argv)
udphostport[udpchannel++] = optarg;
}
break;
+ case 'l':
+ label = optarg;
+ break;
+ case 'm':
+ mac = optarg;
+ break;
case 'v':
(void)fprintf(stderr, "%s: %s (revision %s)\n",
argv[0], VERSION, REVISION);
@@ -402,6 +427,39 @@ int main(int argc, char **argv)
}
}
+ if (label && !mac) {
+ fprintf(stderr, "Need to specify the ethernet device to find the mac.\n");
+ exit(EXIT_FAILURE);
+ }
+ if (mac && strlen(mac) >= IFNAMSIZ) {
+ fprintf(stderr, "Interface name is too long.\n");
+ exit(EXIT_FAILURE);
+ } else if (mac) {
+ struct ifreq addr = { };
+ int fd, rc;
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ fprintf(stderr, "Failed to open socket.\n");
+ exit(EXIT_FAILURE);
+ }
+ memcpy(&addr.ifr_name, mac, strlen(mac));
+ rc = ioctl(fd, SIOCGIFHWADDR, &addr);
+ close(fd);
+ if (rc < 0) {
+ fprintf(stderr, "Failed to query address.\n");
+ exit(EXIT_FAILURE);
+ }
+ mac_string = malloc(40 * sizeof(char));
+ snprintf(mac_string, 40,
+ "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
+ addr.ifr_hwaddr.sa_data[0] & 0xff,
+ addr.ifr_hwaddr.sa_data[1] & 0xff,
+ addr.ifr_hwaddr.sa_data[2] & 0xff,
+ addr.ifr_hwaddr.sa_data[3] & 0xff,
+ addr.ifr_hwaddr.sa_data[4] & 0xff,
+ addr.ifr_hwaddr.sa_data[5] & 0xff);
+ }
+
/* Grok the server, port, and device. */
if (optind < argc)
gpsd_source_spec(argv[optind], &gpsd_source);
--
1.7.10.4

View File

@ -1,27 +0,0 @@
From f5f262be8ae54bd0c0f52802f2007ec89163756f Mon Sep 17 00:00:00 2001
From: Martin Jansa <Martin.Jansa@gmail.com>
Date: Tue, 24 Apr 2012 11:52:35 +0200
Subject: [PATCH 1/2] SConstruct: respect sysroot also in SPLINTOPTS
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@no-log.org>
---
SConstruct | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
Index: gpsd-3.10/SConstruct
===================================================================
--- gpsd-3.10.orig/SConstruct
+++ gpsd-3.10/SConstruct
@@ -1414,7 +1414,10 @@ def Utility(target, source, action):
# Report splint warnings
# Note: test_bits.c is unsplintable because of the PRI64 macros.
# If you get preprocessor or fatal errors, add +showscan.
-splintopts = "-I/usr/include/libusb-1.0 +quiet"
+if not env['sysroot']:
+ splintopts = "-I/usr/include/libusb-1.0 +quiet"
+else:
+ splintopts = "-I%s/usr/include/libusb-1.0 +quiet" % env['sysroot']
# splint does not know about multi-arch, work around that
ma_status, ma = _getstatusoutput('dpkg-architecture -qDEB_HOST_MULTIARCH')
if ma_status == 0:

View File

@ -1,28 +0,0 @@
Index: gpsd-3.10/driver_tsip.c
===================================================================
--- gpsd-3.10.orig/driver_tsip.c
+++ gpsd-3.10/driver_tsip.c
@@ -1201,6 +1201,23 @@ void configuration_packets_generic(struc
/* Request Navigation Configuration */
putbyte(buf, 0, 0x03);
(void)tsip_write(session, 0xbb, buf, 1);
+
+ gpsd_report(session->context->debug,
+ LOG_PROG, "Configuring + Enabling 1PPS\n");
+ /* enable 1pps */
+ putbyte(buf, 0, 0x4a);
+ putbyte(buf, 1, 0x01);
+ (void)tsip_write(session, 0x8e, buf, 2);
+
+ /* request PPS only if at least one sat is visible */
+ putbyte(buf, 0, 0x4e);
+ putbyte(buf, 1, 0x03);
+ (void)tsip_write(session, 0x8e, buf, 2);
+
+ /* request PPS and TSIP to use UTC time, not GPS */
+ putbyte(buf, 0, 0xa2);
+ putbyte(buf, 1, 0x03);
+ (void)tsip_write(session, 0x8e, buf, 2);
}
void configuration_packets_accutime_gold(struct gps_device_t *session)

View File

@ -1,31 +0,0 @@
Index: gpsd-3.10/gps2udp.c
===================================================================
--- gpsd-3.10.orig/gps2udp.c
+++ gpsd-3.10/gps2udp.c
@@ -353,6 +353,7 @@ int main(int argc, char **argv)
bool daemonize = false;
long count = -1;
int option;
+ int i;
char *udphostport[MAX_UDP_DEST];
flags = WATCH_ENABLE;
@@ -387,7 +388,7 @@ int main(int argc, char **argv)
"gps2udp: too many UDP destinations (max=%d)\n",
MAX_UDP_DEST);
} else {
- udphostport[udpchannel++] = optarg;
+ udphostport[udpchannel++] = strdup(optarg);
}
break;
case 'v':
@@ -490,6 +491,9 @@ int main(int argc, char **argv)
} // end count
} // end len > 3
} // end for (;;)
+
+ for (i = 0; i < udpchannel; ++i)
+ free(udphostport[i]);
// This is an infinite loop, should never be here
/*@-unreachable@*/

View File

@ -1,12 +0,0 @@
Index: gpsd-3.9/SConstruct
===================================================================
--- gpsd-3.9.orig/SConstruct
+++ gpsd-3.9/SConstruct
@@ -223,6 +223,7 @@ env['PYTHON'] = sys.executable
env['STRIP'] = "strip"
env['PKG_CONFIG'] = "pkg-config"
env['CHRPATH'] = 'chrpath'
+env['_RPATH'] = ''
for i in ["AR", "ARFLAGS", "CCFLAGS", "CFLAGS", "CC", "CXX", "CXXFLAGS", "STRIP", "PKG_CONFIG", "CHRPATH", "LD", "TAR"]:
if os.environ.has_key(i):
j = i

View File

@ -0,0 +1,156 @@
From cd89f0b340764e73de76f5297217caf61b3d3283 Mon Sep 17 00:00:00 2001
From: Oliver Smith <osmith@sysmocom.de>
Date: Tue, 13 Dec 2022 16:05:00 +0100
Subject: [PATCH] gps2udp: Add a label, timestamp and mac address to each
report
Rebase of 0001-gps2udp-Add-a-label-timestamp-and-mac-address-to-eac.patch
we have been carrying:
From 19a55075d4e60e07d03d49937cd2a4d9239d00a4 Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <hfreyther@sysmocom.de>
Date: Fri, 22 Aug 2014 09:55:19 +0200
Subject: [PATCH] gps2udp: Add a label, timestamp and mac address to each
report
---
clients/gps2udp.c | 61 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 59 insertions(+), 2 deletions(-)
diff --git a/clients/gps2udp.c b/clients/gps2udp.c
index 2d9c6033d..d27814f24 100644
--- a/clients/gps2udp.c
+++ b/clients/gps2udp.c
@@ -22,6 +22,7 @@
#include <getopt.h> // for getopt_long()
#endif
#include <netdb.h> /* for gethostbyname() */
+#include <net/if.h>
#include <netinet/in.h>
#include <stdbool.h>
#include <stdio.h>
@@ -29,6 +30,7 @@
// do not use strsep() it is not POSIX
#include <string.h> /* for strlcpy(), strtok(), etc. */
#include <strings.h>
+#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/socket.h>
#include <sys/stat.h>
@@ -60,6 +62,9 @@ static unsigned int flags;
static unsigned int debug = 0;
static bool aisonly = false;
static bool tpvonly = false;
+static const char *label;
+static const char *mac;
+static char *mac_string;
// return local time hh:mm:ss
static char* time2string(void)
@@ -82,6 +87,7 @@ static char* time2string(void)
static int send_udp(char *nmeastring, size_t ind)
{
+ char output[1024];
char message[MAX_PACKET_LENGTH];
char *buffer;
int channel;
@@ -108,6 +114,16 @@ static int send_udp(char *nmeastring, size_t ind)
buffer[ind] = '\n'; ind++;
buffer[ind] = '\0';
+ /* copy once more for the label */
+ if (label)
+ snprintf(output, 1024, "%s,%llu,%s,%s",
+ label, (unsigned long long ) time(NULL), mac_string, buffer);
+ else
+ snprintf(output, 1024, "%s", buffer);
+
+ output[1023] = '\0';
+ ind = strlen(output);
+
if (0 == (flags & WATCH_JSON) &&
'{' == buffer[0]) {
// do not send JSON when not configured to do so
@@ -129,7 +145,7 @@ static int send_udp(char *nmeastring, size_t ind)
// send message on udp channel
for (channel=0; channel < udpchannel; channel ++) {
ssize_t status = sendto(sock[channel],
- buffer,
+ output,
ind,
0,
(struct sockaddr *)&remote[channel],
@@ -225,6 +241,8 @@ static void usage(void)
" -c COUNT Exit after count packets.\n"
" -d [0-2] 1 display sent packets, "
"2 display ignored packets.\n"
+ " -l [NAME] A label to be used for the output\n"
+ " -m [IF_NAME] The interface to extract the mac from\n"
" -h Show this help.\n"
" -j Feed JSON.\n"
" -n Feed NMEA.\n"
@@ -421,7 +439,7 @@ int main(int argc, char **argv)
bool daemonize = false;
long count = -1;
char *udphostport[MAX_UDP_DEST];
- const char *optstring = "?abc:d:hjntu:V";
+ const char *optstring = "?abc:d:l:m:hjntu:V";
#ifdef HAVE_GETOPT_LONG
int option_index = 0;
static struct option long_options[] = {
@@ -478,6 +496,12 @@ int main(int argc, char **argv)
if (0 < debug)
(void)fprintf(stdout, "Debug %u selected\n", debug);
break;
+ case 'l':
+ label = optarg;
+ break;
+ case 'm':
+ mac = optarg;
+ break;
case 'j':
if (0 < debug)
(void)fprintf(stdout, "JSON selected\n");
@@ -520,6 +544,39 @@ int main(int argc, char **argv)
}
}
+ if (label && !mac) {
+ fprintf(stderr, "Need to specify the ethernet device to find the mac.\n");
+ exit(EXIT_FAILURE);
+ }
+ if (mac && strlen(mac) >= IFNAMSIZ) {
+ fprintf(stderr, "Interface name is too long.\n");
+ exit(EXIT_FAILURE);
+ } else if (mac) {
+ struct ifreq addr = { };
+ int fd, rc;
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0) {
+ fprintf(stderr, "Failed to open socket.\n");
+ exit(EXIT_FAILURE);
+ }
+ memcpy(&addr.ifr_name, mac, strlen(mac));
+ rc = ioctl(fd, SIOCGIFHWADDR, &addr);
+ close(fd);
+ if (rc < 0) {
+ fprintf(stderr, "Failed to query address.\n");
+ exit(EXIT_FAILURE);
+ }
+ mac_string = malloc(40 * sizeof(char));
+ snprintf(mac_string, 40,
+ "%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",
+ addr.ifr_hwaddr.sa_data[0] & 0xff,
+ addr.ifr_hwaddr.sa_data[1] & 0xff,
+ addr.ifr_hwaddr.sa_data[2] & 0xff,
+ addr.ifr_hwaddr.sa_data[3] & 0xff,
+ addr.ifr_hwaddr.sa_data[4] & 0xff,
+ addr.ifr_hwaddr.sa_data[5] & 0xff);
+ }
+
// Grok the server, port, and device.
if (optind < argc) {
gpsd_source_spec(argv[optind], &gpsd_source);
--
2.34.1

View File

@ -0,0 +1,58 @@
From 901b3f9b6747eca8893ecaae824be396a6a4b5db Mon Sep 17 00:00:00 2001
From: Oliver Smith <osmith@sysmocom.de>
Date: Tue, 13 Dec 2022 15:37:15 +0100
Subject: [PATCH] gps2udp: leave argv untouched
Rebase of leave-argv-untouched.patch we carried. Doesn't seem important,
but to keep the behavior consistent. Originally added with the following
commit message to meta-sysmocom-bsp.git:
commit 26d74189eb2023ce14af8dd41b36cd388ab8bebb
Author: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Date: Tue Jul 15 08:28:42 2014 +0200
gpsd: Do not mess with the argv of the process
Henning got really confused that the "a.b.c:1234" he passed to
gps2udp showed up as "a.b.c 1234" in the kernel cmdline. Use
strdup to take a copy of it.
Fixes: SYS#424
---
clients/gps2udp.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/clients/gps2udp.c b/clients/gps2udp.c
index d27814f24..81d141fa2 100644
--- a/clients/gps2udp.c
+++ b/clients/gps2udp.c
@@ -436,6 +436,7 @@ static unsigned int AISGetInt(unsigned char *bitbytes, unsigned int sp,
int main(int argc, char **argv)
{
+ int i;
bool daemonize = false;
long count = -1;
char *udphostport[MAX_UDP_DEST];
@@ -526,7 +527,7 @@ int main(int argc, char **argv)
"gps2udp: too many UDP destinations (max=%d).\n",
MAX_UDP_DEST);
} else {
- udphostport[udpchannel++] = optarg;
+ udphostport[udpchannel++] = strdup(optarg);
if (0 < debug) {
(void)fprintf(stdout, "UDP %s added.\n", optarg);
}
@@ -686,6 +687,9 @@ int main(int argc, char **argv)
} // end len > 3
} // end for (;;)
+ for (i = 0; i < udpchannel; ++i)
+ free(udphostport[i]);
+
// This is an infinite loop, should never be here
(void)fprintf (stderr, "gpsd2udp ERROR abnormal exit\n");
exit (-1);
--
2.34.1

View File

@ -0,0 +1,49 @@
From 9b12594ed0ce769d923a3b4f4d42c3b25caa87d3 Mon Sep 17 00:00:00 2001
From: Oliver Smith <osmith@sysmocom.de>
Date: Tue, 13 Dec 2022 15:25:52 +0100
Subject: [PATCH] tsip: configure and enable 1PPS
Rebase of gpsd-tsip-pps.patch we have been carrying:
From www/time-service-intro.adoc:
> GPS enables receivers to generate a pulse-per-second
> signal ("1PPS" or just "PPS") accurate to the top of the current
> UTC second within 50 ns.
---
drivers/driver_tsip.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/driver_tsip.c b/drivers/driver_tsip.c
index 57b97513c..673bbef7e 100644
--- a/drivers/driver_tsip.c
+++ b/drivers/driver_tsip.c
@@ -4288,6 +4288,26 @@ void configuration_packets_generic(struct gps_device_t *session)
/* Primary Receiver Configuration Parameters Request (0xbb-00)
* returns Primary Receiver Configuration Block (0xbb-00) */
(void)tsip_write1(session, "\xbb\x00", 2);
+
+ GPSD_LOG(LOG_PROG, &session->context->errout,
+ "Configuring + Enabling 1PPS\n");
+ /* enable 1pps */
+ putbyte(buf, 0, 0x8e);
+ putbyte(buf, 1, 0x4a);
+ putbyte(buf, 2, 0x01);
+ (void)tsip_write1(session, buf, 3);
+
+ /* request PPS only if at least one sat is visible */
+ putbyte(buf, 0, 0x8e);
+ putbyte(buf, 1, 0x4e);
+ putbyte(buf, 2, 0x03);
+ (void)tsip_write1(session, buf, 3);
+
+ /* request PPS and TSIP to use UTC time, not GPS */
+ putbyte(buf, 0, 0x8e);
+ putbyte(buf, 1, 0xa2);
+ putbyte(buf, 2, 0x03);
+ (void)tsip_write1(session, buf, 3);
}
/* configure Acutime Gold to a known state */
--
2.34.1

View File

@ -0,0 +1,38 @@
From 221681eeebd621287bd7587475da27d4e7dd17fc Mon Sep 17 00:00:00 2001
From: Oliver Smith <osmith@sysmocom.de>
Date: Tue, 13 Dec 2022 17:53:41 +0100
Subject: [PATCH] SConscript: force use of -pthread
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
With gpsd 3.24, the build system fails to properly detect that our GCC
supports -pthread. When attempting to build without it, the build fails
as follows.
…/ld: gpsd-3.24/libgpsd.a(ppsthread.o): undefined reference to symbol 'pthread_create@@GLIBC_2.4'
…/tmp/ERROR: scons build execution failed.
…/gpsd/3.24-r0/recipe-sysroot/lib/libpthread.so.0: error adding symbols: DSO missing from command line
| collect2: error: ld returned 1 exit status
---
SConscript | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/SConscript b/SConscript
index ddffe068d..ec660c458 100644
--- a/SConscript
+++ b/SConscript
@@ -942,9 +942,7 @@ if not cleaning and not helping:
if not config.CheckCC():
announce("ERROR: CC doesn't work")
- if ((config.CheckCompilerOption("-pthread") and
- not config.env['target_platform'].startswith('darwin'))):
- config.env.MergeFlags("-pthread")
+ config.env.MergeFlags("-pthread")
confdefs = ["/* gpsd_config.h generated by scons, do not hand-hack. */\n"]
--
2.34.1

View File

@ -22,26 +22,26 @@
SUBSYSTEM!="tty", GOTO="gpsd_rules_end"
# Prolific Technology, Inc. PL2303 Serial Port
ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="067b", ATTR{idProduct}=="2303", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# ATEN International Co., Ltd UC-232A Serial Port [pl2303]
ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="0557", ATTR{idProduct}=="2008", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# FTDI 8U232AM
ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# Cypress M8/CY7C64013 (DeLorme uses these)
ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="1163", ATTR{idProduct}=="0100", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# PS-360 OEM (Microsoft GPS sold with Street and Trips 2005)
ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="067b", ATTR{idProduct}=="aaa0", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# Garmin International GPSmap, various models (tested with Garmin GPS 18 USB)
ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="091e", ATTR{idProduct}=="0003", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# Cygnal Integrated Products, Inc. CP210x Composite Device (Used by Holux m241)
ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="10c4", ATTR{idProduct}=="ea60", SYMLINK+="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# u-blox AG, u-blox 5 (tested with Navilock NL-402U)
ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="1546", ATTR{idProduct}=="01a5", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# FTDI FT232
ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
# u-blox 4
ATTR{idVendor}=="1546", ATTR{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ATTR{idVendor}=="1546", ATTR{idProduct}=="01a4", SYMLINK="gps%n", RUN+="/lib/udev/gpsd.hotplug"
ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug.wrapper"
ACTION=="remove", RUN+="/lib/udev/gpsd.hotplug"
LABEL="gpsd_rules_end"

View File

@ -1,17 +0,0 @@
https://bugs.gentoo.org/391299
split up linking flags into multiple arguments
Index: gpsd-3.10/SConstruct
===================================================================
--- gpsd-3.10.orig/SConstruct 2017-03-28 23:47:02.815665786 +0200
+++ gpsd-3.10/SConstruct 2017-03-28 23:47:40.463666285 +0200
@@ -250,7 +250,7 @@
env.Replace(**{j: os.getenv(i)})
for flag in ["LDFLAGS", "LINKFLAGS", "SHLINKFLAGS", "CPPFLAGS"]:
if os.environ.has_key(flag):
- env.MergeFlags({flag : [os.getenv(flag)]})
+ env.MergeFlags({flag : Split(os.getenv(flag))})
# Keep scan-build options in the environment

View File

@ -1,28 +1,25 @@
SUMMARY = "A TCP/IP Daemon simplifying the communication with GPS devices"
SECTION = "console/network"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=7a5d174db44ec45f9638b2c747806821"
DEPENDS = "ncurses python"
PROVIDES = "virtual/gpsd"
PR = "r3.20"
PR = "r1"
SRC_URI = "http://download.savannah.gnu.org/releases/${PN}/${P}.tar.gz \
file://0002-SConstruct-respect-sysroot-also-in-SPLINTOPTS.patch \
file://0001-SConstruct-disable-html-and-man-docs-building-becaus.patch \
file://gpsd-3.3-ldflags.patch \
file://no-rpath-please.patch \
file://gpsd-tsip-pps.patch \
file://leave-argv-untouched.patch \
file://0001-gps2udp-Add-a-label-timestamp-and-mac-address-to-eac.patch \
file://0002-gps2udp-leave-argv-untouched.patch \
file://0003-tsip-configure-and-enable-1PPS.patch \
file://0004-SConscript-force-use-of-pthread.patch \
file://gpsd-default \
file://gpsd \
file://60-gpsd.rules \
file://gpsd.service \
file://gpsd.service \
"
SRC_URI[md5sum] = "fc5b03aae38b9b5b6880b31924d0ace3"
SRC_URI[sha256sum] = "706fc2c1cf3dfbf87c941f543381bccc9c4dc9f8240eec407dcbf2f70b854320"
SRC_URI[md5sum] = "c4e743a507a137c00fdb28ef35b145d0"
SRC_URI[sha256sum] = "00ee13f615655284874a661be13553abe66128e6deb5cd648af9bc0cb345fe5c"
inherit scons update-rc.d systemd
@ -64,9 +61,10 @@ EXTRA_OESCONS = " \
tripmate='false' \
usb='false' \
chrpath='false' \
systemd='${SYSTEMD_OESCONS}' \
libdir='${libdir}' \
${PACKAGECONFIG_CONFARGS} \
systemd='${SYSTEMD_OESCONS}' \
libdir='${libdir}' \
manbuild='false' \
${PACKAGECONFIG_CONFARGS} \
"
# this cannot be used, because then chrpath is not found and only static lib is built
# target=${HOST_SYS}
@ -109,7 +107,7 @@ do_install_append() {
#support for systemd
install -d ${D}${systemd_system_unitdir}/
install -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service
install -m 0644 ${S}/systemd/${BPN}.socket ${D}${systemd_system_unitdir}/${BPN}.socket
install -m 0644 ${BPN}-${PV}/systemd/${BPN}.socket ${D}${systemd_system_unitdir}/${BPN}.socket
}
pkg_postinst_${PN}-conf() {

View File

@ -6,13 +6,13 @@ DEPENDS = "gpsd"
RDEPENDS_${PN} = "libgps"
PE = "1"
PR = "r14"
PV = "0.2+git${SRCPV}"
PR = "r0"
PV = "0.3+git${SRCPV}"
SRC_URI = "git://gitea.sysmocom.de/sysmocom/gpsdate.git;branch=master;protocol=https \
file://gpsdate.default \
"
SRCREV = "cd7b77ef311f317aac7a067308a94e46811a20f2"
SRCREV = "68bcf620b4dc37eefae009175b3edb7ef10a5f0a"
S = "${WORKDIR}/git"
INITSCRIPT_NAME = "gpsdate"

View File

@ -0,0 +1,48 @@
From ea179d83b0aa62719d90748cd1fb260f40055f15 Mon Sep 17 00:00:00 2001
From: Yi Zhao <yi.zhao@windriver.com>
Date: Mon, 13 Jun 2022 22:44:28 +0800
Subject: [PATCH] configure.ac: eliminate build path from openvpn --version
option
Before the patch:
$ openvpn --version
OpenVPN 2.5.7 x86_64-poky-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL]
[snip]
Compile time defines: enable_async_push=no enable_comp_stub=no
[snip]
with_crypto_library=openssl with_gnu_ld=yes
with_libtool_sysroot=/buildarea/build/tmp/work/core2-64-poky-linux/openvpn/2.5.7-r0/recipe-sysroot
with_mem_check=no with_openssl_engine=auto
After the patch:
$ openvpn --version
OpenVPN 2.5.7 x86_64-poky-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL]
[snip]
Compile time defines: enable_async_push=no enable_comp_stub=no
[snip]
with_crypto_library=openssl with_gnu_ld=yes with_mem_check=no
with_openssl_engine=auto
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 2f5f6bc..eddcbc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1377,7 +1377,7 @@ if test "${enable_async_push}" = "yes"; then
esac
fi
-CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
+CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*=' | grep -v 'libtool_sysroot'`"
AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings])
TAP_WIN_COMPONENT_ID="PRODUCT_TAP_WIN_COMPONENT_ID"
--
2.25.1

View File

@ -1,32 +1,40 @@
#!/bin/sh -e
#
#
# Original version by Robert Leslie
# <rob@mars.org>, edited by iwj and cs
# Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as>
# Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net>
# Modified for respecting pid file on service start by Fabian Klemp <fabian.klemp@axino-group.com>
test $DEBIAN_SCRIPT_DEBUG && set -v -x
DAEMON=/usr/sbin/openvpn
CONFIG_DIR=/etc/openvpn
test -x $DAEMON || exit 0
test -d $CONFIG_DIR || exit 0
start_vpn () {
modprobe tun >/dev/null 2>&1 || true
$DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \
--config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->"
start-stop-daemon --start --quiet --pidfile /var/run/openvpn.$NAME.pid \
--exec $DAEMON -- \
--daemon --writepid /var/run/openvpn.$NAME.pid \
--config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || rc="$?"
case $rc in
1) echo -n " ALREADY STARTED->";;
3) echo -n " FAILED->";;
esac
echo -n " $NAME"
}
}
stop_vpn () {
kill `cat $PIDFILE` || true
rm $PIDFILE
}
}
case "$1" in
start)
echo -n "Starting openvpn:"
if test -z $2 ; then
for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
NAME=${CONFIG%%.conf}
@ -41,11 +49,11 @@ start)
fi
fi
echo "."
;;
stop)
echo -n "Stopping openvpn:"
if test -z $2 ; then
for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do
NAME=`echo $PIDFILE | cut -c18-`
@ -87,7 +95,7 @@ reload|force-reload)
done
echo "."
;;
restart)
$0 stop $2
sleep 1

View File

@ -1,40 +0,0 @@
#!/bin/sh
# This systemd generator creates dependency symlinks that make all OpenVPN
# tunnels listed in /etc/default/openvpn's AUTOSTART be started/stopped/reloaded
# when openvpn.service is started/stopped/reloaded.
set -eu
GENDIR="$1"
WANTDIR="$1/openvpn.service.wants"
SERVICEFILE="/lib/systemd/system/openvpn@.service"
AUTOSTART="all"
CONFIG_DIR=/etc/openvpn
mkdir -p "$WANTDIR"
if test -e /etc/default/openvpn ; then
. /etc/default/openvpn
fi
# No VPNs automatically started
if test "x$AUTOSTART" = "xnone" ; then
exit 0
fi
if test "x$AUTOSTART" = "xall" -o -z "$AUTOSTART" ; then
for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do
NAME=${CONFIG%%.conf}
ln -s "$SERVICEFILE" "$WANTDIR/openvpn@$NAME.service"
done
else
for NAME in $AUTOSTART ; do
if test -e $CONFIG_DIR/$NAME.conf ; then
ln -s "$SERVICEFILE" "$WANTDIR/openvpn@$NAME.service"
fi
done
fi
exit 0

View File

@ -1,63 +0,0 @@
SUMMARY = "A full-featured SSL VPN solution via tun device."
HOMEPAGE = "http://openvpn.sourceforge.net"
SECTION = "console/network"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=5aac200199fde47501876cba7263cb0c"
DEPENDS = "lzo openssl iproute2 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
inherit autotools
PR = "r3"
SRC_URI = "http://swupdate.openvpn.org/community/releases/openvpn-${PV}.tar.gz \
file://openvpn \
file://openvpn-generator \
file://openvpn@.service \
file://openvpn.service"
SRC_URI[md5sum] = "6ca03fe0fd093e0d01601abee808835c"
SRC_URI[sha256sum] = "7baed2ff39c12e1a1a289ec0b46fcc49ff094ca58b8d8d5f29b36ac649ee5b26"
CFLAGS += "-fno-inline"
# I want openvpn to be able to read password from file (hrw)
EXTRA_OECONF += "--enable-password-save --enable-iproute2"
EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
# Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
EXTRA_OECONF += "IPROUTE=/sbin/ip"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -d ${D}/${sysconfdir}/openvpn
install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d
# systemd files
install -d ${D}${systemd_system_unitdir}
install -d ${D}${systemd_unitdir}/system-generators
install -m 0644 ${WORKDIR}/openvpn.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/openvpn@.service ${D}${systemd_system_unitdir}
install -m 0755 ${WORKDIR}/openvpn-generator ${D}${systemd_unitdir}/system-generators
}
RDEPENDS_${PN} += "update-rc.d"
RRECOMMENDS_${PN} = "kernel-module-tun"
FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
# Don't go through the systemd.bbclass as we do not want magic to happen
# during install and upgrade. Simply ship the files.
FILES_${PN} += "${systemd_unitdir}"
pkg_postinst_${PN} () {
if [ "x$D" != "x" ]; then
exit 1
fi
if [ -L /etc/rc2.d/S*openvpn ]; then
update-rc.d -f openvpn remove
if [ ! -L /etc/systemd/system/multi-user.target.wants/openvpn.service ]; then
ln -s '/lib/systemd/system/openvpn.service' '/etc/systemd/system/multi-user.target.wants/openvpn.service'
fi
fi
}

View File

@ -0,0 +1,87 @@
SUMMARY = "A full-featured SSL VPN solution via tun device."
HOMEPAGE = "https://openvpn.net/"
SECTION = "net"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b76abd82c14ee01cc34c4ff5e3627b89"
DEPENDS = "lzo openssl iproute2 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
inherit autotools systemd update-rc.d pkgconfig
PR = "r2"
SRC_URI = "http://swupdate.openvpn.org/community/releases/${BP}.tar.gz \
file://0001-configure.ac-eliminate-build-path-from-openvpn-versi.patch \
file://openvpn \
file://openvpn@.service \
file://openvpn.service \
"
UPSTREAM_CHECK_URI = "https://openvpn.net/community-downloads"
SRC_URI[sha256sum] = "a6f315b7231d44527e65901ff646f87d7f07862c87f33531daa109fb48c53db2"
# CVE-2020-7224 and CVE-2020-27569 are for Aviatrix OpenVPN client, not for openvpn.
CVE_CHECK_IGNORE += "CVE-2020-7224 CVE-2020-27569"
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME_${PN} = "openvpn"
INITSCRIPT_PARAMS_${PN} = "start 10 2 3 4 5 . stop 70 0 1 6 ."
CFLAGS += "-fno-inline"
# I want openvpn to be able to read password from file (hrw)
EXTRA_OECONF += "--enable-iproute2"
EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '', '--disable-plugin-auth-pam', d)}"
# Explicitly specify IPROUTE to bypass the configure-time check for /sbin/ip on the host.
EXTRA_OECONF += "IPROUTE=${base_sbindir}/ip"
EXTRA_OECONF += "SYSTEMD_UNIT_DIR=${systemd_system_unitdir} \
TMPFILES_DIR=${nonarch_libdir}/tmpfiles.d \
"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
"
PACKAGECONFIG[systemd] = "--enable-systemd,--disable-systemd,systemd"
PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
do_install_append() {
install -d ${D}/${sysconfdir}/init.d
install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d
install -d ${D}/${sysconfdir}/openvpn
install -d ${D}/${sysconfdir}/openvpn/server
install -d ${D}/${sysconfdir}/openvpn/client
install -d ${D}/${sysconfdir}/openvpn/sample
install -m 644 ${S}/sample/sample-config-files/loopback-server ${D}${sysconfdir}/openvpn/sample/loopback-server.conf
install -m 644 ${S}/sample/sample-config-files/loopback-client ${D}${sysconfdir}/openvpn/sample/loopback-client.conf
install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-config-files
install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-keys
install -dm 755 ${D}${sysconfdir}/openvpn/sample/sample-scripts
install -m 644 ${S}/sample/sample-config-files/* ${D}${sysconfdir}/openvpn/sample/sample-config-files
install -m 644 ${S}/sample/sample-keys/* ${D}${sysconfdir}/openvpn/sample/sample-keys
install -m 644 ${S}/sample/sample-scripts/* ${D}${sysconfdir}/openvpn/sample/sample-scripts
install -d -m 710 ${D}/${localstatedir}/lib/openvpn
# Keep openvpn@.service, openvpn.service to match manuals (SYS#6303)
install -m 0644 ${WORKDIR}/openvpn@.service ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/openvpn.service ${D}${systemd_system_unitdir}
}
PACKAGES =+ " ${PN}-sample "
RRECOMMENDS_${PN} = "kernel-module-tun"
FILES_${PN}-dbg += "${libdir}/openvpn/plugins/.debug"
FILES_${PN} += "${systemd_system_unitdir}/openvpn-server@.service \
${systemd_system_unitdir}/openvpn-client@.service \
${systemd_system_unitdir}/openvpn@.service \
${systemd_system_unitdir}/openvpn.service \
${nonarch_libdir}/tmpfiles.d \
"
FILES_${PN}-sample = "${sysconfdir}/openvpn/sample/ \
"

View File

@ -0,0 +1,30 @@
# Package OpenSSH's sftp server, so the openssh client finds it and doesn't
# need to be run with a flag to use the legacy SCP protocol (SYS#6403)
SUMMARY = "OpenSSH's sftp-server"
DESCRIPTION = "OpenSSH's sftp-server, to be used with dropbear"
HOMEPAGE = "http://www.openssh.com/"
SECTION = "console/network"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENCE;md5=072979064e691d342002f43cd89c0394"
DEPENDS = ""
SRC_URI = "https://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz"
SRC_URI[md5sum] = "3430d5e6e71419e28f440a42563cb553"
SRC_URI[sha256sum] = "e9baba7701a76a51f3d85a62c383a3c9dcd97fa900b859bc7db114c1868af8a8"
inherit autotools
EXTRA_OECONF += "--without-openssl --without-zlib"
S = "${WORKDIR}/openssh-${PV}"
do_compile() {
oe_runmake sftp-server
}
do_install() {
install -Dm755 "${B}"/sftp-server \
-t "${D}"/usr/libexec/
}
FILES_${PN} = "/usr/libexec/sftp-server"

View File

@ -1,4 +0,0 @@
THISDIR := "${@os.path.dirname(d.getVar('FILE', True))}"
FILESPATH =. "${@base_set_filespath(["${THISDIR}/files"], d)}:"
PRINC="4"

View File

@ -1,113 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: sshd
# Required-Start: $remote_fs $syslog $networking
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 1
# Short-Description: Dropbear Secure Shell server
### END INIT INFO
#
# Do not configure this file. Edit /etc/default/dropbear instead!
#
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/dropbear
NAME=dropbear
DESC="Dropbear SSH server"
PIDFILE=/var/run/dropbear.pid
DROPBEAR_PORT=22
DROPBEAR_EXTRA_ARGS=
NO_START=0
set -e
test ! -r /etc/default/dropbear || . /etc/default/dropbear
test "$NO_START" = "0" || exit 0
test -x "$DAEMON" || exit 0
test ! -h /var/service/dropbear || exit 0
readonly_rootfs=0
for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
case $flag in
ro)
readonly_rootfs=1
;;
esac
done
if [ $readonly_rootfs = "1" ]; then
mkdir -p /var/lib/dropbear
DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
else
DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
fi
test -z "$DROPBEAR_BANNER" || \
DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
test -n "$DROPBEAR_RSAKEY" || \
DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
test -n "$DROPBEAR_DSSKEY" || \
DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
test -n "$DROPBEAR_KEYTYPES" || \
DROPBEAR_KEYTYPES="rsa"
gen_keys() {
for t in $DROPBEAR_KEYTYPES; do
case $t in
rsa)
if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
rm $DROPBEAR_RSAKEY
fi
test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
;;
dsa)
if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
rm $DROPBEAR_DSSKEY
fi
test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
;;
esac
done
}
case "$1" in
start)
echo -n "Starting $DESC: "
gen_keys
KEY_ARGS=""
test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
start-stop-daemon -S -p $PIDFILE \
-x "$DAEMON" -- $KEY_ARGS \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
sleep 1
KEY_ARGS=""
test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
start-stop-daemon -S -p $PIDFILE \
-x "$DAEMON" -- $KEY_ARGS \
-p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0

View File

@ -2,10 +2,10 @@ DESCRIPTION = "sysmocom OsmoBTS"
LICENSE = "AGPLv3"
LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788"
SRCREV = "1.6.0"
SRCREV = "1.7.0"
SRC_URI = "git://gerrit.osmocom.org/osmo-bts;protocol=https;destsuffix=git;tag=${SRCREV};nobranch=1"
PV = "${SRCREV}+git${SRCPV}"
PR = "r1.${META_TELEPHONY_OSMO_INC}"
PR = "r0.${META_TELEPHONY_OSMO_INC}"
S = "${WORKDIR}/git"
DEPENDS = "libosmocore libosmo-abis libosmo-netif femtobts-api gpsd"

View File

@ -2,10 +2,10 @@ DESCRIPTION = "Osmocom PCU for sysmoBTS"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
SRCREV = "1.2.0"
SRCREV = "1.3.0"
SRC_URI = "git://gerrit.osmocom.org/osmo-pcu;protocol=https;branch=master;nobranch=1"
PV = "${SRCREV}+git${SRCPV}"
PR = "r1.${META_TELEPHONY_OSMO_INC}"
PR = "r0.${META_TELEPHONY_OSMO_INC}"
S = "${WORKDIR}/git"
DEPENDS = "libosmocore osmo-bts"