commit: 17cdd9c8ca954c180a216b9e33cf8de7be5f4a43 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Thu Jul 23 21:05:18 2020 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Thu Jul 23 22:56:48 2020 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=17cdd9c8
dmraid: Switch to UDEV usage Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> defaults/initrd.scripts | 18 +++++++++--------- defaults/software.sh | 2 +- gen_initramfs.sh | 2 ++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 7d852ee..d2db059 100644 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -1548,10 +1548,12 @@ start_volumes() { if [ "${USE_DMRAID_NORMAL}" = '1' ] then - if [ -x '/sbin/dmraid' ] + if ! hash dmraid >/dev/null 2>&1 then + bad_msg "dodmraid invoked but 'dmraid' not found; Skipping dmraid activation ..." + else good_msg "Activating Device-Mapper RAID(s) ..." - local dmraid_cmd="run /sbin/dmraid -ay" + local dmraid_cmd="run dmraid -ay" if [ -z "${DMRAID_OPTS}" ] then dmraid_cmd="${dmraid_cmd} 2>&1" @@ -1559,16 +1561,14 @@ start_volumes() { dmraid_cmd="${dmraid_cmd} ${DMRAID_OPTS} 2>&1" fi is_log_enabled && dmraid_cmd="${dmraid_cmd} | tee -a '${GK_INIT_LOG}'" - eval "${dmraid_cmd}" - if [ -x '/sbin/kpartx' ] + eval "${dmraid_cmd}" + if [ $? -ne 0 ] then - dmraid_cmd="run /sbin/dmsetup ls --exec '/sbin/kpartx -a -s' 2>&1" - is_log_enabled && dmraid_cmd="${dmraid_cmd} | tee -a '${GK_INIT_LOG}'" - eval "${dmraid_cmd}" + bad_msg "Activation of Device-Mapper RAID(s) failed!" + else + udevsettle fi - else - bad_msg "dodmraid invoked but /sbin/dmraid not found; Skipping dmraid activation ..." fi fi diff --git a/defaults/software.sh b/defaults/software.sh index ae7532f..d8dbfc9 100644 --- a/defaults/software.sh +++ b/defaults/software.sh @@ -60,7 +60,7 @@ GKPKG_CRYPTSETUP_BINPKG="${GKPKG_CRYPTSETUP_BINPKG:-%%CACHE%%/cryptsetup-${GKPKG GKPKG_DMRAID_PN="dmraid" GKPKG_DMRAID_PV="${GKPKG_DMRAID_PV:-VERSION_DMRAID}" -GKPKG_DMRAID_DEPS="lvm" +GKPKG_DMRAID_DEPS="eudev lvm" GKPKG_DMRAID_SRCTAR="${GKPKG_DMRAID_SRCTAR:-${DISTDIR}/dmraid-${GKPKG_DMRAID_PV}.tar.bz2}" GKPKG_DMRAID_SRCDIR="${GKPKG_DMRAID_SRCDIR:-dmraid/${GKPKG_DMRAID_PV}/dmraid}" GKPKG_DMRAID_BINPKG="${GKPKG_DMRAID_BINPKG:-%%CACHE%%/dmraid-${GKPKG_DMRAID_PV}-%%ARCH%%.tar.xz}" diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 1b8c829..24b23bb 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -775,6 +775,8 @@ append_dmraid() { unpack "$(get_gkpkg_binpkg "${PN}")" "${TDIR}" + mkdir -p "${TDIR}"/run/lock/dmraid || gen_die "Failed to create '${TDIR}/run/lock/dmraid'!" + cd "${TDIR}" || gen_die "Failed to chdir to '${TDIR}'!" # Delete unneeded files