Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

14 changed files with 1634 additions and 484 deletions

17
.gitignore vendored
View File

@ -1 +1,16 @@
SOURCES/smartmontools-7.1.tar.gz
smartmontools-5.39.1.tar.gz
/smartmontools-r3169.tar.gz
/smartmontools-5.40.tar.gz
/smartmontools-5.41.tar.gz
/smartmontools-5.42.tar.gz
/smartmontools-5.43.tar.gz
/smartmontools-6.0.tar.gz
/smartmontools-6.1.tar.gz
/smartmontools-6.2.tar.gz
/smartmontools-6.3.tar.gz
/smartmontools-6.4.tar.gz
/smartmontools-6.5.tar.gz
/smartmontools-6.6.tar.gz
/smartmontools-7.0.tar.gz
/smartmontools-7.1.tar.gz
/smartmontools-7.2.tar.gz

View File

@ -1 +1 @@
207dc2b50cab1c6fba7bc248665fbbe3189374e1 SOURCES/smartmontools-7.1.tar.gz
8d68241096f6ed5b1bbcd8b427fa4a881c1f3e33 smartmontools-7.2.tar.gz

File diff suppressed because it is too large Load Diff

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -3,7 +3,7 @@
# Send mail
if which mail >/dev/null 2>&1
then
echo "$SMARTD_MESSAGE" | mail -s "$SMARTD_FAILTYPE" "$SMARTD_ADDRESS"
echo "$SMARTD_FULLMESSAGE" | mail -s "$SMARTD_SUBJECT" "$SMARTD_ADDRESS"
fi
# Notify desktop user

View File

@ -0,0 +1,32 @@
diff -up smartmontools-7.2/smartd.cpp.capnotify smartmontools-7.2/smartd.cpp
--- smartmontools-7.2/smartd.cpp.capnotify 2020-11-23 19:25:16.000000000 +0100
+++ smartmontools-7.2/smartd.cpp 2021-06-16 12:06:03.985526022 +0200
@@ -1020,6 +1020,8 @@ static void capabilities_drop_now()
capng_clear(CAPNG_SELECT_BOTH);
capng_updatev(CAPNG_ADD, (capng_type_t)(CAPNG_EFFECTIVE|CAPNG_PERMITTED),
CAP_SYS_ADMIN, CAP_MKNOD, CAP_SYS_RAWIO, -1);
+ capng_updatev(CAPNG_ADD, (capng_type_t)(CAPNG_BOUNDING_SET),
+ CAP_SETGID, CAP_SETUID, CAP_CHOWN, CAP_FOWNER, CAP_DAC_OVERRIDE, -1);
capng_apply(CAPNG_SELECT_BOTH);
}
@@ -1030,9 +1032,8 @@ static void capabilities_check_config(de
for (unsigned i = 0; i < configs.size(); i++) {
dev_config & cfg = configs[i];
if (!cfg.emailaddress.empty() || !cfg.emailcmdline.empty()) {
- PrintOut(LOG_INFO, "Device: %s, --capabilites is set, mail will be suppressed.\n",
+ PrintOut(LOG_INFO, "Device: %s, --capabilites is set, mail notification may not work.\n",
cfg.name.c_str());
- cfg.emailaddress.clear(); cfg.emailcmdline.clear();
}
}
}
@@ -1633,7 +1634,7 @@ static void Usage()
#ifdef HAVE_LIBCAP_NG
PrintOut(LOG_INFO," -C, --capabilities\n");
PrintOut(LOG_INFO," Drop unneeded Linux process capabilities.\n"
- " Warning: Mail notification does not work when used.\n\n");
+ " Warning: Mail notification may not work when used.\n\n");
#endif
PrintOut(LOG_INFO," -d, --debug\n");
PrintOut(LOG_INFO," Start smartd in debug mode\n\n");

View File

@ -0,0 +1,42 @@
diff -up smartmontools-7.2/configure.ac.fixfdclose smartmontools-7.2/configure.ac
--- smartmontools-7.2/configure.ac.fixfdclose 2024-01-10 16:45:10.994784319 +0100
+++ smartmontools-7.2/configure.ac 2024-01-10 16:47:27.985999103 +0100
@@ -121,6 +121,16 @@ AM_CONDITIONAL(NEED_GETOPT_LONG, [test "
AC_CHECK_FUNCS([clock_gettime ftime gettimeofday])
+case "$host_os" in
+ mingw*)
+ # Older MinGW-w64 (5.0.3) require -lwinpthread
+ AC_SEARCH_LIBS([clock_gettime], [winpthread])
+ ;;
+ *)
+ AC_CHECK_FUNCS([close_range])
+ ;;
+esac
+
# Check byte ordering (defines WORDS_BIGENDIAN)
AC_C_BIGENDIAN
diff -up smartmontools-7.2/smartd.cpp.fixfdclose smartmontools-7.2/smartd.cpp
--- smartmontools-7.2/smartd.cpp.fixfdclose 2024-01-10 16:45:10.996784336 +0100
+++ smartmontools-7.2/smartd.cpp 2024-01-10 16:46:33.786518090 +0100
@@ -1475,8 +1475,16 @@ static int daemon_init()
}
// close any open file descriptors
- for (int i = getdtablesize(); --i >= 0; )
- close(i);
+ int open_max = sysconf(_SC_OPEN_MAX);
+#ifdef HAVE_CLOSE_RANGE
+ if (close_range(0, open_max - 1, 0))
+#endif
+ {
+ // Limit number of close() calls under the assumption that there
+ // are no large gaps between open FDs
+ for (int i = 0, failed = 0; i < open_max && failed < 1024; i++)
+ failed = (!close(i) ? 0 : failed + 1);
+ }
// redirect any IO attempts to /dev/null and change to root directory
int fd = open("/dev/null", O_RDWR);

View File

@ -0,0 +1,231 @@
From 7c207dd5d06efccdee7258f832d4216fe5d1d998 Mon Sep 17 00:00:00 2001
From: "Milan P. Gandhi" <mgandhi@redhat.com>
Date: Mon, 17 Oct 2022 14:25:34 +0530
Subject: [PATCH 3/3] scsiprint.cpp: applied patch proposed by Yannick Hemery
to merge both 'supported' log pages
---
smartmontools-7.1/scsicmds.h | 5 ++
smartmontools-7.1/scsiprint.cpp | 103 +++++++++++++++++---------------
2 files changed, 59 insertions(+), 49 deletions(-)
diff --git a/smartmontools-7.1/scsicmds.h b/smartmontools-7.1/scsicmds.h
index 516f773..9bd8b21 100644
--- a/smartmontools-7.1/scsicmds.h
+++ b/smartmontools-7.1/scsicmds.h
@@ -167,6 +167,11 @@ struct scsi_readcap_resp {
uint16_t l_a_lba; /* Lowest Aligned Logical Block Address */
};
+struct scsi_supp_log_pages {
+ uint8_t page_code;
+ uint8_t subpage_code;
+};
+
/* SCSI Peripheral types (of interest) */
#define SCSI_PT_DIRECT_ACCESS 0x0
#define SCSI_PT_SEQUENTIAL_ACCESS 0x1
diff --git a/smartmontools-7.1/scsiprint.cpp b/smartmontools-7.1/scsiprint.cpp
index 81bed88..21a4929 100644
--- a/smartmontools-7.1/scsiprint.cpp
+++ b/smartmontools-7.1/scsiprint.cpp
@@ -39,6 +39,9 @@ uint8_t gBuf[GBUF_SIZE];
#define LOG_RESP_LONG_LEN ((62 * 256) + 252)
#define LOG_RESP_TAPE_ALERT_LEN 0x144
+/* Supported log pages + Supported log pages and subpages maximum count */
+#define SCSI_SUPP_LOG_PAGES_MAX_COUNT (252 + (62 * 128) + 126)
+
/* Log pages supported */
static bool gSmartLPage = false; /* Informational Exceptions log page */
static bool gTempLPage = false;
@@ -118,14 +121,17 @@ static void
scsiGetSupportedLogPages(scsi_device * device)
{
bool got_subpages = false;
- int k, bump, err, resp_len, num_unreported, num_unreported_spg;
- int resp_len_pg0_0 = 0;
- int resp_len_pg0_ff = 0; /* in SPC-4, response length of supported
- * log pages _and_ log subpages */
+ int k, err, resp_len, num_unreported, num_unreported_spg;
+ int supp_lpg_and_spg_count = 0;
+
const uint8_t * up;
uint8_t sup_lpgs[LOG_RESP_LEN];
+ struct scsi_supp_log_pages supp_lpg_and_spg[SCSI_SUPP_LOG_PAGES_MAX_COUNT];
memset(gBuf, 0, LOG_RESP_LEN);
+ memset(supp_lpg_and_spg, 0, sizeof(supp_lpg_and_spg));
+
+ /* Get supported log pages */
if ((err = scsiLogSense(device, SUPPORTED_LPAGES, 0, gBuf,
LOG_RESP_LEN, 0 /* do double fetch */))) {
if (scsi_debugmode > 0)
@@ -140,12 +146,23 @@ scsiGetSupportedLogPages(scsi_device * device)
logSenStr, scsiErrString(err));
if (err)
return;
- memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
- } else if ((scsi_version >= SCSI_VERSION_SPC_4) &&
- (scsi_version <= SCSI_VERSION_HIGHEST)) {
+ }
+
+ memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
+ resp_len = gBuf[3];
+ up = gBuf + LOGPAGEHDRSIZE;
+
+ for (k = 0; k < resp_len; k += 1) {
+ uint8_t page_code = 0x3f & up[k];
+ supp_lpg_and_spg[supp_lpg_and_spg_count++] = {page_code, 0};
+ }
+
+ /* Get supported log pages and subpages. Most drives seems to include the
+ supported log pages here as well, but some drives such as the Samsung
+ PM1643a will only report the additional log pages with subpages here */
+ if ((scsi_version >= SCSI_VERSION_SPC_4) &&
+ (scsi_version <= SCSI_VERSION_HIGHEST)) {
/* unclear what code T10 will choose for SPC-6 */
- memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
- resp_len_pg0_0 = sup_lpgs[3];
if ((err = scsiLogSense(device, SUPPORTED_LPAGES, SUPP_SPAGE_L_SPAGE,
gBuf, LOG_RESP_LONG_LEN,
-1 /* just single not double fetch */))) {
@@ -153,6 +170,7 @@ scsiGetSupportedLogPages(scsi_device * device)
pout("%s for supported pages and subpages failed [%s]\n",
logSenStr, scsiErrString(err));
} else {
+ /* Ensure we didn't get the same answer than without the subpages */
if (0 == memcmp(gBuf, sup_lpgs, LOG_RESP_LEN)) {
if (scsi_debugmode > 0)
pout("%s: %s ignored subpage field, bad\n",
@@ -163,48 +181,34 @@ scsiGetSupportedLogPages(scsi_device * device)
pout("%s supported subpages is bad SPF=%u SUBPG=%u\n",
logSenRspStr, !! (0x40 & gBuf[0]), gBuf[2]);
} else {
- resp_len_pg0_ff = sg_get_unaligned_be16(gBuf + 2);
got_subpages = true;
}
}
- } else {
- memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
- resp_len_pg0_0 = sup_lpgs[3];
}
if (got_subpages) {
resp_len = sg_get_unaligned_be16(gBuf + 2);
- if (resp_len_pg0_ff <= resp_len_pg0_0) {
- /* something is rotten ....., ignore SUPP_SPAGE_L_SPAGE */
- resp_len = resp_len_pg0_0;
- bump = 1;
- up = sup_lpgs + LOGPAGEHDRSIZE;
- got_subpages = false;
- (void)got_subpages; // not yet used below, suppress warning
- } else {
- resp_len = resp_len_pg0_ff;
- bump = 2;
- up = gBuf + LOGPAGEHDRSIZE;
+ up = gBuf + LOGPAGEHDRSIZE;
+ for (k = 0; k < resp_len; k += 2) {
+ uint8_t page_code = 0x3f & up[k];
+ uint8_t subpage_code = up[k+1];
+ supp_lpg_and_spg[supp_lpg_and_spg_count++] = {page_code, subpage_code};
}
- } else {
- resp_len = resp_len_pg0_0;
- bump = 1;
- up = sup_lpgs + LOGPAGEHDRSIZE;
}
+ num_unreported = 0;
num_unreported_spg = 0;
- for (num_unreported = 0, k = 0; k < resp_len; k += bump, up += bump) {
- uint8_t pg_num = 0x3f & up[0];
- uint8_t sub_pg_num = (0x40 & up[0]) ? up[1] : 0;
+ for (k = 0; k < supp_lpg_and_spg_count; k += 1) {
+ struct scsi_supp_log_pages supp_lpg = supp_lpg_and_spg[k];
- switch (pg_num)
+ switch (supp_lpg.page_code)
{
case SUPPORTED_LPAGES:
- if (! ((NO_SUBPAGE_L_SPAGE == sub_pg_num) ||
- (SUPP_SPAGE_L_SPAGE == sub_pg_num))) {
+ if (! ((NO_SUBPAGE_L_SPAGE == supp_lpg.subpage_code) ||
+ (SUPP_SPAGE_L_SPAGE == supp_lpg.subpage_code))) {
if (scsi_debugmode > 1)
pout("%s: Strange Log page number: 0x0,0x%x\n",
- __func__, sub_pg_num);
+ __func__, supp_lpg.subpage_code);
}
break;
case READ_ERROR_COUNTER_LPAGE:
@@ -223,13 +227,13 @@ scsiGetSupportedLogPages(scsi_device * device)
gNonMediumELPage = true;
break;
case TEMPERATURE_LPAGE:
- if (NO_SUBPAGE_L_SPAGE == sub_pg_num)
+ if (NO_SUBPAGE_L_SPAGE == supp_lpg.subpage_code)
gTempLPage = true;
- else if (ENVIRO_REP_L_SPAGE == sub_pg_num)
+ else if (ENVIRO_REP_L_SPAGE == supp_lpg.subpage_code)
gEnviroReportingLPage = true;
- else if (ENVIRO_LIMITS_L_SPAGE == sub_pg_num)
+ else if (ENVIRO_LIMITS_L_SPAGE == supp_lpg.subpage_code)
gEnviroLimitsLPage = true;
- else if (SUPP_SPAGE_L_SPAGE != sub_pg_num) {
+ else if (SUPP_SPAGE_L_SPAGE != supp_lpg.subpage_code) {
++num_unreported;
++num_unreported_spg;
}
@@ -238,11 +242,11 @@ scsiGetSupportedLogPages(scsi_device * device)
reporting of <lpage>,0xff so it is not an error. */
break;
case STARTSTOP_CYCLE_COUNTER_LPAGE:
- if (NO_SUBPAGE_L_SPAGE == sub_pg_num)
+ if (NO_SUBPAGE_L_SPAGE == supp_lpg.subpage_code)
gStartStopLPage = true;
- else if (UTILIZATION_L_SPAGE == sub_pg_num)
+ else if (UTILIZATION_L_SPAGE == supp_lpg.subpage_code)
gUtilizationLPage = true;
- else if (SUPP_SPAGE_L_SPAGE != sub_pg_num) {
+ else if (SUPP_SPAGE_L_SPAGE != supp_lpg.subpage_code) {
++num_unreported;
++num_unreported_spg;
}
@@ -254,15 +258,15 @@ scsiGetSupportedLogPages(scsi_device * device)
gSmartLPage = true;
break;
case BACKGROUND_RESULTS_LPAGE:
- if (NO_SUBPAGE_L_SPAGE == sub_pg_num)
+ if (NO_SUBPAGE_L_SPAGE == supp_lpg.subpage_code)
gBackgroundResultsLPage = true;
- else if (PEND_DEFECTS_L_SPAGE == sub_pg_num)
+ else if (PEND_DEFECTS_L_SPAGE == supp_lpg.subpage_code)
gPendDefectsLPage = true;
- else if (BACKGROUND_OP_L_SPAGE == sub_pg_num)
+ else if (BACKGROUND_OP_L_SPAGE == supp_lpg.subpage_code)
gBackgroundOpLPage = true;
- else if (LPS_MISALIGN_L_SPAGE == sub_pg_num)
+ else if (LPS_MISALIGN_L_SPAGE == supp_lpg.subpage_code)
gLPSMisalignLPage = true;
- else if (SUPP_SPAGE_L_SPAGE != sub_pg_num) {
+ else if (SUPP_SPAGE_L_SPAGE != supp_lpg.subpage_code) {
++num_unreported;
++num_unreported_spg;
}
@@ -296,9 +300,10 @@ scsiGetSupportedLogPages(scsi_device * device)
gSeagateFactoryLPage = true;
break;
default:
- if (pg_num < 0x30) { /* don't count VS pages */
+ if (supp_lpg.page_code < 0x30) { /* don't count VS pages */
++num_unreported;
- if ((sub_pg_num > 0) && (SUPP_SPAGE_L_SPAGE != sub_pg_num))
+ if ((supp_lpg.subpage_code > 0) &&
+ (SUPP_SPAGE_L_SPAGE != supp_lpg.subpage_code))
++num_unreported_spg;
}
break;
--
2.35.1

View File

@ -0,0 +1,38 @@
diff -up smartmontools-7.2/os_linux.cpp.permsfix smartmontools-7.2/os_linux.cpp
--- smartmontools-7.2/os_linux.cpp.permsfix 2021-11-02 22:08:51.956425716 +0100
+++ smartmontools-7.2/os_linux.cpp 2021-11-02 22:09:55.928583584 +0100
@@ -1022,7 +1022,7 @@ bool linux_aacraid_device::open()
return set_err(ENOENT, "aac entry not found in /proc/devices");
//Create misc device file in /dev/ used for communication with driver
- if(mknod(dev_name,S_IFCHR,makedev(mjr,aHost)))
+ if(mknod(dev_name,S_IFCHR|0600,makedev(mjr,aHost)))
return set_err(errno,"cannot create %s:%s",dev_name,strerror(errno));
afd = ::open(dev_name,O_RDWR);
@@ -1298,14 +1298,14 @@ bool linux_megaraid_device::open()
while (fgets(line, sizeof(line), fp) != NULL) {
int n1 = 0;
if (sscanf(line, "%d megaraid_sas_ioctl%n", &mjr, &n1) == 1 && n1 == 22) {
- n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR, makedev(mjr, 0));
+ n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR|0600, makedev(mjr, 0));
if(report > 0)
pout("Creating /dev/megaraid_sas_ioctl_node = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
break;
}
else if (sscanf(line, "%d megadev%n", &mjr, &n1) == 1 && n1 == 11) {
- n1=mknod("/dev/megadev0", S_IFCHR, makedev(mjr, 0));
+ n1=mknod("/dev/megadev0", S_IFCHR|0600, makedev(mjr, 0));
if(report > 0)
pout("Creating /dev/megadev0 = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
@@ -2970,7 +2970,7 @@ bool linux_smart_interface::get_dev_mega
n1=0;
if (sscanf(line, "%d megaraid_sas_ioctl%n", &mjr, &n1) == 1 && n1 == 22) {
scan_megasas = true;
- n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR, makedev(mjr, 0));
+ n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR|0600, makedev(mjr, 0));
if(scsi_debugmode > 0)
pout("Creating /dev/megaraid_sas_ioctl_node = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)

View File

@ -0,0 +1,24 @@
diff -U0 smartmontools-7.2/ChangeLog.r5448 smartmontools-7.2/ChangeLog
diff -up smartmontools-7.2/nvmecmds.cpp.r5448 smartmontools-7.2/nvmecmds.cpp
--- smartmontools-7.2/nvmecmds.cpp.r5448 2020-12-04 21:40:43.000000000 +0100
+++ smartmontools-7.2/nvmecmds.cpp 2023-09-20 12:33:35.212784397 +0200
@@ -230,8 +230,9 @@ unsigned nvme_read_error_log(nvme_device
unsigned n = nvme_read_log_page(device, 0xffffffff, 0x01, error_log,
num_entries * sizeof(*error_log), lpo_sup);
+ unsigned read_entries = n / sizeof(*error_log);
if (isbigendian()) {
- for (unsigned i = 0; i < n; i++) {
+ for (unsigned i = 0; i < read_entries; i++) {
swapx(&error_log[i].error_count);
swapx(&error_log[i].sqid);
swapx(&error_log[i].cmdid);
@@ -242,7 +243,7 @@ unsigned nvme_read_error_log(nvme_device
}
}
- return n / sizeof(*error_log);
+ return read_entries;
}
// Read NVMe SMART/Health Information log.

View File

@ -1,9 +1,8 @@
Summary: Tools for monitoring SMART capable hard disks
Name: smartmontools
Version: 7.1
Release: 1%{?dist}
Version: 7.2
Release: 9%{?dist}
Epoch: 1
Group: System Environment/Base
License: GPLv2+
URL: http://smartmontools.sourceforge.net/
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@ -15,16 +14,21 @@ Source5: drivedb.h
#fedora/rhel specific
Patch1: smartmontools-5.38-defaultconf.patch
Patch2: smartmontools-7.2-capnotify.patch
Patch3: smartmontools-7.2-permsfix.patch
Patch4: smartmontools-7.2-logsuppagefix3.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
#new rpm does not handle this (yet?)
#Requires(triggerun): systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
Requires(postun): systemd-units
BuildRequires: readline-devel ncurses-devel automake util-linux groff gettext
# from upstream, for < 7.4, #RHEL-11400
Patch5: smartmontools-7.2-r5448.patch
# from upstream, for <= 7.4, #RHEL-15505
Patch6: smartmontools-7.2-fixfdclose.patch
BuildRequires: make
BuildRequires: gcc-c++ readline-devel ncurses-devel automake util-linux groff gettext
BuildRequires: libselinux-devel libcap-ng-devel
BuildRequires: systemd-units systemd-devel
BuildRequires: systemd systemd-devel
%{?systemd_requires}
%description
The smartmontools package contains two utility programs (smartctl
@ -36,25 +40,27 @@ failure.
%prep
%setup -q
%patch1 -p1 -b .defaultconf
# update SOURCE5 on maintainer's machine prior commiting, there's no internet connection on builders
curl %{UrlSource5} -o %{SOURCE5} ||:
%patch -P 1 -p1 -b .defaultconf
%patch -P 2 -p1 -b .capnotify
%patch -P 3 -p1 -b .permsfix
%patch -P 4 -p2 -b .logsuppagefix3
%patch -P 5 -p1 -b .r5448
%patch -P 6 -p1 -b .fixfdclose
cp %{SOURCE5} .
%build
autoreconf -i
%configure --with-selinux --with-libcap-ng=yes --with-libsystemd --with-systemdsystemunitdir=%{_unitdir} --sysconfdir=%{_sysconfdir}/%{name}/ --with-systemdenvfile=%{_sysconfdir}/sysconfig/%{name}
%ifarch sparc64
make CXXFLAGS="$RPM_OPT_FLAGS -fPIE" LDFLAGS="-pie -Wl,-z,relro,-z,now"
%else
make CXXFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro,-z,now"
%endif
# update SOURCE5 on maintainer's machine prior commiting, there's no internet connection on builders
%make_build update-smart-drivedb
./update-smart-drivedb -s - -u sf drivedb.h ||:
cp drivedb.h ../drivedb.h ||:
%make_build CXXFLAGS="$RPM_OPT_FLAGS -fpie" LDFLAGS="-pie -Wl,-z,relro,-z,now"
%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
%make_install
rm -f examplescripts/Makefile*
chmod a-x -R examplescripts/*
@ -62,26 +68,12 @@ install -D -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/smartmon
install -D -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/%{_libexecdir}/%{name}/smartdnotify
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/%{name}/smartd_warning.d
rm -rf $RPM_BUILD_ROOT/etc/{rc.d,init.d}
rm -rf $RPM_BUILD_ROOT/%{_docdir}/%{name}
mkdir -p $RPM_BUILD_ROOT/%{_sharedstatedir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}
mkdir -p $RPM_BUILD_ROOT%{_sharedstatedir}/%{name}
%preun
%systemd_preun smartd.service
%pre
if [ $1 = 2 ] # only during update
then
# for Fedora 19-22
if [ -f %{_sysconfdir}/smartd.conf -a ! -e %{_sysconfdir}/%name ]
then
mkdir -p %{_sysconfdir}/%{name}
cp -p %{_sysconfdir}/smartd.conf %{_sysconfdir}/%{name}
fi
fi
%post
%systemd_post smartd.service
@ -89,9 +81,9 @@ fi
%systemd_postun_with_restart smartd.service
%files
%defattr(-,root,root,-)
%doc AUTHORS ChangeLog COPYING INSTALL NEWS README
%doc AUTHORS ChangeLog INSTALL NEWS README
%doc TODO examplescripts smartd.conf
%license COPYING
%dir %{_sysconfdir}/%name
%dir %{_sysconfdir}/%name/smartd_warning.d
%config(noreplace) %{_sysconfdir}/%{name}/smartd.conf
@ -108,8 +100,75 @@ fi
%{_sharedstatedir}/%{name}
%changelog
* Wed Apr 22 2020 Michal Hlavinka <mhlavink@redhat.com> - 1:7.1-1
- smartmontools updated to 7.1 (#1671154)
* Tue Jan 16 2024 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-9
- smartd would not start with huge FD limits (#RHEL-15505)
* Wed Dec 06 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-8
- fix segfault after read of NVMe error log on big endian (#RHEL-11400)
* Mon May 29 2023 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-7
- support reporting of Error Counter logging details (#2137279)
* Wed Nov 03 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-6
- make notification work with capabilities (#1962593)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1:7.2-5
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:7.2-4
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 25 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-2
- make sure correct version of drivedb.h is used (#1918946)
* Mon Jan 18 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:7.2-1
- smartmontools updated to 7.2
* Mon Jan 18 2021 Michal Hlavinka <mhlavink@redhat.com> - 1:7.1-10
- use capabilites by default
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 06 2020 Michal Hlavinka <mhlavink@redhat.com> - 1:7.1-7
- smartmontools updated to 7.1
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Apr 12 2019 Daniel Axelrod <daxelrod@datto.com> - 1:7.0-6
- Remove unused patches
- Drop pre script for migrating from unsupported Fedora versions
- Replace sed with configure switch
* Wed Apr 03 2019 Michal Hlavinka <mhlavink@redhat.com> - 1:7.0-5
- revert smartd_warning related changes
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jan 03 2019 Michal Hlavinka <mhlavink@redhat.com> - 1:7.0-3
- update default config
* Thu Jan 03 2019 Michal Hlavinka <mhlavink@redhat.com> - 1:7.0-2
- use smartd_warning plugin to notify users (bug #1647534)
- spec cleanup
* Thu Jan 03 2019 Michal Hlavinka <mhlavink@redhat.com> - 1:7.0-1
- smartmontools updated to 7.0
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:6.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Mar 07 2018 Michal Hlavinka <mhlavink@redhat.com> - 1:6.6-4
- add gcc-c++ buildrequire
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:6.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1,6 +1,6 @@
# command line options for smartd
# Add -s /var/lib/smartmontools to enable state persistence
smartd_opts="-q never"
smartd_opts="-q never --capabilities"
# autogenerated config file options
# smartd_conf_opts="-H -m root"

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (smartmontools-7.2.tar.gz) = d7e724295b5d53797b5e4136eea5f5cc278db81e4016ba65142438b8c68c54f85a32c582c147a1590b9bc8f74a58952bcb57b9923dd69d34582530a0985799ea