Hello community, here is the log from the commit of package hdparm for openSUSE:Factory checked in at 2015-06-30 10:15:13 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hdparm (Old) and /work/SRC/openSUSE:Factory/.hdparm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hdparm" Changes: -------- --- /work/SRC/openSUSE:Factory/hdparm/hdparm.changes 2015-01-21 21:54:25.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.hdparm.new/hdparm.changes 2015-06-30 10:15:15.000000000 +0200 @@ -1,0 +2,13 @@ +Mon Jun 22 12:17:05 UTC 2015 - [email protected] + +- update to version 9.48 + * 9.48 - fixed a number of output bugs due to the devslp patch + * 9.47 - added devslp patch (IDENTIFY word 76) from David Woodhouse. + - help and manpage fixes from Michal Minar. + * 9.46 - fix compilation with "musl libc". + - added "hex:aabbcc.." for binary security passwords. + - return EIO when read_big_block() fails + - use llabs() rather than abs() in identify.c +- use spec-cleaner + +------------------------------------------------------------------- Old: ---- hdparm-9.45.tar.gz New: ---- hdparm-9.48.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hdparm.spec ++++++ --- /var/tmp/diff_new_pack.xxVy62/_old 2015-06-30 10:15:15.000000000 +0200 +++ /var/tmp/diff_new_pack.xxVy62/_new 2015-06-30 10:15:15.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package hdparm # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,16 +16,16 @@ # +%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev) } +%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d } Name: hdparm -PreReq: %fillup_prereq coreutils -Provides: base:/sbin/hdparm -Version: 9.45 +Version: 9.48 Release: 0 Summary: A Program to get and set hard disk parameters License: SUSE-Permissive Group: Hardware/Other - -Source: http://downloads.sf.net/hdparm/%name-%version.tar.gz +Url: http://sourceforge.net/projects/hdparm/ +Source: http://downloads.sf.net/hdparm/%{name}-%{version}.tar.gz Source1: 56-idedma.rules Source2: sysconfig.ide Source3: udev.idedma.sh @@ -35,12 +35,10 @@ Patch4: hdparm-9.43-fix-bashisms.patch BuildRequires: pkgconfig BuildRequires: pkgconfig(udev) -Url: http://sourceforge.net/projects/hdparm/ +Requires(post): %fillup_prereq coreutils +Provides: base:/sbin/hdparm BuildRoot: %{_tmppath}/%{name}-%{version}-build -%{!?_udevdir: %global _udevdir %(pkg-config --variable=udevdir udev) } -%{!?_udevrulesdir: %global _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d } - %description A shell utility to access and tune the ioctl features of the Linux IDE driver and IDE drives. @@ -53,27 +51,27 @@ %patch4 -p1 %build -make CFLAGS="%optflags -Wall -Wstrict-prototypes" LDFLAGS= CC="%{__cc}" +make %{?_smp_mflags} CFLAGS="%{optflags} -Wall -Wstrict-prototypes" LDFLAGS= CC="gcc" cp -p wiper/README.txt README.wiper %install -mkdir -p "%buildroot/usr/share/man/man8" -install -d "%buildroot/%_sbindir" -%make_install binprefix="%_prefix" +mkdir -p "%{buildroot}%{_mandir}/man8" +install -d "%{buildroot}/%{_sbindir}" +%make_install binprefix="%{_prefix}" mv contrib/README contrib/README.contrib -install -d "%buildroot/%_udevrulesdir" -install -m 644 %{S:1} "%buildroot/%_udevrulesdir" -install -d "%buildroot/var/adm/fillup-templates" -install -m 644 %{S:2} "%buildroot/var/adm/fillup-templates" -install -m 755 %{S:3} "%buildroot/%_udevdir/idedma.sh" -install -d "%buildroot/usr/lib/hdparm" -install -m 755 contrib/idectl "%buildroot/usr/lib/hdparm" -install -m 755 contrib/ultrabayd "%buildroot/usr/lib/hdparm" -install -m 755 wiper/wiper.sh "%buildroot/%_sbindir" +install -d "%{buildroot}/%{_udevrulesdir}" +install -m 644 %{SOURCE1} "%{buildroot}/%{_udevrulesdir}" +install -d "%{buildroot}%{_localstatedir}/adm/fillup-templates" +install -m 644 %{SOURCE2} "%{buildroot}%{_localstatedir}/adm/fillup-templates" +install -m 755 %{SOURCE3} "%{buildroot}/%{_udevdir}/idedma.sh" +install -d "%{buildroot}%{_libexecdir}/hdparm" +install -m 755 contrib/idectl "%{buildroot}%{_libexecdir}/hdparm" +install -m 755 contrib/ultrabayd "%{buildroot}%{_libexecdir}/hdparm" +install -m 755 wiper/wiper.sh "%{buildroot}/%{_sbindir}" #UsrMerge -mkdir -p "%buildroot/sbin" -ln -sf %{_sbindir}/wiper.sh "%buildroot/sbin" -ln -sf %{_sbindir}/hdparm "%buildroot/sbin" +mkdir -p "%{buildroot}/sbin" +ln -sf %{_sbindir}/wiper.sh "%{buildroot}/sbin" +ln -sf %{_sbindir}/hdparm "%{buildroot}/sbin" #EndUsrMerge %post @@ -104,12 +102,12 @@ && mv etc/sysconfig/ide.new etc/sysconfig/ide rm -f etc/sysconfig/ide.new fi -%{?udev_rules_update:%{udev_rules_update}} +%{?udev_rules_update:%udev_rules_update} %files %defattr(-,root,root) %doc Changelog README.acoustic contrib/README.contrib README.wiper -%doc %{_mandir}/man8/hdparm.8.gz +%{_mandir}/man8/hdparm.8.gz #UsrMerge /sbin/hdparm /sbin/wiper.sh @@ -118,7 +116,7 @@ %{_sbindir}/wiper.sh %{_udevdir}/idedma.sh %{_udevrulesdir}/56-idedma.rules -/usr/lib/hdparm -/var/adm/fillup-templates/sysconfig.ide +%{_libexecdir}/hdparm +%{_localstatedir}/adm/fillup-templates/sysconfig.ide %changelog ++++++ hdparm-9.45.tar.gz -> hdparm-9.48.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/Changelog new/hdparm-9.48/Changelog --- old/hdparm-9.45/Changelog 2014-09-27 16:32:02.000000000 +0200 +++ new/hdparm-9.48/Changelog 2015-06-17 22:34:53.000000000 +0200 @@ -1,3 +1,13 @@ +hdparm-9.48: + - fix bugs from devslp patch. +hdparm-9.47: + - added devslp patch (IDENTIFY word 76) from David Woodhouse. + - help and manpage fixes from Michal Minar. +hdparm-9.46: + - fix compilation with "musl libc". + - added "hex:aabbcc.." for binary security passwords. + - return EIO when read_big_block() fails + - use llabs() rather than abs() in identify.c hdparm-9.45: - fixed blocksize handling in fibmap code to use result from FIGETBSZ in more places (Anton Altaparmakov). - fixed divide by zero exception in geom.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/fallocate.c new/hdparm-9.48/fallocate.c --- old/hdparm-9.45/fallocate.c 2010-10-04 21:38:39.000000000 +0200 +++ new/hdparm-9.48/fallocate.c 2015-06-14 01:22:04.000000000 +0200 @@ -27,7 +27,8 @@ err = EINVAL; #else int fd; - loff_t offset = 0, len; + unsigned long long offset = 0; /* loff_t */ + unsigned long long len; int mode = 0; fd = open(path, O_WRONLY|O_CREAT|O_EXCL, 0600); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/hdparm.8 new/hdparm-9.48/hdparm.8 --- old/hdparm-9.45/hdparm.8 2014-09-27 16:32:14.000000000 +0200 +++ new/hdparm-9.48/hdparm.8 2015-06-17 22:34:33.000000000 +0200 @@ -1,4 +1,4 @@ -.TH HDPARM 8 "September 2014" "Version 9.45" +.TH HDPARM 8 "June 2015" "Version 9.48" .SH NAME hdparm \- get/set SATA/IDE device parameters @@ -677,6 +677,9 @@ Display some basic settings, similar to \-acdgkmur for IDE. This is also the default behaviour when no options are specified. .TP +.I -V +Display program version and exit immediately. +.TP .I --verbose Display extra diagnostics from some commands. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/hdparm.c new/hdparm-9.48/hdparm.c --- old/hdparm-9.45/hdparm.c 2014-09-27 16:05:14.000000000 +0200 +++ new/hdparm-9.48/hdparm.c 2015-06-17 22:34:19.000000000 +0200 @@ -2,6 +2,8 @@ * hdparm.c - Command line interface to get/set hard disk parameters. * - by Mark Lord (C) 1994-2012 -- freely distributable. */ +#define HDPARM_VERSION "v9.48" + #define _LARGEFILE64_SOURCE /*for lseek64*/ #define _BSD_SOURCE /* for strtoll() */ #include <unistd.h> @@ -38,8 +40,6 @@ extern const char *minor_str[]; -#define VERSION "v9.45" - #ifndef O_DIRECT #define O_DIRECT 040000 /* direct disk access, not easily obtained from headers */ #endif @@ -229,7 +229,7 @@ } else { fputs ("read() hit EOF - device too small\n", stderr); } - return 1; + return EIO; } /* access all sectors of buf to ensure the read fully completed */ for (i = 0; i < TIMING_BUF_BYTES; i += 512) @@ -378,7 +378,7 @@ getitimer(ITIMER_REAL, &e1); do { ++iterations; - if (read_big_block (fd, buf)) + if ((err = read_big_block(fd, buf))) goto quit; getitimer(ITIMER_REAL, &e2); elapsed = (e1.it_value.tv_sec - e2.it_value.tv_sec) @@ -911,6 +911,28 @@ } } +int get_id_log_page_data (int fd, __u8 pagenr, __u8 *buf) +{ + struct hdio_taskfile *r; + int err = 0; + + r = malloc(sizeof(struct hdio_taskfile) + 512); + if (!r) { + err = errno; + perror("malloc()"); + return err; + } + + init_hdio_taskfile(r, ATA_OP_READ_LOG_EXT, RW_READ, LBA48_FORCE, 0x30 + (pagenr << 8), 1, 512); + if (do_taskfile_cmd(fd, r, timeout_15secs)) { + err = errno; + } else { + memcpy(buf, r->data, 512); + } + free(r); + return err; +} + static void confirm_i_know_what_i_am_doing (const char *opt, const char *explanation) { if (!i_know_what_i_am_doing) { @@ -1518,7 +1540,7 @@ { FILE *desc = rc ? stderr : stdout; - fprintf(desc,"\n%s - get/set hard disk parameters - version " VERSION ", by Mark Lord.\n\n", progname); + fprintf(desc,"\n%s - get/set hard disk parameters - version " HDPARM_VERSION ", by Mark Lord.\n\n", progname); if (0) if (rc) fprintf(desc, "clue=%d\n", clue); fprintf(desc,"Usage: %s [options] [device ...]\n\n", progname); fprintf(desc,"Options:\n" @@ -1590,6 +1612,7 @@ " --offset use with -t, to begin timings at given offset (in GiB) from start of drive\n" " --prefer-ata12 Use 12-byte (instead of 16-byte) SAT commands when possible\n" " --read-sector Read and dump (in hex) a sector directly from the media\n" + " --repair-sector Alias for the --write-sector option (VERY DANGEROUS)\n" " --security-help Display help for ATA security commands\n" " --trim-sector-ranges Tell SSD firmware to discard unneeded data sectors: lba:count ..\n" " --trim-sector-ranges-stdin Same as above, but reads lba:count pairs from stdin\n" @@ -2280,7 +2303,7 @@ if (do_IDentity == 2) dump_sectors(id, 1); else - identify((void *)id); + identify(fd, (void *)id); } } if (get_lookahead) { @@ -2506,7 +2529,7 @@ } } while (wc < 256); putchar('\n'); - identify(sbuf); + identify(-1, sbuf); return; eof: err = errno; @@ -2546,24 +2569,45 @@ static void get_security_password (int handle_NULL) { unsigned int maxlen = sizeof(security_password) - 1; + unsigned int binary_passwd = 0; - if (argc < 2) { - fprintf(stderr, "missing PASSWD\n"); - exit(EINVAL); - } argp = *argv++, --argc; - if (!argp) { + if (!argp || argc < 1) { fprintf(stderr, "missing PASSWD\n"); exit(EINVAL); } - if (strlen(argp) > maxlen) { + memset(security_password, 0, maxlen + 1); + if (0 == strncmp(argp, "hex:", 4)) { + argp += 4; + if (strlen(argp) != (maxlen * 2)) { + fprintf(stderr, "invalid PASSWD length (hex string must be exactly %d chars)\n", maxlen*2); + exit(EINVAL); + } + char *cur = security_password; + while (*argp) { + int d[2]; + d[0] = fromhex(*argp++); + d[1] = fromhex(*argp++); + *(cur++) = d[0] << 4 | d[1]; + } + binary_passwd = 1; + } else if (strlen(argp) > maxlen) { fprintf(stderr, "PASSWD too long (must be %d chars max)\n", maxlen); exit(EINVAL); - } - memset(security_password, 0, maxlen + 1); - if (!handle_NULL || strcmp(argp, "NULL")) + } else if (!handle_NULL || strcmp(argp, "NULL")) { strcpy(security_password, argp); - printf("security_password=\"%s\"\n", security_password); + } + printf("security_password:"); + if (!binary_passwd) { + printf(" \"%s\"\n", security_password); + } else { + unsigned int i; + for (i = 0; i < maxlen; ++i) { + unsigned char c = security_password[i]; + printf(" %02x", c); + } + putchar('\n'); + } while (*argp) ++argp; } @@ -2926,7 +2970,7 @@ case DO_FLAG('T',do_ctimings); case GET_SET_PARM('u',"unmask-irq",unmask,0,1); case DO_FLAG('v',do_defaults); - case 'V': fprintf(stdout, "%s %s\n", progname, VERSION); exit(0); + case 'V': fprintf(stdout, "%s %s\n", progname, HDPARM_VERSION); exit(0); case SET_FLAG('w',doreset); case GET_SET_PARM('W',"write-cache",wcache,0,1); case SET_FLAG('y',standbynow); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/hdparm.h new/hdparm-9.48/hdparm.h --- old/hdparm-9.45/hdparm.h 2014-09-27 15:31:18.000000000 +0200 +++ new/hdparm-9.48/hdparm.h 2015-06-17 22:31:04.000000000 +0200 @@ -1,7 +1,7 @@ /* Some prototypes for extern functions. */ //#undef __KERNEL_STRICT_NAMES -#include <linux/types.h> +#include <sys/types.h> #if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(x) @@ -9,7 +9,7 @@ #define lba28_limit ((__u64)(1<<28) - 1) -void identify (__u16 *id_supplied); +void identify (int fd, __u16 *id_supplied); void usage_error(int out) __attribute__((noreturn)); void no_scsi (void); void no_xt (void); @@ -30,6 +30,8 @@ void wdidle3_print_timeout (unsigned char timeout); unsigned char wdidle3_msecs_to_timeout (unsigned int msecs); +int get_id_log_page_data (int fd, __u8 pagenr, __u8 *buf); + extern const char *BuffType[4]; struct local_hd_big_geometry { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/hdparm.lsm new/hdparm-9.48/hdparm.lsm --- old/hdparm-9.45/hdparm.lsm 2014-09-27 16:32:52.000000000 +0200 +++ new/hdparm-9.48/hdparm.lsm 2015-06-17 22:35:19.000000000 +0200 @@ -1,8 +1,11 @@ Begin4 Title: hdparm -Version: 9.45 -Entered-date: 2014-09-27 +Version: 9.48 +Entered-date: 2015-06-14 Description: hdparm - get/set hard disk parameters for Linux SATA/IDE drives. + v9.48 fix devslp bugs + v9.47 devslp reporting support + v9.46 added "hex:xxxxxxxx" format for binary security passwords; misc small fixes v9.45 fixed fibmap block size; other minor stuff. v9.44 better sgio compatibility with kernel; fwdownload mode "E"; longer erase timeout; etc. v9.43 rearrange flag execution so that the idle/standby/sleep "now" flags are executed last. @@ -119,7 +122,7 @@ Maintained-by: [email protected] (Mark Lord) Primary-site: http://sourceforge.net/projects/hdparm/ Alternate-site: http://www.ibiblio.org/pub/Linux/system/hardware - 129K hdparm-9.45.tar.gz + 130K hdparm-9.48.tar.gz 4K hdparm.lsm Platforms: Linux Copying-policy: BSD License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/identify.c new/hdparm-9.48/identify.c --- old/hdparm-9.45/identify.c 2013-10-29 13:42:31.000000000 +0100 +++ new/hdparm-9.48/identify.c 2015-06-17 22:33:42.000000000 +0200 @@ -421,9 +421,9 @@ "Disable Data Transfer After Error Detection" /* word 119 bit 0 (ref: 2014DT)*/ }; static const char *cap_sata0_str[16] = { - "unknown 76[15]", /* word 76 bit 15 */ - "unknown 76[14]", /* word 76 bit 14 */ - "unknown 76[13]", /* word 76 bit 13 */ + "READ_LOG_DMA_EXT equivalent to READ_LOG_EXT", /* word 76 bit 15 */ + "Device automatic Partial to Slumber transitions",/* word 76 bit 14 */ + "Host automatic Partial to Slumber transitions",/* word 76 bit 13 */ "NCQ priority information", /* word 76 bit 12 */ "Idle-Unload when NCQ is active", /* word 76 bit 11 */ "Phy event counters", /* word 76 bit 10 */ @@ -446,7 +446,7 @@ "unknown 78[11]", /* word 78 bit 11 */ "unknown 78[10]", /* word 78 bit 10 */ "unknown 78[9]", /* word 78 bit 9 */ - "unknown 78[8]", /* word 78 bit 8 */ + "Device Sleep (DEVSLP)", /* word 78 bit 8 */ "unknown 78[7]", /* word 78 bit 7 */ "Software settings preservation", /* word 78 bit 6 */ "Asynchronous notification (eg. media change)", /* word 78 bit 5 */ @@ -648,8 +648,27 @@ return id[0] == 0x848a || id[0] == 0x844a || (id[83] & 0xc004) == 0x4004; } +static void print_devslp_info (int fd, __u16 *id) +{ + /* Print DEVSLP information */ + if (id[78] & 0x0100) { + __u8 buf[512]; + int deto = 0; + int mdat = 0; + + memset(buf, 0, 512); + if (fd != -1 && !get_id_log_page_data(fd, 8, buf) && (buf[0x37] & 0x80)) { + mdat = buf[0x30] & 0x1f; + deto = buf[0x31]; + printf("Device Sleep:\n"); + printf("\tDEVSLP Exit Timeout (DETO): %d ms (%s)\n", deto?deto:20, deto?"drive":"default"); + printf("\tMinimum DEVSLP Assertion Time (MDAT): %d ms (%s)\n", mdat?mdat:10, deto?"drive":"default"); + } + } +} + /* our main() routine: */ -void identify (__u16 *id_supplied) +void identify (int fd, __u16 *id_supplied) { unsigned int sector_bytes = 512; __u16 val[256], ii, jj, kk; @@ -907,7 +926,7 @@ if(like_std < 3) { nn = (__u32)val[CAPACITY_LSB] << 16 | val[CAPACITY_MSB]; /* check Endian of capacity bytes */ - if(abs(mm - bb) > abs(nn - bb)) + if(llabs((long long)(mm - bb)) > llabs((long long)(nn - bb))) mm = nn; } printf("\tCHS current addressable sectors:%11u\n",mm); @@ -1373,6 +1392,7 @@ printf(" determined by CSEL"); printf("\n"); } + print_devslp_info(fd, val); /* more stuff from std 5 */ if ((like_std > 4) && (eqpt != CDROM)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/sgio.h new/hdparm-9.48/sgio.h --- old/hdparm-9.45/sgio.h 2014-09-27 15:36:43.000000000 +0200 +++ new/hdparm-9.48/sgio.h 2015-06-14 14:53:25.000000000 +0200 @@ -10,6 +10,7 @@ ATA_OP_READ_LONG_ONCE = 0x23, ATA_OP_READ_PIO_EXT = 0x24, ATA_OP_READ_DMA_EXT = 0x25, + ATA_OP_READ_LOG_EXT = 0x2f, ATA_OP_READ_FPDMA = 0x60, // NCQ ATA_OP_WRITE_PIO = 0x30, ATA_OP_WRITE_LONG = 0x32, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.45/sysfs.c new/hdparm-9.48/sysfs.c --- old/hdparm-9.45/sysfs.c 2010-10-04 21:39:20.000000000 +0200 +++ new/hdparm-9.48/sysfs.c 2015-06-13 14:52:42.000000000 +0200 @@ -13,6 +13,7 @@ #include <fcntl.h> #include <errno.h> #include <dirent.h> +#include <limits.h> #include <sys/stat.h> #include <linux/types.h>
