- #!/bin/bash
- #
- # msnfs41client.bash - simple Cygwin frontent for the msnfsv41
- # NFSv4.1 filesystem driver
- #
- #
- # Written by Roland Mainz <roland.mainz@nrubsig.org>
- #
- function nfsclient_install
- {
- set -o nounset
- set -o xtrace
- set -o errexit
- #
- # Test whether we have the Windows permissions to install DLLs
- # and the kernel module
- #
- if ! [[ "$(id -G)" =~ (^|[[:space:]]+)544([[:space:]]+|$) ]] ; 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
- chmod a+x *.exe *.dll
- if false ; then
- # install.bat needs PATH to include $PWD
- PATH="$PWD:$PATH" cmd /c install.bat
- else
- nfs_install
- rundll32 setupapi.dll,InstallHinfSection DefaultInstall 132 ./nfs41rdr.inf
- fi
- cp etc_netconfig /cygdrive/c/etc/netconfig
- cp ms-nfs41-idmap.conf /cygdrive/c/etc/.
- bcdedit /set testsigning on
- regtool -s set '/HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Tcpip/Parameters/Domain' 'GLOBAL.LOC'
- sc query Dfsc
- sc stop Dfsc || true
- sc config Dfsc start=disabled
- sc query nfs41_driver
- domainname
- return 0
- }
- function nfsclient_rundeamon
- {
- set -o xtrace
- set -o nounset
- set -o errexit
- nfsd_debug -d 0 --noldap --gid 1616 --uid 1616
- return $?
- }
- function nfsclient_mount_homedir
- {
- set -o xtrace
- set -o nounset
- nfs_mount -p -o sec=sys H 'derfwpc5131:/export/home/rmainz'
- mount -o bind,posix=1 /cygdrive/h /home/rmainz
- return $?
- }
- function nfsclient_umount_homedir
- {
- set -o xtrace
- set -o nounset
- nfs_mount -d H
- return $?
- }
- function main
- {
- typeset cmd="$1"
- export PATH="$PWD:$PATH"
- if ! which 'nfsd.exe' >/dev/null 2>&1 ; then
- printf $"%s: nfsd not found in %q\n" "$0" "$PWD" 1>&2
- return 1
- fi
- if ! which 'nfs_mount.exe' >/dev/null 2>&1 ; then
- printf $"%s: nfs_mount not found in %q\n" "$0" "$PWD" 1>&2
- return 1
- fi
- case "$cmd" in
- 'install')
- nfsclient_install
- return $?
- ;;
- 'run_deamon' | 'run_daemon')
- nfsclient_rundeamon
- return $?
- ;;
- 'mount_homedir')
- nfsclient_mount_homedir
- return $?
- ;;
- 'umount_homedir')
- nfsclient_umount_homedir
- return $?
- ;;
- *)
- printf $"%s: Unknown cmd %q\n" "$0" "$cmd" 1>&2
- return 1
- ;;
- esac
- return 1
- }
- main "$@"
- exit $?
- # EOF.
msnfs41client.bash - simple Cygwin frontent for the msnfsv41 NFSv4.1 filesystem driver
Posted by Anonymous on Tue 5th Sep 2023 11:49
raw | new post
view followups (newest first): msnfs41client.bash - simple Cygwin frontent for the msnfsv41 NFSv4.1 filesystem driver by Anonymous
modification of post by Anonymous (view diff)
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.