Gentoo Archives: gentoo-commits

From: "Naohiro Aota (naota)" <naota@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sys-freebsd/freebsd-cddl/files: zvol.initd-9.0
Date: Sat, 12 May 2012 07:57:27
Message-Id: 20120512075713.56C0F2004C@flycatcher.gentoo.org
1 naota 12/05/12 07:57:13
2
3 Added: zvol.initd-9.0
4 Log:
5 Remove no more supported command "zfs volinit" from the init script for -9.0.
6
7 (Portage version: 2.2.0_alpha100/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 sys-freebsd/freebsd-cddl/files/zvol.initd-9.0
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0?rev=1.1&content-type=text/plain
14
15 Index: zvol.initd-9.0
16 ===================================================================
17 #!/sbin/runscript
18 # Copyright 1999-2012 Gentoo Foundation
19 # Distributed under the terms of the GNU General Public License v2
20 # $Header: /var/cvsroot/gentoo-x86/sys-freebsd/freebsd-cddl/files/zvol.initd-9.0,v 1.1 2012/05/12 07:57:13 naota Exp $
21
22 depend() {
23 need hostid
24 before fsck
25 }
26
27 start() {
28 einfo "Starting zfs volumes..."
29 eend $?
30 # Enable swap on ZVOLs that have org.freebsd:swap=on.
31 zfs list -H -o org.freebsd:swap,name -t volume | \
32 while read state name; do
33 case "${state}" in
34 [oO][nN])
35 einfo "Enabling swap on zvol ${name}"
36 swapon /dev/zvol/${name}
37 eend $?
38 ;;
39 esac
40 done
41 }
42
43 stop() {
44 # Disable what we had enabled before.
45 zfs list -H -o org.freebsd:swap,name -t volume | \
46 while read state name; do
47 case "${state}" in
48 [oO][nN])
49 einfo "Disabling swap on zvol ${name}"
50 swapoff /dev/zvol/${name}
51 eend $?
52 ;;
53 esac
54 done
55 einfo "Stopping zfs volumes..."
56 eend $?
57 }
58
59 restart() {
60 :
61 }