Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/files/, sys-fs/lvm2/
Date: Mon, 27 Apr 2020 00:50:30
Message-Id: 1587948566.512c60d6f092070e2fab9dfed8fa28a9e05dc591.whissi@gentoo
1 commit: 512c60d6f092070e2fab9dfed8fa28a9e05dc591
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 27 00:49:05 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 27 00:49:26 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=512c60d6
7
8 sys-fs/lvm2: use latest runscript
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 sys-fs/lvm2/files/lvm.rc-2.03.05 | 132 ---------------------------------------
14 sys-fs/lvm2/lvm2-2.03.09.ebuild | 2 +-
15 2 files changed, 1 insertion(+), 133 deletions(-)
16
17 diff --git a/sys-fs/lvm2/files/lvm.rc-2.03.05 b/sys-fs/lvm2/files/lvm.rc-2.03.05
18 deleted file mode 100644
19 index 7b7d90b9826..00000000000
20 --- a/sys-fs/lvm2/files/lvm.rc-2.03.05
21 +++ /dev/null
22 @@ -1,132 +0,0 @@
23 -#!/sbin/openrc-run
24 -# Copyright 1999-2019 Gentoo Authors
25 -# Distributed under the terms of the GNU General Public License v2
26 -
27 -_get_lvm_path() {
28 - local lvm_path=
29 - for lvm_path in /bin/lvm /sbin/lvm ; do
30 - [ -x "$lvm_path" ] && break
31 - done
32 - echo "${lvm_path}"
33 -}
34 -
35 -_need_lvmlockd()
36 -{
37 - local lvm_path="$(_get_lvm_path)"
38 - [ ! -x "${lvm_path}" ] && return 1
39 - ${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
40 -}
41 -
42 -depend() {
43 - before checkfs fsck
44 - after modules device-mapper
45 - config /etc/lvm/lvm.conf
46 - local _need=
47 - if service_started; then
48 - _need=$(service_get_value need)
49 - else
50 - if _need_lvmlockd; then
51 - _need="${_need} lvmlockd"
52 - fi
53 - fi
54 - # Make sure you review /etc/conf.d/lvm as well!
55 - # Depending on your system, it might also introduce udev & mdraid
56 - need sysfs ${_need}
57 -}
58 -
59 -config='global { locking_dir = "/run/lock/lvm" }'
60 -
61 -dm_in_proc() {
62 - local retval=0
63 - for x in devices misc ; do
64 - grep -qs 'device-mapper' /proc/${x}
65 - retval=$((${retval} + $?))
66 - done
67 - return ${retval}
68 -}
69 -
70 -start() {
71 - # LVM support for /usr, /home, /opt ....
72 - # This should be done *before* checking local
73 - # volumes, or they never get checked.
74 -
75 - # NOTE: Add needed modules for LVM or RAID, etc
76 - # to /etc/modules.autoload if needed
77 - lvm_path="$(_get_lvm_path)"
78 - for lvm_path in /bin/lvm /sbin/lvm ; do
79 - [ -x "$lvm_path" ] && break
80 - done
81 - if [ ! -x "$lvm_path" ]; then
82 - eerror "Cannot find lvm binary in /sbin or /bin!"
83 - return 1
84 - fi
85 - if [ -z "${CDBOOT}" ] ; then
86 - if [ -e /proc/modules ] && ! dm_in_proc ; then
87 - modprobe dm-mod 2>/dev/null
88 - fi
89 - if [ -d /proc/lvm ] || dm_in_proc ; then
90 - ebegin "Setting up the Logical Volume Manager"
91 - #still echo stderr for debugging
92 - lvm_commands="#!${lvm_path}\n"
93 - # Extra PV find pass because some devices might not have been available until very recently
94 - lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
95 - # Now make the nodes
96 - lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
97 - # And turn them on!
98 - lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
99 - if _need_lvmlockd; then
100 - # Start lockd VGs as required
101 - lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
102 - fi
103 - # Order of this is important, have to work around dash and LVM readline
104 - printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
105 - eend $? "Failed to setup the LVM"
106 - fi
107 - fi
108 -}
109 -
110 -stop() {
111 - for lvm_path in /bin/lvm /sbin/lvm ; do
112 - [ -x "$lvm_path" ] && break
113 - done
114 - if [ ! -x "$lvm_path" ]; then
115 - eerror "Cannot find lvm binary in /sbin or /bin!"
116 - return 1
117 - fi
118 -
119 - # Stop LVM2
120 - if [ -x /sbin/vgs ] && \
121 - [ -x /sbin/vgchange ] && \
122 - [ -x /sbin/lvchange ] && \
123 - [ -f /etc/lvmtab -o -d /etc/lvm ] && \
124 - [ -d /proc/lvm -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
125 - then
126 - einfo "Shutting down the Logical Volume Manager"
127 -
128 - VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
129 -
130 - if [ "$VGS" ]
131 - then
132 - local _ending="eend"
133 - [ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
134 - ebegin " Shutting Down LVs & VGs"
135 - #still echo stderr for debugging
136 - lvm_commands="#!${lvm_path}\n"
137 - # Extra PV find pass because some devices might not have been available until very recently
138 - lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
139 - # Now make the nodes
140 - lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
141 - # Order of this is important, have to work around dash and LVM readline
142 - printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
143 - rc=$?
144 - msg="Failed (possibly some LVs still needed for /usr or root)"
145 - [ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
146 - ${_ending} $rc "${msg}"
147 - fi
148 -
149 - einfo "Finished shutting down the Logical Volume Manager"
150 - return 0
151 - fi
152 -}
153 -
154 -# vim:ts=4
155
156 diff --git a/sys-fs/lvm2/lvm2-2.03.09.ebuild b/sys-fs/lvm2/lvm2-2.03.09.ebuild
157 index 17bc946ea78..40418f6bae3 100644
158 --- a/sys-fs/lvm2/lvm2-2.03.09.ebuild
159 +++ b/sys-fs/lvm2/lvm2-2.03.09.ebuild
160 @@ -211,7 +211,7 @@ src_install() {
161
162 if use !device-mapper-only ; then
163 newinitd "${FILESDIR}"/dmeventd.initd-2.02.184-r2 dmeventd
164 - newinitd "${FILESDIR}"/lvm.rc-2.03.05 lvm
165 + newinitd "${FILESDIR}"/lvm.rc-2.02.187 lvm
166 newconfd "${FILESDIR}"/lvm.confd-2.02.184-r3 lvm
167 if ! use udev ; then
168 # We keep the variable but remove udev from it.