sys-kernel/dracut: Version bump
This commit is contained in:
parent
77813e2a43
commit
922b1a9ac7
@ -1,10 +1,10 @@
|
||||
# Copyright 1999-2013 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-026-r1.ebuild,v 1.1 2013/03/12 08:47:57 aidecoe Exp $
|
||||
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/dracut-027.ebuild,v 1.2 2013/04/02 14:16:51 aidecoe Exp $
|
||||
|
||||
EAPI=4
|
||||
|
||||
inherit eutils linux-info
|
||||
inherit bash-completion-r1 eutils linux-info
|
||||
|
||||
add_req_use_for() {
|
||||
local dep="$1"; shift
|
||||
@ -23,9 +23,11 @@ LICENSE="GPL-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
|
||||
|
||||
REQUIRED_USE="dracut_modules_crypt-gpg? ( dracut_modules_crypt )
|
||||
dracut_modules_crypt-loop? ( dracut_modules_crypt )
|
||||
REQUIRED_USE="
|
||||
dracut_modules_bootchart? ( !dracut_modules_systemd )
|
||||
dracut_modules_crypt-gpg? ( dracut_modules_crypt )
|
||||
dracut_modules_crypt-ssh? ( dracut_modules_crypt )
|
||||
dracut_modules_crypt-loop? ( dracut_modules_crypt )
|
||||
dracut_modules_livenet? ( dracut_modules_dmsquash-live )
|
||||
"
|
||||
COMMON_MODULES="
|
||||
@ -34,7 +36,6 @@ COMMON_MODULES="
|
||||
dracut_modules_btrfs
|
||||
dracut_modules_caps
|
||||
dracut_modules_crypt-gpg
|
||||
dracut_modules_crypt-ssh
|
||||
dracut_modules_crypt-loop
|
||||
dracut_modules_gensplash
|
||||
dracut_modules_mdraid
|
||||
@ -57,6 +58,7 @@ NETWORK_MODULES="
|
||||
dracut_modules_nbd
|
||||
dracut_modules_nfs
|
||||
dracut_modules_ssh-client
|
||||
dracut_modules_crypt-ssh
|
||||
"
|
||||
add_req_use_for device-mapper ${DM_MODULES}
|
||||
add_req_use_for net ${NETWORK_MODULES}
|
||||
@ -65,8 +67,8 @@ IUSE="debug device-mapper optimization net selinux ${IUSE_DRACUT_MODULES}"
|
||||
|
||||
RESTRICT="test"
|
||||
|
||||
CDEPEND=">sys-fs/udev-166
|
||||
dracut_modules_systemd? ( sys-apps/systemd )
|
||||
CDEPEND="virtual/udev
|
||||
dracut_modules_systemd? ( >=sys-apps/systemd-199 )
|
||||
"
|
||||
RDEPEND="${CDEPEND}
|
||||
app-arch/cpio
|
||||
@ -112,7 +114,7 @@ DEPEND="${CDEPEND}
|
||||
|
||||
DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules
|
||||
README.testsuite TODO )
|
||||
DRACUT_LIBDIR="/usr/lib"
|
||||
MY_LIBDIR="/usr/lib"
|
||||
|
||||
#
|
||||
# Helper functions
|
||||
@ -156,12 +158,9 @@ rm_module() {
|
||||
#
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}/${PV}-0000-fix-version-print.patch"
|
||||
epatch "${FILESDIR}/${PV}-0001-dracut-functions.sh-support-for-altern.patch"
|
||||
epatch "${FILESDIR}/${PV}-0002-gentoo.conf-let-udevdir-be-handled-by-.patch"
|
||||
epatch "${FILESDIR}/${PV}-0004-lsinitrd.sh-fix-for-default-initrd-not.patch"
|
||||
epatch "${FILESDIR}/${PV}-0005-lsinitrd.sh-removed-trailing.patch"
|
||||
epatch "${FILESDIR}/${PV}-0006-make-host_fs_types-a-hashmap.patch"
|
||||
chmod +x "${S}/modules.d/95udev-rules/udev-rules-prepare.sh"
|
||||
|
||||
if use dracut_modules_systemd; then
|
||||
local systemdutildir="$($(tc-getPKG_CONFIG) systemd \
|
||||
@ -178,14 +177,14 @@ src_prepare() {
|
||||
sed -e "5asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \
|
||||
-i "${S}/dracut.conf.d/gentoo.conf.example" || die
|
||||
fi
|
||||
|
||||
if use dracut_modules_crypt-ssh; then
|
||||
epatch "${FILESDIR}/${PV}-crypt-ssh.patch"
|
||||
epatch "${FILESDIR}/${PV}-crypt-ssh.patch"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
econf --libdir="${DRACUT_LIBDIR}"
|
||||
econf --libdir="${MY_LIBDIR}"
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
@ -201,9 +200,13 @@ src_compile() {
|
||||
src_install() {
|
||||
default
|
||||
|
||||
local libdir="${DRACUT_LIBDIR}"
|
||||
newbashcomp "${PN}-bash-completion.sh" "${PN}"
|
||||
|
||||
insinto "${libdir}/dracut/dracut.conf.d/"
|
||||
local dracutlibdir="${MY_LIBDIR#/}/dracut"
|
||||
|
||||
echo "DRACUT_VERSION=$PVR" > "${D%/}/${dracutlibdir}/dracut-version.sh"
|
||||
|
||||
insinto "${dracutlibdir}/dracut.conf.d/"
|
||||
newins dracut.conf.d/gentoo.conf.example gentoo.conf
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
@ -217,7 +220,7 @@ src_install() {
|
||||
# Modules
|
||||
#
|
||||
local module
|
||||
modules_dir="${D%/}/${libdir#/}/dracut/modules.d"
|
||||
modules_dir="${D%/}/${dracutlibdir}/modules.d"
|
||||
|
||||
# Remove modules not enabled by USE flags
|
||||
for module in ${IUSE_DRACUT_MODULES} ; do
|
||||
@ -231,9 +234,17 @@ src_install() {
|
||||
|
||||
# Following flags define set of helper modules which are base dependencies
|
||||
# for others and as so have no practical use, so remove these modules.
|
||||
use device-mapper || rm_module 90dm
|
||||
use device-mapper || rm_module 90dm
|
||||
use net || rm_module 40network 45ifcfg 45url-lib
|
||||
|
||||
if use dracut_modules_systemd; then
|
||||
# With systemd following modules do not make sense
|
||||
rm_module 96securityfs 98selinux
|
||||
else
|
||||
# Without systemd following modules do not make sense
|
||||
rm_module 00systemd-bootchart
|
||||
fi
|
||||
|
||||
# Remove S/390 modules which are not tested at all
|
||||
rm_module 80cms 95dasd 95dasd_mod 95zfcp 95znet
|
||||
|
||||
@ -254,13 +265,12 @@ pkg_postinst() {
|
||||
ewarn "kernel before booting image generated with this Dracut version."
|
||||
ewarn ""
|
||||
|
||||
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS ~MODULES"
|
||||
local CONFIG_CHECK="~BLK_DEV_INITRD ~DEVTMPFS"
|
||||
|
||||
# Kernel configuration options descriptions:
|
||||
local desc_DEVTMPFS="Maintain a devtmpfs filesystem to mount at /dev"
|
||||
local desc_BLK_DEV_INITRD="Initial RAM filesystem and RAM disk "\
|
||||
"(initramfs/initrd) support"
|
||||
local desc_MODULES="Enable loadable module support"
|
||||
|
||||
local opt desc
|
||||
|
||||
@ -282,7 +292,6 @@ pkg_postinst() {
|
||||
ewarn ""
|
||||
ewarn " CONFIG_BLK_DEV_INITRD"
|
||||
ewarn " CONFIG_DEVTMPFS"
|
||||
ewarn " CONFIG_MODULES"
|
||||
ewarn ""
|
||||
fi
|
||||
|
@ -1,55 +0,0 @@
|
||||
From a6b0fde8f776d28988a9ab4e5bf09f78fa858744 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
|
||||
Date: Sun, 10 Mar 2013 13:31:02 +0100
|
||||
Subject: [PATCH 3/3] Revert "crypt, dmraid, mdraid: use
|
||||
for_each_host_dev_and_slaves_all()"
|
||||
|
||||
This reverts commit cf24ac8c19b803e6f5c0576f2d7e78187331cf02.
|
||||
---
|
||||
modules.d/90crypt/module-setup.sh | 2 +-
|
||||
modules.d/90dmraid/module-setup.sh | 2 +-
|
||||
modules.d/90mdraid/module-setup.sh | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
|
||||
index 2b4456b..93b996c 100755
|
||||
--- a/modules.d/90crypt/module-setup.sh
|
||||
+++ b/modules.d/90crypt/module-setup.sh
|
||||
@@ -25,7 +25,7 @@ check() {
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_crypt || return 1
|
||||
+ for_each_host_dev_fs check_crypt || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
|
||||
index c315961..eb949dc 100755
|
||||
--- a/modules.d/90dmraid/module-setup.sh
|
||||
+++ b/modules.d/90dmraid/module-setup.sh
|
||||
@@ -38,7 +38,7 @@ check() {
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_dmraid || return 1
|
||||
+ for_each_host_dev_fs check_dmraid || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
|
||||
index 0efffbb..a2b9ac2 100755
|
||||
--- a/modules.d/90mdraid/module-setup.sh
|
||||
+++ b/modules.d/90mdraid/module-setup.sh
|
||||
@@ -27,7 +27,7 @@ check() {
|
||||
}
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_mdraid || return 1
|
||||
+ for_each_host_dev_fs check_mdraid || return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,42 +0,0 @@
|
||||
From f6e0e5653fac1f856192bfafdcb2fbd86ed8a22a Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Sun, 10 Mar 2013 14:44:32 +0100
|
||||
Subject: [PATCH 3/5] lsinitrd.sh: fix for default initrd not found, but image
|
||||
given
|
||||
|
||||
---
|
||||
lsinitrd.sh | 15 ++++++++-------
|
||||
1 file changed, 8 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh
|
||||
index 7a09423..4b8a7e2 100755
|
||||
--- a/lsinitrd.sh
|
||||
+++ b/lsinitrd.sh
|
||||
@@ -54,16 +54,17 @@ if [[ "$1" ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
-fi
|
||||
-
|
||||
-[[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
-
|
||||
-if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
- image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
else
|
||||
- image="/boot/initramfs-${KERNEL_VERSION}.img}"
|
||||
+ [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id
|
||||
+
|
||||
+ if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
+ image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
+ else
|
||||
+ image="/boot/initramfs-${KERNEL_VERSION}.img}"
|
||||
+ fi
|
||||
fi
|
||||
|
||||
+
|
||||
if ! [[ -f "$image" ]]; then
|
||||
{
|
||||
echo "No <initramfs file> specified and the default image '$image' cannot be accessed!"
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,25 +0,0 @@
|
||||
From bf7a572d8f978e16d92385ebf36e2f837fc2f3d1 Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 11 Mar 2013 15:46:37 +0100
|
||||
Subject: [PATCH 4/5] lsinitrd.sh: removed trailing "}"
|
||||
|
||||
---
|
||||
lsinitrd.sh | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lsinitrd.sh b/lsinitrd.sh
|
||||
index 4b8a7e2..5cd8c2a 100755
|
||||
--- a/lsinitrd.sh
|
||||
+++ b/lsinitrd.sh
|
||||
@@ -60,7 +60,7 @@ else
|
||||
if [[ $MACHINE_ID ]] && ( [[ -d /boot/${MACHINE_ID} ]] || [[ -L /boot/${MACHINE_ID} ]] ); then
|
||||
image="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd"
|
||||
else
|
||||
- image="/boot/initramfs-${KERNEL_VERSION}.img}"
|
||||
+ image="/boot/initramfs-${KERNEL_VERSION}.img"
|
||||
fi
|
||||
fi
|
||||
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -1,409 +0,0 @@
|
||||
From 86152848ed452bf1a01d0bea25c47ea54884a4fd Mon Sep 17 00:00:00 2001
|
||||
From: Harald Hoyer <harald@redhat.com>
|
||||
Date: Mon, 11 Mar 2013 16:32:16 +0100
|
||||
Subject: [PATCH 5/5] make host_fs_types a hashmap
|
||||
|
||||
This requires bash >= 4, but hash maps are so much more comfortable
|
||||
---
|
||||
dracut-functions.sh | 14 +++---------
|
||||
dracut.sh | 23 +++++++++----------
|
||||
modules.d/90btrfs/module-setup.sh | 6 ++---
|
||||
modules.d/90crypt/module-setup.sh | 39 +++++++++++++++++++--------------
|
||||
modules.d/90dmraid/module-setup.sh | 34 ++++++++++++++++------------
|
||||
modules.d/90lvm/module-setup.sh | 36 +++++++++++++++++-------------
|
||||
modules.d/90mdraid/module-setup.sh | 45 +++++++++++++++++++++-----------------
|
||||
modules.d/95cifs/module-setup.sh | 2 +-
|
||||
modules.d/95nfs/module-setup.sh | 6 ++---
|
||||
modules.d/95virtfs/module-setup.sh | 4 ++--
|
||||
10 files changed, 112 insertions(+), 97 deletions(-)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index a6a609c..52a1781 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -450,23 +450,15 @@ find_mp_fstype() {
|
||||
find_root_block_device() { find_block_device /; }
|
||||
|
||||
# for_each_host_dev_fs <func>
|
||||
-# Execute "<func> <dev> <filesystem>" for every "<dev>|<fs>" pair found
|
||||
+# Execute "<func> <dev> <filesystem>" for every "<dev> <fs>" pair found
|
||||
# in ${host_fs_types[@]}
|
||||
for_each_host_dev_fs()
|
||||
{
|
||||
local _func="$1"
|
||||
local _dev
|
||||
- local _fs
|
||||
local _ret=1
|
||||
- for f in ${host_fs_types[@]}; do
|
||||
- OLDIFS="$IFS"
|
||||
- IFS="|"
|
||||
- set -- $f
|
||||
- IFS="$OLDIFS"
|
||||
- _dev="$1"
|
||||
- [[ -b "$_dev" ]] || continue
|
||||
- _fs="$2"
|
||||
- $_func $_dev $_fs && _ret=0
|
||||
+ for _dev in "${!host_fs_types[@]}"; do
|
||||
+ $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0
|
||||
done
|
||||
return $_ret
|
||||
}
|
||||
diff --git a/dracut.sh b/dracut.sh
|
||||
index 28ed4f1..15e66f3 100755
|
||||
--- a/dracut.sh
|
||||
+++ b/dracut.sh
|
||||
@@ -744,11 +744,13 @@ trap 'exit 1;' SIGINT
|
||||
# Need to be able to have non-root users read stuff (rpcbind etc)
|
||||
chmod 755 "$initdir"
|
||||
|
||||
+declare -A host_fs_types
|
||||
+
|
||||
for line in "${fstab_lines[@]}"; do
|
||||
set -- $line
|
||||
#dev mp fs fsopts
|
||||
push host_devs "$1"
|
||||
- push host_fs_types "$1|$3"
|
||||
+ host_fs_types["$1"]="$3"
|
||||
done
|
||||
|
||||
for f in $add_fstab; do
|
||||
@@ -791,28 +793,27 @@ fi
|
||||
_get_fs_type() (
|
||||
[[ $1 ]] || return
|
||||
if [[ -b $1 ]] && get_fs_env $1; then
|
||||
- echo "$(readlink -f $1)|$ID_FS_TYPE"
|
||||
+ echo "$(readlink -f $1) $ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if [[ -b /dev/block/$1 ]] && get_fs_env /dev/block/$1; then
|
||||
- echo "$(readlink -f /dev/block/$1)|$ID_FS_TYPE"
|
||||
+ echo "$(readlink -f /dev/block/$1) $ID_FS_TYPE"
|
||||
return 1
|
||||
fi
|
||||
if fstype=$(find_dev_fstype $1); then
|
||||
- echo "$1|$fstype"
|
||||
+ echo "$1 $fstype"
|
||||
return 1
|
||||
fi
|
||||
return 1
|
||||
)
|
||||
|
||||
for dev in "${host_devs[@]}"; do
|
||||
- unset fs_type
|
||||
- for fstype in $(_get_fs_type $dev) \
|
||||
- $(check_block_and_slaves _get_fs_type $(get_maj_min $dev)); do
|
||||
- if ! strstr " ${host_fs_types[*]} " " $fstype ";then
|
||||
- push host_fs_types "$fstype"
|
||||
- fi
|
||||
- done
|
||||
+ while read key val; do
|
||||
+ host_fs_types["$key"]="$val"
|
||||
+ done < <(
|
||||
+ _get_fs_type $dev
|
||||
+ check_block_and_slaves_all _get_fs_type $(get_maj_min $dev)
|
||||
+ )
|
||||
done
|
||||
|
||||
[[ -d $udevdir ]] \
|
||||
diff --git a/modules.d/90btrfs/module-setup.sh b/modules.d/90btrfs/module-setup.sh
|
||||
index 0f79f5e..4a7c01d 100755
|
||||
--- a/modules.d/90btrfs/module-setup.sh
|
||||
+++ b/modules.d/90btrfs/module-setup.sh
|
||||
@@ -9,12 +9,10 @@ check() {
|
||||
type -P btrfs >/dev/null || return 1
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- local _found
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
- strstr "$fs" "\|btrfs" && _found="1"
|
||||
+ [[ "$fs" == "btrfs" ]] && return 0
|
||||
done
|
||||
- [[ $_found ]] || return 1
|
||||
- unset _found
|
||||
+ return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
diff --git a/modules.d/90crypt/module-setup.sh b/modules.d/90crypt/module-setup.sh
|
||||
index 2b4456b..b76f6ae 100755
|
||||
--- a/modules.d/90crypt/module-setup.sh
|
||||
+++ b/modules.d/90crypt/module-setup.sh
|
||||
@@ -7,8 +7,30 @@ check() {
|
||||
# if cryptsetup is not installed, then we cannot support encrypted devices.
|
||||
type -P cryptsetup >/dev/null || return 1
|
||||
|
||||
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
+ for fs in "${host_fs_types[@]}"; do
|
||||
+ [[ $fs = "crypto_LUKS" ]] && return 0
|
||||
+ done
|
||||
+ return 255
|
||||
+ }
|
||||
+
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+depends() {
|
||||
+ echo dm rootfs-block
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+installkernel() {
|
||||
+ instmods dm_crypt =crypto
|
||||
+}
|
||||
+
|
||||
+install() {
|
||||
+
|
||||
check_crypt() {
|
||||
local dev=$1 fs=$2
|
||||
+
|
||||
[[ $fs = "crypto_LUKS" ]] || return 1
|
||||
ID_FS_UUID=$(udevadm info --query=property --name=$dev \
|
||||
| while read line; do
|
||||
@@ -24,23 +46,8 @@ check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
- [[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_crypt || return 1
|
||||
- }
|
||||
-
|
||||
- return 0
|
||||
-}
|
||||
-
|
||||
-depends() {
|
||||
- echo dm rootfs-block
|
||||
- return 0
|
||||
-}
|
||||
-
|
||||
-installkernel() {
|
||||
- instmods dm_crypt =crypto
|
||||
-}
|
||||
+ for_each_host_dev_fs check_crypt
|
||||
|
||||
-install() {
|
||||
dracut_install cryptsetup rmdir readlink umount
|
||||
inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev
|
||||
diff --git a/modules.d/90dmraid/module-setup.sh b/modules.d/90dmraid/module-setup.sh
|
||||
index c315961..76daa4a 100755
|
||||
--- a/modules.d/90dmraid/module-setup.sh
|
||||
+++ b/modules.d/90dmraid/module-setup.sh
|
||||
@@ -8,9 +8,27 @@ check() {
|
||||
# in trying to support it in the initramfs.
|
||||
type -P dmraid >/dev/null || return 1
|
||||
|
||||
+ [[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
+ for fs in "${host_fs_types[@]}"; do
|
||||
+ [[ $fs = *_raid_member ]] && return 0
|
||||
+ done
|
||||
+ return 255
|
||||
+ }
|
||||
+
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+depends() {
|
||||
+ echo dm rootfs-block
|
||||
+ return 0
|
||||
+}
|
||||
+
|
||||
+install() {
|
||||
+ local _i
|
||||
+
|
||||
check_dmraid() {
|
||||
local dev=$1 fs=$2 holder DEVPATH DM_NAME
|
||||
- [[ "$fs" = "${fs%%_raid_member}" ]] && return 1
|
||||
+ [[ "$fs" != *_raid_member ]] && return 1
|
||||
|
||||
DEVPATH=$(udevadm info --query=property --name=$dev \
|
||||
| while read line; do
|
||||
@@ -37,20 +55,8 @@ check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
- [[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_dmraid || return 1
|
||||
- }
|
||||
+ for_each_host_dev_fs check_dmraid
|
||||
|
||||
- return 0
|
||||
-}
|
||||
-
|
||||
-depends() {
|
||||
- echo dm rootfs-block
|
||||
- return 0
|
||||
-}
|
||||
-
|
||||
-install() {
|
||||
- local _i
|
||||
dracut_install dmraid
|
||||
dracut_install -o kpartx
|
||||
inst $(command -v partx) /sbin/partx
|
||||
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
|
||||
index e0e4043..22186f4 100755
|
||||
--- a/modules.d/90lvm/module-setup.sh
|
||||
+++ b/modules.d/90lvm/module-setup.sh
|
||||
@@ -7,22 +7,11 @@ check() {
|
||||
# No point trying to support lvm if the binaries are missing
|
||||
type -P lvm >/dev/null || return 1
|
||||
|
||||
- check_lvm() {
|
||||
- local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
|
||||
- eval $(udevadm info --query=property --name=/dev/block/$1|egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
|
||||
- [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
|
||||
- [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
|
||||
- if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
|
||||
- if ! [[ $kernel_only ]]; then
|
||||
- echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
- fi
|
||||
- push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
|
||||
- fi
|
||||
- return 0
|
||||
- }
|
||||
-
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_lvm || return 1
|
||||
+ for fs in "${host_fs_types[@]}"; do
|
||||
+ [[ $fs = LVM*_member ]] && return 0
|
||||
+ done
|
||||
+ return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -38,6 +27,23 @@ install() {
|
||||
local _i
|
||||
inst lvm
|
||||
|
||||
+ check_lvm() {
|
||||
+ local DM_VG_NAME DM_LV_NAME DM_UDEV_DISABLE_DISK_RULES_FLAG
|
||||
+
|
||||
+ eval $(udevadm info --query=property --name=$1 | egrep '(DM_VG_NAME|DM_LV_NAME|DM_UDEV_DISABLE_DISK_RULES_FLAG)=')
|
||||
+ [[ "$DM_UDEV_DISABLE_DISK_RULES_FLAG" = "1" ]] && return 1
|
||||
+ [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1
|
||||
+ if ! strstr " ${_activated[*]} " " ${DM_VG_NAME}/${DM_LV_NAME} "; then
|
||||
+ if ! [[ $kernel_only ]]; then
|
||||
+ echo " rd.lvm.lv=${DM_VG_NAME}/${DM_LV_NAME} " >> "${initdir}/etc/cmdline.d/90lvm.conf"
|
||||
+ fi
|
||||
+ push _activated "${DM_VG_NAME}/${DM_LV_NAME}"
|
||||
+ fi
|
||||
+ return 0
|
||||
+ }
|
||||
+
|
||||
+ for_each_host_dev_fs check_lvm
|
||||
+
|
||||
inst_rules "$moddir/64-lvm.rules"
|
||||
|
||||
if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then
|
||||
diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh
|
||||
index 0efffbb..70c27dd 100755
|
||||
--- a/modules.d/90mdraid/module-setup.sh
|
||||
+++ b/modules.d/90mdraid/module-setup.sh
|
||||
@@ -7,27 +7,11 @@ check() {
|
||||
# No mdadm? No mdraid support.
|
||||
type -P mdadm >/dev/null || return 1
|
||||
|
||||
- check_mdraid() {
|
||||
- local dev=$1 fs=$2 holder DEVPATH MD_UUID
|
||||
- [[ "$fs" = "${fs%%_raid_member}" ]] && return 1
|
||||
-
|
||||
- MD_UUID=$(/sbin/mdadm --examine --export $dev \
|
||||
- | while read line; do
|
||||
- [[ ${line#MD_UUID} = $line ]] && continue
|
||||
- eval "$line"
|
||||
- echo $MD_UUID
|
||||
- break
|
||||
- done)
|
||||
-
|
||||
- [[ ${MD_UUID} ]] || return 1
|
||||
- if ! [[ $kernel_only ]]; then
|
||||
- echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
- fi
|
||||
- return 0
|
||||
- }
|
||||
-
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
- for_each_host_dev_and_slaves_all check_mdraid || return 1
|
||||
+ for fs in "${host_fs_types[@]}"; do
|
||||
+ [[ "$fs" == *_raid_member ]] && return 0
|
||||
+ done
|
||||
+ return 255
|
||||
}
|
||||
|
||||
return 0
|
||||
@@ -48,6 +32,27 @@ install() {
|
||||
inst $(command -v partx) /sbin/partx
|
||||
inst $(command -v mdadm) /sbin/mdadm
|
||||
|
||||
+ check_mdraid() {
|
||||
+ local dev=$1 fs=$2 holder DEVPATH MD_UUID
|
||||
+ [[ "$fs" != *_raid_member ]] && return 1
|
||||
+
|
||||
+ MD_UUID=$(/sbin/mdadm --examine --export $dev \
|
||||
+ | while read line; do
|
||||
+ [[ ${line#MD_UUID} = $line ]] && continue
|
||||
+ eval "$line"
|
||||
+ echo $MD_UUID
|
||||
+ break
|
||||
+ done)
|
||||
+
|
||||
+ [[ ${MD_UUID} ]] || return 1
|
||||
+ if ! [[ $kernel_only ]]; then
|
||||
+ echo " rd.md.uuid=${MD_UUID} " >> "${initdir}/etc/cmdline.d/90mdraid.conf"
|
||||
+ fi
|
||||
+ return 0
|
||||
+ }
|
||||
+
|
||||
+ for_each_host_dev_fs check_mdraid
|
||||
+
|
||||
inst_rules 64-md-raid.rules
|
||||
# remove incremental assembly from stock rules, so they don't shadow
|
||||
# 65-md-inc*.rules and its fine-grained controls, or cause other problems
|
||||
diff --git a/modules.d/95cifs/module-setup.sh b/modules.d/95cifs/module-setup.sh
|
||||
index 1c7d0be..bf0eddf 100755
|
||||
--- a/modules.d/95cifs/module-setup.sh
|
||||
+++ b/modules.d/95cifs/module-setup.sh
|
||||
@@ -8,7 +8,7 @@ check() {
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
- strstr "$fs" "\|cifs" && return 0
|
||||
+ [[ "$fs" == "cifs" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
diff --git a/modules.d/95nfs/module-setup.sh b/modules.d/95nfs/module-setup.sh
|
||||
index 38ee5d7..7c3a64d 100755
|
||||
--- a/modules.d/95nfs/module-setup.sh
|
||||
+++ b/modules.d/95nfs/module-setup.sh
|
||||
@@ -9,9 +9,9 @@ check() {
|
||||
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
- strstr "$fs" "\|nfs" && return 0
|
||||
- strstr "$fs" "\|nfs3" && return 0
|
||||
- strstr "$fs" "\|nfs4" && return 0
|
||||
+ [[ "$fs" == "nfs" ]] && return 0
|
||||
+ [[ "$fs" == "nfs3" ]] && return 0
|
||||
+ [[ "$fs" == "nfs4" ]] && return 0
|
||||
done
|
||||
return 255
|
||||
}
|
||||
diff --git a/modules.d/95virtfs/module-setup.sh b/modules.d/95virtfs/module-setup.sh
|
||||
index 0b961a8..12bd354 100755
|
||||
--- a/modules.d/95virtfs/module-setup.sh
|
||||
+++ b/modules.d/95virtfs/module-setup.sh
|
||||
@@ -5,9 +5,9 @@
|
||||
check() {
|
||||
[[ $hostonly ]] || [[ $mount_needs ]] && {
|
||||
for fs in ${host_fs_types[@]}; do
|
||||
- strstr "$fs" "\|9p" && return 0
|
||||
+ [[ "$fs" == "9p" ]] && return 0
|
||||
done
|
||||
- return 1
|
||||
+ return 255
|
||||
}
|
||||
|
||||
if type -P systemd-detect-virt >/dev/null 2>&1; then
|
||||
--
|
||||
1.8.1.4
|
||||
|
13
sys-kernel/dracut/files/027-0000-fix-version-print.patch
Normal file
13
sys-kernel/dracut/files/027-0000-fix-version-print.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/modules.d/99base/init.sh b/modules.d/99base/init.sh
|
||||
index b441a27..410201a 100755
|
||||
--- a/modules.d/99base/init.sh
|
||||
+++ b/modules.d/99base/init.sh
|
||||
@@ -104,7 +104,7 @@ else
|
||||
fi
|
||||
|
||||
[ -f /etc/initrd-release ] && . /etc/initrd-release
|
||||
-[ -n "$VERSION" ] && info "dracut-$VERSION"
|
||||
+[ -n "$VERSION_ID" ] && info "$NAME-$VERSION_ID"
|
||||
|
||||
source_conf /etc/conf.d
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 76e3d3ac2d753f17c59dfe9758ea36897bedaddf Mon Sep 17 00:00:00 2001
|
||||
From 3688462730a97d4cc5644dab87aadf147d8c72f0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
|
||||
Date: Sun, 6 Jan 2013 13:35:01 +0100
|
||||
Subject: [PATCH 1/3] dracut-functions.sh: support for alternative udev dirs -
|
||||
Subject: [PATCH 1/2] dracut-functions.sh: support for alternative udev dirs -
|
||||
udevaltdirs
|
||||
|
||||
It is required for Gentoo which moves udev from / to /usr and supports
|
||||
@ -13,10 +13,10 @@ Credits go to Alexander Tsoy <alexander@tsoy.me>.
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/dracut-functions.sh b/dracut-functions.sh
|
||||
index 2a84d17..a6a609c 100755
|
||||
index eba7412..d888f4c 100755
|
||||
--- a/dracut-functions.sh
|
||||
+++ b/dracut-functions.sh
|
||||
@@ -955,6 +955,15 @@ inst_rules() {
|
||||
@@ -961,6 +961,15 @@ inst_rules() {
|
||||
inst_dir "$_target"
|
||||
for _rule in "$@"; do
|
||||
if [ "${_rule#/}" = "$_rule" ]; then
|
||||
@ -33,5 +33,5 @@ index 2a84d17..a6a609c 100755
|
||||
if [[ -f $r/$_rule ]]; then
|
||||
_found="$r/$_rule"
|
||||
--
|
||||
1.8.1.4
|
||||
1.8.1.5
|
||||
|
@ -1,7 +1,7 @@
|
||||
From f4bfd74c673c5f4d01cf9855f2e4f58c59f5b658 Mon Sep 17 00:00:00 2001
|
||||
From 624a97d4e2b548889b5f758ed6a908a1495b44be Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Amadeusz=20=C5=BBo=C5=82nowski?= <aidecoe@aidecoe.name>
|
||||
Date: Sun, 16 Dec 2012 20:02:48 +0100
|
||||
Subject: [PATCH 2/3] gentoo.conf: let udevdir= be handled by pkg-config and
|
||||
Subject: [PATCH 2/2] gentoo.conf: let udevdir= be handled by pkg-config and
|
||||
use udevaltdirs
|
||||
|
||||
To avoid need of rebuild after udev update/downgrade let udevdir= be set
|
||||
@ -26,5 +26,5 @@ index 1361a30..b78e5c6 100644
|
||||
|
||||
#
|
||||
--
|
||||
1.8.1.4
|
||||
1.8.1.5
|
||||
|
Loading…
Reference in New Issue
Block a user