xref: /netbsd-src/external/bsd/am-utils/dist/README.sun2amd (revision a53f50b9b44dc9467ccc9c464999b1d1c509cb0c)
1		Sun-style Automounter Syntax Support in Amd
2		       Last updated: October 10, 2005
3
4
5* Summary
6
7The goal of this effort is to provide a drop in replacement for the Sun
8automounter.  This is implemented in two ways.  (1) A new parser built into
9Amd.  (2) a standalone sun2amd Unix filter tool that can convert Sun-style
10maps to Amd maps.
11
12Support for Sun-style maps in Amd (including this document) is a
13work-in-progress.  This feature as a whole has not been throughly tested and
14is "alpha" quality as of the date posted at the top of this document.
15
16* Status
17
18Currently sun2amd supports most of the basic syntax features of Sun maps.
19However, support for Sun auto.master maps does not yet exists at any level.
20Below is a list of supported and not-yet supported features.
21
221. Supported Sun map features:
23
24- Simple map entry format: <key> [mount_options] location ...
25	locations take the form of host:pathname
26
27- Map Key Substitution: <key> <hostname>:/tmp/&
28	the & expands to <key>
29
30- Wildcard Key: * <hostname>:/tmp
31	This is is a catch-all entry.
32
33- Variable Substitution:
34	$ARCH, $CPU, $HOST, $OSNAME, $OSREL, $OSVERS, $NATISA
35
36- Multiple Mount format:
37	<key> [mount_options] [mountpoint] [mount-options locations...]...
38
39	ex.
40		pluto -ro /tmp1 host1:/tmp1 /tmp2 host2:/tmp2
41
42- HSFS file-system (cdrom): <key> -fstype=hsfs,ro :/dev/cdrom
43
44
452. Not-yet supported Sun map features:
46
47- Replicated File Systems: <hostname>,<hostname>...:<pathname>
48	This is a feature of Solaris that allows a user to specify a
49	set of hosts to appear as one in a map entry.  When a host
50	does not respond the kernel will switch to an alternate
51	server.  Amd will supports the syntax for replicated file
52	systems by creating multiple hosts, however, Amd will not
53	perform any kind of fail over.
54
55- CacheFS (although Amd supports type:=cachefs, sun2amd doesn't yet parse
56  it).
57
58- AutoFS (although Amd supports Autofs mounts and type:=auto, sun2amd
59  may not parse it fully).
60
61- Included maps: +<map_name>
62	This will include the contents of a map into another map.
63
64- Sun master maps: auto.master
65	Amd still relies and amd.conf.  Any feature in auto.master
66        must be duplicated using Amd equivalent features in amd.conf.
67
68- /net mount point:
69	The automounter is suppose to dynamically create map entries
70        under this mount point corresponding to NFS server(s) exported
71        file systems.  While this isn't parser by sun2amd, Amd does support
72	host maps (type:=host).
73
74- Federated Naming Service (FNS) (-xfn):
75	A naming server that wraps a number of other naming service
76        under one interface.
77
78- "-null" map option: A way to cancel maps in the auto.master file.
79
80- nsswitch.conf:
81	This file provides a way to specify what lookup service to use
82        for a number of systems including Sun's automounter.  In amd
83        lookup services for map files are define in the amd.conf file.
84
85
86* Setup
87
88To enable Sun-style maps in Amd, set "sun_map_syntax = yes" in your amd.conf
89file.  When this flag is set in [global], all maps read by Amd are assumed
90to be Sun style maps.  You can set this on a per map basis, thus mixing
91Sun-style and Amd-style maps.  For more information about amd.conf please
92see the Amd documentation.
93
94Example:
95
96# file: amd.conf
97################
98[ global ]
99sun_map_syntax = yes
100
101[ /home ]
102map_name = /etc/amd.sun_map
103map_type = file
104
105
106* sun2amd command line utility
107
108In addition to build-in Amd support there also exists the sun2amd command
109line utility that converts Sun maps to Amd maps.  This can be useful in
110migrating one or more Sun maps to the Amd syntax in one step.
111
112Example usage:
113
114$ sun2amd -i sun_map -o amd_map
115
116This line tells sun2amd to read the file sun_map and redirect its output to
117a file called amd_map.  By default sun2amd reads from stdin and writes to
118stdout (i.e., traditional Unix filter).
119
120
121* FAQ
122
123Q1: I know "/net" is not supported, but how can I achieve the same
124    functionality with Amd?
125
126A1: In short, you must create the '/net' entry as a Amd entry of type host
127    by hand.  Below is an example of how to do this.  See the Amd
128    documentation on type autofs for more information.
129
130Example:
131
132# file: amd.conf
133################
134[ /net ]
135map_name = /etc/amd.net
136
137# file: /etc/amd.net
138###############
139/defaults  fs:=${autodir}/${rhost}/root/${rfs}
140*          rhost:=${key};type:=host;rfs:=/
141
142(more FAQ entries to come...)
143