pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/tme If the device for the serial console is ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f6e62b63e2d1
branches:  trunk
changeset: 626156:f6e62b63e2d1
user:      christos <christos%pkgsrc.org@localhost>
date:      Sat Nov 02 22:43:29 2013 +0000

description:
If the device for the serial console is given as "pty" allocate one
automatically, and tell the user what got allocated.

diffstat:

 emulators/tme/Makefile                                 |   4 +-
 emulators/tme/distinfo                                 |   7 +++-
 emulators/tme/patches/patch-host_posix_posix-serial.c  |  36 ++++++++++++++++++
 emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS |  22 +++++++++++
 emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA  |  24 ++++++++++++
 emulators/tme/patches/patch-machine_sun4_SUN4-75       |  27 +++++++++++++
 emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1  |  27 +++++++++++++
 7 files changed, 144 insertions(+), 3 deletions(-)

diffs (195 lines):

diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/Makefile
--- a/emulators/tme/Makefile    Sat Nov 02 21:53:36 2013 +0000
+++ b/emulators/tme/Makefile    Sat Nov 02 22:43:29 2013 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.45 2013/10/10 14:42:08 ryoon Exp $
+# $NetBSD: Makefile,v 1.46 2013/11/02 22:43:29 christos Exp $
 #
 
 DISTNAME=              tme-0.8
-PKGREVISION=           21
+PKGREVISION=           22
 CATEGORIES=            emulators
 MASTER_SITES=          http://csail.mit.edu/~fredette/tme/
 
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/distinfo
--- a/emulators/tme/distinfo    Sat Nov 02 21:53:36 2013 +0000
+++ b/emulators/tme/distinfo    Sat Nov 02 22:43:29 2013 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.17 2013/11/02 21:53:36 martin Exp $
+$NetBSD: distinfo,v 1.18 2013/11/02 22:43:29 christos Exp $
 
 SHA1 (tme-0.8.tar.gz) = dd4f3421c20ceed548c5328a21dbb26e80f46b9c
 RMD160 (tme-0.8.tar.gz) = 6bd505c5fa7810d37f436883383c4ba655df2ded
@@ -10,10 +10,15 @@
 SHA1 (patch-ae) = cfcea636744991c6eef84ea34ca78d40eb01c086
 SHA1 (patch-af) = cd3ffe52d4d75d05394ca74c3f69052bfdc41989
 SHA1 (patch-host_bsd_bsd-bpf.c) = 02a94a141da7d1790969deb8624d3a219d3e64ed
+SHA1 (patch-host_posix_posix-serial.c) = b1e009d6432c49672ca07a16ced939c8a46ef6e2
 SHA1 (patch-ic_ieee754_ieee754-misc-auto.sh) = afeb7452ef64bcae71e4dbae21881cff12cb9d4f
+SHA1 (patch-machine_sun2_SUN2-MULTIBUS) = dc44d9c842277a2f4ff55b0200edbc990ee86669
 SHA1 (patch-machine_sun2_sun2-mainbus.c) = 91b901d37d5f9a72064831d440c4371b81857640
+SHA1 (patch-machine_sun3_SUN3-CARRERA) = 73b8f3a5a7c587aa726db4fa53844f2a0dc82a24
 SHA1 (patch-machine_sun3_sun3-mainbus.c) = bfe56fdee109824ccf8a81760406b6c5d1ab7157
+SHA1 (patch-machine_sun4_SUN4-75) = 02218192d50e7679358e822515210711602c3271
 SHA1 (patch-machine_sun4_sun4-mainbus.c) = 9dda3c5365e608cce2faa180d6a58351c8e58095
+SHA1 (patch-machine_sun4u_SUN-ULTRA-1) = e2bd0b991acf47ff01658f2f692913c24d7478b5
 SHA1 (patch-tmesh_Makefile.in) = 850adc8390ea3031ee3d55396373be8507a43c32
 SHA1 (patch-tmesh_tmesh-cmds.c) = 6fffc98ea828e0b58261d810382665ae56da03ff
 SHA1 (patch-tmesh_tmesh-input.y) = 1337a8faa4bc1a90a14c29d0d6853ec8f86b4cf2
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/patches/patch-host_posix_posix-serial.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-host_posix_posix-serial.c     Sat Nov 02 22:43:29 2013 +0000
@@ -0,0 +1,36 @@
+$NetBSD: patch-host_posix_posix-serial.c,v 1.1 2013/11/02 22:43:29 christos Exp $
+
+If the device filename is just "pty" allocate one dynamically using the
+posix functions to avoid bsd'isms (openpty)
+
+--- host/posix/posix-serial.c.orig     2007-08-23 20:57:01.000000000 -0400
++++ host/posix/posix-serial.c  2013-11-02 17:56:20.000000000 -0400
+@@ -933,7 +933,27 @@
+   }
+   if (fd_in < 0) {
+     if (strcmp(filename_in, filename_out) == 0) {
+-      fd_in = fd_out = open(filename_in, O_RDWR | O_NONBLOCK);
++      if (strcmp(filename_in, "pty") == 0) {
++      fd_in = fd_out = posix_openpt(O_RDWR | O_NONBLOCK);
++      if (fd_in != -1) {
++        int serrno;
++        if (grantpt(fd_in) == -1) {
++bad:       serrno = errno;
++          (void)close(fd_in);
++          (void)close(fd_out);
++          errno = serrno;
++        } else {
++          filename_in = filename_out = ptsname(fd_in);
++          if (filename_in) {
++            tme_output_append(_output, "Using %s as console\n", filename_in);
++          } else {
++            goto bad;
++          }
++        }
++      }
++      } else {
++      fd_in = fd_out = open(filename_in, O_RDWR | O_NONBLOCK);
++      }
+     }
+     else {
+       fd_in = open(filename_in, O_RDONLY | O_NONBLOCK);
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS    Sat Nov 02 22:43:29 2013 +0000
@@ -0,0 +1,22 @@
+$NetBSD: patch-machine_sun2_SUN2-MULTIBUS,v 1.1 2013/11/02 22:43:29 christos Exp $
+
+Make it use auto-allocated ptys
+
+--- machine/sun2/SUN2-MULTIBUS 2005-04-30 11:12:12.000000000 -0400
++++ machine/sun2/SUN2-MULTIBUS 2013-11-02 18:30:00.000000000 -0400
+@@ -73,11 +73,11 @@
+ ##
+ # uncomment the following line if you aren't using the GTK-based
+ # display console above.  this will connect ttya to the master side of
+-# a pseudo-tty (in this case, /dev/ttyr0), which you can connect to
+-# using tip or some other serial communications program on the slave
+-# side (in this case, /dev/ptyr0):
++# a pseudo-tty, which you can connect to using tip or some other serial
++# communications program on the slave (in this case, a pty allocated
++# automatically):
+ #
+-#console0 at zs0 channel A: tme/host/posix/serial device /dev/ttyr0 break-carats
++#console0 at zs0 channel A: tme/host/posix/serial device pty
+ 
+ ## a SCSI disk:
+ ##
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA     Sat Nov 02 22:43:29 2013 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-machine_sun3_SUN3-CARRERA,v 1.1 2013/11/02 22:43:29 christos Exp $
+
+Make it use auto-allocated ptys
+
+--- machine/sun3/SUN3-CARRERA  2007-08-23 21:18:05.000000000 -0400
++++ machine/sun3/SUN3-CARRERA  2013-11-02 18:29:53.000000000 -0400
+@@ -44,12 +44,12 @@
+ ## ttya:
+ ##
+ # uncomment the following line if you aren't using the GTK-based
+-# display console.  this will connect ttya to the master side of
+-# a pseudo-tty (in this case, /dev/ttyr0), which you can connect to
+-# using tip or some other serial communications program on the slave
+-# side (in this case, /dev/ptyr0):
++# display console above.  this will connect ttya to the master side of
++# a pseudo-tty, which you can connect to using tip or some other serial
++# communications program on the slave (in this case, a pty allocated
++# automatically):
+ #
+-#console0 at zs0 channel A: tme/host/posix/serial device /dev/ttyr0 break-carats
++#console0 at zs0 channel A: tme/host/posix/serial device pty
+ 
+ ## the sun3 VME buses:
+ ##
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/patches/patch-machine_sun4_SUN4-75
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-machine_sun4_SUN4-75  Sat Nov 02 22:43:29 2013 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-machine_sun4_SUN4-75,v 1.1 2013/11/02 22:43:29 christos Exp $
+
+Make it use auto-allocated ptys
+
+--- machine/sun4/SUN4-75       2010-06-05 15:26:31.000000000 -0400
++++ machine/sun4/SUN4-75       2013-11-02 18:29:49.000000000 -0400
+@@ -46,14 +46,14 @@
+ 
+ ## ttya:
+ ##
+-# comment the first line, and uncomment the following line if you
+-# aren't using the GTK-based display console.  this will connect ttya
+-# to the master side of a pseudo-tty (in this case, /dev/ttyr0), which
+-# you can connect to using tip or some other serial communications
+-# program on the slave side (in this case, /dev/ptyr0):
++# uncomment the following line if you aren't using the GTK-based
++# display console above.  this will connect ttya to the master side of
++# a pseudo-tty, which you can connect to using tip or some other serial
++# communications program on the slave (in this case, a pty allocated
++# automatically):
+ #
+ sink1 at zs0 channel A: tme/serial/sink
+-#console0 at zs0 channel A: tme/host/posix/serial device /dev/ttyr0 break-carats
++#console0 at zs0 channel A: tme/host/posix/serial device pty
+ 
+ ## the SBus esp SCSI:
+ ##
diff -r a15ff425fab4 -r f6e62b63e2d1 emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1     Sat Nov 02 22:43:29 2013 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-machine_sun4u_SUN-ULTRA-1,v 1.1 2013/11/02 22:43:29 christos Exp $
+
+Make it use auto-allocated ptys
+
+--- machine/sun4u/SUN-ULTRA-1  2010-06-05 15:30:55.000000000 -0400
++++ machine/sun4u/SUN-ULTRA-1  2013-11-02 18:30:24.000000000 -0400
+@@ -47,14 +47,14 @@
+ 
+ ## ttya:
+ ##
+-# comment the first line, and uncomment the following line if you
+-# aren't using the GTK-based display console.  this will connect ttya
+-# to the master side of a pseudo-tty (in this case, /dev/ttyr0), which
+-# you can connect to using tip or some other serial communications
+-# program on the slave side (in this case, /dev/ptyr0):
++# uncomment the following line if you aren't using the GTK-based
++# display console above.  this will connect ttya to the master side of
++# a pseudo-tty, which you can connect to using tip or some other serial
++# communications program on the slave (in this case, a pty allocated
++# automatically):
+ #
+ sink1 at zs0 channel A: tme/serial/sink
+-#console0 at zs0 channel A: tme/host/posix/serial device /dev/ttyr0 break-carats
++#console0 at zs0 channel A: tme/host/posix/serial device pty
+ 
+ ## the SBus esp SCSI:
+ ##



Home | Main Index | Thread Index | Old Index