public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/musl:master commit in: sys-fs/lvm2/files/
@ 2020-04-27 12:45 Anthony G. Basile
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile @ 2020-04-27 12:45 UTC (permalink / raw
  To: gentoo-commits

commit:     d8d90c46de2431c9c848d58f6d3ef001fd3d17a3
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Sun Apr 26 10:05:00 2020 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Apr 27 12:44:51 2020 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=d8d90c46

sys-fs/lvm2: add missing rc script

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 sys-fs/lvm2/files/lvm.rc-2.02.187 | 173 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 173 insertions(+)

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.187 b/sys-fs/lvm2/files/lvm.rc-2.02.187
new file mode 100644
index 0000000..3468adc
--- /dev/null
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.187
@@ -0,0 +1,173 @@
+#!/sbin/openrc-run
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+_get_lvm_path() {
+	local lvm_path=
+	for lvm_path in /bin/lvm /sbin/lvm ; do
+		[ -x "${lvm_path}" ] && break
+	done
+	echo "${lvm_path}"
+}
+
+_use_lvmetad() {
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
+}
+
+_use_lvmlockd() {
+	local lvm_path="$(_get_lvm_path)"
+	[ ! -x "${lvm_path}" ] && return 1
+	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
+}
+
+depend() {
+	before checkfs fsck
+	after modules device-mapper
+	# We may want lvmetad based on the configuration. If we added lvmetad
+	# support while lvm2 is running then we aren't dependent on it. For the
+	# more common case, if its disabled in the config we aren't dependent
+	# on it.
+	config /etc/lvm/lvm.conf
+	local _want=
+
+	if service_started ; then
+		_want=$(service_get_value want)
+	else
+		if _use_lvmetad ; then
+			_want="${_want} lvmetad"
+		fi
+
+		if _use_lvmlockd ; then
+			_want="${_want} lvmlockd"
+		fi
+	fi
+
+	# Make sure you review /etc/conf.d/lvm as well!
+	# Depending on your system, it might also introduce udev & mdraid
+	need sysfs
+
+	if [ -n "${_want}" ] ; then
+		want ${_want}
+	fi
+}
+
+config='global { locking_dir = "/run/lock/lvm" }'
+
+dm_in_proc() {
+	local retval=0
+	for x in devices misc ; do
+		grep -qs 'device-mapper' /proc/${x}
+		retval=$((${retval} + $?))
+	done
+	return ${retval}
+}
+
+start() {
+	# LVM support for /usr, /home, /opt ....
+	# This should be done *before* checking local
+	# volumes, or they never get checked.
+
+	# NOTE: Add needed modules for LVM or RAID, etc
+	#       to /etc/modules.autoload if needed
+
+	lvm_path="$(_get_lvm_path)"
+	if [ -z "${lvm_path}" ] ; then
+		eerror "Failed to find lvm binary in /bin or /sbin!"
+		return 1
+	fi
+
+	if [ -z "${CDBOOT}" ] ; then
+		if [ -e /proc/modules ] && ! dm_in_proc ; then
+			ebegin "Trying to load dm-mod module"
+			modprobe dm-mod 2>/dev/null
+			eend $?
+		fi
+
+		if [ -d /proc/lvm ] || dm_in_proc ; then
+			local has_errors=0 verbose_command
+
+			yesno "${rc_verbose}" && verbose_command=" -v"
+
+			ebegin "Starting the Logical Volume Manager"
+
+			if _use_lvmetad ; then
+				# Extra PV find pass because some devices might not have been available until very recently
+				${lvm_path} pvscan${verbose_command} --config "${config}" --cache
+				[ $? -ne 0 ] && has_errors=1
+			fi
+
+			# Now make the nodes
+			${lvm_path} vgscan${verbose_command} --config "${config}" --mknodes
+			[ $? -ne 0 ] && has_errors=1
+
+			# Enable all VGs
+			${lvm_path} vgchange${verbose_command} --config "${config}" --sysinit --activate y
+			[ $? -ne 0 ] && has_errors=1
+
+			if _use_lvmlockd ; then
+				# Start lockd VGs as required
+				${lvm_path} vgchange${verbose_command} --config "${config}" --lock-start --lock-opt auto
+				[ $? -ne 0 ] && has_errors=1
+			fi
+
+			eend ${has_errors} "Failed to start the Logical Volume Manager"
+		fi
+	fi
+}
+
+start_post() {
+	local _want=
+	if _use_lvmetad ; then
+		_want="${_want} lvmetad"
+	fi
+
+	if _use_lvmlockd ; then
+		_want="${_want} lvmlockd"
+	fi
+
+	service_set_value want "${_want}"
+}
+
+stop() {
+	lvm_path="$(_get_lvm_path)"
+	if [ -z "${lvm_path}" ] ; then
+		eerror "Failed to find lvm binary in /bin or /sbin!"
+		return 1
+	fi
+
+	# Stop LVM2
+	if [ -f /etc/lvmtab -o -d /etc/lvm ] \
+		&& [ -d /proc/lvm  -o "$(grep device-mapper /proc/misc 2>/dev/null)" ]
+	then
+		local VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
+		if [ -z "${VGS}" ] ; then
+			# nothing to do for us
+			return 0
+		fi
+
+		local has_errors=0 verbose_command eend_cmd="eend"
+
+		yesno "${rc_verbose}" && verbose_command=" -v"
+
+		local msg="Failed to stop Logical Volume Manager"
+		if [ "${RC_RUNLEVEL}" = shutdown ] ; then
+			# failures on shutdown are non-fatal
+			eend_cmd="ewend"
+			msg="${msg} (possibly some LVs still needed for /usr or root)"
+		fi
+
+		ebegin "Stopping the Logical Volume Manager"
+
+		${lvm_path} vgchange${verbose_command} --config "${config}" --sysinit --activate n
+		[ $? -ne 0 ] && has_errors=1
+
+		${eend_cmd} ${has_errors} "${msg}"
+	fi
+
+	# at this point make sure we always exit without indicating an error
+	return 0
+}
+
+# vim:ts=4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/musl:master commit in: sys-fs/lvm2/files/
@ 2020-04-27 12:45 Anthony G. Basile
  0 siblings, 0 replies; 2+ messages in thread
From: Anthony G. Basile @ 2020-04-27 12:45 UTC (permalink / raw
  To: gentoo-commits

commit:     1869cd26ba6b5b19d011168f9f15170b77fcd7dc
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Sun Apr 26 11:07:21 2020 +0000
Commit:     Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Mon Apr 27 12:44:51 2020 +0000
URL:        https://gitweb.gentoo.org/proj/musl.git/commit/?id=1869cd26

sys-fs/lvm2: clean unused files

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>

 sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1        |  25 ----
 sys-fs/lvm2/files/lvm.confd-2.02.28-r2             |   5 -
 sys-fs/lvm2/files/lvm.rc-2.02.172                  | 149 --------------------
 sys-fs/lvm2/files/lvm.rc-2.02.184-r3               | 154 ---------------------
 ...183-implement-libc-specific-reopen_stream.patch |  24 ----
 5 files changed, 357 deletions(-)

diff --git a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1 b/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
deleted file mode 100644
index 930e84b..0000000
--- a/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-PIDFILE=/run/dmeventd.pid
-BIN=/sbin/dmeventd
-
-depend() {
-	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
-	# means dmeventd is NOT notified, as it cannot be safely running
-	after lvm device-mapper
-}
-
-start() {
-	ebegin "Starting dmeventd"
-	start-stop-daemon --start --exec $BIN --pidfile $PIDFILE
-	eend $?
-}
-
-stop() {
-	ebegin "Stopping dmeventd"
-	start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE
-	eend $?
-}
-

diff --git a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2 b/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
deleted file mode 100644
index 2fbd866..0000000
--- a/sys-fs/lvm2/files/lvm.confd-2.02.28-r2
+++ /dev/null
@@ -1,5 +0,0 @@
-# LVM should normally only be started after mdraid is available
-# this is because LVM physical volumes are very often MD devices.
-RC_AFTER="mdraid"
-
-# vim: ft=gentoo-conf-d

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.172 b/sys-fs/lvm2/files/lvm.rc-2.02.172
deleted file mode 100644
index 4bc363c..0000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.172
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-_get_lvm_path() {
-	local lvm_path=
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	echo "${lvm_path}"
-}
-
-_need_lvmetad()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
-}
-
-_need_lvmlockd()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
-}
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	# We may use lvmetad based on the configuration. If we added lvmetad
-	# support while lvm2 is running then we aren't dependent on it. For the
-	# more common case, if its disabled in the config we aren't dependent
-	# on it.
-	config /etc/lvm/lvm.conf
-	local _need=
-	if service_started; then
-		_need=$(service_get_value need)
-	else
-		if _need_lvmetad; then
-			_need="${_need} lvmetad"
-		fi
-		if _need_lvmlockd; then
-			_need="${_need} lvmlockd"
-		fi
-	fi
-	need sysfs ${_need}
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	lvm_path="$(_get_lvm_path)"
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#!${lvm_path}\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
-			if _need_lvmlockd; then
-				# Start lockd VGs as required
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
-			fi
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-start_post()
-{
-	# Save if we needed lvmetad
-	if _need_lvmetad; then
-		service_set_value need lvmetad
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-
-	# Stop LVM2
-	if [ -x /sbin/vgs ] && \
-		[ -x /sbin/vgchange ] && \
-		[ -x /sbin/lvchange ] && \
-		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
-		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-	then
-		einfo "Shutting down the Logical Volume Manager"
-
-		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-		if [ "$VGS" ]
-		then
-			local _ending="eend"
-			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
-			ebegin "  Shutting Down LVs & VGs"
-				#still echo stderr for debugging
-				lvm_commands="#!${lvm_path}\n"
-				# Extra PV find pass because some devices might not have been available until very recently
-				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Now make the nodes
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Order of this is important, have to work around dash and LVM readline
-				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			${_ending} $? "Failed (possibly some LVs still needed for /usr or root)"
-		fi
-
-		einfo "Finished shutting down the Logical Volume Manager"
-		return 0
-	fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.184-r3 b/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
deleted file mode 100644
index b48efb0..0000000
--- a/sys-fs/lvm2/files/lvm.rc-2.02.184-r3
+++ /dev/null
@@ -1,154 +0,0 @@
-#!/sbin/openrc-run
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-_get_lvm_path() {
-	local lvm_path=
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	echo "${lvm_path}"
-}
-
-_need_lvmetad()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmetad=1'
-}
-
-_need_lvmlockd()
-{
-	local lvm_path="$(_get_lvm_path)"
-	[ ! -x "${lvm_path}" ] && return 1
-	${lvm_path} dumpconfig global 2>/dev/null | grep -q 'use_lvmlockd=1'
-}
-
-depend() {
-	before checkfs fsck
-	after modules device-mapper
-	# We may use lvmetad based on the configuration. If we added lvmetad
-	# support while lvm2 is running then we aren't dependent on it. For the
-	# more common case, if its disabled in the config we aren't dependent
-	# on it.
-	config /etc/lvm/lvm.conf
-	local _need=
-	if service_started; then
-		_need=$(service_get_value need)
-	else
-		if _need_lvmetad; then
-			_need="${_need} lvmetad"
-		fi
-		if _need_lvmlockd; then
-			_need="${_need} lvmlockd"
-		fi
-	fi
-	# Make sure you review /etc/conf.d/lvm as well!
-	# Depending on your system, it might also introduce udev & mdraid
-	need sysfs ${_need}
-}
-
-config='global { locking_dir = "/run/lock/lvm" }'
-
-dm_in_proc() {
-	local retval=0
-	for x in devices misc ; do
-		grep -qs 'device-mapper' /proc/${x}
-		retval=$((${retval} + $?))
-	done
-	return ${retval}
-}
-
-start() {
-	# LVM support for /usr, /home, /opt ....
-	# This should be done *before* checking local
-	# volumes, or they never get checked.
-
-	# NOTE: Add needed modules for LVM or RAID, etc
-	#       to /etc/modules.autoload if needed
-	lvm_path="$(_get_lvm_path)"
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-	if [ -z "${CDBOOT}" ] ; then
-		if [ -e /proc/modules ] && ! dm_in_proc ; then
-			modprobe dm-mod 2>/dev/null
-		fi
-		if [ -d /proc/lvm ] || dm_in_proc ; then
-			ebegin "Setting up the Logical Volume Manager"
-			#still echo stderr for debugging
-			lvm_commands="#!${lvm_path}\n"
-			# Extra PV find pass because some devices might not have been available until very recently
-			lvm_commands="${lvm_commands}pvscan --config '${config}'\n"
-			# Now make the nodes
-			lvm_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
-			if _need_lvmlockd; then
-				# Start lockd VGs as required
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
-			fi
-			# Order of this is important, have to work around dash and LVM readline
-			printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 >/dev/null
-			eend $? "Failed to setup the LVM"
-		fi
-	fi
-}
-
-start_post()
-{
-	# Save if we needed lvmetad
-	if _need_lvmetad; then
-		service_set_value need lvmetad
-	fi
-}
-
-stop() {
-	for lvm_path in /bin/lvm /sbin/lvm ; do
-		[ -x "$lvm_path" ] && break
-	done
-	if [ ! -x "$lvm_path" ]; then
-		eerror "Cannot find lvm binary in /sbin or /bin!"
-		return 1
-	fi
-
-	# Stop LVM2
-	if [ -x /sbin/vgs ] && \
-		[ -x /sbin/vgchange ] && \
-		[ -x /sbin/lvchange ] && \
-		[ -f /etc/lvmtab -o -d /etc/lvm ] && \
-		[ -d /proc/lvm  -o "`grep device-mapper /proc/misc 2>/dev/null`" ]
-	then
-		einfo "Shutting down the Logical Volume Manager"
-
-		VGS=$($lvm_path vgs --config "${config}" -o vg_name --noheadings --nosuffix --rows 2> /dev/null)
-
-		if [ "$VGS" ]
-		then
-			local _ending="eend"
-			[ "$RC_RUNLEVEL" = shutdown ] && _ending="ewend"
-			ebegin "  Shutting Down LVs & VGs"
-				#still echo stderr for debugging
-				lvm_commands="#!${lvm_path}\n"
-				# Extra PV find pass because some devices might not have been available until very recently
-				lvm_commands="${lvm_commands}lvchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Now make the nodes
-				lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ln ${VGS}\n"
-				# Order of this is important, have to work around dash and LVM readline
-				printf "%b\n" "${lvm_commands}" | $lvm_path /proc/self/fd/0 --config "${config}" >/dev/null
-			rc=$?
-			msg="Failed (possibly some LVs still needed for /usr or root)"
-			[ "$RC_RUNLEVEL" = shutdown ] && msg="${msg} [rc=$rc]" && rc=0
-			${_ending} $rc "${msg}"
-		fi
-
-		einfo "Finished shutting down the Logical Volume Manager"
-		return 0
-	fi
-}
-
-# vim:ts=4

diff --git a/sys-fs/lvm2/files/lvm2-2.02.183-implement-libc-specific-reopen_stream.patch b/sys-fs/lvm2/files/lvm2-2.02.183-implement-libc-specific-reopen_stream.patch
deleted file mode 100644
index 6034be3..0000000
--- a/sys-fs/lvm2/files/lvm2-2.02.183-implement-libc-specific-reopen_stream.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/lib/log/log.c b/lib/log/log.c
-index 79fbd7a..0999d10 100644
---- a/lib/log/log.c
-+++ b/lib/log/log.c
-@@ -161,6 +161,7 @@ static void _check_and_replace_standard_log_streams(FILE *old_stream, FILE *new_
-  * Close and reopen standard stream on file descriptor fd.
-  */
- int reopen_standard_stream(FILE **stream, const char *mode)
-+#ifdef __GLIBC__
- {
- 	int fd, fd_copy, new_fd;
- 	const char *name;
-@@ -207,6 +208,11 @@ int reopen_standard_stream(FILE **stream, const char *mode)
- 	*stream = new_stream;
- 	return 1;
- }
-+#else
-+{
-+    return (freopen(NULL, mode, *stream) != NULL);
-+}
-+#endif
- 
- void init_log_fn(lvm2_log_fn_t log_fn)
- {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-27 12:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-27 12:45 [gentoo-commits] proj/musl:master commit in: sys-fs/lvm2/files/ Anthony G. Basile
  -- strict thread matches above, loose matches on Subject: below --
2020-04-27 12:45 Anthony G. Basile

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox