comparison sbin/ftjail @ 380:6be930eb7490

Implement the "fzfs create-tree" command
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 20 Feb 2023 00:43:30 +0100
parents b4173e88c57c
children 84d2735fe7f6
comparison
equal deleted inserted replaced
379:b4173e88c57c 380:6be930eb7490
38 38
39 populate-tmpl -L|-P DIRECTORY BASETXZ 39 populate-tmpl -L|-P DIRECTORY BASETXZ
40 40
41 snapshot-tmpl BASE-RO SKELETON-RW SNAPSHOT-NAME 41 snapshot-tmpl BASE-RO SKELETON-RW SNAPSHOT-NAME
42 42
43 copy-skel [-A] [-L] [-M MOUNTPOINT] [-P] [-u] SOURCE-DS SNAPSHOT-NAME TARGET-DS 43 copy-skel [-A] [-D] [-L] [-M MOUNTPOINT] [-P] [-u] SOURCE-DS SNAPSHOT-NAME TARGET-DS
44 44
45 build-etcupdate-current-tmpl DIRECTORY TARBALL 45 build-etcupdate-current-tmpl DIRECTORY TARBALL
46 46
47 freebsd-update [-k] [-o OLD-ORIGIN] DIRECTORY NEW-ORIGIN [ETCUPDATE-TARBALL] 47 freebsd-update [-k] [-o OLD-ORIGIN] DIRECTORY NEW-ORIGIN [ETCUPDATE-TARBALL]
48 48
767 #: 767 #:
768 #: Implementation of "copy-skel" 768 #: Implementation of "copy-skel"
769 #: 769 #:
770 command_copy_skel() { 770 command_copy_skel() {
771 local _ds_source _snapshot_name _ds_target 771 local _ds_source _snapshot_name _ds_target
772 local _opt_symlink _opt_nomount _opt_canmount _opt_mountpoint 772 local _opt_symlink _opt_nomount _opt_canmount _opt_mountpoint _opt_nodata
773 773
774 local _opt _name _relative_name _root_canmount 774 local _opt _name _relative_name _root_canmount
775 775
776 _opt_symlink="" 776 _opt_symlink=""
777 _opt_nomount="" 777 _opt_nomount=""
778 _opt_canmount="-o canmount=on" 778 _opt_canmount="-o canmount=on"
779 _opt_mountpoint="" 779 _opt_mountpoint=""
780 780 _opt_nodata=""
781 while getopts "ALM:Pu" _opt ; do 781
782 while getopts "ADLM:Pu" _opt ; do
782 case ${_opt} in 783 case ${_opt} in
783 A) 784 A)
784 _opt_canmount="-o canmount=noauto" 785 _opt_canmount="-o canmount=noauto"
786 ;;
787 D)
788 _opt_nodata="yes"
785 ;; 789 ;;
786 L) 790 L)
787 _opt_symlink="yes" 791 _opt_symlink="yes"
788 ;; 792 ;;
789 M) 793 M)
802 done 806 done
803 shift $((OPTIND-1)) 807 shift $((OPTIND-1))
804 OPTIND=1 808 OPTIND=1
805 809
806 [ -z "${_opt_symlink}" ] && { echo "ERROR: -L or -P must be given" 1>&2; return 2; } 810 [ -z "${_opt_symlink}" ] && { echo "ERROR: -L or -P must be given" 1>&2; return 2; }
811 [ \( "${_opt_nodata}" = "yes" \) -a \( "${_opt_symlink}" = "yes" \) ] && { echo "ERROR: -L and -D are incompatible" 1>&2; return 2; }
807 812
808 _ds_source="${1-}" 813 _ds_source="${1-}"
809 _snapshot_name="${2-}" 814 _snapshot_name="${2-}"
810 _ds_target="${3-}" 815 _ds_target="${3-}"
811 816