public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/files/
Date: Tue, 14 Apr 2020 18:34:52 +0000 (UTC)	[thread overview]
Message-ID: <1586889260.1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7.whissi@gentoo> (raw)

commit:     1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 14 17:42:51 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Tue Apr 14 18:34:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bb133b5

sys-fs/lvm2: runscript: rework start()

- Don't use LVM script anymore: If one command within script failed,
  any following command won't run anymore.

- Be verbose when rc_verbose=yes is set.

- Only call pvscan when lvmetad is used.

Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 sys-fs/lvm2/files/lvm.rc-2.02.187 | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/sys-fs/lvm2/files/lvm.rc-2.02.187 b/sys-fs/lvm2/files/lvm.rc-2.02.187
index d9c11730cdb..f9ad753ea82 100644
--- a/sys-fs/lvm2/files/lvm.rc-2.02.187
+++ b/sys-fs/lvm2/files/lvm.rc-2.02.187
@@ -86,24 +86,33 @@ start() {
 		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"
+			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_commands="${lvm_commands}vgscan --config '${config}' --mknodes\n"
-			# And turn them on!
-			lvm_commands="${lvm_commands}vgchange --config '${config}' --sysinit -a ly\n"
+			${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_commands="${lvm_commands}vgchange --config '${config}' --lock-start --lock-opt auto\n"
+				${lvm_path} vgchange${verbose_command} --config "${config}" --lock-start --lock-opt auto
+				[ $? -ne 0 ] && has_errors=1
 			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"
+			eend ${has_errors} "Failed to start the Logical Volume Manager"
 		fi
 	fi
 }


             reply	other threads:[~2020-04-14 18:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 18:34 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-17 19:48 [gentoo-commits] repo/gentoo:master commit in: sys-fs/lvm2/files/ Mike Gilbert
2023-01-01 18:16 Conrad Kostecki
2022-10-30  9:28 Sam James
2020-06-07  4:41 Aaron Bauman
2020-04-14 18:34 Thomas Deutschmann
2020-04-14 18:34 Thomas Deutschmann
2020-04-14 18:34 Thomas Deutschmann
2020-04-14 18:34 Thomas Deutschmann
2019-04-17  7:26 Robin H. Johnson
2019-02-27  5:35 Aaron Bauman
2018-08-05  1:11 Thomas Deutschmann
2018-08-04 22:34 Thomas Deutschmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1586889260.1bb133b505d5aade0cc0b6c6e16f1bc3e9a266f7.whissi@gentoo \
    --to=whissi@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox