- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index a5ea187..d2316ca 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -88,6 +88,7 @@ NFSv4.1 client and filesystem driver for Windows 10/11
- util-linux
- wget
- - Packages (recommended):
- + libnfs (for /usr/bin/nfs-ls)
- make
- git
- dos2unix
- @@ -321,4 +322,13 @@ $ /sbin/nfs_mount
- might require $ chmod a+rw /dev/vmnet0 # on VMware host, so that
- the VM can use "Promiscuous Mode".
- +
- +#
- +# 11. Source code:
- +#
- +- Source code can be obtained from https://github.com/kofemann/ms-nfs41-client
- +- Build instructions can be found at
- +https://github.com/kofemann/ms-nfs41-client/tree/master/cygwin
- +
- +
- # EOF.
- diff --git a/cygwin/README.txt b/cygwin/README.txt
- index 39dd517..f008d7a 100644
- --- a/cygwin/README.txt
- +++ b/cygwin/README.txt
- @@ -15,8 +15,7 @@
- export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
- git clone https://github.com/kofemann/ms-nfs41-client.git
- cd ms-nfs41-client
- -cd cygwin
- -make installdest
- +make -f cygwin/Makefile installdest
- #### Install the software (requires mintty.exe running as "Adminstrator"):
- @@ -86,6 +85,9 @@ bash ../cygwin/devel/msnfs41client.bash mount_homedir
- ######## Testing:
- +** Manual testing:
- +See ms-nfs41-client/tests/manual_testing.txt
- +
- ** "cthon04" test suite:
- # mount a NFSv4 filesystem, and then execute this
- # on this filesystem
- diff --git a/cygwin/cygwin_ksh93/cygwin_ksh93.readme b/cygwin/cygwin_ksh93/cygwin_ksh93.readme
- new file mode 100644
- index 0000000..d0ca429
- --- /dev/null
- +++ b/cygwin/cygwin_ksh93/cygwin_ksh93.readme
- @@ -0,0 +1,11 @@
- +#
- +# Cygwin ast-ksh/ksh93 README
- +#
- +
- +# Build sequence
- +cygport --64 ksh93.cygport download
- +cygport --64 ksh93.cygport prep
- +cygport --64 ksh93.cygport compile
- +cygport --64 ksh93.cygport install
- +cygport --64 ksh93.cygport package
- +# EOF.
- diff --git a/cygwin/cygwin_ksh93/ksh93.cygport b/cygwin/cygwin_ksh93/ksh93.cygport
- new file mode 100644
- index 0000000..a052035
- --- /dev/null
- +++ b/cygwin/cygwin_ksh93/ksh93.cygport
- @@ -0,0 +1,300 @@
- +#
- +# ksh93.cygport
- +#
- +# Copyright (C) 2024 Roland Mainz <roland.mainz@nrubsig.org>
- +#
- +# This file is free software; I give unlimited permission to copy and/or
- +# distribute it, with or without modifications, as long as this notice is
- +# preserved.
- +#
- +
- +NAME=astksh
- +LICENSE="Eclipse Public License - v 2.0"
- +HOMEPAGE="https://github.com/ksh93/ksh"
- +VERSION=1.0.8
- +RELEASE=0
- +
- +PKG_NAMES="astksh astksh_devel"
- +
- +astksh_SUMMARY="The AT&T Korn Shell"
- +astksh_DESCRIPTION="Original version of the AT&T AST Korn Shell 93."
- +astksh_CATEGORY="Base Shells"
- +astksh_CONTENTS=" \
- + bin/ksh.exe \
- + bin/ksh93.exe \
- + bin/rksh.exe \
- + bin/rksh93.exe \
- + etc/ksh.kshrc \
- + usr/share/doc/astksh \
- + usr/share/man/man1 \
- +"
- +
- +astksh_devel_SUMMARY="Development files for AT&T ksh"
- +astksh_devel_DESCRIPTION="This package contains development tools and scripts for AT&T ksh"
- +astksh_devel_CATEGORY="Devel"
- +astksh_devel_CONTENTS="usr/share/ksh \
- + bin/shcomp.exe \
- +"
- +
- +SRC_URI="https://github.com/ksh93/ksh/archive/refs/tags/v1.0.8.zip"
- +SRC_DIR='./ksh-1.0.8/'
- +PATCH_URI="ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch"
- +
- +BUILD_REQUIRES=" \
- + bash \
- + coreutils \
- + bison \
- + gcc-g++ \
- + libiconv-devel \
- + libintl-devel \
- + libncurses-devel \
- + make \
- + sed \
- + texinfo \
- +"
- +
- +CPPFLAGS=
- +CYGCONF_ARGS=
- +DIFF_EXCLUDES=
- +DOCS=
- +
- +function print_gnulinux_builtin_header
- +{
- +# Make sure to use \\ instead of \ for continuations
- +cat <<ENDOFTEXT
- +
- +#ifndef _GNULINUX_KSH_CMDLIST_H
- +#define _GNULINUX_KSH_CMDLIST_H
- +
- +#ifdef __cplusplus
- +extern "C" {
- +#endif
- +
- +/*
- + * List builtins for Linux.
- + * The list here is partially autogenerated and partially hand-picked
- + * based on compatibility with the native GNU coreutils versions of
- + * these tools
- + */
- +
- +/* GNU coreutils compatible commands.
- + * Be careful, some are in /bin while others are in /usr/bin
- + */
- +#define ASTCMDLIST(f) \
- + { "/usr/ast/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
- +#define BINCMDLIST(f) \
- + { "/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) }, \
- + { "/usr/bin/" #f, NV_BLTIN|NV_BLTINOPT|NV_NOFREE, bltin(f) },
- +/* undo ast_map.h #defines to avoid collision */
- +#undef basename
- +#undef chmod
- +#undef chown
- +#undef dirname
- +#undef mkdir
- +#undef mkfifo
- +#undef mktemp
- +#undef readlink
- +#undef realpath
- +#undef rmdir
- +
- +
- +/* Generated data, do not edit. */
- +BINCMDLIST(basename)
- +BINCMDLIST(cksum)
- +BINCMDLIST(comm)
- +BINCMDLIST(cut)
- +BINCMDLIST(dirname)
- +BINCMDLIST(expr)
- +BINCMDLIST(fold)
- +BINCMDLIST(join)
- +BINCMDLIST(logname)
- +BINCMDLIST(mkdir)
- +BINCMDLIST(mkfifo)
- +BINCMDLIST(mktemp)
- +BINCMDLIST(paste)
- +BINCMDLIST(pathchk)
- +BINCMDLIST(rev)
- +BINCMDLIST(rmdir)
- +BINCMDLIST(sleep)
- +BINCMDLIST(sync)
- +BINCMDLIST(tee)
- +BINCMDLIST(tty)
- +BINCMDLIST(uniq)
- +BINCMDLIST(wc)
- +
- +/* Mandatory for ksh93 test suite and AST scripts */
- +BINCMDLIST(getconf)
- +
- +ASTCMDLIST(basename)
- +ASTCMDLIST(cat)
- +ASTCMDLIST(chgrp)
- +ASTCMDLIST(chmod)
- +ASTCMDLIST(chown)
- +ASTCMDLIST(cksum)
- +ASTCMDLIST(cmp)
- +ASTCMDLIST(comm)
- +ASTCMDLIST(cp)
- +ASTCMDLIST(cut)
- +ASTCMDLIST(date)
- +ASTCMDLIST(dirname)
- +//BINCMDLIST(egrep)
- +//ASTCMDLIST(egrep)
- +ASTCMDLIST(expr)
- +ASTCMDLIST(fds)
- +//BINCMDLIST(fgrep)
- +//ASTCMDLIST(fgrep)
- +ASTCMDLIST(fmt)
- +ASTCMDLIST(fold)
- +//BINCMDLIST(grep)
- +//ASTCMDLIST(grep)
- +ASTCMDLIST(head)
- +ASTCMDLIST(id)
- +//BINCMDLIST(iconv)
- +//ASTCMDLIST(iconv)
- +ASTCMDLIST(join)
- +ASTCMDLIST(ln)
- +ASTCMDLIST(logname)
- +//ASTCMDLIST(ls)
- +ASTCMDLIST(md5sum)
- +BINCMDLIST(md5sum)
- +ASTCMDLIST(mkdir)
- +ASTCMDLIST(mkfifo)
- +ASTCMDLIST(mktemp)
- +ASTCMDLIST(mv)
- +ASTCMDLIST(paste)
- +ASTCMDLIST(pathchk)
- +ASTCMDLIST(pids)
- +//BINCMDLIST(od)
- +//ASTCMDLIST(od)
- +//BINCMDLIST(readlink)
- +//ASTCMDLIST(readlink)
- +//BINCMDLIST(realpath)
- +//ASTCMDLIST(realpath)
- +ASTCMDLIST(rev)
- +ASTCMDLIST(rm)
- +ASTCMDLIST(rmdir)
- +ASTCMDLIST(stty)
- +//ASTCMDLIST(sha1sum)
- +//BINCMDLIST(sha1sum)
- +//ASTCMDLIST(sha256sum)
- +//BINCMDLIST(sha256sum)
- +//ASTCMDLIST(sha384sum)
- +//BINCMDLIST(sha384sum)
- +//ASTCMDLIST(sha512sum)
- +//BINCMDLIST(sha512sum)
- +ASTCMDLIST(sum)
- +ASTCMDLIST(sync)
- +ASTCMDLIST(tail)
- +ASTCMDLIST(tee)
- +//BINCMDLIST(tr)
- +//ASTCMDLIST(tr)
- +ASTCMDLIST(tty)
- +ASTCMDLIST(uname)
- +ASTCMDLIST(uniq)
- +//ASTCMDLIST(vmstate)
- +ASTCMDLIST(wc)
- +// ASTCMDLIST(xgrep)
- +//BINCMDLIST(xargs)
- +//ASTCMDLIST(xargs)
- +
- +#ifdef __cplusplus
- +}
- +#endif
- +
- +#endif /* !_GNULINUX_KSH_CMDLIST_H */
- +ENDOFTEXT
- + return 0
- +}
- +
- +src_compile()
- +{
- + cd ${S}
- +
- + #
- + # prepare build
- + #
- +
- + # translate cygport ARCH to AST hosttype
- + if [[ "$ARCH" == 'i686' ]] ; then
- + ast_hosttype='cygwin.i386'
- + elif [[ "$ARCH" == 'x86_64' ]] ; then
- + ast_hosttype='cygwin.i386-64'
- + else
- + false
- + fi
- +
- + gnulinux_builtin_header="${PWD}/tmp_gnulinux_builtin_header.h"
- + print_gnulinux_builtin_header >"${gnulinux_builtin_header}"
- +
- + # ksh93+AST config flags
- + bast_flags="-DSHOPT_CMDLIB_BLTIN=0 -DSH_CMDLIB_DIR=\\\"/usr/ast/bin\\\" -DSHOPT_CMDLIB_HDR=\\\"${gnulinux_builtin_header}\\\" -DSHOPT_SYSRC"
- +
- + # build debug
- + #export IFFEFLAGS=-d1
- +
- + # fix build issues with mkfifo
- + sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
- +
- +
- + #
- + # build AT&T AST ksh
- + #
- + if [[ "$ARCH" == 'i686' ]] ; then
- + export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \
- + /bin/bash ./bin/package make \
- + CC="/usr/bin/gcc -m32 -std=gnu17" CCFLAGS="-Os -g ${bast_flags}" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"
- + elif [[ "$ARCH" == 'x86_64' ]] ; then
- + export SHELL=/bin/bash HOSTTYPE="${ast_hosttype}"; \
- + /bin/bash ./bin/package make \
- + CC="/usr/bin/gcc -m64 -std=gnu17" CCFLAGS="-Os -g ${bast_flags}" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"
- + else
- + # unsupported arch!
- + false
- + fi
- +
- +
- + #
- + # create ksh.kshrc
- + #
- + {
- + printf '#\n# /etc/ksh.kshrc+~/.kshrc are sourced only for interactive shells\n#\n\n'
- + printf '# default prompt\n'
- + printf 'PS1=%q\n' $'\E[32m$(/usr/bin/logname)@$(/usr/bin/hostname) \E[33m${PWD/~(Sl-r)$HOME/"~"}\E[0m\n$ '
- + printf '# default editor mode\n'
- + printf 'set -o gmacs\n'
- + } >${S}/etc_ksh_kshrc
- +}
- +
- +#
- +# install ksh, rksh, shcomp
- +#
- +src_install()
- +{
- + if [[ "$ARCH" == 'i686' ]] ; then
- + ast_hosttype='cygwin.i386'
- + elif [[ "$ARCH" == 'x86_64' ]] ; then
- + ast_hosttype='cygwin.i386-64'
- + else
- + false
- + fi
- +
- + /usr/bin/install -D -m0755 ${S}/arch/${ast_hosttype}/bin/ksh.exe ${D}/bin/ksh.exe
- + ln ${D}/bin/ksh.exe ${D}/bin/rksh.exe
- + ln ${D}/bin/ksh.exe ${D}/bin/ksh93.exe
- + ln ${D}/bin/ksh.exe ${D}/bin/rksh93.exe
- + /usr/bin/install -D -m0755 ${S}/arch/${ast_hosttype}/bin/ksh.exe ${D}/bin/shcomp.exe
- + /usr/bin/install -D -m0644 ${S}/arch/${ast_hosttype}/man/man1/sh.1 ${D}/usr/share/man/man1/ksh.1
- + /usr/bin/install -D -m0644 ${S}/etc_ksh_kshrc ${D}/etc/ksh.kshrc
- +
- + for i in ${S}/src/cmd/ksh93/tests/* ; do
- + /usr/bin/install -D -m0644 $i ${D}/usr/share/ksh/tests/$(basename "$i")
- + done
- +}
- +
- +CYGWIN_MAINTAINER=Roland%20Mainz
- +CYGWIN_MAINTAINER_EMAIL=roland.mainz@nrubsig.org
- +
- +CYGWIN_CO_MAINTAINER=Cedric%20Blancher
- +CYGWIN_CO_MAINTAINER_EMAIL=cedric.blancher@gmail.com
- +
- +# EOF.
- diff --git a/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch b/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch
- new file mode 100644
- index 0000000..2c193c8
- --- /dev/null
- +++ b/cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch
- @@ -0,0 +1,29 @@
- +diff --git a/src/lib/libast/port/astconf.c b/src/lib/libast/port/astconf.c
- +index b6b58027..396cd46d 100644
- +--- a/src/lib/libast/port/astconf.c
- ++++ b/src/lib/libast/port/astconf.c
- +@@ -1355,6 +1355,24 @@ astgetconf(const char* name, const char* path, const char* value, int flags, Err
- + Lookup_t look;
- + Sfio_t* tmp;
- +
- ++#ifdef __CYGWIN__
- ++ /*
- ++ * hack for Cygwin to make Cygwin UNC paths (with leading
- ++ * two slashes) work.
- ++ *
- ++ * Testcase:
- ++ * cd into UNC path, print "pwd -P", result must start with
- ++ * "//<hostname>/<path>"
- ++ * ---- snip ----
- ++ * $ bash -c 'cd "//derfw1fs10.global.loc/rfw" ; path_to_kshdir/ksh.exe -c "pwd -P ; true" ; true'
- ++ * //derfw1fs10.global.loc/rfw
- ++ * ---- snip ----
- ++ *
- ++ */
- ++ if (!strcmp(name, "PATH_LEADING_SLASHES")) {
- ++ return "1";
- ++ }
- ++#endif /* __CYGWIN__ */
- + if (!name)
- + {
- + if (path)
- diff --git a/cygwin/cygwin_libnfs/buildlibnfs.ksh b/cygwin/cygwin_libnfs/buildlibnfs.ksh
- new file mode 100644
- index 0000000..5eccc66
- --- /dev/null
- +++ b/cygwin/cygwin_libnfs/buildlibnfs.ksh
- @@ -0,0 +1,41 @@
- +#!/bin/ksh93
- +
- +#
- +# buildlibnfs.ksh - build libnfs for Cygwin 3.6.x
- +#
- +# Written by roland.mainz@nrubsig.org
- +#
- +
- +set -o xtrace
- +set -o errexit
- +
- +#
- +# get sources and patch them
- +#
- +git clone https://github.com/sahlberg/libnfs.git
- +# fix "nfs_v4.c:436:29: error: array subscript has type 'char' [-Werror=char-subscripts]"
- +sed -i -E 's/if \(isdigit\(\*buf\)\) \{/if (isdigit((int)*buf)) {/' libnfs/lib/nfs_v4.c
- +
- +# workaround for ms-nfs41-client
- +git config --global --add safe.directory "$PWD/libnfs"
- +
- +cd libnfs
- +
- +#
- +# configure
- +#
- +autoupdate
- +ln -s /usr/share/libtool/build-aux/ltmain.sh .
- +autoreconf || true
- +automake --add-missing
- +autoreconf
- +./configure --without-libkrb5 --enable-utils
- +
- +#
- +# build
- +#
- +make -j8 all
- +
- +print '# done.'
- +
- +# EOF.
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index f8fc3b8..1410a88 100644
- --- a/tests/manual_testing.txt
- +++ b/tests/manual_testing.txt
- @@ -1,5 +1,5 @@
- #
- -# ms-nfs41-client manual testing sequence, 2024-02-26
- +# ms-nfs41-client/tests/manual_testing.txt - manual testing sequence, 2024-03-24
- #
- # Draft version, needs to be turned into automated tests
- # if possible
- @@ -64,6 +64,7 @@ ksh93 -c 'builtin id ; rm -f x ; touch x ; chgrp "$(id -g -n)" x && print OK'
- #
- # Tests for groups
- +#
- # (Add groups "cygwingrp1" and "cygwingrp2" to both Linux NFSv4 server
- # and Windows machine, after that $ chgrp cygwingrp2 # should work)
- #
- @@ -93,6 +94,7 @@ root@DERFWNB4966:~# usermod -a -G cygwingrp1 roland_mainz
- root@DERFWNB4966:~# usermod -a -G cygwingrp2 roland_mainz
- ---- snip ---
- +
- #
- # Test for group ACLs
- #
- @@ -145,9 +147,11 @@ git clone -b 'v1.0.8' https://github.com/ksh93/ksh.git
- cd ksh
- git config --global --add safe.directory "$PWD"
- sed -i -r 's/mkfifo.+?(-m [[:digit:]]+)/mkfifo /g' ./src/cmd/INIT/package.sh ./bin/package
- +# add patch so UNC path support is enabled (e.g. "cd cd //derfwnb4966_ipv6linklocal@2049/nfs4/net_tmpfs")
- +patch -p1 <'../cygwin/cygwin_ksh93/ksh_1_0_8_libast_Cygwin_set_PATH_LEADING_SLASHES_for_UNC_paths.patch'
- # repeat:
- rm -Rf arch
- -time ksh93 -c 'export SHELL=/bin/bash HOSTTYPE="cygwin.i386-64"; /bin/bash ./bin/package make CC="/usr/bin/cc -std=gnu17" CCFLAGS="-Os -g" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"' 2>&1 | tee buildlog.log
- +time bash -c 'export SHELL=/bin/bash HOSTTYPE="cygwin.i386-64"; /bin/bash ./bin/package make CC="/usr/bin/cc -std=gnu17" CCFLAGS="-Os -g" SHELL="$SHELL" HOSTTYPE="$HOSTTYPE"' 2>&1 | tee buildlog.log
- #
- @@ -166,6 +170,7 @@ printf "path_len=%d\n" "${#PWD}"
- git clone https://git.savannah.gnu.org/git/bash.git
- cd bash/
- +git config --global --add safe.directory "$PWD"
- # Cygwin: workaround for configure using cp -p where ln -s should be used
- # (this is an automake/autoconf issue, they should trust Cygwin and not use
- # ancient workarounds for issues which no longer exists)
- @@ -179,8 +184,10 @@ make clean && make -j4 all
- #
- # ms-nfs41-client
- #
- +
- git clone https://github.com/kofemann/ms-nfs41-client.git
- cd ms-nfs41-client
- +git config --global --add safe.directory "$PWD"
- export PATH+=":/cygdrive/c/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/"
- # repeat:
- # clean
- @@ -193,6 +200,7 @@ MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Release -p:Pl
- #
- # gcc
- #
- +
- # * Notes:
- # - The build requires that there are at least 131 characters left in
- # the path, e.g. $ echo $((260-${#PWD} > 131)) # should be "1",
- @@ -210,6 +218,7 @@ MSBuild.exe build.vc19/nfs41-client.sln -t:Build -p:Configuration=Release -p:Pl
- #
- git clone -b 'releases/gcc-13.2.0' git://gcc.gnu.org/git/gcc.git
- cd gcc/
- +git config --global --add safe.directory "$PWD"
- # Cygwin: workaround for configure using cp -p where ln -s should be used
- # (this is an automake/autoconf issue, they should trust Cygwin and not use
- # ancient workarounds for issues which no longer exists)
- @@ -220,4 +229,24 @@ cd gcc/
- make -j4 clean
- (yes | make -j32 all)
- +
- +#
- +# libnfs
- +#
- +
- +# get sources and patch them
- +git clone https://github.com/sahlberg/libnfs.git
- +# fix "nfs_v4.c:436:29: error: array subscript has type 'char' [-Werror=char-subscripts]"
- +sed -i -E 's/if \(isdigit\(\*buf\)\) \{/if (isdigit((int)*buf)) {/' libnfs/lib/nfs_v4.c
- +
- +cd libnfs
- +git config --global --add safe.directory "$PWD"
- +autoupdate
- +ln -s /usr/share/libtool/build-aux/ltmain.sh .
- +autoreconf || true
- +automake --add-missing
- +autoreconf
- +./configure --without-libkrb5 --enable-utils
- +make -j8 all
- +
- # EOF.
README updates
Posted by Anonymous on Fri 22nd Mar 2024 16:16
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.