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] proj/genkernel:master commit in: defaults/, gkbuilds/
Date: Thu, 23 Jul 2020 23:57:35 +0000 (UTC)	[thread overview]
Message-ID: <1595545007.f6f9384b423e9bb9b8cee294f4ddbeee7c518463.whissi@gentoo> (raw)

commit:     f6f9384b423e9bb9b8cee294f4ddbeee7c518463
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 23 20:36:13 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Jul 23 22:56:47 2020 +0000
URL:        https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=f6f9384b

mdadm: Switch to UDEV usage

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

 defaults/initrd.scripts | 38 --------------------------------------
 defaults/linuxrc        |  3 ---
 defaults/software.sh    |  2 +-
 defaults/unlock-luks.sh |  1 -
 gkbuilds/mdadm.gkbuild  |  3 +++
 5 files changed, 4 insertions(+), 43 deletions(-)

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 9b2b32c..5515f49 100644
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -1525,24 +1525,6 @@ start_volumes() {
 		run ln -sf /dev/device-mapper /dev/mapper/control
 	fi
 
-	if [ "${USE_MDADM}" = '1' ]
-	then
-		if [ -x '/sbin/mdadm' ]
-		then
-			local mdadm_cmd="run /sbin/mdadm --assemble --scan 2>&1"
-			is_log_enabled && mdadm_cmd="${mdadm_cmd} | tee -a '${GK_INIT_LOG}'"
-			eval "${mdadm_cmd}"
-
-			#Intel Matrix RAID (and possibly others) have a container layer above the actual volumes,
-			#So we have to look for volumes that haven't been activated.
-			mdadm_cmd="run /sbin/mdadm -IRs 2>&1"
-			is_log_enabled && mdadm_cmd="${mdadm_cmd} | tee -a '${GK_INIT_LOG}'"
-			eval "${mdadm_cmd}"
-		else
-			bad_msg "domdadm invoked but /sbin/mdadm not found; Skipping mdadm raid assembly ..."
-		fi
-	fi
-
 	if [ "${USE_MULTIPATH_NORMAL}" = '1' ]
 	then
 		for multipath_path in /sbin/multipath /bin/multipath MISSING
@@ -1887,7 +1869,6 @@ openLUKS() {
 				continue
 			fi
 
-			setup_md_device ${LUKS_DEVICE}
 			if ! run cryptsetup isLuks ${LUKS_DEVICE}
 			then
 				bad_msg "The LUKS device ${LUKS_DEVICE} does not contain a LUKS header" ${CRYPT_SILENT}
@@ -2571,25 +2552,6 @@ setup_btrfsctl() {
 	fi
 }
 
-setup_md_device() {
-	local device
-
-	[ -z "$1" ] && device="${REAL_ROOT}" || device="$1"
-	[ -z "${device}" ] && return # LiveCD
-
-	if [ $(echo ${device}|sed -e 's#\(luks:\)\?\(/dev/md\)[[:digit:]]\+#\2#') = "/dev/md" ]
-	then
-		good_msg 'Detected real_root as a md device. Setting up the device node ...'
-		MD_NUMBER=$(echo ${device}|sed -e 's#\(luks:\)\?/dev/md\([[:digit:]]\+\)#\2#')
-		if [ ! -e /dev/md${MD_NUMBER} ]
-		then
-			run mknod /dev/md${MD_NUMBER} b 9 ${MD_NUMBER} >/dev/null 2>&1
-			[ $? -ne 0 ] && bad_msg "Creation of /dev/md${MD_NUMBER} failed ..."
-		fi
-		run raidautorun /dev/md${MD_NUMBER}
-	fi
-}
-
 rundebugshell() {
 	if is_debug
 	then

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 210085a..4c1b470 100644
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -625,9 +625,6 @@ sdelay
 # Setup btrfs, see bug 303529
 setup_btrfsctl
 
-# Setup md device nodes if they dont exist
-setup_md_device
-
 # Scan volumes
 start_volumes
 

diff --git a/defaults/software.sh b/defaults/software.sh
index 463d8cf..3de9470 100644
--- a/defaults/software.sh
+++ b/defaults/software.sh
@@ -165,7 +165,7 @@ GKPKG_LZO_BINPKG="${GKPKG_LZO_BINPKG:-%%CACHE%%/lzo-${GKPKG_LZO_PV}-%%ARCH%%.tar
 
 GKPKG_MDADM_PN="mdadm"
 GKPKG_MDADM_PV="${GKPKG_MDADM_PV:-VERSION_MDADM}"
-GKPKG_MDADM_DEPS=""
+GKPKG_MDADM_DEPS="eudev"
 GKPKG_MDADM_SRCTAR="${GKPKG_MDADM_SRCTAR:-${DISTDIR}/mdadm-${GKPKG_MDADM_PV}.tar.xz}"
 GKPKG_MDADM_SRCDIR="${GKPKG_MDADM_SRCDIR:-mdadm-${GKPKG_MDADM_PV}}"
 GKPKG_MDADM_BINPKG="${GKPKG_MDADM_BINPKG:-%%CACHE%%/mdadm-${GKPKG_MDADM_PV}-%%ARCH%%.tar.xz}"

diff --git a/defaults/unlock-luks.sh b/defaults/unlock-luks.sh
index 87381ab..710d951 100644
--- a/defaults/unlock-luks.sh
+++ b/defaults/unlock-luks.sh
@@ -63,7 +63,6 @@ main() {
 				exit 1
 			fi
 
-			setup_md_device "${LUKS_DEVICE}"
 			if ! run cryptsetup isLuks "${LUKS_DEVICE}"
 			then
 				bad_msg "The LUKS device ${LUKS_DEVICE} does not contain a LUKS header" "${CRYPT_SILENT}"

diff --git a/gkbuilds/mdadm.gkbuild b/gkbuilds/mdadm.gkbuild
index 2307d0e..b43f753 100644
--- a/gkbuilds/mdadm.gkbuild
+++ b/gkbuilds/mdadm.gkbuild
@@ -10,6 +10,7 @@ src_prepare() {
 		-e "/^CXFLAGS = /s:^CXFLAGS = \(.*\)$:CXFLAGS = ${CFLAGS} ${defs}:" \
 		-e "/^CWFLAGS = /s:^CWFLAGS = \(.*\)$:CWFLAGS = -Wall:" \
 		-e "s/^# LDFLAGS = -static/LDFLAGS = -static/" \
+		-e "s|^UDEVDIR := .*|UDEVDIR = $(get_udevdir)|" \
 		Makefile \
 		|| die "Failed to sed mdadm Makefile"
 }
@@ -19,6 +20,8 @@ src_compile() {
 }
 
 src_install() {
+	gkmake V=1 DESTDIR="${D}" install-udev
+
 	mkdir -p "${D}"/sbin || die "Failed to create '${D}/sbin'!"
 
 	cp -a mdadm "${D}"/sbin/ \


             reply	other threads:[~2020-07-23 23:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23 23:57 Thomas Deutschmann [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-27 10:42 [gentoo-commits] proj/genkernel:master commit in: defaults/, gkbuilds/ Sam James
2021-07-06  0:25 Thomas Deutschmann
2021-03-13 15:42 Thomas Deutschmann
2020-08-26 22:54 Thomas Deutschmann
2020-07-23 23:57 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=1595545007.f6f9384b423e9bb9b8cee294f4ddbeee7c518463.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