summaryrefslogtreecommitdiff
path: root/emulators/tme/patches
diff options
context:
space:
mode:
authorchristos <christos>2013-11-02 22:43:29 +0000
committerchristos <christos>2013-11-02 22:43:29 +0000
commita7683d4dffedff3ca50d4bc4afd2d2235991b700 (patch)
tree297067c4eb7f1d23261b8e6c1864a6319dd20212 /emulators/tme/patches
parent777e18ef78b2f57094d862ca2455ad3312173d64 (diff)
downloadpkgsrc-a7683d4dffedff3ca50d4bc4afd2d2235991b700.tar.gz
If the device for the serial console is given as "pty" allocate one
automatically, and tell the user what got allocated.
Diffstat (limited to 'emulators/tme/patches')
-rw-r--r--emulators/tme/patches/patch-host_posix_posix-serial.c36
-rw-r--r--emulators/tme/patches/patch-machine_sun2_SUN2-MULTIBUS22
-rw-r--r--emulators/tme/patches/patch-machine_sun3_SUN3-CARRERA24
-rw-r--r--emulators/tme/patches/patch-machine_sun4_SUN4-7527
-rw-r--r--emulators/tme/patches/patch-machine_sun4u_SUN-ULTRA-127
5 files changed, 136 insertions, 0 deletions
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:
+ ##