]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
mdadm: New package.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Feb 2010 15:35:47 +0000 (16:35 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 19 Feb 2010 15:35:47 +0000 (16:35 +0100)
pkgs/core/mdadm/mdadm.nm [new file with mode: 0644]
pkgs/core/mdadm/patches/mdadm-3.0-devel2-warn.patch [new file with mode: 0644]

diff --git a/pkgs/core/mdadm/mdadm.nm b/pkgs/core/mdadm/mdadm.nm
new file mode 100644 (file)
index 0000000..2792e7b
--- /dev/null
@@ -0,0 +1,65 @@
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007, 2008 Michael Tremer & Christian Schmidt                 #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
+
+###############################################################################
+# Definitions
+###############################################################################
+
+include $(PKGROOT)/Include
+
+PKG_NAME       = mdadm
+PKG_VER        = 3.0-devel2
+PKG_REL        = 0
+
+PKG_MAINTAINER =
+PKG_GROUP      = System/Base
+PKG_URL        = http://www.kernel.org/pub/linux/utils/raid/mdadm/
+PKG_LICENSE    = GPLv2+
+PKG_SUMMARY    = The mdadm program controls Linux md devices (software RAID arrays).
+
+PKG_BUILD_DEPS+= groff
+
+define PKG_DESCRIPTION
+       The mdadm program is used to create, manage, and monitor Linux MD (software \
+       RAID) devices.  As such, it provides similar functionality to the raidtools \
+       package.  However, mdadm is a single program, and it can perform \
+       almost all functions without a configuration file, though a configuration \
+       file can be used to help with some common tasks.
+endef
+
+PKG_TARBALL    = $(THISAPP).tar.bz2
+
+CFLAGS        += -fno-strict-aliasing
+
+define STAGE_PREPARE_CMDS
+       cd $(DIR_APP) && sed -e "s/^INSTALL = .*/INSTALL = install/" -i Makefile
+endef
+
+define STAGE_BUILD
+       cd $(DIR_APP) && make $(PARALLELISMFLAGS) CXFLAGS="$(CFLAGS)" \
+               SYSCONFDIR="/etc" MDASSEMBLE_AUTO=1
+endef
+
+define STAGE_INSTALL
+       cd $(DIR_APP) && make install BINDIR=/sbin DESTDIR=$(BUILDROOT)
+
+       -mkdir -pv $(BUILDROOT)/var/run/mdadm
+       chmod 700 $(BUILDROOT)/var/run/mdadm
+endef
diff --git a/pkgs/core/mdadm/patches/mdadm-3.0-devel2-warn.patch b/pkgs/core/mdadm/patches/mdadm-3.0-devel2-warn.patch
new file mode 100644 (file)
index 0000000..b472010
--- /dev/null
@@ -0,0 +1,24 @@
+--- mdadm-3.0-devel2/mdopen.c.warn     2009-02-12 09:13:54.000000000 -0500
++++ mdadm-3.0-devel2/mdopen.c  2009-02-12 09:34:15.000000000 -0500
+@@ -88,8 +88,9 @@ void make_parts(char *dev, int cnt)
+                       if (chmod(name, stb2.st_mode & 07777))
+                               perror("chmod");
+               } else {
+-                      snprintf(sym, 10000, "%s%s%d", orig, odig?"p":"", i);
+-                      symlink(sym, name);
++                      snprintf(sym, 1024, "%s%s%d", orig, odig?"p":"", i);
++                      if (symlink(sym, name))
++                              perror("symlink");
+               }
+               stat(name, &stb2);
+               add_dev(name, &stb2, 0, NULL);
+@@ -357,7 +358,8 @@ int create_mddev(char *dev, char *name, 
+                                       strcpy(chosen, devname);
+                               }
+                       } else
+-                              symlink(devname, chosen);
++                              if (symlink(devname, chosen))
++                                      perror("symlink");
+                       if (use_mdp && strcmp(chosen, devname) != 0)
+                               make_parts(chosen, parts);
+               }