diff options
author | christos <christos@pkgsrc.org> | 2013-11-02 22:43:29 +0000 |
---|---|---|
committer | christos <christos@pkgsrc.org> | 2013-11-02 22:43:29 +0000 |
commit | 8b99c665d7c336b06788192b10c70bcec9d52e2a (patch) | |
tree | 297067c4eb7f1d23261b8e6c1864a6319dd20212 | |
parent | 99a67866aead03eec18a11d4ebf61d156fe91f03 (diff) | |
download | pkgsrc-8b99c665d7c336b06788192b10c70bcec9d52e2a.tar.gz |
If the device for the serial console is given as "pty" allocate one
automatically, and tell the user what got allocated.
-rw-r--r-- | emulators/tme/Makefile | 4 | ||||
-rw-r--r-- | emulators/tme/distinfo | 7 | ||||
-rw-r--r-- | emulators/tme/patches/patch-host_posix_posix-serial.c | 36 | ||||
-rw-r--r-- | emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS | 22 | ||||
-rw-r--r-- | emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA | 24 | ||||
-rw-r--r-- | emulators/tme/patches/patch-machine_sun4_SUN4-75 | 27 | ||||
-rw-r--r-- | emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1 | 27 |
7 files changed, 144 insertions, 3 deletions
diff --git a/emulators/tme/Makefile b/emulators/tme/Makefile index 17486d6b6b5..7737c01b61c 100644 --- a/emulators/tme/Makefile +++ b/emulators/tme/Makefile @@ -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 --git a/emulators/tme/distinfo b/emulators/tme/distinfo index a99acba9f69..7d682ca819b 100644 --- a/emulators/tme/distinfo +++ b/emulators/tme/distinfo @@ -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-ad) = e90986262fe9d883ae64fe01dfb4ae07bde6a916 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 --git a/emulators/tme/patches/patch-host_posix_posix-serial.c b/emulators/tme/patches/patch-host_posix_posix-serial.c new file mode 100644 index 00000000000..0a5fcb3bb9f --- /dev/null +++ b/emulators/tme/patches/patch-host_posix_posix-serial.c @@ -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 --git a/emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS b/emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS new file mode 100644 index 00000000000..af43f56e2e7 --- /dev/null +++ b/emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS @@ -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 --git a/emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA b/emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA new file mode 100644 index 00000000000..56c5e159f9a --- /dev/null +++ b/emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA @@ -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 --git a/emulators/tme/patches/patch-machine_sun4_SUN4-75 b/emulators/tme/patches/patch-machine_sun4_SUN4-75 new file mode 100644 index 00000000000..a81c30bf4bd --- /dev/null +++ b/emulators/tme/patches/patch-machine_sun4_SUN4-75 @@ -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 --git a/emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1 b/emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1 new file mode 100644 index 00000000000..2fb52f4d76f --- /dev/null +++ b/emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-1 @@ -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: + ## |