debian/0000755000000000000000000000000012226757011007171 5ustar debian/changelog0000644000000000000000000001461512226756606011063 0ustar libatasmart (0.19-3) unstable; urgency=low [ Dmitrijs Ledkovs ] * Use dh-autoreconf addon, to update config.sub|guess thus fixing FTBFS on arm64 (LP: #1234343, Closes: #725203) [ Martin Pitt ] * Disable silent build rules, for build log checks and debugging. -- Martin Pitt Mon, 14 Oct 2013 14:03:04 +0200 libatasmart (0.19-2) unstable; urgency=low * debian/local/apport-hook.py: Fix syntax to be Python 3 compatible. (LP: #1013171) * debian/local/apport-hook.py: Include output of "udisksctl dump" from udisks2. * Add 0001-Dont-test-undefined-bits.patch: Fix an incorrect IO error reading SMART status, by filtering out undefined bits. Thanks Phillip Susi. (LP: #1143495) * Bump Standards-Version to 3.9.4, no changes necessary. -- Martin Pitt Mon, 25 Mar 2013 07:38:36 +0100 libatasmart (0.19-1) unstable; urgency=low * New upstream release. * Track .xz tarballs. * Refresh 0002-Drop-our-own-many-bad-sectors-heuristic.patch. * Remove 0003-Add-S.M.A.R.T-attributes-for-Samsung-SSD.patch, merged upstream. * Update debian/libatasmart-dev.install, upstream no longer builds a static library. -- Michael Biebl Wed, 23 May 2012 08:44:25 +0200 libatasmart (0.18-3) unstable; urgency=low * Update broken .so symlink in libatasmart-dev for the multiarch paths. (Closes: #661404) -- Michael Biebl Mon, 27 Feb 2012 01:20:55 +0100 libatasmart (0.18-2) unstable; urgency=low * Add 0003-Add-S.M.A.R.T-attributes-for-Samsung-SSD.patch: Add more attribute names from Samsung SSD. Thanks to Tobias Wolf for the patch! (Closes: #650673, LP: #885869) * Bump Standards-Version to 3.9.3. * Build library for Multi-Arch. * Mark libatasmart-bin as M-A: foreign. -- Martin Pitt Sun, 26 Feb 2012 19:02:49 +0100 libatasmart (0.18-1) unstable; urgency=low * New upstream release. * Remove 0001-Speed-up-get_overall-and-get_bad.patch, merged upstream. * Refresh 0002-Drop-our-own-many-bad-sectors-heuristic.patch. * Bump Standards-Version to 3.9.2. No further changes. -- Michael Biebl Wed, 12 Oct 2011 01:02:34 +0200 libatasmart (0.17+git20100219-3) unstable; urgency=low * Switch to source format 3.0 (quilt) - Add debian/source/format. - Drop Build-Depends on quilt. - Remove /usr/share/cdbs/1/rules/patchsys-quilt.mk from debian/rules. * Switch from cdbs to dh - Drop Build-Depends on cdbs. - Bump Build-Depends on debhelper for override targets and the --remaining-packages option. - Convert debian/rules to use dh. * Bump Standards-Version to 3.9.1. No further changes. * Use dpkg-vendor instead of lsb_release. * Bump debhelper compatibility level to 8 and update build dependency accordingly. -- Michael Biebl Mon, 07 Feb 2011 22:08:27 +0100 libatasmart (0.17+git20100219-2) unstable; urgency=low * debian/local/apport-hook.py: Update for udisks. * Add 0001-Speed-up-get_overall-and-get_bad.patch: Speed up get_overall() and get_bad(). (fd.o #26834) * Add 0002-Drop-our-own-many-bad-sectors-heuristic.patch: Drop our own "many bad sectors" heuristic.This currently causes a lot of false positives, because in many cases our threshold is either overly pessimistically low, or the raw value is implausibly high. Just use the normalized values vs. threshold for now. (Closes: #584969, LP: #438136, fd.o #25772) -- Martin Pitt Tue, 08 Jun 2010 08:40:22 +0200 libatasmart (0.17+git20100219-1) unstable; urgency=low * New upstream git snapshot (up to 2cc5102): - Autoconfiscation done with recent libtool (Closes: #558570) - Blacklist Oxford Semiconductor bridge [0928:0000], causing USB resets on probing. (LP: #474988) - Provide names for attributes 184 and 188. (LP: #521864) - Some small bug fixes. * Drop 01-export-symbols.patch, included upstream. * Drop 99-autoreconf.patch, not necessary any more. * debian/control: Wrap build dependencies. * Add debian/local/apport-hook.py: Apport package hook for collecting devkit-disks --dump and available SMART blobs. Install it in debian/rules when building on Ubuntu. Add "lsb-release" build dependency for this. * debian/libatasmart-dev.install: Ship Vala .vapi file. * debian/control: Bump Standards-Version to 3.8.4 (no changes necessary). -- Martin Pitt Fri, 19 Feb 2010 23:37:28 +0100 libatasmart (0.17-1) unstable; urgency=low * New upstream release. * debian/patches/01-export-symbols.patch - Restrict the list of exported symbols to sk_*. * debian/patches/99-autoreconf.patch - Run automake to update the build system for the changes in 01-export-symbols.patch. * Use quilt to apply the patches. -- Michael Biebl Tue, 27 Oct 2009 05:24:25 +0100 libatasmart (0.16-1) unstable; urgency=low * New upstream release. - Blacklist some more JMicron bridges. This includes the changes from 0.15-3. -- Michael Biebl Tue, 29 Sep 2009 06:25:13 +0200 libatasmart (0.15-3) unstable; urgency=low * atasmart.c: Blacklist JMicron drives 152d:233[89] as well, since they were also confirmed to cause USB resets on SMART probing. (LP: #387161, https://bugzilla.redhat.com/show_bug.cgi?id=515881) -- Martin Pitt Thu, 24 Sep 2009 11:26:24 +0200 libatasmart (0.15-2) unstable; urgency=low * Move libatasmart4 to /lib so DeviceKit-disks and its udev helper will work without /usr being mounted. -- Michael Biebl Wed, 23 Sep 2009 16:17:21 +0200 libatasmart (0.15-1) unstable; urgency=low * New upstream bug fix release. In particular, this blacklists the JMicron SATA bridge 152d:2329, since it causes USB resets when being probed for SMART. (https://bugzilla.redhat.com/show_bug.cgi?id=515881, LP: #387161) * Bump Standards-Version to 3.8.3 (no changes necessary). -- Martin Pitt Fri, 18 Sep 2009 09:31:34 +0200 libatasmart (0.14-1) unstable; urgency=low * New upstream version. * Update *.install, *.symbols, and debian/control for 0 → 4 library soname change. * Add myself to uploaders. -- Martin Pitt Fri, 07 Aug 2009 10:13:42 +0100 libatasmart (0.13-1) unstable; urgency=low * Initial release. (Closes: #527305) -- Michael Biebl Wed, 06 May 2009 21:43:52 +0200 debian/compat0000644000000000000000000000000212226756606010400 0ustar 9 debian/control0000644000000000000000000000304112226756606010603 0ustar Source: libatasmart Section: libs Priority: optional Maintainer: Utopia Maintenance Team Uploaders: Michael Biebl , Martin Pitt Build-Depends: debhelper (>= 9), autotools-dev, pkg-config, libudev-dev, dh-autoreconf Standards-Version: 3.9.4 Vcs-Git: git://git.debian.org/git/pkg-utopia/libatasmart.git Vcs-Browser: http://git.debian.org/?p=pkg-utopia/libatasmart.git;a=summary Homepage: http://0pointer.de/blog/projects/being-smart.html Package: libatasmart-dev Section: libdevel Architecture: any Depends: libatasmart4 (= ${binary:Version}), ${misc:Depends} Description: ATA S.M.A.R.T. reading and parsing library - development files A small and lightweight parser library for ATA S.M.A.R.T. hard disk health monitoring. . This package contains the development files. Package: libatasmart4 Section: libs Architecture: any Pre-Depends: ${misc:Pre-Depends} Depends: ${shlibs:Depends}, ${misc:Depends} Multi-Arch: same Description: ATA S.M.A.R.T. reading and parsing library A small and lightweight parser library for ATA S.M.A.R.T. hard disk health monitoring. . This package contains the shared library. Package: libatasmart-bin Section: utils Architecture: any Multi-Arch: foreign Depends: ${shlibs:Depends}, ${misc:Depends} Description: ATA S.M.A.R.T. reading and parsing library - utilities A small and lightweight parser library for ATA S.M.A.R.T. hard disk health monitoring. . This package contains utilities which allow to query the S.M.A.R.T. information. debian/copyright0000644000000000000000000000250412226756606011136 0ustar This package was debianized by Michael Biebl on Wed, 06 May 2009 21:43:52 +0200 It was downloaded from http://git.0pointer.de/?p=libatasmart.git;a=summary Upstream Author: Lennart Poettering Copyright: Copyright 2008 Lennart Poettering License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This package 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU Lesser General Public License can be found in `/usr/share/common-licenses/LGPL-2.1'. The Debian packaging is: Copyright (C) 2009 Michael Biebl and is licensed under the GPL version 3, see `/usr/share/common-licenses/GPL-3'. debian/gbp.conf0000644000000000000000000000003612226756606010620 0ustar [DEFAULT] pristine-tar = True debian/libatasmart-bin.install0000644000000000000000000000001212226756606013634 0ustar usr/sbin/ debian/libatasmart-dev.install0000644000000000000000000000006312226756606013650 0ustar usr/include/* usr/lib/*/pkgconfig usr/share/vala/* debian/libatasmart4.install0000644000000000000000000000003312226756606013155 0ustar usr/lib/*/libatasmart.so.* debian/libatasmart4.symbols0000644000000000000000000000201412226756606013200 0ustar libatasmart.so.4 libatasmart4 #MINVER# sk_disk_check_sleep_mode@Base 0.13 sk_disk_dump@Base 0.13 sk_disk_free@Base 0.13 sk_disk_get_blob@Base 0.13 sk_disk_get_size@Base 0.13 sk_disk_identify_is_available@Base 0.13 sk_disk_identify_parse@Base 0.13 sk_disk_open@Base 0.13 sk_disk_set_blob@Base 0.13 sk_disk_smart_get_bad@Base 0.13 sk_disk_smart_get_overall@Base 0.13 sk_disk_smart_get_power_cycle@Base 0.13 sk_disk_smart_get_power_on@Base 0.13 sk_disk_smart_get_temperature@Base 0.13 sk_disk_smart_is_available@Base 0.13 sk_disk_smart_parse@Base 0.13 sk_disk_smart_parse_attributes@Base 0.13 sk_disk_smart_read_data@Base 0.13 sk_disk_smart_self_test@Base 0.13 sk_disk_smart_status@Base 0.13 sk_smart_attribute_unit_to_string@Base 0.13 sk_smart_offline_data_collection_status_to_string@Base 0.13 sk_smart_overall_to_string@Base 0.13 sk_smart_self_test_available@Base 0.13 sk_smart_self_test_execution_status_to_string@Base 0.13 sk_smart_self_test_polling_minutes@Base 0.13 sk_smart_self_test_to_string@Base 0.13 debian/local/0000755000000000000000000000000012226756606010274 5ustar debian/local/apport-hook.py0000644000000000000000000000165712226756606013122 0ustar '''apport package hook for libatasmart (c) 2009 Canonical Ltd. Author: Martin Pitt ''' import os import os.path import apport.hookutils import dbus UD = 'org.freedesktop.UDisks' def add_info(report): report['UdisksDump'] = apport.hookutils.command_output(['udisks', '--dump']) report['Udisks2Dump'] = apport.hookutils.command_output(['udisksctl', 'dump']) # grab SMART blobs dkd = dbus.Interface(dbus.SystemBus().get_object(UD, '/org/freedesktop/UDisks'), UD) for d in dkd.EnumerateDevices(): dev_props = dbus.Interface(dbus.SystemBus().get_object(UD, d), dbus.PROPERTIES_IFACE) blob = dev_props.Get(UD, 'DriveAtaSmartBlob') if len(blob) > 0: report['AtaSmartBlob_' + os.path.basename(d)] = ''.join(map(chr, blob)) if __name__ == '__main__': r = {} add_info(r) for k, v in r.items(): print('%s: "%s"' % (k, v)) debian/patches/0000755000000000000000000000000012226756606010631 5ustar debian/patches/0001-Dont-test-undefined-bits.patch0000644000000000000000000000234012226756606017006 0ustar Author: Phillip Susi 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. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61998 Bug-Ubuntu: https://launchpad.net/bugs/1143495 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; debian/patches/0002-Drop-our-own-many-bad-sectors-heuristic.patch0000644000000000000000000000632112226756606021706 0ustar From 6846b7c2431dbeaddd9f931c609b522c04e55732 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 19 Mar 2010 14:56:06 +0100 Subject: [PATCH 2/2] Drop our own "many bad sectors" heuristic This currently causes a lot of false positives, because in many cases our threshold is either overly pessimistically low, or the raw value is implausibly high. Just use the normalized values vs. threshold for now. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=25772 Bug-Ubuntu: https://launchpad.net/bugs/438136 --- atasmart.c | 33 +++++++++++---------------------- 1 files changed, 11 insertions(+), 22 deletions(-) Index: libatasmart/atasmart.c =================================================================== --- libatasmart.orig/atasmart.c 2012-05-23 08:34:14.007836753 +0200 +++ libatasmart/atasmart.c 2012-05-23 08:34:43.903835695 +0200 @@ -130,6 +130,8 @@ SkBool current_pending_sector_found:1; uint64_t reallocated_sector_count; uint64_t current_pending_sector; + SkBool reallocated_sector_count_bad:1; + SkBool current_pending_sector_bad:1; void *blob; }; @@ -2190,16 +2192,23 @@ if (a->pretty_unit != SK_SMART_ATTRIBUTE_UNIT_SECTORS) return; + if (!a->current_value_valid) + return; + if (!strcmp(a->name, "reallocated-sector-count")) { if (a->pretty_value > d->reallocated_sector_count) d->reallocated_sector_count = a->pretty_value; d->reallocated_sector_count_found = TRUE; + if (a->good_now_valid && !a->good_now) + d->reallocated_sector_count_bad = TRUE; } if (!strcmp(a->name, "current-pending-sector")) { if (a->pretty_value > d->current_pending_sector) d->current_pending_sector = a->pretty_value; d->current_pending_sector_found = TRUE; + if (a->good_now_valid && !a->good_now) + d->current_pending_sector_bad = TRUE; } } @@ -2255,24 +2264,9 @@ return _P(map[overall]); } -static uint64_t u64log2(uint64_t n) { - unsigned r; - - if (n <= 1) - return 0; - - r = 0; - for (;;) { - n = n >> 1; - if (!n) - return r; - r++; - } -} - int sk_disk_smart_get_overall(SkDisk *d, SkSmartOverall *overall) { SkBool good; - uint64_t sectors, sector_threshold; + uint64_t sectors; assert(d); assert(overall); @@ -2293,13 +2287,7 @@ return -1; sectors = 0; } else { - - /* We use log2(n_sectors)*1024 as a threshold here. We - * had to pick something, and this makes a bit of - * sense, or doesn't it? */ - sector_threshold = u64log2(d->size/512) * 1024; - - if (sectors >= sector_threshold) { + if (d->reallocated_sector_count_bad || d->current_pending_sector_bad) { *overall = SK_SMART_OVERALL_BAD_SECTOR_MANY; return 0; } debian/patches/series0000644000000000000000000000017012226756606012044 0ustar # Debian patches for libatasmart 0001-Dont-test-undefined-bits.patch 0002-Drop-our-own-many-bad-sectors-heuristic.patch debian/rules0000755000000000000000000000150712226756606010265 0ustar #!/usr/bin/make -f %: dh $@ --with autoreconf export LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed override_dh_auto_configure: dh_auto_configure -- --disable-silent-rules override_dh_link: dh_link -plibatasmart-dev lib/$(DEB_HOST_MULTIARCH)/$$(basename $$(readlink debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libatasmart.so)) usr/lib/$(DEB_HOST_MULTIARCH)/libatasmart.so dh_link --remaining-packages override_dh_install: dh_install # library should go into /lib for usage in udisks etc. set -e; cd debian/libatasmart?; mv usr/lib .; rmdir usr # when building for Ubuntu, install Apport hook if dpkg-vendor --is ubuntu; then \ install -m 644 -D debian/local/apport-hook.py debian/libatasmart4/usr/share/apport/package-hooks/libatasmart4.py; \ fi override_dh_installdocs: dh_installdocs --all README debian/source/0000755000000000000000000000000012226756606010502 5ustar debian/source/format0000644000000000000000000000001412226756606011710 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000007412226756606010234 0ustar version=3 http://0pointer.de/public/libatasmart-(.*).tar.xz