summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl F. Meinkopf2022-03-20 02:25:48 +0300
committerKarl F. Meinkopf2022-03-20 02:27:26 +0300
commit6e51b693ae9ca1595ac0c7c65e6c95fbb0b8f36e (patch)
treea0de5f3dd03b77bab1a324937d4253a1a4d6ca0a
downloadaur-6e51b693ae9ca1595ac0c7c65e6c95fbb0b8f36e.tar.gz
Initialize the package (v4.2)
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD47
-rw-r--r--assembly-rules-imsm.patch11
-rw-r--r--disable-werror.patch11
-rw-r--r--mdadm.conf67
-rw-r--r--mdadm_udev_install25
6 files changed, 188 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..a64c355921d5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,27 @@
+pkgbase = mdadm-patched-intel-rst
+ pkgdesc = A tool for managing/monitoring Linux md device arrays, also known as Software RAID (patched to work properly with Intel RST FakeRAID)
+ pkgver = 4.2
+ pkgrel = 1
+ url = https://git.kernel.org/pub/scm/utils/mdadm
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ makedepends = patch
+ depends = glibc
+ depends = systemd
+ provides = mdadm
+ replaces = raidtools
+ backup = etc/mdadm.conf
+ source = git+https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git#tag=mdadm-4.2?signed
+ source = disable-werror.patch
+ source = assembly-rules-imsm.patch
+ source = mdadm.conf
+ source = mdadm_udev_install
+ validpgpkeys = 6A86B80E1D22F21D0B26BA75397D82E0531A9C91
+ sha256sums = SKIP
+ sha256sums = 85c98b8fe880bdd365fc0e400af10c2e5d0c439d338e055f66c16162f9282846
+ sha256sums = 3d882f33b8c56cf7d5c8882a332104b3a228ee42a0ba005f9c9905c2c2ca23a2
+ sha256sums = 4ce1e90690282f98e4828e11576fbd61be65e97a2cdae6c7eac7035ea5ee53e5
+ sha256sums = b6782029bdae2d7f87ea0e332bb90f72a7792e933580e37602e81e2f1bb82a9c
+
+pkgname = mdadm-patched-intel-rst
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..2b040614b0b9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Tobias Powalowski <tpowa@archlinux.org>
+# Contributor: Judd Vinet <jvinet@zeroflux.org>
+
+pkgname=mdadm-patched-intel-rst
+pkgver=4.2
+pkgrel=1
+pkgdesc='A tool for managing/monitoring Linux md device arrays, also known as Software RAID (patched to work properly with Intel RST FakeRAID)'
+arch=('x86_64')
+provides=('mdadm')
+license=('GPL')
+url='https://git.kernel.org/pub/scm/utils/mdadm'
+makedepends=('git' 'patch')
+depends=('glibc' 'systemd')
+replaces=('raidtools')
+backup=('etc/mdadm.conf')
+validpgpkeys=('6A86B80E1D22F21D0B26BA75397D82E0531A9C91') # Jes Sorensen
+source=("git+https://git.kernel.org/pub/scm/utils/mdadm/mdadm.git#tag=mdadm-${pkgver}?signed"
+ 'disable-werror.patch'
+ 'assembly-rules-imsm.patch'
+ 'mdadm.conf'
+ 'mdadm_udev_install')
+sha256sums=('SKIP'
+ '85c98b8fe880bdd365fc0e400af10c2e5d0c439d338e055f66c16162f9282846'
+ '3d882f33b8c56cf7d5c8882a332104b3a228ee42a0ba005f9c9905c2c2ca23a2'
+ '4ce1e90690282f98e4828e11576fbd61be65e97a2cdae6c7eac7035ea5ee53e5'
+ 'b6782029bdae2d7f87ea0e332bb90f72a7792e933580e37602e81e2f1bb82a9c')
+prepare() {
+ cd mdadm
+ patch -Np0 -i ${srcdir}/disable-werror.patch
+ patch -Np0 -i ${srcdir}/assembly-rules-imsm.patch
+}
+
+build() {
+ cd mdadm
+
+ make CXFLAGS="$CFLAGS" BINDIR=/usr/bin UDEVDIR=/usr/lib/udev
+}
+
+package() {
+ cd mdadm
+
+ make INSTALL=/usr/bin/install BINDIR=/usr/bin DESTDIR="$pkgdir" UDEVDIR=/usr/lib/udev install
+ make SYSTEMD_DIR="$pkgdir"/usr/lib/systemd/system install-systemd
+ install -D -m644 ../mdadm.conf "$pkgdir"/etc/mdadm.conf
+ install -D -m644 ../mdadm_udev_install "$pkgdir"/usr/lib/initcpio/install/mdadm_udev
+ ln -s mdadm_udev "$pkgdir"/usr/lib/initcpio/install/mdadm
+}
diff --git a/assembly-rules-imsm.patch b/assembly-rules-imsm.patch
new file mode 100644
index 000000000000..10c30af88666
--- /dev/null
+++ b/assembly-rules-imsm.patch
@@ -0,0 +1,11 @@
+--- udev-md-raid-assembly.rules.old 2022-03-20 01:46:42.730000041 +0300
++++ udev-md-raid-assembly.rules 2022-03-20 01:51:35.713333437 +0300
+@@ -30,7 +30,7 @@
+
+ # remember you can limit what gets auto/incrementally assembled by
+ # mdadm.conf(5)'s 'AUTO' and selectively whitelist using 'ARRAY'
+-ACTION=="add|change", IMPORT{program}="BINDIR/mdadm --incremental --export $devnode --offroot $env{DEVLINKS}"
++ACTION=="add|change", IMPORT{program}="/usr/bin/env IMSM_NO_PLATFORM=1 BINDIR/mdadm -ARs"
+ ACTION=="add|change", ENV{MD_STARTED}=="*unsafe*", ENV{MD_FOREIGN}=="no", ENV{SYSTEMD_WANTS}+="mdadm-last-resort@$env{MD_DEVICE}.timer"
+ ACTION=="remove", ENV{ID_PATH}=="?*", RUN+="BINDIR/mdadm -If $name --path $env{ID_PATH}"
+ ACTION=="remove", ENV{ID_PATH}!="?*", RUN+="BINDIR/mdadm -If $name"
diff --git a/disable-werror.patch b/disable-werror.patch
new file mode 100644
index 000000000000..2f294197dcfc
--- /dev/null
+++ b/disable-werror.patch
@@ -0,0 +1,11 @@
+--- Makefile.old 2022-01-10 17:07:50.475985407 +0100
++++ Makefile 2022-01-10 17:08:11.599433663 +0100
+@@ -50,7 +50,7 @@
+ CC := $(CROSS_COMPILE)gcc
+ endif
+ CXFLAGS ?= -ggdb
+-CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
++CWFLAGS = -Wall -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
+ CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O3
+ endif
diff --git a/mdadm.conf b/mdadm.conf
new file mode 100644
index 000000000000..36eaa0cc0b46
--- /dev/null
+++ b/mdadm.conf
@@ -0,0 +1,67 @@
+# mdadm configuration file
+#
+# mdadm will function properly without the use of a configuration file,
+# but this file is useful for keeping track of arrays and member disks.
+# In general, a mdadm.conf file is created, and updated, after arrays
+# are created. This is the opposite behavior of /etc/raidtab which is
+# created prior to array construction.
+#
+#
+# the config file takes two types of lines:
+#
+# DEVICE lines specify a list of devices of where to look for
+# potential member disks
+#
+# ARRAY lines specify information about how to identify arrays so
+# so that they can be activated
+#
+
+
+# You can have more than one device line and use wild cards. The first
+# example includes SCSI the first partition of SCSI disks /dev/sdb,
+# /dev/sdc, /dev/sdd, /dev/sdj, /dev/sdk, and /dev/sdl. The second
+# line looks for array slices on IDE disks.
+#
+#DEVICE /dev/sd[bcdjkl]1
+#DEVICE /dev/hda1 /dev/hdb1
+#
+# The designation "partitions" will scan all partitions found in
+# /proc/partitions
+DEVICE partitions
+
+
+# ARRAY lines specify an array to assemble and a method of identification.
+# Arrays can currently be identified by using a UUID, superblock minor number,
+# or a listing of devices.
+#
+# super-minor is usually the minor number of the metadevice
+# UUID is the Universally Unique Identifier for the array
+# Each can be obtained using
+#
+# mdadm -D <md>
+#
+# To capture the UUIDs for all your RAID arrays to this file, run these:
+# to get a list of running arrays:
+# # mdadm -D --scan >>/etc/mdadm.conf
+# to get a list from superblocks:
+# # mdadm -E --scan >>/etc/mdadm.conf
+#
+#ARRAY /dev/md0 UUID=3aaa0122:29827cfa:5331ad66:ca767371
+#ARRAY /dev/md1 super-minor=1
+#ARRAY /dev/md2 devices=/dev/hda1,/dev/hdb1
+#
+# ARRAY lines can also specify a "spare-group" for each array. mdadm --monitor
+# will then move a spare between arrays in a spare-group if one array has a
+# failed drive but no spare
+#ARRAY /dev/md4 uuid=b23f3c6d:aec43a9f:fd65db85:369432df spare-group=group1
+#ARRAY /dev/md5 uuid=19464854:03f71b1b:e0df2edd:246cc977 spare-group=group1
+#
+
+
+# When used in --follow (aka --monitor) mode, mdadm needs a
+# mail address and/or a program. To start mdadm's monitor mode, enable
+# mdadm.service in systemd.
+#
+# If the lines are not found, mdadm will exit quietly
+#MAILADDR root@mydomain.tld
+#PROGRAM /usr/sbin/handle-mdadm-events
diff --git a/mdadm_udev_install b/mdadm_udev_install
new file mode 100644
index 000000000000..64a0862c1d69
--- /dev/null
+++ b/mdadm_udev_install
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+build() {
+ add_checked_modules -f 'dm-' 'drivers/md/*'
+
+ # check if a custom mdadm.conf exists
+ if grep -qw ^ARRAY "$BASEDIR/etc/mdadm.conf"; then
+ echo "Custom /etc/mdadm.conf file will be used in initramfs for assembling arrays."
+ add_file "/etc/mdadm.conf"
+ fi
+
+ map add_udev_rule \
+ '63-md-raid-arrays.rules' \
+ '64-md-raid-assembly.rules'
+}
+
+help() {
+ cat <<HELPEOF
+This hook loads the necessary modules for a RAID array and uses incremental
+assembly via udev at runtime to create the devices. This hook will NOT work
+without the udev hook included on the image.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et: