-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packages: add mdadm package for software RAID support
- Loading branch information
Showing
7 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
From 06ebc9f352e211cf6adc34a35737da88d2e067c2 Mon Sep 17 00:00:00 2001 | ||
From: Todd Neal <[email protected]> | ||
Date: Fri, 7 Jun 2024 18:22:52 +0000 | ||
Subject: [PATCH] report monitor output to syslog | ||
|
||
--- | ||
systemd/mdmonitor-oneshot.service | 2 +- | ||
systemd/mdmonitor.service | 2 +- | ||
2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/systemd/mdmonitor-oneshot.service b/systemd/mdmonitor-oneshot.service | ||
index ba86b44..032b8aa 100644 | ||
--- a/systemd/mdmonitor-oneshot.service | ||
+++ b/systemd/mdmonitor-oneshot.service | ||
@@ -10,7 +10,7 @@ Description=Reminder for degraded MD arrays | ||
Documentation=man:mdadm(8) | ||
|
||
[Service] | ||
-Environment=MDADM_MONITOR_ARGS=--scan | ||
+Environment=MDADM_MONITOR_ARGS="--scan --syslog" | ||
EnvironmentFile=-/run/sysconfig/mdadm | ||
ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh | ||
ExecStart=BINDIR/mdadm --monitor --oneshot $MDADM_MONITOR_ARGS | ||
diff --git a/systemd/mdmonitor.service b/systemd/mdmonitor.service | ||
index 9c36478..de4ed1b 100644 | ||
--- a/systemd/mdmonitor.service | ||
+++ b/systemd/mdmonitor.service | ||
@@ -11,7 +11,7 @@ DefaultDependencies=no | ||
Documentation=man:mdadm(8) | ||
|
||
[Service] | ||
-Environment= MDADM_MONITOR_ARGS=--scan | ||
+Environment= MDADM_MONITOR_ARGS="--scan --syslog" | ||
EnvironmentFile=-/run/sysconfig/mdadm | ||
ExecStartPre=-/usr/lib/mdadm/mdadm_env.sh | ||
ExecStart=BINDIR/mdadm --monitor $MDADM_MONITOR_ARGS | ||
-- | ||
2.40.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "mdadm" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
build = "../build.rs" | ||
|
||
[lib] | ||
path = "../packages.rs" | ||
|
||
[package.metadata.build-package] | ||
releases-url = "https://cdn.kernel.org/pub/linux/utils/raid/mdadm/" | ||
|
||
[[package.metadata.build-package.external-files]] | ||
url = "https://cdn.kernel.org/pub/linux/utils/raid/mdadm/mdadm-4.3.tar.xz" | ||
sha512 = "e44977f2f80d2471cb313803a60c92dafe8282ac06bbbfd41ae90ca493c64a3da94db924538788d045fd7f0667333912dabedb0b070f9abf5c0540b32e0fa08f" | ||
|
||
[build-dependencies] | ||
glibc = { path = "../glibc" } | ||
systemd = { path = "../systemd" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
d /var/run/mdadm 0700 chrony chrony - | ||
Z /var/run/mdadm 0700 chrony chrony - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Name: %{_cross_os}mdadm | ||
Version: 4.3 | ||
Release: 1%{?dist} | ||
Summary: mdadm is used for controlling Linux md devices (aka RAID arrays) | ||
License: GPL-2.0-only | ||
URL: https://cdn.kernel.org/pub/linux/utils/raid/mdadm/ | ||
Source0: https://cdn.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz | ||
BuildRequires: %{_cross_os}glibc-devel | ||
BuildRequires: %{_cross_os}systemd-devel | ||
|
||
Source100: mdadm-tmpfiles.conf | ||
Patch100: 0001-report-monitor-output-to-syslog.patch | ||
|
||
%description | ||
%{summary}. | ||
|
||
%global set_env \ | ||
%set_cross_build_flags \\\ | ||
export CC=%{_cross_target}-gcc \\\ | ||
CXFLAGS="%{_cross_cflags} -DNO_COROSYNC -DNO_DLM" \ | ||
%{nil} | ||
|
||
%prep | ||
%autosetup -n mdadm-%{version} -p1 | ||
|
||
%build | ||
%set_env | ||
make LDFLAGS="%{_cross_ldflags}" | ||
|
||
%install | ||
%set_env | ||
make install-bin DESTDIR=%{buildroot}%{_cross_rootdir}/usr | ||
make install-udev DESTDIR=%{buildroot} | ||
make install-systemd DESTDIR= SYSTEMD_DIR=%{buildroot}%{_cross_unitdir} | ||
|
||
install -d %{buildroot}%{_cross_tmpfilesdir} | ||
install -p -m 0644 %{S:100} %{buildroot}%{_cross_tmpfilesdir}/mdadm.conf | ||
|
||
%files | ||
%license COPYING | ||
%{_cross_attribution_file} | ||
|
||
%{_cross_sbindir}/mdadm | ||
%{_cross_sbindir}/mdmon | ||
|
||
%{_cross_tmpfilesdir}/mdadm.conf | ||
|
||
%{_cross_udevrulesdir}/01-md-raid-creating.rules | ||
%{_cross_udevrulesdir}/63-md-raid-arrays.rules | ||
%{_cross_udevrulesdir}/64-md-raid-assembly.rules | ||
%{_cross_udevrulesdir}/69-md-clustered-confirm-device.rules | ||
|
||
%{_cross_unitdir}/[email protected] | ||
%{_cross_unitdir}/[email protected] | ||
%{_cross_unitdir}/[email protected] | ||
%{_cross_unitdir}/[email protected] | ||
%{_cross_unitdir}/mdmonitor.service | ||
%{_cross_unitdir}-shutdown/mdadm.shutdown | ||
|
||
# periodically runs an mdcheck bash script | ||
%exclude %{_cross_unitdir}/mdcheck_continue.service | ||
%exclude %{_cross_unitdir}/mdcheck_continue.timer | ||
%exclude %{_cross_unitdir}/mdcheck_start.service | ||
%exclude %{_cross_unitdir}/mdcheck_start.timer | ||
|
||
# no mail address or alert command, so no-ops | ||
%exclude %{_cross_unitdir}/mdmonitor-oneshot.service | ||
%exclude %{_cross_unitdir}/mdmonitor-oneshot.timer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.