Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison sbin/ftjail @ 239:23f37702a502
Creating datasets for base and skeleton
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Fri, 09 Sep 2022 21:48:29 +0200 |
| parents | 9b0d83703a28 |
| children | 04fde1941966 |
comparison
equal
deleted
inserted
replaced
| 238:9b0d83703a28 | 239:23f37702a502 |
|---|---|
| 120 # SKELETON NAME DRY-RUN | 120 # SKELETON NAME DRY-RUN |
| 121 # | 121 # |
| 122 command_datasets_tmpl_skel() { | 122 command_datasets_tmpl_skel() { |
| 123 local _p_base _name _dry_run | 123 local _p_base _name _dry_run |
| 124 | 124 |
| 125 local _ds_skel _child | 125 local _ds_skel _child _child_zfsopts |
| 126 | 126 |
| 127 _p_skel="${1-}" | 127 _p_skel="${1-}" |
| 128 _name="${2-}" | 128 _name="${2-}" |
| 129 _dry_run="${3-}" | 129 _dry_run="${3-}" |
| 130 | 130 |
| 158 # | 158 # |
| 159 # XXX FIXME: What about usr/ports/distfiles | 159 # XXX FIXME: What about usr/ports/distfiles |
| 160 # We typically want to use binary packages. | 160 # We typically want to use binary packages. |
| 161 # And if we use ports they are not in usr/ports typically. | 161 # And if we use ports they are not in usr/ports typically. |
| 162 # | 162 # |
| 163 # XXX FIXME: What about /home | 163 #zfs create -u -o canmount=off "${_ds_skel}/usr/ports" |
| 164 # | 164 # |
| 165 for _child in etc usr/local tmp var root ; do | 165 # XXX FIXME: What about home |
| 166 zfs create -u -o canmount=noauto "${_ds_skel}/${_child}" | 166 # |
| 167 for _child in etc home root tmp usr/local var ; do | |
| 168 case "${_child}" in | |
| 169 "tmp"|"var/tmp") | |
| 170 _child_zfsopts="-o sync=disabled -o setuid=off" | |
| 171 ;; | |
| 172 "home") | |
| 173 _child_zfsopts="-o setuid=off" | |
| 174 ;; | |
| 175 "usr/ports/distfiles") | |
| 176 _child_zfsopts="-o exec=off -o setuid=off -o compression=off -o primarycache=metadata" | |
| 177 ;; | |
| 178 "var/mail") | |
| 179 _child_zfsopts="-o atime=on -o exec=off -o setuid=off" | |
| 180 ;; | |
| 181 *) | |
| 182 _child_zfsopts="" | |
| 183 ;; | |
| 184 esac | |
| 185 zfs create -u -o canmount=noauto ${_child_zfsopts} "${_ds_skel}/${_child}" | |
| 167 done | 186 done |
| 168 } | 187 } |
| 169 | 188 |
| 170 | 189 |
| 171 # | 190 # |
