blob: c40ea35d768bcda09eec01aad2e891ae8155f491 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
--- Completion/Unix/Command/_mount.orig Sun Jun 3 22:30:24 2001
+++ Completion/Unix/Command/_mount Sun Jun 3 22:30:32 2001
@@ -365,6 +365,52 @@
'onerror[set behaviour on error]:behaviour on error:(panic lock umount repair)'
)
;;
+ freebsd*)
+ _fs_any=(
+ '(sync)async[do all I/O asynchronously]'
+ 'current[use current options on already mounted file system]'
+ 'force[force R/W mount of unclean filesystem]'
+ 'fstab[use options listed in /etc/fstab]'
+ 'noasync[do I/O synchronously]'
+ 'noatime[don'"'"'t update access time]'
+ 'noauto[can only be mounted explicitly]'
+ 'noclusterr[disable read clustering]'
+ 'noclusterw[disable write clustering]'
+ 'nodev[don'"'"'t interpret devices]'
+ 'noexec[don'"'"'t allow execution of binaries]'
+ 'nosuid[ignore suid and sgid bits]'
+ 'nosymfollow[don'"'"'t follow symlinks]'
+ 'rdonly[mount file system read-only]'
+ '(async)sync[do all I/O synchronously]'
+ 'suiddir[allow suid bits on directories]'
+ 'update[change status of already mounted filesystem]'
+ 'union[cause the namespace at the mount point to appear as the union of the mounted filesystem and the existing directory]'
+ )
+ _fs_iso9660=(
+ 'extatt[enable use of extended attributes]'
+ 'gens[don'"'"'t strip version number on files]'
+ 'joliet[don'"'"'t use any Joliet extensions]'
+ 'rrip[don'"'"'t use any Rockridge extensions]'
+ 'strictjoliet[relax checking for Supplementary Volume Descriptor Flags field which is set to a wrong value on some Joliet formatted disks]'
+ )
+ _fs_std=(
+ 'nodev[don'"'"'t interpret devices]'
+ 'noexec[don'"'"'t allow execution of binaries]'
+ 'nosuid[ignore suid and sgid bits]'
+ 'rdonly[mount file system read-only]'
+ 'union[cause the namespace at the mount point to appear as the union of the mounted filesystem and the existing directory]'
+ )
+ _fs_devfs=( "$_fs_std[@]" )
+ _fs_fdesc=( "$_fs_std[@]" )
+ _fs_kernfs=( "$_fs_std[@]" )
+ _fs_linprocfs=( "$_fs_std[@]" )
+ _fs_procfs=( "$_fs_std[@]" )
+ _fs_msdos=(
+ 'shortnames[]'
+ 'longnames[]'
+ 'nowin95[]'
+ )
+ ;;
esac
fi
@@ -475,6 +521,25 @@
deffs=hsfs
typeops=-F
;;
+ freebsd*)
+ args=( -s
+ '-a[mount all filesystems in fstab]'
+ '-d[cause everything to be done except for the actual system call]'
+ '-f[forced mount]'
+ '-o[specify file system options]:file system option:->fsopt'
+ '-p[print mounted file systems]'
+ '-r[mount readonly]'
+ '-t[specify file system type]:file system type:->fstype'
+ '-u[change status of already mounted filesystem]'
+ '-v[verbose mode]'
+ '-w[mount read/write]'
+ ':dev or dir:->devordir'
+ ':mount point:_files -/'
+ )
+ fss=( cd9660 devfs ext2fs fdesc kernfs linprocfs mfs msdos nfs
+ ntfs null nwfs portal procfs std ufs umap union )
+ deffs=ufs
+ ;;
*)
# Default for all other systems. Dunno.
@@ -517,6 +582,17 @@
'-v[verbose]'
)
;;
+ freebsd*)
+ args=(
+ '-a[unmount all mounted file systems]'
+ '-A[unmount all mounted file systems except the root]'
+ '-f[force unmount]'
+ '-h[unmount all filesystems associated with host]:hostnames:_hosts'
+ '-t[unmount all filesystems of specified type]:file system type:->fstype'
+ '-v[verbose mode]'
+ '*:dev or dir:->udevordir'
+ )
+ ;;
*)
args=( \
'-h[show help]'
@@ -553,20 +629,55 @@
if (( $+opt_args[-a] )); then
_message "no device or directory with option \`-a'"
else
- _alternative \
- 'devices:device:{compadd "$expl[@]" /dev/*}' \
- 'directories:mount point:_files -/' && ret=0
+ local dev_tmp mp_tmp mline
+
+ case "$OSTYPE" in
+ freebsd*)
+ while read mline; do
+ case $mline[(w)1] in
+ \#* )
+ ;;
+ proc)
+ ;;
+ *)
+ [[ $mline[(w)3] == swap ]] || \
+ dev_tmp=( $dev_tmp $mline[(w)1] ) \
+ mp_tmp=( $mp_tmp $mline[(w)2] )
+ ;;
+ esac
+ done < /etc/fstab
+
+ _alternative \
+ 'devices:device:compadd -a dev_tmp' \
+ 'directories:mount point:compadd -a mp_tmp' && ret=0
+ ;;
+ *)
+ _alternative \
+ 'devices:device:{compadd "$expl[@]" /dev/*}' \
+ 'directories:mount point:_files -/' && ret=0
+ ;;
+ esac
fi
;;
udevordir)
if (( $+opt_args[-a] )); then
_message "no device or directory with option \`-a'"
else
- local dev_tmp mp_tmp
+ local dev_tmp mp_tmp mline
- tmp=( "${(@f)$(< /etc/mtab)}" )
- dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
- mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
+ case "$OSTYPE" in
+ freebsd*)
+ /sbin/mount | while read mline; do
+ dev_tmp=( $dev_tmp $mline[(w)1] )
+ mp_tmp=( $mp_tmp $mline[(w)3] )
+ done
+ ;;
+ *)
+ tmp=( "${(@f)$(< /etc/mtab)}" )
+ dev_tmp=( "${(@)${(@)tmp%% *}:#none}" )
+ mp_tmp=( "${(@)${(@)tmp#* }%% *}" )
+ ;;
+ esac
_alternative \
'devices:device:compadd -a dev_tmp' \
|