Package init

This commit is contained in:
overweight 2019-09-30 10:54:55 -04:00
commit 5461e2c22d
3 changed files with 82 additions and 0 deletions

View File

@ -0,0 +1,26 @@
Author: Phillip Susi <psusi@ubuntu.com>
Subject: fix an incorrect IO error reading SMART status
Description: The read SMART status command's return status
was testing for a success/failure value that included 8
bits that are "N/A" according to the standard, and required
that they be zeros. At least some drives do not fill them
with zeros, so correct this by masking off the undefined
bits.
Index: b/atasmart.c
===================================================================
--- a/atasmart.c
+++ b/atasmart.c
@@ -925,10 +925,10 @@
/* SAT/USB bridges truncate packets, so we only check for 4F,
* not for 2C on those */
if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) &&
- cmd[4] == htons(0x4F00U))
+ (cmd[4] & htons(0xFF00U)) == htons(0x4F00U))
*good = TRUE;
else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) &&
- cmd[4] == htons(0xF400U))
+ (cmd[4] & htons(0xFF00U)) == htons(0xF400U))
*good = FALSE;
else {
errno = EIO;

BIN
libatasmart-0.19.tar.xz Normal file

Binary file not shown.

56
libatasmart.spec Normal file
View File

@ -0,0 +1,56 @@
Name: libatasmart
Version: 0.19
Release: 16
Summary: ATA S.M.A.R.T. Disk Health Monitoring Library
License: LGPLv2+
URL: https://github.com/Rupan/libatasmart
Source0: https://0pointer.de/public/libatasmart-%{version}.tar.xz
Patch0: libatasmart-0.19-wd-fix.patch
BuildRequires: gcc systemd-devel
%description
a lean, small and clean implementation of an ATA S.M.A.R.T. reading and parsing library.
%package devel
Summary: Development Files for libatasmart Client Development
Requires: %{name} = %{version}-%{release} pkgconfig vala
%description devel
Development Files for libatasmart Client Development
%package_help
%ldconfig_scriptlets
%prep
%autosetup -n %{name}-%{version} -p1
%build
%configure
%make_build
%install
%make_install
%delete_la_and_a
%files
%defattr(-,root,root)
%doc LGPL
%{_libdir}/*.so.*
%{_sbindir}/*
%files devel
%defattr(-,root,root)
%{_includedir}/atasmart.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/*.so
%{_datadir}/vala/*/*.vapi
%exclude %{_docdir}/libatasmart/README
%files help
%defattr(-,root,root)
%doc README */SAMSUNG* */ST* */Maxtor* */WDC* */FUJITSU* */INTEL* */TOSHIBA* */MCC*
%changelog
* Mon Sep 2 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.19-16
- Package init