Skip to content

Commit

Permalink
Merge branch 'pr/5'
Browse files Browse the repository at this point in the history
  • Loading branch information
resuna committed Mar 27, 2017
2 parents dea2cdb 4ef27f7 commit 4e21cff
Show file tree
Hide file tree
Showing 11 changed files with 290 additions and 48 deletions.
16 changes: 14 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@
# on some platforms.
#

PLATFORMS = jessie yakkety freebsd alpine macosx
PLATFORMS = wheezy jessie yakkety freebsd alpine macosx sunos

all:
@echo
Expand All @@ -20,7 20,7 @@ all:
@echo Available platform targets: $(PLATFORMS)
@echo

jessie yakkety freebsd slackware:
wheezy jessie yakkety freebsd slackware:
(cd tnm && autoheader && autoconf && ./configure)
(cd tkined && autoheader && autoconf && ./configure)

Expand All @@ -40,6 40,18 @@ netbsd:
(cd tkined && autoheader && autoconf \
&& ./configure --with-tcl=/usr/pkg/lib --with-tk=/usr/pkg/lib)

sunos:
(cd tnm && autoheader && autoconf \
&& ./configure --with-tcl=/usr/local/lib)
(cd tkined && autoheader && autoconf \
&& ./configure --with-tcl=/usr/local/lib --with-tk=/usr/local/lib)

minix:
(cd tnm && autoheader && autoconf \
&& ./configure --with-tcl=/usr/pkg/lib)
(cd tkined && autoheader && autoconf \
&& ./configure --with-tcl=/usr/pkg/lib --with-tk=/usr/pkg/lib)

build:
(cd tnm && make)
(cd tkined && make)
Expand Down
12 changes: 12 additions & 0 deletions PORTS
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 89,18 @@ Configure with:
./configure --bindir=/usr/local/bin/ --libdir=/Library/Tcl


MINIX3
======

There is highly experimental support for MINIX3. At the moment of
writing this (20170311) minix does not have official support for
sunrpc. However the community member sambuc has kindly imported the
sunrpc implementation of NetBSD into minix.

Please read the file README.minix if you are interested in scotty on
MINIX3.


Solaris 11.3
============

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 221,9 @@ Credits
Jürgen has listed meticulously all contributors and benefactors at
the end of the original `tnm/README.md` file.

Lionel Sambuc has provided all needed bits to compile scotty on
MINIX3.


History
=======
Expand Down
154 changes: 154 additions & 0 deletions README.minix
Original file line number Diff line number Diff line change
@@ -0,0 1,154 @@
# -*- mode: markdown -*-

Note: all instructions are to be carried out as user root, unless
explicitely specified otherwise.


Requisites
==========

Scotty will not work with the stable release 3.3.0. You need
to start from a recent snapshot and recompile the system.

The procedure is easy and is described in [Tracking Current][]

We used the [R3.4.0rc5][] CD for development and installed MINIX3
inside a VirtualBox.

After installation and reboot we installed the basic development
packages with:

pkgin_sets

And then the following packages:

pkgin install autoconf mozilla-rootcerts-openssl tcl tk

rpcgen Kernel
=============

Clone the minix repository of sambuc into `/usr/src` and checkout the
`rpcgen2` branch.

cd /usr/src
git clone https://github.com/sambuc/minix
git checkout rpcgen2

To rebuild the system a workaround has to be used, please follow the
instructions provided by sambuc:

> Hello,
>
>
> There is a bit of a chicken-and-egg issue there, here are a couple of steps to go around that:
> 1. cp -r /usr/src/include/rcp /usr/include/rpc
> 2. cd /usr/src/usr.bin/rpcgen
> 3. make all install
> 4. rm -f /usr/include/rpc/* # Keep the folder, but empty it!
> 5. cd /usr/src
> 6. make build # if you already have build the sources, you can speed up things with
> -or-
> make build MKUPDATE=yes
>
> From there on, rpcgen will be installed, and it might work, provided that the current pollts implementation has some limitations.
>
> I might have some time to try and imrpove the pollts implementation a bit, but as long as it is not merged upstream, it comes with no promises.
>
>
> Kind regards,
>
> Lionel
Now reboot into your newly built system (a simple `reboot` is enough,
lean back and wait for the prompt).

Scotty compilation
==================

As a normal user:

Clone the scotty repository, enter the cloned directory and issue the
standard:

make minix build
su
make install

Or step by step:

cd tnm
autoheader
autoconf
./configure --with-tcl=/usr/pgk/lib
make
su
make install sinstall

cd ../tkined
autoheader
autoconf
./configure --with-tcl=/usr/pkg/lib --with-tk=/usr/pkg/lib
make
su
make install

Loopback device
===============

MINIX does not provide a loopback device, but most tests require one.
Here are steps to create one. We suppose, that you have just one real
Ethernet interface which uses network 0, so your `/etc/inet.conf`
might look like:

eth0 lance 0 { default; }

Add a line:

psip1;

The reboot. This adds a pseudo IP interface for network 1 (eth0 is
network 0). As root run:

ifconfig -I /dev/psip1 -h 127.0.0.1 -n 255.0.0.0 -m 40000

To see the loopback device run:

ifonfig -a

You must repeat the `ifconfig` line everytime you reboot the system,
or arrange this to be done for you in the system startup scripts.

Optionally add a `/etc/hosts` file with the contents:

127.0.0.1 localhost


Status
======

Tnm::icmp(n) seems not to work at all. Note that we needed to change the code
in `nmicmpd.c` (look out for `__minix`) in order to get `nmicmpd` to
start at all, since the 'old' minix stack does not support most socket
options, in this case you can not set `SO_SNDBUF`.

Tnm::sunrpc(n) runs all available tests, that is, just the surface of
the `sunrpc` commandline interface. Somebody would have to enable rpc
services and then test again and give feedback to sambuc about how rpc
is behaving.

Tnm::udp(n):

- all tests fail, because they want to use 127.0.0.1. `udp` itself
seems to work ok.

- creating an udp endpoint assigns the IP number of the default network
interface (eth0) instead of the "all interfaces" 0.0.0.0

In sum: what fails are the tests.

Tkined starts and shows the Tools menu. Since icmp does not work,
discovery and monitoring is hindered.


[Tracking Current]: http://wiki.minix3.org/doku.php?id=developersguide:trackingcurrent
[R3.4.0rc5]: http://download.minix3.org/iso/snapshot/minix_R3.4.0rc5-1d9650c.iso.bz2
2 changes: 1 addition & 1 deletion tkined/tclconfig/tcl.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1697,7 1697,7 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a'
TCL_LIB_VERSIONS_OK=nodots
;;
NetBSD-*)
Minix-*|NetBSD-*)
# NetBSD has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
Expand Down
30 changes: 21 additions & 9 deletions tnm/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 207,32 @@ all: binaries libraries doc

# SunRpc needs headers and stubs to be generated
#--------------------------------------------------------------------
TNM_DIR = $(top_builddir)/tnm
TNM_GENERIC_DIR = $(TNM_DIR)/generic
TNM_GENERIC_DIR = $(top_builddir)/generic
RPCGEN = @RPCGEN@
PKG_LIBS = @PKG_LIBS@

.SUFFIXES: .x
.x.h:
-cp $< .
# I could not tell some makes (SunOS, Minix3) how to do the following
# with a .SUFFIX rule.
# rpcgen does not behave consistently over different platforms with
# respect to its output files. The only portable way seem to be,
# building output from input in the same directory.
ether.h: $(TNM_GENERIC_DIR)/ether.x
cp $(TNM_GENERIC_DIR)/${@:.h=.x} .
$(RPCGEN) ${@:.h=.x}
mount.h: $(TNM_GENERIC_DIR)/mount.x
cp $(TNM_GENERIC_DIR)/${@:.h=.x} .
$(RPCGEN) ${@:.h=.x}
pcnfsd.h: $(TNM_GENERIC_DIR)/pcnfsd.x
cp $(TNM_GENERIC_DIR)/${@:.h=.x} .
$(RPCGEN) ${@:.h=.x}
rstat.h: $(TNM_GENERIC_DIR)/rstat.x
cp $(TNM_GENERIC_DIR)/${@:.h=.x} .
$(RPCGEN) ${@:.h=.x}

ether_clnt.c ether_xdr.c: ether.h
mount_clnt.c mount_xdr.c: mount.h
pcnfsd_clnt.c pcnfsd_xdr.c: pcnfsd.h
rstat_clnt.c rstat_xdr.c: rstat.h
ether_clnt.c ether_xdr.c : ether.h
mount_clnt.c mount_xdr.c : mount.h
pcnfsd_clnt.c pcnfsd_xdr.c : pcnfsd.h
rstat_clnt.c rstat_xdr.c : rstat.h

tnmSunRpc.o: tnmSunRpc.c mount.h ether.h rstat.h pcnfsd.h

Expand Down
14 changes: 6 additions & 8 deletions tnm/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 145,6 @@ Fail with: POSIX EADDRINUSE {address already in use}.
Note: these use the same udp endpoint to send and receive. Might just
rewrite the tests.

### Tests

If tests are run with: `scotty3.0.2 all.tcl` we get a segfault on exit.

### Build

Man files are install in a place, where they cannot be seen
Expand Down Expand Up @@ -207,6 203,11 @@ found there by default.
- actually we get a result, but not the expected `portmapper`,
instead we get `rpcbind`

Minix
-----

See the ../README.minix file.

Generic
-------

Expand Down Expand Up @@ -431,10 432,7 @@ Wishlist
Port to
-------

- OpenIndiana (Solaris)
- only Tcl 8.5 available
- Minix:
- Note: Minix3.3 is missing rpc/rpcgen implementation.
- OpenIndiana
- Windows

Fix
Expand Down
Loading

0 comments on commit 4e21cff

Please sign in to comment.