- From 9f531aba9e8ce82de5956ff64f68717a3a1e53e9 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 21 May 2024 13:48:21 +0200
- Subject: [PATCH 1/3] cygwin: Multiarch support for "msnfs41client"+better
- error checking
- Add support for multiple architectures to msnfs41client.bash,
- and improve error checking
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/devel/msnfs41client.bash | 146 +++++++++++++++++++++++++-------
- 1 file changed, 117 insertions(+), 29 deletions(-)
- diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
- index cf4c516..a0ea540 100644
- --- a/cygwin/devel/msnfs41client.bash
- +++ b/cygwin/devel/msnfs41client.bash
- @@ -44,6 +44,42 @@ function is_windows_admin_account
- return 1
- }
- +function check_machine_arch
- +{
- + typeset winpwd
- + typeset uname_m
- +
- + # get the location where this script is installed,
- + # because on Cygwin the script will be installed
- + # in /cygdrive/c/cygwin/lib/msnfs41client/ (32bit) or
- + # in /cygdrive/c/cygwin64/lib/msnfs41client/ (64bit).
- + winpwd="$(cygpath -w "$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")")"
- +
- + uname_m="$(uname -m)"
- +
- + case "${uname_m}" in
- + 'x86_64')
- + if [[ "${winpwd}" != 'C:\cygwin64\'* ]] ; then
- + printf $"%s: Requires 64bit Cygwin\n" "$0" 1>&2
- + return 1
- + fi
- + return 0
- + ;;
- + 'i686')
- + if [[ "${winpwd}" != 'C:\cygwin\'* ]] ; then
- + printf $"%s: Requires 32bit Cygwin\n" "$0" 1>&2
- + return 1
- + fi
- + return 0
- + ;;
- + *)
- + printf $"%s: Unknown arch/Cygwin combination ('%s'/'%s')\n" "$0" "${uname_m}" "${winpwd}" 1>&2
- + return 1
- + ;;
- + esac
- + # not reached
- +}
- +
- function nfsclient_install
- {
- set -o nounset
- @@ -52,14 +88,10 @@ function nfsclient_install
- # switch to the location where this script is installed,
- # because on Cygwin the script will be installed
- - # in /cygdrive/c/cygwin64/lib/msnfs41client/
- + # in /cygdrive/c/cygwin/lib/msnfs41client/ (32bit) or
- + # in /cygdrive/c/cygwin64/lib/msnfs41client/ (64bit).
- cd -P "$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")"
- - if ! is_windows_admin_account ; then
- - printf $"%s: Install requires Windows Adminstator permissions.\n" "$0"
- - return 1
- - fi
- -
- # make sure all binaries are executable, Windows cmd does
- # not care, but Cygwin&bash do.
- # If *.ddl are not executable nfs*.exe fail with 0xc0000022
- @@ -383,18 +415,30 @@ function nfsclient_system_rundeamon
- function watch_kernel_debuglog
- {
- + typeset dbgview_cmd
- +
- printf "# logging start...\n" 1>&2
- +
- + case "$(uname -m)" in
- + 'x86_64') dbgview_cmd='dbgview64' ;;
- + 'i686') dbgview_cmd='dbgview' ;;
- + *)
- + printf $"%s: Unknown machine type\n" "$0" 1>&2
- + return 1
- + ;;
- + esac
- +
- # seperate process so SIGINT works
- # use DebugView (https://learn.microsoft.com/en-gb/sysinternals/downloads/debugview) to print kernel log
- - bash -c '
- + dbgview_cmd="${dbgview_cmd}" bash -c '
- klogname="msnfs41client_watch_kernel_debuglog$$.log"
- - dbgview64 /t /k /l "$klogname" &
- + $dbgview_cmd /t /k /l "$klogname" &
- (( dbgview_pid=$! ))
- trap "(( dbgview_pid != 0)) && kill $dbgview_pid && wait ; (( dbgview_pid=0 ))" INT TERM EXIT
- sleep 2
- printf "# logging %s ...\n" "$klogname" 1>&2
- tail -n0 -f "$klogname"'
- - printf "# logging done\n" 1>&2
- + printf '# logging done\n' 1>&2
- return 0
- }
- @@ -481,12 +525,13 @@ function sys_terminal
- PsExec -accepteula -nobanner \
- -i \
- -s -w "$(cygpath -w "$PWD")" \
- - 'C:\cygwin64\bin\mintty.exe'
- + "$(cygpath -w "$(which mintty.exe)")" --nodaemon
- }
- function main
- {
- typeset cmd="$1"
- + typeset -i numerr=0
- # path where this script is installed
- typeset scriptpath="$(dirname -- "$(realpath "${BASH_SOURCE[0]}")")"
- @@ -511,66 +556,109 @@ function main
- case "$cmd" in
- 'install')
- + check_machine_arch || (( numerr++ ))
- + require_cmd 'regtool.exe' || (( numerr++ ))
- + require_cmd 'cygrunsrv.exe' || (( numerr++ ))
- + require_cmd 'nfsd.exe' || (( numerr++ ))
- + require_cmd 'nfs_install.exe' || (( numerr++ ))
- + require_cmd 'rundll32.exe' || (( numerr++ ))
- + require_cmd 'bcdedit.exe' || (( numerr++ ))
- + require_cmd 'fsutil.exe' || (( numerr++ ))
- + require_cmd 'sc.exe' || (( numerr++ ))
- + if ! is_windows_admin_account ; then
- + printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- + (( numerr++ ))
- + fi
- + (( numerr > 0 )) && return 1
- +
- nfsclient_install
- return $?
- ;;
- 'run_deamon' | 'run_daemon')
- - #require_cmd 'cdb.exe' || return 1
- - require_cmd 'nfsd.exe' || return 1
- - require_cmd 'nfsd_debug.exe' || return 1
- - require_cmd 'nfs_mount.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + #require_cmd 'cdb.exe' || (( numerr++ ))
- + require_cmd 'nfsd.exe' || (( numerr++ ))
- + require_cmd 'nfsd_debug.exe' || (( numerr++ ))
- + require_cmd 'nfs_mount.exe' || (( numerr++ ))
- + (( numerr > 0 )) && return 1
- +
- nfsclient_rundeamon
- return $?
- ;;
- 'sys_run_deamon' | 'sys_run_daemon')
- - #require_cmd 'cdb.exe' || return 1
- - require_cmd 'PsExec.exe' || return 1
- - require_cmd 'nfsd.exe' || return 1
- - require_cmd 'nfsd_debug.exe' || return 1
- - require_cmd 'nfs_mount.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + #require_cmd 'cdb.exe' || (( numerr++ ))
- + require_cmd 'PsExec.exe' || (( numerr++ ))
- + require_cmd 'nfsd.exe' || (( numerr++ ))
- + require_cmd 'nfsd_debug.exe' || (( numerr++ ))
- + require_cmd 'nfs_mount.exe' || (( numerr++ ))
- if ! is_windows_admin_account ; then
- printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- - return 1
- + (( numerr++ ))
- fi
- + (( numerr > 0 )) && return 1
- +
- nfsclient_system_rundeamon
- return $?
- ;;
- 'sys_mount_homedir')
- - require_cmd 'nfs_mount.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + require_cmd 'nfs_mount.exe' || (( numerr++ ))
- if ! is_windows_admin_account ; then
- printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- - return 1
- + (( numerr++ ))
- fi
- + (( numerr > 0 )) && return 1
- +
- nfsclient_system_mount_homedir
- return $?
- ;;
- 'mount_homedir')
- - require_cmd 'nfs_mount.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + require_cmd 'nfs_mount.exe' || (( numerr++ ))
- + (( numerr > 0 )) && return 1
- +
- nfsclient_mount_homedir
- return $?
- ;;
- 'umount_homedir')
- - require_cmd 'nfs_mount.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + require_cmd 'nfs_mount.exe' || (( numerr++ ))
- + (( numerr > 0 )) && return 1
- +
- nfsclient_umount_homedir
- return $?
- ;;
- # misc
- 'watch_kernel_debuglog')
- - require_cmd 'dbgview64' || return 1
- + check_machine_arch || (( numerr++ ))
- + case "$(uname -m)" in
- + 'x86_64') require_cmd 'dbgview64' || (( numerr++ )) ;;
- + 'i686') require_cmd 'dbgview' || (( numerr++ )) ;;
- + *)
- + printf $"%s: Unknown machine type\n" "$0" 1>&2
- + (( numerr++ ))
- + ;;
- + esac
- if ! is_windows_admin_account ; then
- printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- - return 1
- + (( numerr++ ))
- fi
- + (( numerr > 0 )) && return 1
- +
- watch_kernel_debuglog
- return $?
- ;;
- 'sys_terminal')
- - require_cmd 'mintty.exe' || return 1
- - require_cmd 'PsExec.exe' || return 1
- + check_machine_arch || (( numerr++ ))
- + require_cmd 'mintty.exe' || (( numerr++ ))
- + require_cmd 'PsExec.exe' || (( numerr++ ))
- if ! is_windows_admin_account ; then
- printf $"%s: %q requires Windows Adminstator permissions.\n" "$0" "$cmd"
- - return 1
- + (( numerr++ ))
- fi
- + (( numerr > 0 )) && return 1
- +
- sys_terminal
- return $?
- ;;
- --
- 2.43.0
- From c1f1f8743ad7626808b518920c5a2fd6545ff483 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 21 May 2024 15:26:12 +0200
- Subject: [PATCH 2/3] cygwin,tests: Update README+package lists for Win10/32bit
- Update README+package lists for Win10/32bit
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 12 ++++++++++++
- tests/manual_testing.txt | 15 +++++++++++++--
- 2 files changed, 25 insertions(+), 2 deletions(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index 5ceb58b..c24ef18 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -101,6 +101,7 @@ NFSv4.1 client and filesystem driver for Windows 10/11
- make
- git
- dos2unix
- + unzip
- #
- #
- @@ -199,6 +200,15 @@ $ /sbin/nfs_mount
- #
- # 8. Notes:
- #
- +- Cygwin 32bit can be installed like this:
- +---- snip ----
- +# Install Cygwin 32bit on Windows 32 with packages required by "ms-nfs41-client"
- +# (Windows NFSv4.1 client):
- +# 1. Get installer from https://www.cygwin.com/setup-x86.exe
- +# 2. Run installer with these arguments:
- +setup-x86.exe --allow-unsupported-windows -q --no-verify --site http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/2022/11/23/063457 -P cygwin,cygwin-devel,cygrunsrv,cygutils,cygutils-extra,bash,bzip2,coreutils,getent,gdb,grep,hostname,less,libiconv,libiconv2,pax,pbzip2,procps-ng,sed,tar,time,util-linux,wget,libnfs,make,git,dos2unix,unzip
- +---- snip ----
- +
- - Idmapping (including uid/gid mapping) between NFSv4 client and
- NFSv4 server works via /lib/msnfs41client/cygwin_idmapper.ksh,
- which either uses builtin static data, or /usr/bin/getent passwd
- @@ -331,6 +341,8 @@ $ /sbin/nfs_mount
- c) the EaSize field cannot be reported for directory queries of
- FileBothDirInformation, FileFullDirInfo, or FileIdFullDirInfo.
- +- Win10/32bit-only: $ net use H: /delete # does not work,
- + use $ nfs_mount -d 'H' instead #
- #
- # 10. Notes for troubleshooting && finding bugs/debugging:
- diff --git a/tests/manual_testing.txt b/tests/manual_testing.txt
- index 0359cb9..cade142 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 manual testing sequence, 2024-05-21
- #
- # Draft version, needs to be turned into automated tests
- # if possible
- @@ -9,10 +9,15 @@
- # Notes:
- # - The following Cygwin packages must be installed for running the tests:
- # ---- snip ----
- +# gcc-core
- +# gcc-g++
- +# clang
- +# gdb
- # make
- -# git
- # netpbm
- +# git
- # subversion
- +# cygport
- # dos2unix
- # ncurses-devel
- # libgmp-devel
- @@ -22,6 +27,12 @@
- # libisl-devel
- # flex
- # bison
- +# unzip
- +# pax
- +# tar
- +# konsole
- +# nedit
- +# emacs
- # ---- snip ----
- #
- # - Benchmarking/profiling should be done with the realtime virus checker
- --
- 2.43.0
- From 8f5aff990ff3af38615c0039b9d39e80773aaac4 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Tue, 21 May 2024 15:31:48 +0200
- Subject: [PATCH 3/3] cygwin: Add comment accessing NFSv4.1 filesystem via NAT
- Add comment to cygwin/README.bintarball.txt about accessing NFSv4.1
- filesystems via Network address translation (NAT) - in such
- a case the source port will be >= 1024, and most NFSv4.1 servers
- will return a |EPERM| (permission error) in such a case.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- cygwin/README.bintarball.txt | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
- diff --git a/cygwin/README.bintarball.txt b/cygwin/README.bintarball.txt
- index c24ef18..e91340b 100644
- --- a/cygwin/README.bintarball.txt
- +++ b/cygwin/README.bintarball.txt
- @@ -289,9 +289,13 @@ setup-x86.exe --allow-unsupported-windows -q --no-verify --site http://ctm.crouc
- If nfsd.exe/nfsd_debug.exe is started without the Windows priviledge
- to use reserved ports, then a mount attempt can fail.
- This can be worked around on the NFSv4 server side - on Linux using
- - the "insecure" export option in /etc/exports and on Solaris/Illumos
- + the "insecure" export option in /etc/exports and on Solaris/Illumos
- using export option "resvport" (see nfs(5)).
- +- Accessing mounts from a VMware/QEMU/VirtualBox VM using NAT requires
- + the the "insecure" export option in /etc/exports and on
- + Solaris/Illumos using export option "resvport" (see nfs(5)), as the
- + NFSv4 client source TCP port will be >= 1024.
- #
- # 9. Known issues:
- --
- 2.43.0
msnfs41client: Patch for multiarch support+docs+misc, 2024-05-21
Posted by Anonymous on Tue 21st May 2024 17:05
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.