Accepting request 35548 from home:michal-m:branches:Base:System
Copy from home:michal-m:branches:Base:System/mdadm via accept of submit request 35548 revision 3. Request was accepted with message: OBS-URL: https://build.opensuse.org/request/show/35548 OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=17
This commit is contained in:
parent
c9aea3ee03
commit
4aea6a09c6
35
64-md-raid.rules
Normal file
35
64-md-raid.rules
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# 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="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"
|
||||||
|
|
||||||
|
# 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{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
|
||||||
|
ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
|
||||||
|
ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
|
||||||
|
|
||||||
|
ENV{DEVTYPE}!="partition", GOTO="md_vol_id"
|
||||||
|
IMPORT{program}="/sbin/mdadm --detail --export %r/$parent"
|
||||||
|
ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace"
|
||||||
|
ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n"
|
||||||
|
ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
|
||||||
|
ENV{DEVTYPE}=="partition", 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"
|
@ -1,4 +1,32 @@
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 23 14:49:38 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- mkinitrd-*.sh: Assemble md arrays even if the root= or resume=
|
||||||
|
option doesn't directly refer to md (bnc#589676, bnc#586837,
|
||||||
|
bnc#583424).
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 11 10:18:18 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- 64-md-raid.rules: Use blkid instead of vol_id.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 11 09:58:21 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- 64-md-raid.rules: Allow --incremental assembly if "AUTO -all" is
|
||||||
|
given in mdadm.conf (fate#307478).
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 9 16:15:41 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- Install udev rules in /lib/udev/rules.d (fate#307478).
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 22 15:14:03 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- mkinitrd-setup.sh: call mdadm --scan only if necessary
|
||||||
|
(bnc#581769).
|
||||||
|
|
||||||
Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz
|
Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz
|
||||||
|
|
||||||
- fix modprobe invocation in boot.md (bnc#565293).
|
- fix modprobe invocation in boot.md (bnc#565293).
|
||||||
|
10
mdadm.spec
10
mdadm.spec
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
Name: mdadm
|
Name: mdadm
|
||||||
Version: 3.0.3
|
Version: 3.0.3
|
||||||
Release: 2
|
Release: 3
|
||||||
BuildRequires: sgmltool
|
BuildRequires: sgmltool
|
||||||
PreReq: %fillup_prereq %insserv_prereq
|
PreReq: %fillup_prereq %insserv_prereq
|
||||||
Obsoletes: raidtools
|
Obsoletes: raidtools
|
||||||
@ -37,6 +37,7 @@ Source3: mdadmd
|
|||||||
Source4: boot.md
|
Source4: boot.md
|
||||||
Source5: mkinitrd-setup.sh
|
Source5: mkinitrd-setup.sh
|
||||||
Source6: mkinitrd-boot.sh
|
Source6: mkinitrd-boot.sh
|
||||||
|
Source7: 64-md-raid.rules
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Mdadm is a program that can be used to control Linux md devices. It is
|
Mdadm is a program that can be used to control Linux md devices. It is
|
||||||
@ -73,8 +74,8 @@ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd
|
|||||||
rm -rf $RPM_BUILD_ROOT/var/run/mdadm
|
rm -rf $RPM_BUILD_ROOT/var/run/mdadm
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/run
|
mkdir -p $RPM_BUILD_ROOT/var/run
|
||||||
ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm
|
ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm
|
||||||
# remove here, using the one in the udev package
|
install -d $RPM_BUILD_ROOT/lib/udev/rules.d
|
||||||
rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules
|
install -m 644 %_sourcedir/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d
|
||||||
|
|
||||||
%post
|
%post
|
||||||
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup
|
||||||
@ -117,5 +118,8 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%dir /lib/mkinitrd/scripts
|
%dir /lib/mkinitrd/scripts
|
||||||
/lib/mkinitrd/scripts/setup-md.sh
|
/lib/mkinitrd/scripts/setup-md.sh
|
||||||
/lib/mkinitrd/scripts/boot-md.sh
|
/lib/mkinitrd/scripts/boot-md.sh
|
||||||
|
%dir /lib/udev
|
||||||
|
%dir /lib/udev/rules.d
|
||||||
|
/lib/udev/rules.d/64-md-raid.rules
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@ -42,6 +42,9 @@ md_assemble()
|
|||||||
{
|
{
|
||||||
local dev=$1 mdconf container
|
local dev=$1 mdconf container
|
||||||
|
|
||||||
|
if test -e "$dev"; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
case "$dev" in
|
case "$dev" in
|
||||||
/dev/md[0-9]*p[0-9]*)
|
/dev/md[0-9]*p[0-9]*)
|
||||||
dev=${dev%p[0-9]*}
|
dev=${dev%p[0-9]*}
|
||||||
@ -84,5 +87,8 @@ if [ -n "$need_mdadm" ]; then
|
|||||||
if [ -n "$md_dev" ] ; then
|
if [ -n "$md_dev" ] ; then
|
||||||
md_assemble "$md_dev"
|
md_assemble "$md_dev"
|
||||||
fi
|
fi
|
||||||
|
for dev in $md_devs; do
|
||||||
|
md_assemble "$dev"
|
||||||
|
done
|
||||||
wait_for_events
|
wait_for_events
|
||||||
fi
|
fi
|
||||||
|
@ -6,7 +6,7 @@ mdblockdev=
|
|||||||
|
|
||||||
# Full mdadm.conf generated by mdadm.
|
# Full mdadm.conf generated by mdadm.
|
||||||
# Contains all created MD RAIDs
|
# Contains all created MD RAIDs
|
||||||
mdadm_conf=$(mdadm --examine --brief --scan)
|
mdadm_conf=
|
||||||
|
|
||||||
cont_list=
|
cont_list=
|
||||||
md_devs=
|
md_devs=
|
||||||
@ -64,7 +64,10 @@ for bd in $blockdev ; do
|
|||||||
mdconf="$(mdadm -Db "$container")\\n$mdconf"
|
mdconf="$(mdadm -Db "$container")\\n$mdconf"
|
||||||
;;
|
;;
|
||||||
[0-9a-f]*[0-9a-f])
|
[0-9a-f]*[0-9a-f])
|
||||||
mdconf="$(mdadm -Ebs | grep "UUID=$container")\\n$mdconf"
|
if test -z "$mdadm_conf"; then
|
||||||
|
mdadm_conf=$(mdadm --examine --brief --scan)
|
||||||
|
fi
|
||||||
|
mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "unrecognized container for $md_dev: $container"
|
echo "unrecognized container for $md_dev: $container"
|
||||||
@ -84,6 +87,10 @@ if [ -n "$root_md" ] ; then
|
|||||||
eval echo -e \"\$md_conf_$md\" >> $tmp_mnt/etc/mdadm.conf
|
eval echo -e \"\$md_conf_$md\" >> $tmp_mnt/etc/mdadm.conf
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
# Remember which arrays are needed for the root or swap device and assemble
|
||||||
|
# them all during boot. The root= or resume= option might not directly refer to
|
||||||
|
# the array.
|
||||||
|
md_devs=$(printf '/dev/%s ' $md_devs)
|
||||||
|
|
||||||
save_var need_mdadm
|
save_var need_mdadm
|
||||||
save_var root_md
|
save_var md_devs
|
||||||
|
Loading…
Reference in New Issue
Block a user