pkgsrc-WIP-changes archive

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

sdl-hercules-hyperion: enable networking by cutting out less code.



Module Name:	pkgsrc-wip
Committed By:	Olaf Seibert <rhialto%falu.nl@localhost>
Pushed By:	rhialto
Date:		Tue Sep 29 20:06:38 2020 +0200
Changeset:	5870e6906aeb6e9d53061658d8def2bfdf3d8709

Modified Files:
	sdl-hercules-hyperion/Makefile
	sdl-hercules-hyperion/distinfo
	sdl-hercules-hyperion/patches/patch-tuntap.c

Log Message:
sdl-hercules-hyperion: enable networking by cutting out less code.

Tested with a Linux install ISO (see
https://astr0baby.wordpress.com/2018/06/03/installing-ubuntu-18-04-server-s390x-in-hercules-mainframe-simulator/
)
and I could get 2 out of 4 potential configurations working:

    # Network. My host machine's address is 10.0.0.blah.
    #
    # Works in Linux installer image:
    # 0A00.2        CTCI -n /dev/tun0 -t 1500 10.0.1.2 10.0.1.1
    # Create tun0 with
    # sudo ifconfig tun0 create inet 10.0.1.1/24
    # sudo route add 10.0.1.2 10.0.1.2

    # Used in L3 mode (tun): didn't work
    # 0A00.3        QETH ifname tun0 iface /dev/tun0   ipaddr 10.0.1.2
    # sudo ifconfig tun0 create inet 10.0.1.1/24
    # sudo route add 10.0.1.2 10.0.1.2

    # Used in L2 mode (tap): worked:
    0A00.3  QETH ifname tun0 iface /dev/tap0   ipaddr 10.0.1.2
    #              prepare tap0: sudo ifconfig tap0 create inet 10.0.1.1/24
    #                            sudo route add 10.0.1.2 10.0.1.2 prob. not needed or wanted

    # Not available in Linux intaller image
    # 0A00.2       LCS     --dev /dev/tap0 --mac f2:0b:a4:2e:fd:5b 10.0.1.2
    #              prepare tap0: sudo ifconfig tap0 create inet 10.0.1.1/24
    #                            sudo route add 10.0.1.2 10.0.1.2

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=5870e6906aeb6e9d53061658d8def2bfdf3d8709

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 sdl-hercules-hyperion/Makefile               |  1 +
 sdl-hercules-hyperion/distinfo               |  3 +-
 sdl-hercules-hyperion/patches/patch-tuntap.c | 58 +++++++++++++++++++++++++---
 3 files changed, 55 insertions(+), 7 deletions(-)

diffs:
diff --git a/sdl-hercules-hyperion/Makefile b/sdl-hercules-hyperion/Makefile
index 4d50bbb59d..cb2edefa9c 100644
--- a/sdl-hercules-hyperion/Makefile
+++ b/sdl-hercules-hyperion/Makefile
@@ -1,6 +1,7 @@
 # $NetBSD$
 
 PKGNAME=	sdl-hercules-hyperion-4.2.1
+PKGREVISION=	1
 DISTNAME=	Release_${PKGVERSION_NOREV}
 CATEGORIES=	emulators
 MASTER_SITES=	${MASTER_SITE_GITHUB:=SDL-Hercules-390/}
diff --git a/sdl-hercules-hyperion/distinfo b/sdl-hercules-hyperion/distinfo
index 65994c53b4..3d2a9ab3ad 100644
--- a/sdl-hercules-hyperion/distinfo
+++ b/sdl-hercules-hyperion/distinfo
@@ -14,5 +14,6 @@ SHA1 (patch-hostopts.h) = d464925f82570cbcf368f0b76d1b545a5eebacfd
 SHA1 (patch-hscutl.c) = 72ff77bff284e63bc42e124b56051fe735f74de6
 SHA1 (patch-hthreads.h) = 25004a78c3fd0a803c5f4e0b0de8d05819602ac9
 SHA1 (patch-htypes.h) = 7e057ae370b266758176fbe13964581cac5004f0
-SHA1 (patch-tuntap.c) = ea3ca480613781e9dc09479d32e6d1138cc396aa
+SHA1 (patch-msgenu.h) = 89a1ac7373da138e79e3538aaaf96f85d07ab873
+SHA1 (patch-tuntap.c) = 9fc0be227907ae0eca4bb41c95be8c3540d6def5
 SHA1 (patch-tuntap.h) = 24946aab519beb6185800801f2bb38dccfdfef94
diff --git a/sdl-hercules-hyperion/patches/patch-tuntap.c b/sdl-hercules-hyperion/patches/patch-tuntap.c
index 4ce41af495..b299fcb45b 100644
--- a/sdl-hercules-hyperion/patches/patch-tuntap.c
+++ b/sdl-hercules-hyperion/patches/patch-tuntap.c
@@ -4,12 +4,58 @@ NetBSD is totally different. Patch the whole file out for now.
 
 --- tuntap.c.orig	2019-09-10 18:06:20.000000000 +0000
 +++ tuntap.c
-@@ -30,7 +30,7 @@
+@@ -26,6 +26,11 @@
+ /* Thus  for  preconfigured FreeBSD interfaces we need to modify the */
+ /* name of the character file being opened.                          */
+ 
++/* On NetBSD you open /dev/tun<n> which must be given by the user,   */
++/* who has pre-configured that tunnel for use.                       */
++/* If you want a L2 (ethernet) interface, open /dev/tap or           */
++/* /dev/tap<n>.  You cannot switch from one mode to the other.       */
++
+ 
  #include "hstdinc.h"
  
- /* jbs 1/19/2008 added ifdef on __SOLARIS__ */
--#if !defined(__SOLARIS__)
-+#if !defined(__SOLARIS__) && !defined(__NetBSD__)
+@@ -71,6 +76,7 @@ static void tuntap_term( void* arg )
+ //
+ // TUNTAP_SetMode           (TUNTAP_CreateInterface helper)
+ //
++#if defined(__linux__) || defined(OPTION_W32_CTCI)
+ static int TUNTAP_SetMode (int fd, struct hifr *hifr, int iFlags)
+ {
+     int rc;
+@@ -157,6 +163,7 @@ static int TUNTAP_SetMode (int fd, struc
+ 
+     return rc;
+ }   // End of function  TUNTAP_SetMode()
++#endif /* __linux__ || OPTION_W32_CTCI */
+ 
+ 
+ //
+@@ -248,6 +255,7 @@ int             TUNTAP_CreateInterface( 
+     if ( strncasecmp( utsbuf.sysname, "linux",  5 ) == 0 )
+ #endif
+     {
++#if defined (__linux__) || defined(OPTION_W32_CTCI)
+         // Linux kernel (builtin tun device) or Windows
+         struct hifr hifr;
+ 
+@@ -271,10 +279,18 @@ int             TUNTAP_CreateInterface( 
+         }
  
- #include "hercules.h"
- #include "tuntap.h"
+         strcpy( pszNetDevName, hifr.hifr_name );
++#endif /* __linux__ || OPTION_W32_CTCI */
+     }
+ #if !defined( OPTION_W32_CTCI )
+     else
+     {
++        if ((iFlags & IFF_TUN) && !strstr(pszTUNDevice, "tun")) {
++             WRMSG( HHC00156, "W", pszTUNDevice );
++        }
++        if ((iFlags & IFF_TAP) && !strstr(pszTUNDevice, "tap")) {
++             WRMSG( HHC00157, "W", pszTUNDevice );
++        }
++
+         // Other OS: Simply use basename of the device
+         // Notes: (JAP) This is problematic at best. Until we have a
+         //        clean FreeBSD compile from the base tree I can't


Home | Main Index | Thread Index | Old Index