diff options
author | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2013-10-06 18:34:14 +0000 |
---|---|---|
committer | Amadeusz Piotr Żołnowski <aidecoe@gentoo.org> | 2013-10-06 18:34:14 +0000 |
commit | f5463b79c51cfb47fbe70d5c7a41531756f06c57 (patch) | |
tree | f7b88dbb0aad688312ab8c5c85dfcb4f03f051f1 /sys-kernel | |
parent | added ~ppc64 keyword wrt bug #484458 (diff) | |
download | gentoo-2-f5463b79c51cfb47fbe70d5c7a41531756f06c57.tar.gz gentoo-2-f5463b79c51cfb47fbe70d5c7a41531756f06c57.tar.bz2 gentoo-2-f5463b79c51cfb47fbe70d5c7a41531756f06c57.zip |
Applied patches with bug fixes wrt mdraid and lvm.
It fixes bug #486344, bug #485748, possible bug on PPC and bug related to
net-bonding.
Thanks to Alexander Tsoy <alexander@tsoy.me> for some of these patches and
generally for help.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key F0134531E1DBFAB5)
Diffstat (limited to 'sys-kernel')
7 files changed, 531 insertions, 1 deletions
diff --git a/sys-kernel/dracut/ChangeLog b/sys-kernel/dracut/ChangeLog index 11abd20ee78f..087a55827e97 100644 --- a/sys-kernel/dracut/ChangeLog +++ b/sys-kernel/dracut/ChangeLog @@ -1,6 +1,22 @@ # ChangeLog for sys-kernel/dracut # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.132 2013/10/02 21:13:08 aidecoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-kernel/dracut/ChangeLog,v 1.133 2013/10/06 18:34:14 aidecoe Exp $ + +*dracut-033-r3 (06 Oct 2013) + + 06 Oct 2013; Amadeusz Żołnowski <aidecoe@gentoo.org> +dracut-033-r3.ebuild, + +files/033-0005-dracut.sh-harden-host_modalias-reading.patch, + +files/033-0006-ifup-do-not-dhcp-on-network-interface-.patch, + +files/033-0007-lvm-mdraid-Fix-LVM-on-MD-activation.patch, + +files/033-0008-mdraid-module-setup.sh-install-configs.patch, + +files/033-0009-mdraid-module-setup.sh-fixes-for-mdadm.patch: + Applied patches with bug fixes wrt mdraid and lvm. + + It fixes bug #486344, bug #485748, possible bug on PPC and bug related to + net-bonding. + + Thanks to Alexander Tsoy <alexander@tsoy.me> for some of these patches and + generally for help. *dracut-033-r2 (02 Oct 2013) diff --git a/sys-kernel/dracut/dracut-033-r3.ebuild b/sys-kernel/dracut/dracut-033-r3.ebuild new file mode 100644 index 000000000000..4927b568d40a --- /dev/null +++ b/sys-kernel/dracut/dracut-033-r3.ebuild @@ -0,0 +1,314 @@ +# 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-033-r3.ebuild,v 1.1 2013/10/06 18:34:14 aidecoe Exp $ + +EAPI=4 + +inherit bash-completion-r1 eutils linux-info multilib systemd + +add_req_use_for() { + local dep="$1"; shift + local f + + for f in "$@"; do + REQUIRED_USE+="${f}? ( ${dep} ) +" + done +} + +DESCRIPTION="Generic initramfs generation tool" +HOMEPAGE="http://dracut.wiki.kernel.org" +SRC_URI="mirror://kernel/linux/utils/boot/${PN}/${P}.tar.bz2" +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86" + +REQUIRED_USE=" + dracut_modules_bootchart? ( !dracut_modules_systemd ) + dracut_modules_crypt-gpg? ( dracut_modules_crypt ) + dracut_modules_crypt-loop? ( dracut_modules_crypt ) + dracut_modules_livenet? ( dracut_modules_dmsquash-live ) + " +COMMON_MODULES=" + dracut_modules_biosdevname + dracut_modules_bootchart + dracut_modules_btrfs + dracut_modules_caps + dracut_modules_crypt-gpg + dracut_modules_crypt-loop + dracut_modules_dash + dracut_modules_gensplash + dracut_modules_mdraid + dracut_modules_multipath + dracut_modules_plymouth + dracut_modules_syslog + dracut_modules_systemd + " +DM_MODULES=" + dracut_modules_crypt + dracut_modules_dmraid + dracut_modules_dmsquash-live + dracut_modules_livenet + dracut_modules_lvm + " +NETWORK_MODULES=" + dracut_modules_cifs + dracut_modules_iscsi + dracut_modules_livenet + dracut_modules_nbd + dracut_modules_nfs + dracut_modules_ssh-client + " +add_req_use_for device-mapper ${DM_MODULES} +add_req_use_for net ${NETWORK_MODULES} +IUSE_DRACUT_MODULES="${COMMON_MODULES} ${DM_MODULES} ${NETWORK_MODULES}" +IUSE="debug device-mapper net selinux ${IUSE_DRACUT_MODULES}" + +RESTRICT="test" + +CDEPEND="virtual/udev + dracut_modules_systemd? ( >=sys-apps/systemd-199 ) + " +RDEPEND="${CDEPEND} + app-arch/cpio + >=app-shells/bash-4.0 + >=sys-apps/baselayout-1.12.14-r1 + >sys-apps/kmod-5[tools] + >=sys-apps/sysvinit-2.87-r3 + >=sys-apps/util-linux-2.21 + virtual/pkgconfig + + debug? ( dev-util/strace ) + device-mapper? ( >=sys-fs/lvm2-2.02.33 ) + net? ( net-misc/curl >=net-misc/dhcp-4.2.4_p2-r1[client] sys-apps/iproute2 ) + selinux? ( sys-libs/libselinux sys-libs/libsepol ) + dracut_modules_biosdevname? ( sys-apps/biosdevname ) + dracut_modules_bootchart? ( app-benchmarks/bootchart2 sys-apps/usleep + sys-process/acct ) + dracut_modules_btrfs? ( sys-fs/btrfs-progs ) + dracut_modules_caps? ( sys-libs/libcap ) + dracut_modules_cifs? ( net-fs/cifs-utils ) + dracut_modules_crypt? ( sys-fs/cryptsetup ) + dracut_modules_crypt-gpg? ( app-crypt/gnupg ) + dracut_modules_dash? ( >=app-shells/dash-0.5.4.11 ) + dracut_modules_dmraid? ( sys-fs/dmraid sys-fs/multipath-tools ) + dracut_modules_gensplash? ( media-gfx/splashutils ) + dracut_modules_iscsi? ( >=sys-block/open-iscsi-2.0.871.3 ) + dracut_modules_lvm? ( >=sys-fs/lvm2-2.02.33 ) + dracut_modules_mdraid? ( >=sys-fs/mdadm-3.2.6-r1 ) + dracut_modules_multipath? ( sys-fs/multipath-tools ) + dracut_modules_nbd? ( sys-block/nbd ) + dracut_modules_nfs? ( net-fs/nfs-utils net-nds/rpcbind ) + dracut_modules_plymouth? ( >=sys-boot/plymouth-0.8.3-r1 ) + dracut_modules_ssh-client? ( dev-libs/openssl ) + dracut_modules_syslog? ( || ( app-admin/syslog-ng app-admin/rsyslog ) ) + " +DEPEND="${CDEPEND} + app-text/asciidoc + >=dev-libs/libxslt-1.1.26 + app-text/docbook-xml-dtd:4.5 + >=app-text/docbook-xsl-stylesheets-1.75.2 + " + +DOCS=( AUTHORS HACKING NEWS README README.generic README.kernel README.modules + README.testsuite TODO ) +MY_LIBDIR=/usr/lib + +# +# Helper functions +# + +# Returns true if any of specified modules is enabled by USE flag and false +# otherwise. +# $1 = list of modules (which have corresponding USE flags of the same name) +any_module() { + local m modules=" $@ " + + for m in ${modules}; do + ! use $m && modules=${modules/ $m / } + done + + shopt -s extglob + modules=${modules%%+( )} + shopt -u extglob + + [[ ${modules} ]] +} + +# Removes module from modules.d. +# $1 = module name +# Module name can be specified without number prefix. +rm_module() { + local force m + [[ $1 = -f ]] && force=-f + + for m in $@; do + if [[ $m =~ ^[0-9][0-9][^\ ]*$ ]]; then + rm ${force} --interactive=never -r "${modules_dir}"/$m + else + rm ${force} --interactive=never -r "${modules_dir}"/[0-9][0-9]$m + fi + done +} + +# +# ebuild functions +# + +src_prepare() { + 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}-0003-Use-the-same-paths-in-dracut.sh-as-tho.patch" + epatch "${FILESDIR}/${PV}-0004-Install-dracut-install-into-libexec-di.patch" + epatch "${FILESDIR}/${PV}-0005-dracut.sh-harden-host_modalias-reading.patch" + epatch "${FILESDIR}/${PV}-0006-ifup-do-not-dhcp-on-network-interface-.patch" + epatch "${FILESDIR}/${PV}-0007-lvm-mdraid-Fix-LVM-on-MD-activation.patch" + epatch "${FILESDIR}/${PV}-0008-mdraid-module-setup.sh-install-configs.patch" + epatch "${FILESDIR}/${PV}-0009-mdraid-module-setup.sh-fixes-for-mdadm.patch" + + local libdirs ldir + + for ldir in $(get_all_libdirs); do + libdirs+=" /$ldir /usr/$ldir" + done + + libdirs="${libdirs# }" + einfo "Setting libdirs to \"${libdirs}\" ..." + sed -e "3alibdirs=\"${libdirs}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + + if use dracut_modules_systemd; then + local systemdutildir="$(systemd_get_utildir)" + local systemdsystemunitdir="$(systemd_get_unitdir)" + einfo "Setting systemdutildir to ${systemdutildir} and ..." + sed -e "5asystemdutildir=\"${systemdutildir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + einfo "Setting systemdsystemunitdir to ${systemdsystemunitdir}..." + sed -e "6asystemdsystemunitdir=\"${systemdsystemunitdir}\"" \ + -i "${S}/dracut.conf.d/gentoo.conf.example" || die + fi +} + +src_configure() { + local myconf="--libdir=${MY_LIBDIR}" + myconf+=" --bashcompletiondir=$(get_bashcompdir)" + + if use dracut_modules_systemd; then + myconf+=" --systemdsystemunitdir='$(systemd_get_unitdir)'" + fi + + econf ${myconf} +} + +src_compile() { + tc-export CC + emake doc install/dracut-install +} + +src_install() { + default + + local my_libdir="${MY_LIBDIR}" + 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 + newins dracut.logrotate dracut + + dodir /var/lib/dracut/overlay + + dohtml dracut.html + + # + # Modules + # + local module + modules_dir="${D%/}/${dracutlibdir}/modules.d" + + # Remove modules not enabled by USE flags + for module in ${IUSE_DRACUT_MODULES} ; do + ! use ${module} && rm_module -f ${module#dracut_modules_} + done + + # Those flags are specific, and even are corresponding to modules, they need + # to be declared as regular USE flags. + use debug || rm_module 95debug + use selinux || rm_module 98selinux + + # 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 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 + + # Remove modules which won't work for sure + rm_module 95fcoe # no tools + # fips module depends on masked app-crypt/hmaccalc + rm_module 01fips 02fips-aesni + + # Remove extra modules which go to future dracut-extras + rm_module 05busybox 97masterkey 98ecryptfs 98integrity +} + +pkg_postinst() { + if linux-info_get_any_version && linux_config_src_exists; then + ewarn "" + ewarn "If the following test report contains a missing kernel" + ewarn "configuration option, you should reconfigure and rebuild your" + ewarn "kernel before booting image generated with this Dracut version." + ewarn "" + + 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 opt desc + + # Generate ERROR_* variables for check_extra_config. + for opt in ${CONFIG_CHECK}; do + opt=${opt#\~} + desc=desc_${opt} + eval "local ERROR_${opt}='CONFIG_${opt}: \"${!desc}\"" \ + "is missing and REQUIRED'" + done + + check_extra_config + echo + else + ewarn "" + ewarn "Your kernel configuration couldn't be checked. Do you have" + ewarn "/usr/src/linux/.config file there? Please check manually if" + ewarn "following options are enabled:" + ewarn "" + ewarn " CONFIG_BLK_DEV_INITRD" + ewarn " CONFIG_DEVTMPFS" + ewarn "" + fi + + if use dracut_modules_crypt || use dracut_modules_dmraid || use \ + dracut_modules_mdraid || use dracut_modules_lvm; then + + if ! [[ $(</proc/cmdline) =~ rd.auto[\ =] ]]; then + ewarn "Autoassembly of special devices like cryptoLUKS, dmraid, " + ewarn "mdraid or lvm is off for default as of >=dracut-024." + ewarn "Use rd.auto option to turn it on." + fi + fi +} diff --git a/sys-kernel/dracut/files/033-0005-dracut.sh-harden-host_modalias-reading.patch b/sys-kernel/dracut/files/033-0005-dracut.sh-harden-host_modalias-reading.patch new file mode 100644 index 000000000000..0c775702f9d1 --- /dev/null +++ b/sys-kernel/dracut/files/033-0005-dracut.sh-harden-host_modalias-reading.patch @@ -0,0 +1,29 @@ +From 5e588b0713bf149660817979e25fd443e319aeb9 Mon Sep 17 00:00:00 2001 +From: Harald Hoyer <harald@redhat.com> +Date: Fri, 13 Sep 2013 16:33:01 +0200 +Subject: [PATCH 5/9] dracut.sh: harden host_modalias reading + +Some weird PPC driver make their modulias unreadable + +$ cat /sys/devices/vio/4000/modalias +cat: /sys/devices/vio/4000/modalias: No such device +--- + dracut.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut.sh b/dracut.sh +index 066d9d6..bc46b1c 100755 +--- a/dracut.sh ++++ b/dracut.sh +@@ -921,7 +921,7 @@ if [[ $hostonly ]]; then + declare -A host_modalias + find /sys/devices/ -name modalias -print > "$initdir/.modalias" + while read m; do +- host_modalias["$(<"$m")"]=1 ++ modalias="$(<"$m")" && [[ $modalias ]] && host_modalias["$modalias"]=1 + done < "$initdir/.modalias" + rm -f -- "$initdir/.modalias" + +-- +1.8.3.2 + diff --git a/sys-kernel/dracut/files/033-0006-ifup-do-not-dhcp-on-network-interface-.patch b/sys-kernel/dracut/files/033-0006-ifup-do-not-dhcp-on-network-interface-.patch new file mode 100644 index 000000000000..fd15add1a0f5 --- /dev/null +++ b/sys-kernel/dracut/files/033-0006-ifup-do-not-dhcp-on-network-interface-.patch @@ -0,0 +1,38 @@ +From dc03b57ca7fe5f83dc91b2d6b44aa67d83ccd399 Mon Sep 17 00:00:00 2001 +From: WANG Chao <chaowang@redhat.com> +Date: Fri, 13 Sep 2013 22:28:44 +0800 +Subject: [PATCH 6/9] ifup: do not dhcp on network interface of secondary stack + +Configure cmdline to: + ip=br0:dhcp bridge=br0:bond0 bond=bond0:eth0 + +By default ifup bond0 will run dhcp on bond0, which is wrong. bond0 +isn't the top interface. we should really run dhcp on br0. + +So if we ifup an network interface on secondary stack, we should not +dhcp. Fix this issue with this patch. +--- + modules.d/40network/ifup.sh | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/modules.d/40network/ifup.sh b/modules.d/40network/ifup.sh +index 3261647..9f6f449 100755 +--- a/modules.d/40network/ifup.sh ++++ b/modules.d/40network/ifup.sh +@@ -336,6 +336,13 @@ for p in $(getargs ip=); do + exit 0 + done + ++# netif isn't the top stack? Then we should exit here. ++# eg. netif is bond0. br0 is on top of it. dhcp br0 is correct but dhcp ++# bond0 doesn't make sense. ++if [ -n "$DO_BOND_SETUP" -o -n "$DO_TEAM_SETUP" -o -n "$DO_VLAN_SETUP" ]; then ++ exit 0 ++fi ++ + # no ip option directed at our interface? + if [ ! -e /tmp/setup_net_${netif}.ok ]; then + do_dhcp -4 +-- +1.8.3.2 + diff --git a/sys-kernel/dracut/files/033-0007-lvm-mdraid-Fix-LVM-on-MD-activation.patch b/sys-kernel/dracut/files/033-0007-lvm-mdraid-Fix-LVM-on-MD-activation.patch new file mode 100644 index 000000000000..3663d6e6fb6f --- /dev/null +++ b/sys-kernel/dracut/files/033-0007-lvm-mdraid-Fix-LVM-on-MD-activation.patch @@ -0,0 +1,46 @@ +From cb669ae9816be6d213b68c380b5720f05d43e4c7 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha <prajnoha@redhat.com> +Date: Fri, 4 Oct 2013 10:41:24 +0200 +Subject: [PATCH 7/9] lvm/mdraid: Fix LVM on MD activation + +The 69-dm-lvm-metad.rules set some udev env. variables that makes it +possible to detect the right time to activate LVM on MD. The MD is very +similar to DM during activation - it's usable only after proper device +activation - the CHANGE event. We need to make a difference between a +CHANGE event that comes from this activation and CHANGE event that is +the outcome of the WATCH udev rule (otherwise we'd end up with LVM +activation done on each CHANGE event - which is wrong). + +So we need the udev databse to be persistent during pivot to root fs +even for MD devices. +--- + modules.d/90lvm/module-setup.sh | 2 +- + modules.d/90mdraid/59-persistent-storage-md.rules | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh +index 2ef9a51..f98ffff 100755 +--- a/modules.d/90lvm/module-setup.sh ++++ b/modules.d/90lvm/module-setup.sh +@@ -82,7 +82,7 @@ install() { + } > "${initdir}/etc/lvm/lvm.conf" + fi + +- inst_rules 11-dm-lvm.rules ++ inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules + # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules + # files, but provides the one below: + inst_rules 64-device-mapper.rules +diff --git a/modules.d/90mdraid/59-persistent-storage-md.rules b/modules.d/90mdraid/59-persistent-storage-md.rules +index bea9325..6ef858a 100644 +--- a/modules.d/90mdraid/59-persistent-storage-md.rules ++++ b/modules.d/90mdraid/59-persistent-storage-md.rules +@@ -20,4 +20,5 @@ IMPORT{program}="/sbin/mdadm --detail --export $tempnode" + IMPORT BLKID + OPTIONS+="link_priority=100" + OPTIONS+="watch" ++OPTIONS+="db_persist" + LABEL="md_end" +-- +1.8.3.2 + diff --git a/sys-kernel/dracut/files/033-0008-mdraid-module-setup.sh-install-configs.patch b/sys-kernel/dracut/files/033-0008-mdraid-module-setup.sh-install-configs.patch new file mode 100644 index 000000000000..c6e8d99af602 --- /dev/null +++ b/sys-kernel/dracut/files/033-0008-mdraid-module-setup.sh-install-configs.patch @@ -0,0 +1,33 @@ +From 5821cc78250075a855175572c420808cddcf40f5 Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy <alexander@tsoy.me> +Date: Thu, 3 Oct 2013 14:54:42 +0400 +Subject: [PATCH 8/9] mdraid/module-setup.sh: install configs from + /etc/mdadm.conf.d + +/etc/mdadm.conf.d directory is supported since mdadm-3.3 +--- + modules.d/90mdraid/module-setup.sh | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 5df2274..45767c6 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -93,6 +93,14 @@ install() { + else + [ -f /etc/mdadm/mdadm.conf ] && inst /etc/mdadm/mdadm.conf /etc/mdadm.conf + fi ++ if [ -d /etc/mdadm.conf.d ]; then ++ local f ++ inst_dir /etc/mdadm.conf.d ++ for f in /etc/mdadm.conf.d/*.conf; do ++ [ -f "$f" ] || continue ++ inst "$f" ++ done ++ fi + fi + + inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh" +-- +1.8.3.2 + diff --git a/sys-kernel/dracut/files/033-0009-mdraid-module-setup.sh-fixes-for-mdadm.patch b/sys-kernel/dracut/files/033-0009-mdraid-module-setup.sh-fixes-for-mdadm.patch new file mode 100644 index 000000000000..af4efb1d9968 --- /dev/null +++ b/sys-kernel/dracut/files/033-0009-mdraid-module-setup.sh-fixes-for-mdadm.patch @@ -0,0 +1,54 @@ +From 8cdb852fd2aa4d0746baee04018cde9b3fd04ddd Mon Sep 17 00:00:00 2001 +From: Alexander Tsoy <alexander@tsoy.me> +Date: Sun, 29 Sep 2013 01:31:01 +0400 +Subject: [PATCH 9/9] mdraid/module-setup.sh: fixes for mdadm-3.2.6+ + +mdadm-3.2.6+: +Incremental assembly rule contains "--offroot" arg. Update +regexp to catch this variant. + +mdadm-3.3+: +Rules was splitted into two files: 63-md-raid-arrays.rules +and 64-md-raid-assembly.rules. Install them both and edit +the latter. +--- + modules.d/90mdraid/module-setup.sh | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/modules.d/90mdraid/module-setup.sh b/modules.d/90mdraid/module-setup.sh +index 45767c6..34aae1e 100755 +--- a/modules.d/90mdraid/module-setup.sh ++++ b/modules.d/90mdraid/module-setup.sh +@@ -59,6 +59,7 @@ cmdline() { + } + + install() { ++ local rule rule_path + inst_multiple cat + inst_multiple -o mdmon + inst $(command -v partx) /sbin/partx +@@ -67,12 +68,20 @@ install() { + cmdline >> "${initdir}/etc/cmdline.d/90mdraid.conf" + echo >> "${initdir}/etc/cmdline.d/90mdraid.conf" + ++ # <mdadm-3.3 udev rule + inst_rules 64-md-raid.rules ++ # >=mdadm-3.3 udev rules ++ inst_rules 63-md-raid-arrays.rules 64-md-raid-assembly.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 + # when we explicitly don't want certain components to be incrementally + # assembled +- sed -i -r -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode)"/d' "${initdir}${udevdir}/rules.d/64-md-raid.rules" ++ for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do ++ rule_path="${initdir}${udevdir}/rules.d/${rule}" ++ [ -f "${rule_path}" ] && sed -i -r \ ++ -e '/RUN\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \ ++ "${rule_path}" ++ done + + inst_rules "$moddir/65-md-incremental-imsm.rules" + +-- +1.8.3.2 + |