[Git][NTPsec/ntpsec][master] 4 commits: Remove duplicate include sys/ioctl.h in refclock_trimble

Hal Murray gitlab at mg.gitlab.com
Mon Dec 17 22:13:17 UTC 2018


Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
8f7014a7 by Hal Murray at 2018-12-17T22:12:54Z
Remove duplicate include sys/ioctl.h in refclock_trimble

- - - - -
51625689 by Hal Murray at 2018-12-17T22:12:54Z
call seccomp_release() -- free up storage

- - - - -
d1db00eb by Hal Murray at 2018-12-17T22:12:54Z
Add support for NetBSD to buildprep

- - - - -
dcb1d0e2 by Hal Murray at 2018-12-17T22:12:54Z
Add support for FreeBSD to buildprep

- - - - -


3 changed files:

- buildprep
- ntpd/ntp_sandbox.c
- ntpd/refclock_trimble.c


Changes:

=====================================
buildprep
=====================================
@@ -10,6 +10,8 @@ DRYRUN="no"
 NTPVIZ="no"
 DOC="no"
 
+OS=`uname -s`
+
 # Loop through option flags
 for optflag in "$@"
 do
@@ -50,7 +52,8 @@ done
 cat <<EOF
 # Preparing your system for ntpsec source build...
 # This script presently knows about:
-#   CentOS, Debian, Fedora, Gentoo, SLES, Ubuntu, and Alpine Linux
+#   CentOS, Debian, Fedora, Gentoo, NetBSD, FreeBSD,
+$   SLES, Ubuntu, and Alpine Linux
 # If you are running something else, such as macOS or Solaris, please
 # read the source for this buildprep script to get an idea of what packages
 # are required.
@@ -60,7 +63,8 @@ EOF
 if [ "$DRYRUN" = "yes" ]
 then
 	do=echo
-	echo "# Run this without -n|--dry-run, as root, for actual installation.\n#"
+	echo "# Run this without -n|--dry-run, as root, for actual installation."
+	echo "#"
 else
 	do=""
 	if [ "$(id -u)" != 0 ]
@@ -101,6 +105,31 @@ then
     # Alpine Linux, musl rather than glibc
     installer=apk
     install="$do $installer add"
+elif test "$OS" = "NetBSD"
+then
+  if pkgin -v
+  then
+    # NetBSD binary package installer
+    installer=pkgin
+    install="$do $installer install"
+  else
+    echo "## Looks like a NetBSD system"
+    echo "## You need to setup pkgin"
+    echo "## The last page of install disk has a check-box to do it"
+    echo "## But you don't get that option on a Raspberry Pi."
+    echo "## For the Pi, do something like:"
+    echo "## pkg_add ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/earmv7hf/8.0/All/pkgin-0.9.4nb8.tgz"
+    echo "## Adjust the version an arch to match your setup."
+    exit 1
+  fi
+elif test "$OS" = "FreeBSD"
+then
+  if pkg -v
+  then
+    # FreeBSD binary package installer
+    installer=pkg
+    install="$do $installer install"
+  fi
 else
     echo "# ERROR: Package manager unidentified - Unsupported operating system"
     exit 1
@@ -142,6 +171,29 @@ daemon () {
 	    $install sys-libs/libcap sys-libs/libseccomp
 	    $install sys-devel/bison net-misc/pps-tools
 	    ;;
+	pkgin)
+	    # NetBSD
+	    #  There is nothing magic about 3.7.
+	    #  In Dec 2018, 3.6 and 2.7 are also good candidates.
+	    $install bison python37 py37-curses-3.7
+	    # setup "python" from command line
+	    $do ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python
+	    $do ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python3
+	    # Add to Python search path
+	    if [ "$DRYRUN" = "yes" ]
+            then
+		echo echo /usr/local/lib/python3.7/site-packages \> \\
+		echo "  " /usr/pkg/lib/python3.7/site-packages/ntpsec.pth
+	    else
+		echo /usr/local/lib/python3.7/site-packages > \
+			/usr/pkg/lib/python3.7/site-packages/ntpsec.pth
+	    fi
+	    ;;
+	pkg)
+	    # FreeBSD
+	    $install bison python3
+	    $do ln -s /usr/local/bin/python3 /usr/local/bin/python
+	    ;;
 	yum|dnf)
 	    $do $installer groupinstall "Development Tools" 	# Build environment
 	    $install bison openssl-devel 		# build
@@ -231,6 +283,12 @@ doc () {
 		echo "# You may need to enable EPEL repositories"
 		$install asciidoc
 		;;
+	 pkgin)
+		$install asciidoc
+		;;
+	 pkg)
+		$install asciidoc
+		;;
 	 yast|zypper)
 		$install asciidoc
 		;;


=====================================
ntpd/ntp_sandbox.c
=====================================
@@ -448,6 +448,8 @@ int scmp_sc[] = {
 	else {
 		msyslog(LOG_NOTICE, "INIT: sandbox: seccomp enabled.");
 	}
+        seccomp_release(ctx);
+
 #endif /* HAVE_SECCOMP_H */
 
 	return nonroot;


=====================================
ntpd/refclock_trimble.c
=====================================
@@ -20,10 +20,6 @@
 
 #include "config.h"
 
-#ifdef HAVE_SYS_IOCTL_H
-# include <sys/ioctl.h>
-#endif /* not HAVE_SYS_IOCTL_H */
-
 #if defined HAVE_SYS_MODEM_H
 #include <sys/modem.h>
 #endif



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/fd0f1d8603fb9a31b57663c13326e859a68e4b2c...dcb1d0e260794ff7151fa62c93430a70a30abec6

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/fd0f1d8603fb9a31b57663c13326e859a68e4b2c...dcb1d0e260794ff7151fa62c93430a70a30abec6
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181217/8a94485c/attachment-0001.html>


More information about the vc mailing list