- From fc84ce3b9496228db7d52c0eb5ecac60cfdf7ed3 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Mar 2025 15:23:15 +0100
- Subject: [PATCH 1/2] cygwin: cygwinaccount2nfs4account: Add Solaris+Illumos
- support
- Add Solaris+Illumos support to cygwinaccount2nfs4account.ksh
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- .../cygwinaccount2nfs4account.ksh | 70 ++++++++++++++-----
- 1 file changed, 54 insertions(+), 16 deletions(-)
- diff --git a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- index f2c99bd..264b9c5 100644
- --- a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- +++ b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
- @@ -3,7 +3,7 @@
- #
- # MIT License
- #
- -# Copyright (c) 2024 Roland Mainz <roland.mainz@nrubsig.org>
- +# Copyright (c) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
- #
- # Permission is hereby granted, free of charge, to any person obtaining a copy
- # of this software and associated documentation files (the "Software"), to deal
- @@ -187,7 +187,8 @@ function accountdata2linuxscript
- {
- set -o nounset
- - nameref accountdata=$1
- + typeset os="$1"
- + nameref accountdata=$2
- typeset gidlist=''
- typeset sidname
- @@ -230,16 +231,35 @@ function accountdata2linuxscript
- printf '# User data:\n'
- printf '#\n'
- - printf 'mkdir -p %q\n' "${curruser.homedir}"
- - printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
- - "${curruser.uid}" \
- - "${curruser.gid}" \
- - "${gidlist}" \
- - "${curruser.shell}" \
- - "${curruser.login_name}"
- - printf 'chown %q %q\n' \
- - "${curruser.uid}:${curruser.gid}" \
- - "${curruser.homedir}"
- + case "$os" in
- + 'linux')
- + printf 'mkdir -p %q\n' "${curruser.homedir}"
- + printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
- + "${curruser.uid}" \
- + "${curruser.gid}" \
- + "${gidlist}" \
- + "${curruser.shell}" \
- + "${curruser.login_name}"
- + printf 'chown %q %q\n' \
- + "${curruser.uid}:${curruser.gid}" \
- + "${curruser.homedir}"
- + ;;
- + 'solaris' | 'illumos')
- + printf 'mkdir -p %q\n' "/export/${curruser.homedir}"
- + printf 'printf "%s\\tlocalhost:/export/home/%s\\n" >>"/etc/auto_home"\n' \
- + "${curruser.login_name}" \
- + "${curruser.login_name}"
- + printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
- + "${curruser.uid}" \
- + "${curruser.gid}" \
- + "${gidlist}" \
- + "${curruser.shell}" \
- + "${curruser.login_name}"
- + printf 'chown %q %q\n' \
- + "${curruser.uid}:${curruser.gid}" \
- + "/export/${curruser.homedir}"
- + ;;
- + esac
- return 0
- }
- @@ -292,12 +312,14 @@ function convert_curruser2linuxscript
- #
- # Generate Linux script from collected "account_data"
- #
- - accountdata2linuxscript account_data
- + accountdata2linuxscript "${cfg.os}" account_data
- #
- # Print NFSv4 server config
- #
- - print_nfs4_server_config cfg
- + if [[ "${cfg.os}" == 'linux' ]] ; then
- + print_nfs4_server_config cfg
- + fi
- #
- # Done
- @@ -363,7 +385,7 @@ function convert_givenuser2linuxscript
- #
- # Generate Linux script from collected "account_data"
- #
- - accountdata2linuxscript account_data
- + accountdata2linuxscript "${cfg.os}" account_data
- #
- # Print NFSv4 server config
- @@ -384,13 +406,15 @@ function main
- # fixme: Need better text layout for $ cygwinaccount2nfs4account --man #
- typeset -r cygwinaccount2nfs4account_usage=$'+
- - [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2024-12-10 \$\n]
- + [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2025-03-19 \$\n]
- [-author?Roland Mainz <roland.mainz@nrubsig.org>]
- [+NAME?cygwinaccount2nfs4account - convert Cygwin user/group account
- info to Linux/UNIX NFSv4 server account data]
- [+DESCRIPTION?\bcygwinaccount2nfs4account\b convert Cygwin user/group account
- info to Linux/UNIX NFSv4 server account data.]
- [D:debug?Enable debugging.]
- + [O:os?Operating system, either \blinux\b, \bsolaris\b or
- + \billumos\b).]:[os]
- --man
- @@ -413,6 +437,9 @@ function main
- 'D')
- c.debug=true
- ;;
- + 'O')
- + typeset c.os="${OPTARG}"
- + ;;
- *)
- usage "${progname}" "${cygwinaccount2nfs4account_usage}"
- return $?
- @@ -427,6 +454,17 @@ function main
- unset c.args[$i]
- done
- + if [[ ! -v c.os ]] ; then
- + print -u2 -f $"%s: Require -O <operating-system>\n"
- + return 1
- + fi
- +
- + if [[ "${c.os}" != ~(Elr)(linux|solaris|illumos) ]] ; then
- + print -u2 -f $"%s: Unsuppoted -O value %q, supported are 'linux', 'solaris', 'illumos'\n" \
- + "${c.os}"
- + return 1
- + fi
- +
- #
- # c.args mighth be a sparse array (e.g. "([1]=aaa [2]=bbb [4]=ccc)")
- # right now after we removed processed options/arguments.
- --
- 2.45.1
- From 6e20d02c7f90c47502931fd4ab9b37d24562d4fa Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Wed, 19 Mar 2025 15:24:49 +0100
- Subject: [PATCH 2/2] tests: Update Solaris 11.4+Illumos MFSv4.1 server setup
- instructions
- Update Solaris 11.4+Illumos MFSv4.1 server setup instructions
- per testing, mailinglist and IRC feedback.
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- tests/nfs_server_setup.txt | 24 +++++++++++++++++++-----
- 1 file changed, 19 insertions(+), 5 deletions(-)
- diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
- index a4ff027..e8340c9 100644
- --- a/tests/nfs_server_setup.txt
- +++ b/tests/nfs_server_setup.txt
- @@ -51,13 +51,19 @@ printf "server 10.49.0.5\n" >/etc/inet/ntp.conf
- svcadm enable ntp
- # configure&start NFS server
- +svcadm enable network/nfs/mapid
- svcadm enable network/nfs/server
- sharectl set -p nfsmapid_domain=global.loc nfs
- sharectl set -p server_delegation=on nfs
- +
- +# prepare test share
- mkdir /nfsdata
- chmod a+rwx /nfsdata
- -share -F nfs -o rw /nfsdata/
- -svcs svc:/network/nfs/server:default
- +share -p -F nfs -o rw /nfsdata
- +
- +# verify whether mapid and nfs/server are running
- +svcs network/nfs/mapid
- +svcs network/nfs/server
- # performance: disable sync/ZIL on ZFS pool which exports NFS files
- zfs set sync=disabled rpool
- @@ -77,7 +83,7 @@ See https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/man
- #
- # Illumos NFSv4.1 server setup
- -# (similar to Solaris 11)
- +# (similar to Solaris 11.4)
- #
- ##### 1. Server setup
- @@ -87,14 +93,22 @@ svcadm enable ntp
- svcadm restart ntp
- # configure&start NFS server
- +svcadm enable network/nfs/mapid
- svcadm enable network/nfs/server
- sharectl set -p nfsmapid_domain=global.loc nfs
- sharectl set -p server_delegation=on nfs
- sharectl set -p server_versmax=4.1 nfs
- +
- +# prepare test share
- mkdir /nfsdata
- chmod a+rwx /nfsdata
- -share -F nfs -o rw /nfsdata/
- -svcs svc:/network/nfs/server:default
- +share -p -F nfs -o rw /nfsdata
- +
- +# verify whether mapid and nfs/server are running
- +svcs network/nfs/mapid
- +svcs network/nfs/server
- +
- +# restarting network/nfs/server only restores shares in /etc/dfs/dfstab
- # performance: disable sync/ZIL on ZFS pool which exports NFS files
- zfs set sync=disabled rpool
- --
- 2.45.1
msnfs41client: Patches for (better) Solaris/Illumos support, 2025-03-19
Posted by Anonymous on Wed 19th Mar 2025 16:03
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.