From b5de3e63a0e5edcb651d6c72f384ae6d151274c1c51a76c1cf329422c599b8d7 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 18 Aug 2011 06:03:57 +0000 Subject: [PATCH] - Use udev rules file from upstream package, rather have having a separate one. OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=40 --- 64-md-raid.rules | 40 ------------------- ...37e75b1f5b => mdadm-3.2.2_git3b1dab1bdbda0 | 18 +++++++++ mdadm.changes | 6 +++ mdadm.spec | 5 +-- 4 files changed, 26 insertions(+), 43 deletions(-) delete mode 100644 64-md-raid.rules rename mdadm-3.2.2_git15537e75b1f5b => mdadm-3.2.2_git3b1dab1bdbda0 (96%) diff --git a/64-md-raid.rules b/64-md-raid.rules deleted file mode 100644 index 169cdb4..0000000 --- a/64-md-raid.rules +++ /dev/null @@ -1,40 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="md_end" -ACTION!="add|change", GOTO="md_end" - -# import data from a raid member and activate it -ENV{ID_FS_TYPE}=="linux_raid_member", PROGRAM="/bin/grep -qs '^AUTO -all' /etc/mdadm.conf", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" -# import data from a raid set -KERNEL!="md*", GOTO="md_end" - -ENV{DEVTYPE}!="disk",GOTO="md_not_disk" -#this extra caution avoids some races with the device disappearing -TEST!="md/array_state", GOTO="md_end" -# container devices have a metadata version of e.g. 'external:ddf' and -# never leave state 'inactive' -ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -LABEL="md_ignore_state" - -IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" -ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" -ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" - -LABEL="md_not_disk" - -ENV{DEVTYPE}!="partition", GOTO="md_vol_id" -IMPORT{program}="/sbin/mdadm --detail --export %r/$parent" -ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" -ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" -ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" -ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" - -LABEL="md_vol_id" -IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -OPTIONS+="link_priority=100" -ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -LABEL="md_end" diff --git a/mdadm-3.2.2_git15537e75b1f5b b/mdadm-3.2.2_git3b1dab1bdbda0 similarity index 96% rename from mdadm-3.2.2_git15537e75b1f5b rename to mdadm-3.2.2_git3b1dab1bdbda0 index d0d24d2..20998bd 100644 --- a/mdadm-3.2.2_git15537e75b1f5b +++ b/mdadm-3.2.2_git3b1dab1bdbda0 @@ -949,6 +949,24 @@ index 44314ba..56813b7 100644 buf[n] = 0; *val = strtoull(buf, &ep, 0); if (ep == buf || (*ep != 0 && *ep != '\n' && *ep != ' ')) +diff --git a/udev-md-raid.rules b/udev-md-raid.rules +index 1d89833..c2105bc 100644 +--- a/udev-md-raid.rules ++++ b/udev-md-raid.rules +@@ -3,9 +3,11 @@ + SUBSYSTEM!="block", GOTO="md_end" + + # handle potential components of arrays +-ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ++ENV{ID_FS_TYPE}=="linux_raid_member", ENV{ID_PATH}!="", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ++ENV{ID_FS_TYPE}=="linux_raid_member", ENV{ID_PATH}=="", ACTION=="remove", RUN+="/sbin/mdadm -If $name" + ENV{ID_FS_TYPE}=="linux_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" +-ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ++ENV{ID_FS_TYPE}=="isw_raid_member", ENV{ID_PATH}!="", ACTION=="remove", RUN+="/sbin/mdadm -If $name --path $env{ID_PATH}" ++ENV{ID_FS_TYPE}=="isw_raid_member", ENV{ID_PATH}=="", ACTION=="remove", RUN+="/sbin/mdadm -If $name" + ENV{ID_FS_TYPE}=="isw_raid_member", ACTION=="add", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" + + # handle md arrays diff --git a/util.c b/util.c index 10bbe56..ce03239 100644 --- a/util.c diff --git a/mdadm.changes b/mdadm.changes index 8993480..2ff2c79 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Aug 18 06:01:39 UTC 2011 - nfbrown@novell.com + +- Use udev rules file from upstream package, rather + have having a separate one. + ------------------------------------------------------------------- Thu Aug 18 03:01:57 UTC 2011 - nfbrown@novell.com diff --git a/mdadm.spec b/mdadm.spec index ba1a9ac..8019d3d 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -37,8 +37,7 @@ Source3: mdadmd Source4: boot.md Source5: mkinitrd-setup.sh Source6: mkinitrd-boot.sh -Source7: 64-md-raid.rules -Patch0: mdadm-3.2.2_git15537e75b1f5b +Patch0: mdadm-3.2.2_git3b1dab1bdbda0 %description Mdadm is a program that can be used to control Linux md devices. It is @@ -77,7 +76,7 @@ rm -rf $RPM_BUILD_ROOT/var/run/mdadm mkdir -p $RPM_BUILD_ROOT/var/run ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm install -d $RPM_BUILD_ROOT/lib/udev/rules.d -install -m 644 %_sourcedir/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d +install -m 644 udev-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup