pastebin - collaborative debugging tool
rovema.kpaste.net RSS


msnfs41client: Patches for (better) Solaris/Illumos support, 2025-03-19
Posted by Anonymous on Wed 19th Mar 2025 16:03
raw | new post

  1. From fc84ce3b9496228db7d52c0eb5ecac60cfdf7ed3 Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 19 Mar 2025 15:23:15 +0100
  4. Subject: [PATCH 1/2] cygwin: cygwinaccount2nfs4account: Add Solaris+Illumos
  5.  support
  6.  
  7. Add Solaris+Illumos support to cygwinaccount2nfs4account.ksh
  8.  
  9. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  10. ---
  11. .../cygwinaccount2nfs4account.ksh             | 70 ++++++++++++++-----
  12.  1 file changed, 54 insertions(+), 16 deletions(-)
  13.  
  14. diff --git a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  15. index f2c99bd..264b9c5 100644
  16. --- a/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  17. +++ b/cygwin/utils/cygwinaccount2nfs4account/cygwinaccount2nfs4account.ksh
  18. @@ -3,7 +3,7 @@
  19.  #
  20.  # MIT License
  21.  #
  22. -# Copyright (c) 2024 Roland Mainz <roland.mainz@nrubsig.org>
  23. +# Copyright (c) 2024-2025 Roland Mainz <roland.mainz@nrubsig.org>
  24.  #
  25.  # Permission is hereby granted, free of charge, to any person obtaining a copy
  26.  # of this software and associated documentation files (the "Software"), to deal
  27. @@ -187,7 +187,8 @@ function accountdata2linuxscript
  28.  {
  29.         set -o nounset
  30.  
  31. -       nameref accountdata=$1
  32. +       typeset os="$1"
  33. +       nameref accountdata=$2
  34.         typeset gidlist=''
  35.         typeset sidname
  36.  
  37. @@ -230,16 +231,35 @@ function accountdata2linuxscript
  38.         printf '# User data:\n'
  39.         printf '#\n'
  40.  
  41. -       printf 'mkdir -p %q\n' "${curruser.homedir}"
  42. -       printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
  43. -               "${curruser.uid}" \
  44. -               "${curruser.gid}" \
  45. -               "${gidlist}" \
  46. -               "${curruser.shell}" \
  47. -               "${curruser.login_name}"
  48. -       printf 'chown %q %q\n' \
  49. -               "${curruser.uid}:${curruser.gid}" \
  50. -               "${curruser.homedir}"
  51. +       case "$os" in
  52. +               'linux')
  53. +                       printf 'mkdir -p %q\n' "${curruser.homedir}"
  54. +                       printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
  55. +                               "${curruser.uid}" \
  56. +                               "${curruser.gid}" \
  57. +                               "${gidlist}" \
  58. +                               "${curruser.shell}" \
  59. +                               "${curruser.login_name}"
  60. +                       printf 'chown %q %q\n' \
  61. +                               "${curruser.uid}:${curruser.gid}" \
  62. +                               "${curruser.homedir}"
  63. +               ;;
  64. +               'solaris' | 'illumos')
  65. +                       printf 'mkdir -p %q\n' "/export/${curruser.homedir}"
  66. +                       printf 'printf "%s\\tlocalhost:/export/home/%s\\n" >>"/etc/auto_home"\n' \
  67. +                               "${curruser.login_name}" \
  68. +                               "${curruser.login_name}"
  69. +                       printf 'useradd -u %s -g %s -G %q -s %q %q\n' \
  70. +                               "${curruser.uid}" \
  71. +                               "${curruser.gid}" \
  72. +                               "${gidlist}" \
  73. +                               "${curruser.shell}" \
  74. +                               "${curruser.login_name}"
  75. +                       printf 'chown %q %q\n' \
  76. +                               "${curruser.uid}:${curruser.gid}" \
  77. +                               "/export/${curruser.homedir}"
  78. +               ;;
  79. +       esac
  80.  
  81.         return 0
  82.  }
  83. @@ -292,12 +312,14 @@ function convert_curruser2linuxscript
  84.         #
  85.         # Generate Linux script from collected "account_data"
  86.         #
  87. -       accountdata2linuxscript account_data
  88. +       accountdata2linuxscript "${cfg.os}" account_data
  89.  
  90.         #
  91.         # Print NFSv4 server config
  92.         #
  93. -       print_nfs4_server_config cfg
  94. +       if [[ "${cfg.os}" == 'linux' ]] ; then
  95. +               print_nfs4_server_config cfg
  96. +       fi
  97.  
  98.         #
  99.         # Done
  100. @@ -363,7 +385,7 @@ function convert_givenuser2linuxscript
  101.         #
  102.         # Generate Linux script from collected "account_data"
  103.         #
  104. -       accountdata2linuxscript account_data
  105. +       accountdata2linuxscript "${cfg.os}" account_data
  106.  
  107.         #
  108.         # Print NFSv4 server config
  109. @@ -384,13 +406,15 @@ function main
  110.  
  111.         # fixme: Need better text layout for $ cygwinaccount2nfs4account --man #
  112.         typeset -r cygwinaccount2nfs4account_usage=$'+
  113. -       [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2024-12-10 \$\n]
  114. +       [-?\n@(#)\$Id: cygwinaccount2nfs4account (Roland Mainz) 2025-03-19 \$\n]
  115.         [-author?Roland Mainz <roland.mainz@nrubsig.org>]
  116.         [+NAME?cygwinaccount2nfs4account - convert Cygwin user/group account
  117.                 info to Linux/UNIX NFSv4 server account data]
  118.         [+DESCRIPTION?\bcygwinaccount2nfs4account\b convert Cygwin user/group account
  119.                 info to Linux/UNIX NFSv4 server account data.]
  120.         [D:debug?Enable debugging.]
  121. +       [O:os?Operating system, either \blinux\b, \bsolaris\b or
  122. +               \billumos\b).]:[os]
  123.  
  124.         --man
  125.  
  126. @@ -413,6 +437,9 @@ function main
  127.                         'D')
  128.                                 c.debug=true
  129.                                 ;;
  130. +                        'O')
  131. +                               typeset c.os="${OPTARG}"
  132. +                               ;;
  133.                         *)
  134.                                 usage "${progname}" "${cygwinaccount2nfs4account_usage}"
  135.                                 return $?
  136. @@ -427,6 +454,17 @@ function main
  137.                 unset c.args[$i]
  138.         done
  139.  
  140. +       if [[ ! -v c.os ]] ; then
  141. +               print -u2 -f $"%s: Require -O <operating-system>\n"
  142. +               return 1
  143. +       fi
  144. +
  145. +       if [[ "${c.os}" != ~(Elr)(linux|solaris|illumos) ]] ; then
  146. +               print -u2 -f $"%s: Unsuppoted -O value %q, supported are 'linux', 'solaris', 'illumos'\n" \
  147. +                       "${c.os}"
  148. +               return 1
  149. +       fi
  150. +
  151.         #
  152.         # c.args mighth be a sparse array (e.g. "([1]=aaa [2]=bbb [4]=ccc)")
  153.         # right now after we removed processed options/arguments.
  154. --
  155. 2.45.1
  156.  
  157. From 6e20d02c7f90c47502931fd4ab9b37d24562d4fa Mon Sep 17 00:00:00 2001
  158. From: Roland Mainz <roland.mainz@nrubsig.org>
  159. Date: Wed, 19 Mar 2025 15:24:49 +0100
  160. Subject: [PATCH 2/2] tests: Update Solaris 11.4+Illumos MFSv4.1 server setup
  161.  instructions
  162.  
  163. Update Solaris 11.4+Illumos MFSv4.1 server setup instructions
  164. per testing, mailinglist and IRC feedback.
  165.  
  166. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  167. ---
  168. tests/nfs_server_setup.txt | 24 +++++++++++++++++++-----
  169.  1 file changed, 19 insertions(+), 5 deletions(-)
  170.  
  171. diff --git a/tests/nfs_server_setup.txt b/tests/nfs_server_setup.txt
  172. index a4ff027..e8340c9 100644
  173. --- a/tests/nfs_server_setup.txt
  174. +++ b/tests/nfs_server_setup.txt
  175. @@ -51,13 +51,19 @@ printf "server 10.49.0.5\n" >/etc/inet/ntp.conf
  176.  svcadm enable ntp
  177.  
  178.  # configure&start NFS server
  179. +svcadm enable network/nfs/mapid
  180.  svcadm enable network/nfs/server
  181.  sharectl set -p nfsmapid_domain=global.loc nfs
  182.  sharectl set -p server_delegation=on nfs
  183. +
  184. +# prepare test share
  185.  mkdir /nfsdata
  186.  chmod a+rwx /nfsdata
  187. -share -F nfs -o rw /nfsdata/
  188. -svcs svc:/network/nfs/server:default
  189. +share -p -F nfs -o rw /nfsdata
  190. +
  191. +# verify whether mapid and nfs/server are running
  192. +svcs network/nfs/mapid
  193. +svcs network/nfs/server
  194.  
  195.  # performance: disable sync/ZIL on ZFS pool which exports NFS files
  196.  zfs set sync=disabled rpool
  197. @@ -77,7 +83,7 @@ See https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/man
  198.  
  199.  #
  200.  # Illumos NFSv4.1 server setup
  201. -# (similar to Solaris 11)
  202. +# (similar to Solaris 11.4)
  203.  #
  204.  
  205.  ##### 1. Server setup
  206. @@ -87,14 +93,22 @@ svcadm enable ntp
  207.  svcadm restart ntp
  208.  
  209.  # configure&start NFS server
  210. +svcadm enable network/nfs/mapid
  211.  svcadm enable network/nfs/server
  212.  sharectl set -p nfsmapid_domain=global.loc nfs
  213.  sharectl set -p server_delegation=on nfs
  214.  sharectl set -p server_versmax=4.1 nfs
  215. +
  216. +# prepare test share
  217.  mkdir /nfsdata
  218.  chmod a+rwx /nfsdata
  219. -share -F nfs -o rw /nfsdata/
  220. -svcs svc:/network/nfs/server:default
  221. +share -p -F nfs -o rw /nfsdata
  222. +
  223. +# verify whether mapid and nfs/server are running
  224. +svcs network/nfs/mapid
  225. +svcs network/nfs/server
  226. +
  227. +# restarting network/nfs/server only restores shares in /etc/dfs/dfstab
  228.  
  229.  # performance: disable sync/ZIL on ZFS pool which exports NFS files
  230.  zfs set sync=disabled rpool
  231. --
  232. 2.45.1

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.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at