Here's an update to the latest amtterm-1.7 release from 2022. It
drops most of the SSL/auth etc diffs backported from
https://github.com/Openwsman/wsmancli/
There's also a new tool called amtider (for floppy or CDROM
redirection) that might come in handy, it needed a few patches but I
haven't tested it. I've put this in the -term subpackage because it
doesn't have any dep, but I can move it back to -main.
I doubt this will change anything to the disconnections I get when
booting my T14 Gen 3 - will test that later.
Test reports & oks welcome.
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/comms/amtterm/Makefile,v
diff -u -p -r1.18 Makefile
--- Makefile 31 Aug 2025 12:01:04 -0000 1.18
+++ Makefile 31 Aug 2025 20:40:01 -0000
@@ -1,8 +1,7 @@
COMMENT-term= cli client for Intel AMT serial-over-lan
COMMENT-main= client and tools for Intel AMT serial-over-lan
-V= 1.6
-REVISION= 3
+V= 1.7
DISTNAME= amtterm-$V
PKGNAME-term= amtterm-cli-$V
MULTI_PACKAGES= -main -term
@@ -19,7 +18,7 @@ WANTLIB += atk-1.0 c cairo cairo-gobject
WANTLIB += gio-2.0 glib-2.0 gobject-2.0 gtk-3 harfbuzz intl pango-1.0
WANTLIB += pangocairo-1.0 ssl vte-2.91
-# https://git.kraxel.org/cgit/amtterm/
+# https://github.com/kraxel/amtterm/
SITES= https://www.kraxel.org/releases/amtterm/
LIB_DEPENDS-term=
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/comms/amtterm/distinfo,v
diff -u -p -r1.4 distinfo
--- distinfo 2 Nov 2020 16:10:23 -0000 1.4
+++ distinfo 31 Aug 2025 18:54:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (amtterm-1.6.tar.gz) = EkLOpGeCeqHi6RtBhGIpygpbPz4JJgsN+deNyHUHVZA=
-SIZE (amtterm-1.6.tar.gz) = 40804
+SHA256 (amtterm-1.7.tar.gz) = jFi3azI3UE11G/NYj+8lEXJIoFaVI/DYber2ltFClNQ=
+SIZE (amtterm-1.7.tar.gz) = 54769
Index: patches/patch-GNUmakefile
===================================================================
RCS file: patches/patch-GNUmakefile
diff -N patches/patch-GNUmakefile
--- patches/patch-GNUmakefile 11 Mar 2022 18:26:24 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-Add SSL/auth code
-https://github.com/Openwsman/wsmancli/issues/10#issuecomment-751253133
-
-Index: GNUmakefile
---- GNUmakefile.orig
-+++ GNUmakefile
-@@ -1,11 +1,24 @@
- # config
-+#USE_OPENSSL=1
-+#USE_GNUTLS=1
- srcdir = .
- VPATH = $(srcdir)
- -include Make.config
- include $(srcdir)/mk/Variables.mk
-
-+ifdef USE_OPENSSL
-+SSL_DEFS=-DUSE_OPENSSL
-+pkglst+=openssl
-+endif
-+
-+ifdef USE_GNUTLS
-+SSL_DEFS=-DUSE_GNUTLS
-+pkglst+=gnutls
-+endif
-+
- CFLAGS += -Wall -Wno-pointer-sign
- CFLAGS += -DVERSION='"$(VERSION)"'
-+CFLAGS += $(SSL_DEFS)
-
- TARGETS := amtterm
- DESKTOP := $(wildcard *.desktop)
-@@ -60,8 +73,8 @@ distclean: clean
-
- #################################################################
-
--amtterm: amtterm.o redir.o tcp.o
--gamt: gamt.o redir.o tcp.o parseconfig.o
-+amtterm: amtterm.o redir.o tcp.o auth.o ssl.o
-+gamt: gamt.o redir.o tcp.o parseconfig.o auth.o ssl.o
-
- #################################################################
-
Index: patches/patch-amtider_c
===================================================================
RCS file: patches/patch-amtider_c
diff -N patches/patch-amtider_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-amtider_c 31 Aug 2025 19:24:45 -0000
@@ -0,0 +1,93 @@
+Replace Linux-only signalfd code with portable sigaction(2).
+
+Index: amtider.c
+--- amtider.c.orig
++++ amtider.c
+@@ -29,7 +29,6 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+-#include <sys/signalfd.h>
+ #include <sys/mman.h>
+
+ #include "redir.h"
+@@ -63,29 +62,33 @@ static void state_ider(void *cb_data, enum redir_state
+ }
+ }
+
++static volatile sig_atomic_t got_signal;
++
++static void sighandler(int sig)
++{
++ got_signal = 1;
++}
++
+ static int redir_loop(struct redir *r)
+ {
+ struct timeval tv;
+ fd_set set;
+- sigset_t mask;
+- int max_fd = r->sock, sfd;
++ struct sigaction sa;
++ int max_fd = r->sock;
+ int interval = HEARTBEAT_INTERVAL * 4 / 1000;
+
+- sigemptyset(&mask);
+- sigaddset(&mask, SIGINT);
+- sigaddset(&mask, SIGQUIT);
+-
+- if (sigprocmask(SIG_BLOCK, &mask, NULL) == -1) {
+- perror("sigprocmask");
++ memset(&sa, 0, sizeof sa);
++ sigemptyset(&sa.sa_mask);
++ sa.sa_handler = sighandler;
++ if (sigaction(SIGINT, &sa, NULL) == -1) {
++ perror("sigaction(SIGINT)");
+ exit(1);
+ }
+- sfd = signalfd(-1, &mask, 0);
+- if (sfd < 0) {
+- perror("signalfd");
++ if (sigaction(SIGQUIT, &sa, NULL) == -1) {
++ perror("sigaction(SIGQUIT)");
+ exit(1);
+ }
+
+-
+ for(;;) {
+ if (r->state == REDIR_CLOSED ||
+ r->state == REDIR_ERROR)
+@@ -93,16 +96,16 @@ static int redir_loop(struct redir *r)
+
+ FD_ZERO(&set);
+ FD_SET(r->sock, &set);
+- if (sfd > 0) {
+- FD_SET(sfd, &set);
+- max_fd = sfd > r->sock? sfd : r->sock;
+- }
++ max_fd = r->sock;
+ tv.tv_sec = interval;
+ tv.tv_usec = 0;
+ switch (select(max_fd+1,&set,NULL,NULL,&tv)) {
+ case -1:
+- perror("select");
+- return -1;
++ if (got_signal) {
++ perror("select");
++ return -1;
++ }
++ break;
+ case 0:
+ fprintf(stderr,"select: timeout\n");
+ return -1;
+@@ -112,9 +115,7 @@ static int redir_loop(struct redir *r)
+ if (-1 == redir_data(r))
+ return -1;
+ }
+- if (FD_ISSET(sfd, &set)) {
+- close(sfd);
+- sfd = -1;
++ if (got_signal) {
+ if (-1 == redir_ider_stop(r))
+ return -1;
+ interval = 2;
Index: patches/patch-amtterm_c
===================================================================
RCS file: patches/patch-amtterm_c
diff -N patches/patch-amtterm_c
--- patches/patch-amtterm_c 11 Mar 2022 18:26:24 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,49 +0,0 @@
-Add SSL/auth code
-https://github.com/Openwsman/wsmancli/issues/10#issuecomment-751253133
-
-Index: amtterm.c
---- amtterm.c.orig
-+++ amtterm.c
-@@ -179,10 +179,18 @@ static void usage(FILE *fp)
- " -h print this text\n"
- " -v verbose (default)\n"
- " -q quiet\n"
-+ " -L use legacy authentication\n"
-+#if defined(USE_OPENSSL) || defined(USE_GNUTLS)
-+ " -C cacert enable SSL and use PEM cacert file\n"
-+
No comments:
Post a Comment