Sync from SUSE:SLFO:Main dmraid revision e2f239ce1015a02b7c6655b297cbfec3

This commit is contained in:
Adrian Schröter 2024-05-03 12:06:17 +02:00
commit ac9e5670dc
13 changed files with 859 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,30 @@
From 3e073f5ac0b1d8d930615cd3fbb1401b56ceb848 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 26 Oct 2017 14:31:04 +0200
Subject: [PATCH] remove partitions with O_RDONLY
It's not necessary to use O_RDWR to use BLKPG_DEL_PARTITION.
It's actually harmful, because closing the device will cause
an IN_CLOSE_WRITE inotify event, which will trigger a BLKRRPART
from systemd, which will reinstate all partitions just deleted.
---
lib/device/partition.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/device/partition.c b/lib/device/partition.c
index 99e92f6a66cd..bcc8de819eb4 100644
--- a/1.0.0.rc16/lib/device/partition.c
+++ b/1.0.0.rc16/lib/device/partition.c
@@ -22,8 +22,7 @@ _remove_subset_partitions(struct lib_context *lc, struct raid_set *rs)
};
list_for_each_entry(rd, &rs->devs, devs) {
- int fd = open(rd->di->path, O_RDWR);
-
+ int fd = open(rd->di->path, O_RDONLY);
if (fd < 0)
LOG_ERR(lc, 0, "opening %s: %s\n", rd->di->path,
strerror(errno));
--
2.14.2

11
README.SUSE Normal file
View File

@ -0,0 +1,11 @@
Note about some pdc card:
Model: "Promise FastTrak100 TX2"
Vendor: pci 0x105a "Promise Technology, Inc."
Device: pci 0x6268 "PDC20270 (FastTrak100 LP/TX2/TX4)"
SubVendor: pci 0x105a "Promise Technology, Inc."
SubDevice: pci 0x4d68 "FastTrak100 TX2"
This card detects only devices to 128 GB. If you are running dmraid
with this card you will only be able to use the space up to this limit.

31
ddf-erase Normal file
View File

@ -0,0 +1,31 @@
Allow dmraid to erase ddf metadata properly.
2 things go wrong:
1/ when seeking to the anchor, it seeks to far by a factor of 512
2/ when writing to the anchor, it writes 0 bytes, not 512.
Signed-off-by: NeilBrown <neilb@suse.de>
References: bnc#712671
---
lib/format/ddf/ddf1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- 1.0.0.rc16.orig/lib/format/ddf/ddf1.c
+++ 1.0.0.rc16/lib/format/ddf/ddf1.c
@@ -536,7 +536,7 @@ try_to_find_ddf1(struct lib_context *lc,
ddf1_sboffset) || !is_ddf1(lc, di, ddf1))
goto bad;
- ddf1->anchor_offset = ddf1_sboffset;
+ ddf1->anchor_offset = ddf1_sboffset / 512;
/* Convert endianness */
ddf1->in_cpu_format = 0;
@@ -967,6 +967,7 @@ setup_rd(struct lib_context *lc, struct
ma[i].offset = ddf1->primary->primary_table_lba;
ma->offset = ddf1->anchor_offset;
+ ma->size = 512;
(ma++)->area = &ddf1->anchor;
(ma++)->area = ddf1->primary;

View File

@ -0,0 +1,100 @@
---
lib/activate/devmapper.c | 80 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 80 insertions(+)
--- 1.0.0.rc16.orig/lib/activate/devmapper.c
+++ 1.0.0.rc16/lib/activate/devmapper.c
@@ -207,6 +207,82 @@ run_task(struct lib_context *lc, struct
return ret;
}
+int get_edd_value(unsigned long *value, const char *path)
+{
+ FILE *file;
+ unsigned long v;
+
+ file = fopen(path, "r");
+ if (file == NULL)
+ return 0;
+
+ if (fscanf(file, "%lu", &v) == 0) {
+ fclose(file);
+ return 0;
+ }
+ fclose(file);
+
+ *value = v;
+ return 1;
+}
+
+#define EDD_PREFIX "/sys/firmware/edd/int13_dev80/"
+
+int getgeo_edd(unsigned long *cylinders,
+ unsigned long *heads,
+ unsigned long *sectors)
+{
+ int res;
+ unsigned long c, h, s;
+
+ res = get_edd_value(&c, EDD_PREFIX "legacy_max_cylinder") &&
+ get_edd_value(&h, EDD_PREFIX "legacy_max_head") &&
+ get_edd_value(&s, EDD_PREFIX "legacy_sectors_per_track");
+
+ if (!res)
+ return 0;
+
+ *cylinders = c;
+ *heads = h;
+ *sectors = s;
+
+ return 1;
+}
+
+/* Set the geometry of the device */
+int set_geometry(struct lib_context *lc, struct raid_set *rs)
+{
+ int ret;
+ struct dm_task *dmt;
+ unsigned long c, h, sec, st;
+ char cyl[10], heads[10], sectors[10], start[10];
+
+ st = 0;
+ if (!getgeo_edd(&c, &h, &sec)) {
+ /* default */
+ c = 16383;
+ h = 16;
+ sec = 63;
+ }
+
+ snprintf(cyl, 10, "%lu", c);
+ snprintf(heads, 10, "%lu", h);
+ snprintf(sectors, 10, "%lu", sec);
+ snprintf(start, 10, "%lu", st);
+
+ _init_dm();
+ ret = (dmt = dm_task_create(DM_DEVICE_SET_GEOMETRY)) &&
+ dm_task_set_name(dmt, rs->name) &&
+ dm_task_set_geometry(dmt, cyl, heads, sectors, start);
+
+ if (ret)
+ ret = dm_task_run(dmt);
+
+ _exit_dm(dmt);
+
+ return ret;
+}
+
/* Create a mapped device. */
int
dm_create(struct lib_context *lc, struct raid_set *rs, char *table, char *name)
@@ -216,6 +292,10 @@ dm_create(struct lib_context *lc, struct
/* Create <dev_name> */
ret = run_task(lc, rs, table, DM_DEVICE_CREATE, name);
+ /* Set geometry */
+ if (ret)
+ set_geometry(lc, rs);
+
/*
* In case device creation failed, check if target
* isn't registered with the device-mapper core

BIN
dmraid-1.0.0.rc16-3.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

15
dmraid-activation.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description=Activation of DM RAID sets
DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-udev-settle.service
Before=lvm2-activation-early.service cryptsetup.target local-fs.target shutdown.target
Wants=systemd-udev-settle.service
[Service]
EnvironmentFile=-/etc/sysconfig/dmraid
ExecStart=/sbin/dmraid -ay -p $DMRAID_START_OPTIONS
Type=oneshot
[Install]
WantedBy=sysinit.target

View File

@ -0,0 +1,13 @@
Index: 1.0.0.rc16/lib/locking/locking.c
===================================================================
--- 1.0.0.rc16.orig/lib/locking/locking.c
+++ 1.0.0.rc16/lib/locking/locking.c
@@ -12,7 +12,7 @@
#include "internal.h"
/* File locking private data. */
-static const char *lock_file = "/var/lock/dmraid/.lock";
+static const char *lock_file = "/run/lock/dmraid/.lock";
static int lf = -1;
/* flock file. */

380
dmraid.changes Normal file
View File

@ -0,0 +1,380 @@
-------------------------------------------------------------------
Tue Dec 27 10:33:15 UTC 2022 - Ludwig Nussel <lnussel@suse.com>
- Replace transitional %usrmerged macro with regular version check (boo#1206798)
-------------------------------------------------------------------
Tue May 17 07:54:00 UTC 2022 - Ferdinand Thiessen <rpm@fthiessen.de>
- Update to 1.0.0.rc16 patch level 3
- Drop upstream fixed and resolved dmraid-destdir.patch,
dmraid-1.0.0.rc16-cvs-2010-02-02.patch, lib-install.patch,
fix-return-function-type.patch and handle_spaces
- Drop remove_trylock, only required for very old glibc versions
(openSUSE 11.x)
-------------------------------------------------------------------
Tue Nov 17 13:59:10 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
- prepare usrmerge (boo#1029961)
-------------------------------------------------------------------
Thu Oct 17 17:38:43 UTC 2019 - Richard Brown <rbrown@suse.com>
- Remove obsolete Groups tag (fate#326485)
-------------------------------------------------------------------
Mon May 27 13:05:45 UTC 2019 - Martin Liška <mliska@suse.cz>
- Add fix-return-function-type.patch in order to fix
a warning.
-------------------------------------------------------------------
Thu Nov 23 13:39:52 UTC 2017 - rbrown@suse.com
- Replace references to /var/adm/fillup-templates with new
%_fillupdir macro (boo#1069468)
-------------------------------------------------------------------
Thu Oct 26 21:02:43 UTC 2017 - mwilck@suse.com
- dmraid: remove partitions with O_RDONLY
* add 0001-remove-partitions-with-O_RDONLY.patch
-------------------------------------------------------------------
Sat Feb 18 05:26:58 UTC 2017 - kukuk@suse.com
- Remove obsolete insserv call
-------------------------------------------------------------------
Thu Dec 10 16:08:28 CET 2015 - tiwai@suse.de
- Fix missing dependency on coreutils for initrd macros (boo#958562)
- Call missing initrd macro at postun (boo#958562)
-------------------------------------------------------------------
Mon Jul 13 09:33:56 UTC 2015 - lwang@suse.com
- dmevent_tool fails with "undefined symbol" (bnc#935623)
Added: fix-undefined-symbol.patch
-------------------------------------------------------------------
Wed Feb 4 19:33:01 UTC 2015 - coolo@suse.com
- remove with -f to avoid dependency on local umask
-------------------------------------------------------------------
Fri Dec 12 14:10:53 UTC 2014 - kkaempf@suse.com
- Split off dmraid-devel subpackage
-------------------------------------------------------------------
Mon Nov 10 10:39:45 UTC 2014 - dimstar@opensuse.org
- Own /usr/lib/tmpfiles.d: in the past, we were lucky for another
package in the build dependency chain to own this for us, but in
fact we should do it ourselves.
-------------------------------------------------------------------
Fri Jul 25 14:36:25 UTC 2014 - jeffm@suse.com
- Rename README.SuSE to README.SUSE (bnc#889025).
-------------------------------------------------------------------
Fri Jun 13 17:08:35 UTC 2014 - trenn@suse.de
- Use rpm macros to only trigger one initrd rebuild per install/update
-------------------------------------------------------------------
Wed May 21 09:40:42 UTC 2014 - jsegitz@novell.com
- added necessary macros for systemd files
-------------------------------------------------------------------
Fri Sep 13 20:04:57 UTC 2013 - crrodriguez@opensuse.org
- Fix Makefiles so they support DESTDIR
Added: dmraid-destdir.patch
- add tmpfiles.d so runtime directories are properly created
- Remove sysvinit support and replace it for native systemd support.
Added: dmraid-activation.service
Removed: boot.dmraid
-------------------------------------------------------------------
Tue Jul 23 14:38:15 CEST 2013 - ohering@suse.de
- Remove usage of absolute paths in initrd
- Remove some checks from mkinitrd scripts, they are always true
- List all used binaries in programs tag
-------------------------------------------------------------------
Wed Nov 28 12:07:36 UTC 2012 - rmilasan@suse.com
- Move lock file to /run/lock so it wont interfere with systemd.
-------------------------------------------------------------------
Mon Jul 9 09:03:57 UTC 2012 - cfarrell@suse.com
- license update: GPL-2.0
See lib/register/dmreg.c and tools/dmevent_tool.c (both have GPL-2.0
license)
-------------------------------------------------------------------
Mon Jan 9 09:28:36 UTC 2012 - aj@suse.de
- Add automake as buildrequires.
-------------------------------------------------------------------
Tue Dec 20 20:21:46 UTC 2011 - coolo@suse.com
- add autoconf as buildrequire to avoid implicit dependency
-------------------------------------------------------------------
Wed Sep 21 23:57:12 UTC 2011 - nfbrown@suse.com
- rebuild.fix: When a rebuild is requested that
cannot be handled, report and error instead of
crashing (bnc#716904)
- ddf-erase: Allow dmraid to erase ddf metadata
properly (bnc#712671)
-------------------------------------------------------------------
Fri May 27 09:29:31 UTC 2011 - lnussel@suse.de
- don't hard require boot.device-mapper in boot.dmraid. dm-mod is
autoloaded when accessing /dev/mapper/control anyways.
-------------------------------------------------------------------
Mon Apr 19 23:11:39 UTC 2010 - nfbrown@novell.com
- handle_space: cope with arrays with spaces in the name stored
in the metadata (bnc#470696)
- remove_trylock: pthreads_mutex_trylock is still very new in
glibc so safest not to use it yet (bnc#594388)
-------------------------------------------------------------------
Tue Feb 2 03:46:18 UTC 2010 - nfbrown@novell.com
- new upstream version, including latest CVS updates.
Both libdmraid-events and dm_dso_reg_tool are not
in the main package.
- dm_dso_reg_tool has been renamed to dmevent_tool in
line with upstream change.
bnc#528796 bnc#511329
-------------------------------------------------------------------
Mon Oct 5 22:19:52 UTC 2009 - crrodriguez@opensuse.org
- fix a few more fdleaks [bnc#543151]
-------------------------------------------------------------------
Sat Oct 3 13:21:37 UTC 2009 - crrodriguez@opensuse.org
- fix directory handle leaks in libdmraid-events [bnc#524202]
-------------------------------------------------------------------
Mon Aug 24 21:28:51 UTC 2009 - hvogel@novell.com
- Fix activation of isw raid sets when the disks have serialnumber
longer then 16 characters
- Add patch adding --rm_partitions cmdline option and functionality
- Fix mismatch between BIOS and dmraid's view of ISW raid 10 sets
-------------------------------------------------------------------
Sun Aug 2 18:50:22 UTC 2009 - jansimon.moeller@opensuse.org
- The cmdline options don't work when compiling the events module
on ARM. Add patch to directly include the ldflags in the
Makefile.
-------------------------------------------------------------------
Mon Nov 24 09:43:13 CET 2008 - hare@suse.de
- Properly quote mkinitrd scripts (bnc#447966)
-------------------------------------------------------------------
Mon Nov 10 12:44:08 CET 2008 - mkoenig@suse.de
- adapt mkinitrd script to changed UUID prefix [bnc#441479]
-------------------------------------------------------------------
Tue Oct 14 17:33:33 CEST 2008 - mkoenig@suse.de
- remove whitespace from serial id [bnc#433833]
-------------------------------------------------------------------
Thu Sep 25 14:49:41 CEST 2008 - mkoenig@suse.de
- update to 1.0.0rc15
* jm.c: fixed name handling
* nv.c: fixed endian bug
* added support for RAID set create/remove/rebuild and
event handling
- needed for [fate#304215,fate#303950,fate#304216]
- removed patches
dmraid-1.0.0.rc13-jm_termination.patch
dmraid-1.0.0.rc14-ddf1_segfault.patch
dmraid-add_uuid.patch
dmraid_fixup_nvidia.diff
dmraid-move-type-definition.diff
dmraid-pdc_max_sectors.patch
-------------------------------------------------------------------
Wed Sep 24 18:25:01 CEST 2008 - ro@suse.de
- change "udevsettle" to "udevadm settle"
-------------------------------------------------------------------
Tue Sep 16 17:36:09 CEST 2008 - mkoenig@suse.de
- ignore the timestamp for LSI 1068E DDF1 metadata [bnc#426615]
-------------------------------------------------------------------
Mon Sep 15 13:42:57 CEST 2008 - ro@suse.de
- fix typo in libdmraid Makefile
- split off libdmraid-events0 package according to
shared library packaging policy
-------------------------------------------------------------------
Sat Sep 13 21:44:39 CEST 2008 - meissner@suse.de
- symlink, not copy the .so to the .so.0 file
- removed self-provides, some other .spec file fixes
-------------------------------------------------------------------
Wed Sep 10 15:14:19 CEST 2008 - xwhu@novell.com
- Adding DSO for event-handling [fate#304214]
-------------------------------------------------------------------
Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de
- Call mkinitrd_setup during %post and %postun (bnc#413709)
-------------------------------------------------------------------
Wed Aug 20 15:20:06 CEST 2008 - mkoenig@suse.de
- enable SELinux support [fate#303662]
-------------------------------------------------------------------
Wed Aug 13 12:36:08 CEST 2008 - mkoenig@suse.de
- fix init script tags
-------------------------------------------------------------------
Wed Jul 23 15:27:07 CEST 2008 - hare@suse.de
- Include mkinitrd scriptlets.
-------------------------------------------------------------------
Wed Mar 12 16:24:06 CET 2008 - mkoenig@suse.de
- add hack to avoid segfault with DDF1 metadata and explicit
indication of the raid set [#367686]
-------------------------------------------------------------------
Wed Sep 12 14:44:57 CEST 2007 - mkoenig@suse.de
- add quirk for maximum detected device size of some pdc card
[#215222]
-------------------------------------------------------------------
Tue Jul 31 14:42:18 CEST 2007 - hare@suse.de
- dmraid requires kpartx.
-------------------------------------------------------------------
Mon Jul 30 13:34:11 CEST 2007 - hare@suse.de
- Do not activate partitions from dmraid; udev handles it.
-------------------------------------------------------------------
Tue Jul 10 10:59:13 CEST 2007 - mkoenig@suse.de
- update to version 1.0.0.rc14
* bugfix release
-------------------------------------------------------------------
Tue Jun 19 13:32:48 CEST 2007 - mkoenig@suse.de
- use boot.localfs to avoid expansion problem
-------------------------------------------------------------------
Tue Jun 19 13:00:45 CEST 2007 - mkoenig@suse.de
- Add X-Start-Before: $local_fs dependency
-------------------------------------------------------------------
Thu Mar 29 11:40:15 CEST 2007 - mkoenig@suse.de
- Add zlib-devel to BuildRequires
-------------------------------------------------------------------
Tue Feb 20 14:44:36 CET 2007 - mkoenig@suse.de
- provide boot script [#230708]
-------------------------------------------------------------------
Mon Dec 11 10:48:21 CET 2006 - mkoenig@suse.de
- fix jm name string termination problem [#223843]
patch: dmraid-1.0.0.rc13-jm_termination.patch
- fix min, max macros
patch: dmraid-1.0.0.rc13-fix_macro.patch
-------------------------------------------------------------------
Thu Nov 23 16:51:32 CET 2006 - mkoenig@suse.de
- fix geometry patch [#222110]
-------------------------------------------------------------------
Mon Nov 20 18:53:55 CET 2006 - mkoenig@suse.de
- set geometry of dm device [#222110]
-------------------------------------------------------------------
Thu Nov 9 14:25:36 CET 2006 - mkoenig@suse.de
- update to version 1.0.0.rc13
* Fixes for Promise FastTrak and Silicon Image Medley ATARAID
* Support for SNIA DDF1 and JBOD
-------------------------------------------------------------------
Thu Sep 14 00:17:11 CEST 2006 - ro@suse.de
- use device-mapper-devel in BuildRequires
-------------------------------------------------------------------
Tue Aug 29 10:09:10 CEST 2006 - hare@suse.de
- update to 1.0.0-rc11
- NVidia endianness fixes
- Add UUID to device-mapper tables
- Fixup '-cc' argument
-------------------------------------------------------------------
Wed Jan 25 21:35:31 CET 2006 - mls@suse.de
- converted neededforbuild to BuildRequires
-------------------------------------------------------------------
Mon Dec 5 10:10:35 CET 2005 - kukuk@suse.de
- Remove unused klibc-devel from neededforbuild
-------------------------------------------------------------------
Wed Jul 13 16:25:07 CEST 2005 - cadaha@suse.de
- update to 1.0.0-rc8, fix big endian build
-------------------------------------------------------------------
Wed Sep 22 01:14:20 CEST 2004 - cadaha@suse.de
- fix dmraid -rc output for unsupported devices
-------------------------------------------------------------------
Mon Sep 20 19:21:34 CEST 2004 - cadaha@suse.de
- created package

172
dmraid.spec Normal file
View File

@ -0,0 +1,172 @@
#
# spec file for package dmraid
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} >= 1550
%define sbindir %_sbindir
%else
%define sbindir /sbin
%endif
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
Name: dmraid
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: device-mapper-devel
BuildRequires: libselinux-devel
BuildRequires: suse-module-tools
BuildRequires: systemd-rpm-macros
BuildRequires: zlib-devel
Requires: aaa_base
Requires: kpartx
Requires(post): coreutils
Requires(postun):coreutils
URL: http://people.redhat.com/~heinzm/sw/dmraid/src/
Summary: A Device-Mapper Software RAID Support Tool
License: GPL-2.0-only
Version: 1.0.0.rc16.3
%define src_version 1.0.0.rc16-3
Release: 0
Source: https://people.redhat.com/~heinzm/sw/dmraid/src/dmraid-%{src_version}.tar.bz2
Source1: sysconfig.dmraid
Source3: README.SUSE
Source6: dmraid-activation.service
Patch0: dmraid-1.0.0.rc13-geometry.patch
Patch1: rebuild.fix
Patch2: ddf-erase
Patch3: dmraid-move-var-lock-to-run-lock.patch
Patch4: fix-undefined-symbol.patch
Patch5: 0001-remove-partitions-with-O_RDONLY.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq
%{systemd_requires}
%description
This software discovers, activates, deactivates, and displays
properties of software RAID sets, such as ATARAID, and contained DOS
partitions.
dmraid uses libdevmapper and the device-mapper kernel runtime to create
devices with respective mappings for the ATARAID sets discovered.
The following ATARAID types are supported:
- Highpoint HPT37X
- Highpoint HPT45X
- Intel Software RAID
- Promise FastTrak
- Silicon Image Medley
%package devel
Summary: Development files for dmraid
Requires: %{name} = %{version}
%description devel
This software discovers, activates, deactivates, and displays
properties of software RAID sets, such as ATARAID, and contained DOS
partitions.
dmraid uses libdevmapper and the device-mapper kernel runtime to create
devices with respective mappings for the ATARAID sets discovered.
%prep
%setup -n dmraid/%{src_version}/dmraid
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p2
cp %{SOURCE3} .
%build
#rm -f aclocal.m4
autoreconf -fi
rm -r autom4te.cache
%configure \
--with-usrlibdir=%{_libdir} \
%if 0%{?suse_version} < 1550
--sbindir=%{sbindir} \
%endif
--with-user=`id -nu` --with-group=`id -ng` \
--enable-libselinux --enable-libsepol
make
%install
%make_install
rm -f %{buildroot}%{_libdir}/libdmraid.a
mkdir -p %{buildroot}%{_fillupdir}
install -m644 %{SOURCE1} %{buildroot}%{_fillupdir}/sysconfig.dmraid
install -D -m 0644 %{S:6} %{buildroot}%{_unitdir}/dmraid-activation.service
install -d %{buildroot}%{_tmpfilesdir}
echo 'd /run/lock/dmraid 0700 root root -' > %{buildroot}%{_tmpfilesdir}/dmraid.conf
# E: spurious-executable-perm (Badness: 50) /usr/include/dmraid/locking.h
chmod -x %{buildroot}%{_prefix}/include/dmraid/*h
%pre
%service_add_pre dmraid-activation.service
%preun
%service_del_preun dmraid-activation.service
%post
/sbin/ldconfig
%service_add_post dmraid-activation.service
%{?regenerate_initrd_post}
%posttrans
%{?regenerate_initrd_posttrans}
%{fillup_only}
%postun
/sbin/ldconfig
%service_del_postun dmraid-activation.service
%{?regenerate_initrd_post}
%files
%defattr(-, root, root)
%{sbindir}/dmraid
%{sbindir}/dmevent_tool
%{_mandir}/man8/*
%doc LICENSE LICENSE_GPL LICENSE_LGPL README README.SUSE TODO doc/*
%{_fillupdir}/sysconfig.dmraid
%{_libdir}/libdmraid.so.*
%{_libdir}/libdmraid-events-isw.so
%dir %{_libdir}/device-mapper
%{_libdir}/device-mapper/libdmraid-events-isw.so
%dir %{_tmpfilesdir}
%{_tmpfilesdir}/dmraid.conf
%{_unitdir}/dmraid-activation.service
%files devel
%defattr(-, root, root)
%{_prefix}/include/dmraid
%{_libdir}/libdmraid.so
%changelog

View File

@ -0,0 +1,28 @@
From 352b509c8f452a0d77d8adb9149130d5af624b32 Mon Sep 17 00:00:00 2001
From: Liuhua Wang <lwang@suse.com>
Date: Thu, 9 Jul 2015 10:22:46 +0800
Subject: [PATCH] fix undefined symbol
Signed-off-by: Liuhua Wang <lwang@suse.com>
References: bnc#935623
---
dmraid/1.0.0.rc16/tools/dmevent_tool.c | 2 ++
1 file changed, 2 insertions(+)
diff --git 1.0.0.rc16.orig/tools/dmevent_tool.c 1.0.0.rc16/tools/dmevent_tool.c
index 8562098..4c43b30 100644
--- 1.0.0.rc16.orig/tools/dmevent_tool.c
+++ 1.0.0.rc16/tools/dmevent_tool.c
@@ -77,6 +77,8 @@
#define SYS_DM_DEV "/dev"
#define SYS_DM_SLAVES_DIR "/slaves"
+int dmeventd_debug = 0;
+
/* Command line option counters for CLI processing. */
enum option_type { OPT_a, OPT_h, OPT_m, OPT_r, OPT_u, OPT_V, OPT_SUM, OPT_MAX };
static int optc[OPT_MAX];
--
1.8.4.5

27
rebuild.fix Normal file
View File

@ -0,0 +1,27 @@
Only imsm arrays can be rebuild by dmraid
Others cause a segfault.
Fix that so they print a more helpful error messages.
From: Leonardo Chiquitto <lchiquitto@suse.com>
Reviewed-by: NeilBrown <neilb@suse.de>
References: bnc#716904
---
lib/metadata/reconfig.c | 5 +++++
1 file changed, 5 insertions(+)
--- 1.0.0.rc16.orig/lib/metadata/reconfig.c
+++ 1.0.0.rc16/lib/metadata/reconfig.c
@@ -552,6 +552,11 @@ _rebuild_raidset(struct lib_context *lc,
int driveRebuild = 1;
rs = find_group(lc, sub_rs);
+ if (!rs) {
+ log_print(lc, "Rebuild: array \"%s\" cannot be rebuilt by dmraid.\n",
+ set_name);
+ return 1;
+ }
/* raid 0 cannot be rebuild - exit */
if (T_RAID0(sub_rs) && (!SETS(sub_rs))) {

26
sysconfig.dmraid Normal file
View File

@ -0,0 +1,26 @@
## Path: System/File systems/dmraid
## Description: dmraid configuration
#
## Type: integer(0:)
## Default: 60
#
# Timeout for udev device detection. This is the upper limit which the
# boot script will wait for udev to finish hotplug event processing.
# If not all devices are detected during boot this value should be
# increased. Setting this to '0' disables waiting for udev.
#
DMRAID_DEVICE_TIMEOUT="60"
## Type: string
## Default: ""
#
# Commandline options for dmraid on start
#
DMRAID_START_OPTIONS=""
## Type: string
## Default: ""
#
# Commandline options for dmraid on stop
#
DMRAID_STOP_OPTIONS=""