From 99b18a326cc18e9d0ce8fcc794082de6478966ed Mon Sep 17 00:00:00 2001 From: Jesus Alvarez Date: Thu, 12 Jun 2014 23:28:53 -0700 Subject: [PATCH] Remove systemd files from zfs-utils-lts --- zfs-utils-lts/50-zfs.preset | 2 - zfs-utils-lts/PKGBUILD | 14 -- zfs-utils-lts/zfs-import-cache.service | 11 -- zfs-utils-lts/zfs-import-scan.service | 11 -- zfs-utils-lts/zfs-mount.service | 15 -- zfs-utils-lts/zfs-share.service | 11 -- zfs-utils-lts/zfs-utils.bash-completion | 232 ------------------------ zfs-utils-lts/zfs-utils.service | 19 -- zfs-utils-lts/zfs.target | 7 - 9 files changed, 322 deletions(-) delete mode 100644 zfs-utils-lts/50-zfs.preset delete mode 100644 zfs-utils-lts/zfs-import-cache.service delete mode 100644 zfs-utils-lts/zfs-import-scan.service delete mode 100644 zfs-utils-lts/zfs-mount.service delete mode 100644 zfs-utils-lts/zfs-share.service delete mode 100644 zfs-utils-lts/zfs-utils.bash-completion delete mode 100644 zfs-utils-lts/zfs-utils.service delete mode 100644 zfs-utils-lts/zfs.target diff --git a/zfs-utils-lts/50-zfs.preset b/zfs-utils-lts/50-zfs.preset deleted file mode 100644 index 4efdd72..0000000 --- a/zfs-utils-lts/50-zfs.preset +++ /dev/null @@ -1,2 +0,0 @@ -# ZFS is enabled by default -enable zfs.* diff --git a/zfs-utils-lts/PKGBUILD b/zfs-utils-lts/PKGBUILD index 42da005..5a1b1f9 100644 --- a/zfs-utils-lts/PKGBUILD +++ b/zfs-utils-lts/PKGBUILD @@ -18,12 +18,6 @@ source=("http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.2.tar.gz "zfs-utils.bash-completion-r1" "zfs-utils.initcpio.install" "zfs-utils.initcpio.hook" - "zfs-import-cache.service" - "zfs-import-scan.service" - "zfs-mount.service" - "zfs-share.service" - "zfs.target" - "50-zfs.preset" ) md5sums=('0b183b0abdd5be287046ad9ce4f899fd' '9ddb0c8a94861f929d0fa741fdc49950' @@ -75,12 +69,4 @@ package() { install -D -m644 "${srcdir}"/zfs-utils.initcpio.hook "${pkgdir}"/usr/lib/initcpio/hooks/zfs install -D -m644 "${srcdir}"/zfs-utils.initcpio.install "${pkgdir}"/usr/lib/initcpio/install/zfs install -D -m644 "${srcdir}"/zfs-utils.bash-completion-r1 "${pkgdir}"/usr/share/bash-completion/completions/zfs - - # XXX: steal from the upstream master branch, should be removed in the future - install -D -m644 "${srcdir}"/zfs-import-cache.service "${pkgdir}"/usr/lib/systemd/system/zfs-import-cache.service - install -D -m644 "${srcdir}"/zfs-import-scan.service "${pkgdir}"/usr/lib/systemd/system/zfs-import-scan.service - install -D -m644 "${srcdir}"/zfs-mount.service "${pkgdir}"/usr/lib/systemd/system/zfs-mount.service - install -D -m644 "${srcdir}"/zfs-share.service "${pkgdir}"/usr/lib/systemd/system/zfs-share.service - install -D -m644 "${srcdir}"/zfs.target "${pkgdir}"/usr/lib/systemd/system/zfs.target - install -D -m644 "${srcdir}"/50-zfs.preset "${pkgdir}"/usr/lib/systemd/system-preset/50-zfs.preset } diff --git a/zfs-utils-lts/zfs-import-cache.service b/zfs-utils-lts/zfs-import-cache.service deleted file mode 100644 index ebcb97e..0000000 --- a/zfs-utils-lts/zfs-import-cache.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Import ZFS pools by cache file -DefaultDependencies=no -Requires=systemd-udev-settle.service -After=systemd-udev-settle.service -ConditionPathExists=/etc/zfs/zpool.cache - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/zpool import -c /etc/zfs/zpool.cache -aN diff --git a/zfs-utils-lts/zfs-import-scan.service b/zfs-utils-lts/zfs-import-scan.service deleted file mode 100644 index b40357b..0000000 --- a/zfs-utils-lts/zfs-import-scan.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Import ZFS pools by device scanning -DefaultDependencies=no -Requires=systemd-udev-settle.service -After=systemd-udev-settle.service -ConditionPathExists=!/etc/zfs/zpool.cache - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/zpool import -d /dev/disk/by-id -aN diff --git a/zfs-utils-lts/zfs-mount.service b/zfs-utils-lts/zfs-mount.service deleted file mode 100644 index 4819c7b..0000000 --- a/zfs-utils-lts/zfs-mount.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Mount ZFS filesystems -DefaultDependencies=no -Wants=zfs-import-cache.service -Wants=zfs-import-scan.service -Requires=systemd-udev-settle.service -After=systemd-udev-settle.service -After=zfs-import-cache.service -After=zfs-import-scan.service -Before=local-fs.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/zfs mount -a diff --git a/zfs-utils-lts/zfs-share.service b/zfs-utils-lts/zfs-share.service deleted file mode 100644 index c97b5c0..0000000 --- a/zfs-utils-lts/zfs-share.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=ZFS file system shares -After=nfs-server.service -After=smb.service -PartOf=nfs-server.service -PartOf=smb.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/zfs share -a diff --git a/zfs-utils-lts/zfs-utils.bash-completion b/zfs-utils-lts/zfs-utils.bash-completion deleted file mode 100644 index 1b9428b..0000000 --- a/zfs-utils-lts/zfs-utils.bash-completion +++ /dev/null @@ -1,232 +0,0 @@ -# Copyright (c) 2010, Aneurin Price - -# Permission is hereby granted, free of charge, to any person -# obtaining a copy of this software and associated documentation -# files (the "Software"), to deal in the Software without -# restriction, including without limitation the rights to use, -# copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following -# conditions: - -# The above copyright notice and this permission notice shall be -# included in all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. - -__zfs_get_commands() -{ - zfs 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq -} - -__zfs_get_properties() -{ - zfs get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all -} - -__zfs_get_editable_properties() -{ - zfs get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}' -} - -__zfs_get_inheritable_properties() -{ - zfs get 2>&1 | awk '$3 == "YES" {print $1}' -} - -__zfs_list_datasets() -{ - zfs list -H -o name -} - -__zfs_list_filesystems() -{ - zfs list -H -o name -t filesystem -} - -__zfs_list_snapshots() -{ - zfs list -H -o name -t snapshot -} - -__zfs_list_volumes() -{ - zfs list -H -o name -t volume -} - -__zfs_argument_chosen() -{ - for word in $(seq $((COMP_CWORD-1)) -1 2) - do - local prev="${COMP_WORDS[$word]}" - for property in $@ - do - if [ "x$prev" = "x$property" ] - then - return 0 - fi - done - done - return 1 -} - -__zfs_complete_ordered_arguments() -{ - local list1=$1 - local list2=$2 - local cur=$3 - local extra=$4 - if __zfs_argument_chosen $list1 - then - COMPREPLY=($(compgen -W "$list2 $extra" -- "$cur")) - else - COMPREPLY=($(compgen -W "$list1 $extra" -- "$cur")) - fi -} - -__zfs_complete() -{ - local cur prev cmd cmds - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - cmd="${COMP_WORDS[1]}" - cmds=$(__zfs_get_commands) - - if [ "${prev##*/}" = "zfs" ] - then - COMPREPLY=($(compgen -W "$cmds -?" -- "$cur")) - return 0 - fi - - case "${cmd}" in - clone) - __zfs_complete_ordered_arguments "$(__zfs_list_snapshots)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur - return 0 - ;; - get) - __zfs_complete_ordered_arguments "$(__zfs_get_properties)" "$(__zfs_list_datasets)" "$cur" "-H -r -p" - return 0 - ;; - inherit) - __zfs_complete_ordered_arguments "$(__zfs_get_inheritable_properties)" "$(__zfs_list_datasets)" $cur - return 0 - ;; - list) - if [ "x$prev" = "x-o" ] - then - COMPREPLY=($(compgen -W "$(__zfs_get_properties)" -- "${cur##*,}")) - local existing_opts=$(expr "$cur" : '\(.*,\)') - if [ ! "x$existing_opts" = "x" ] - then - COMPREPLY=( "${COMPREPLY[@]/#/${existing_opts}}" ) - fi - else - COMPREPLY=($(compgen -W "$(__zfs_list_datasets) -H -r -o" -- "$cur")) - fi - return 0 - ;; - promote) - COMPREPLY=($(compgen -W "$(__zfs_list_filesystems)" -- "$cur")) - return 0 - ;; - rollback|send) - COMPREPLY=($(compgen -W "$(__zfs_list_snapshots)" -- "$cur")) - return 0 - ;; - snapshot) - COMPREPLY=($(compgen -W "$(__zfs_list_filesystems) $(__zfs_list_volumes)" -- "$cur")) - return 0 - ;; - set) - __zfs_complete_ordered_arguments "$(__zfs_get_editable_properties)" "$(__zfs_list_filesystems) $(__zfs_list_volumes)" $cur - return 0 - ;; - *) - COMPREPLY=($(compgen -W "$(__zfs_list_datasets)" -- "$cur")) - return 0 - ;; - esac - -} - -__zpool_get_commands() -{ - zpool 2>&1 | awk '/^\t[a-z]/ {print $1}' | uniq -} - -__zpool_get_properties() -{ - zpool get 2>&1 | awk '$2 == "YES" || $2 == "NO" {print $1}'; echo all -} - -__zpool_get_editable_properties() -{ - zpool get 2>&1 | awk '$2 == "YES" {printf("%s=\n", $1)}' -} - -__zpool_list_pools() -{ - zpool list -H -o name -} - -__zpool_complete() -{ - local cur prev cmd cmds - COMPREPLY=() - cur="${COMP_WORDS[COMP_CWORD]}" - prev="${COMP_WORDS[COMP_CWORD-1]}" - cmd="${COMP_WORDS[1]}" - cmds=$(__zpool_get_commands) - - if [ "${prev##*/}" = "zpool" ] - then - COMPREPLY=($(compgen -W "$cmds" -- "$cur")) - return 0 - fi - - case "${cmd}" in - get) - __zfs_complete_ordered_arguments "$(__zpool_get_properties)" "$(__zpool_list_pools)" $cur - return 0 - ;; - import) - if [ "x$prev" = "x-d" ] - then - _filedir -d - else - COMPREPLY=($(compgen -W "$(__zpool_list_pools) -d" -- "$cur")) - fi - return 0 - ;; - set) - __zfs_complete_ordered_arguments "$(__zpool_get_editable_properties)" "$(__zpool_list_pools)" $cur - return 0 - ;; - add|attach|clear|create|detach|offline|online|remove|replace) - local pools="$(__zpool_list_pools)" - if __zfs_argument_chosen $pools - then - _filedir - else - COMPREPLY=($(compgen -W "$pools" -- "$cur")) - fi - return 0 - ;; - *) - COMPREPLY=($(compgen -W "$(__zpool_list_pools)" -- "$cur")) - return 0 - ;; - esac - -} - -complete -F __zfs_complete zfs -complete -o filenames -F __zpool_complete zpool diff --git a/zfs-utils-lts/zfs-utils.service b/zfs-utils-lts/zfs-utils.service deleted file mode 100644 index d7a4a50..0000000 --- a/zfs-utils-lts/zfs-utils.service +++ /dev/null @@ -1,19 +0,0 @@ -[Unit] -Description=Zettabyte File System (ZFS) -Documentation=man:zfs(8) man:zpool(8) -DefaultDependencies=no -After=cryptsetup.target -Before=local-fs.target -Conflicts=shutdown.target umount.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/modprobe zfs -ExecStart=/usr/bin/zpool import -c /etc/zfs/zpool.cache -aN -ExecStart=/usr/bin/zfs mount -a -ExecStart=/usr/bin/zfs share -a -ExecStop=/usr/bin/zfs umount -a - -[Install] -WantedBy=local-fs.target diff --git a/zfs-utils-lts/zfs.target b/zfs-utils-lts/zfs.target deleted file mode 100644 index 7d46487..0000000 --- a/zfs-utils-lts/zfs.target +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=ZFS startup target -Requires=zfs-mount.service -Requires=zfs-share.service - -[Install] -WantedBy=multi-user.target