commit hdparm for openSUSE:Factory
Hello community,
here is the log from the commit of package hdparm for openSUSE:Factory
checked in at Wed Feb 2 01:46:18 CET 2011.
--------
--- hdparm/hdparm.changes 2010-11-29 12:43:25.000000000 +0100
+++ /mounts/work_src_done/STABLE/hdparm/hdparm.changes 2011-01-26 10:38:03.000000000 +0100
@@ -1,0 +2,11 @@
+Wed Jan 26 09:36:13 UTC 2011 - puzel@novell.com
+
+- update to hdparm-9.37 (bnc#664825)
+ - handle raid1 start_lba values, and show -1 for indeterminte
+ raid start_lba values
+ - abort --fibmap when start_lba is indeterminate
+ - updated wiper.sh to fix a kink with hfsplus filesystems
+ - updated wiper.sh to no longer rely on the obsolete "rdev"
+ command
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
hdparm-9.36.tar.bz2
New:
----
hdparm-9.37.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hdparm.spec ++++++
--- /var/tmp/diff_new_pack.ngCBj8/_old 2011-02-02 01:45:39.000000000 +0100
+++ /var/tmp/diff_new_pack.ngCBj8/_new 2011-02-02 01:45:39.000000000 +0100
@@ -24,7 +24,7 @@
PreReq: %insserv_prereq %fillup_prereq coreutils
Provides: base:/sbin/hdparm
AutoReqProv: on
-Version: 9.36
+Version: 9.37
Release: 1
Summary: A Program to get and set hard disk parameters
Source: %{name}-%{version}.tar.bz2
++++++ hdparm-9.36.tar.bz2 -> hdparm-9.37.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/Changelog new/hdparm-9.37/Changelog
--- old/hdparm-9.36/Changelog 2010-11-11 15:36:09.000000000 +0100
+++ new/hdparm-9.37/Changelog 2011-01-24 16:15:10.000000000 +0100
@@ -1,3 +1,8 @@
+hdparm-9.37
+ - handle raid1 start_lba values, and show -1 for indeterminte raid start_lba values
+ - abort --fibmap when start_lba is indeterminate
+ - updated wiper.sh to fix a kink with hfsplus filesystems
+ - updated wiper.sh to no longer rely on the obsolete "rdev" command
hdparm-9.36
- udpated raid1ext4trim.sh script to version 1.4
- updated wiper.sh to support hfsplus and ntfs filesystem types, courtesy of Heiko Wegeler
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/fibmap.c new/hdparm-9.37/fibmap.c
--- old/hdparm-9.36/fibmap.c 2009-09-29 23:14:57.000000000 +0200
+++ new/hdparm-9.37/fibmap.c 2010-11-24 22:20:17.000000000 +0100
@@ -248,6 +248,11 @@
close(fd);
return err;
}
+ if (start_lba == START_LBA_UNKNOWN) {
+ fprintf(stderr, "Unable to determine start offset LBA for device, aborting.\n");
+ close(fd);
+ return EIO;
+ }
sectors_per_block = st.st_blksize / sector_bytes;
printf("\n%s:\n filesystem blocksize %lu, begins at LBA %llu;"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/geom.c new/hdparm-9.37/geom.c
--- old/hdparm-9.36/geom.c 2010-10-04 21:40:02.000000000 +0200
+++ new/hdparm-9.37/geom.c 2010-11-24 22:54:48.000000000 +0100
@@ -21,6 +21,59 @@
#include "hdparm.h"
+static int get_driver_major (const char *driver, unsigned int *major)
+{
+ static const char proc_devices[] = "/proc/devices";
+ char buf[256];
+ int err = 0;
+ FILE *fp = fopen(proc_devices, "r");
+
+ if (fp == NULL) {
+ err = EIO;
+ } else {
+ while (fgets(buf, sizeof(buf) - 1, fp)) {
+ int len = strlen(buf);
+ if (len > 5 && buf[len - 1] == '\n') {
+ buf[len - 1] = '\0';
+ if (buf[3] == ' ' && 0 == strcmp(buf + 4, driver)) {
+ *major = atoi(buf);
+ break;
+ }
+ }
+ }
+ }
+ if (err)
+ perror(proc_devices);
+ if (fp)
+ fclose(fp);
+ return err;
+}
+
+static unsigned int md_major (void)
+{
+ static unsigned int maj = 0;
+
+ if (!maj) {
+ unsigned int val;
+ if (0 == get_driver_major("md", &val))
+ maj = val;
+ }
+ return maj;
+}
+
+int fd_is_raid (int fd)
+{
+ struct stat st;
+
+ if (!md_major())
+ return 0; /* not a RAID device */
+ if (fstat(fd, &st)) {
+ perror("fstat()");
+ return 0; /* ugh.. shouldn't happen */
+ }
+ return (major(st.st_rdev) == md_major());
+}
+
static int get_sector_count (int fd, __u64 *nsectors)
{
int err;
@@ -45,6 +98,47 @@
return err;
}
+/*
+ * "md" (RAID) devices have per-member "start" offsets.
+ * Realistically, we can only support raid1 arrays here,
+ * and only then when all members have the same "start" offsets.
+ */
+static int get_raid1_start_lba (int fd, __u64 *start_lba)
+{
+ char buf[32];
+ unsigned int member, raid_disks;
+ __u64 start = 0, offset = 0;
+
+ if (sysfs_get_attr(fd, "md/level", "%s", buf, NULL, 0)
+ || sysfs_get_attr(fd, "md/raid_disks", "%u", &raid_disks, NULL, 0))
+ return ENODEV;
+ if (strcmp(buf, "raid1") || !raid_disks)
+ return EINVAL;
+ for (member = 0; member < raid_disks; ++member) {
+ __u64 member_start, member_offset;
+ char member_path[32];
+ sprintf(member_path, "md/rd%u/offset", member);
+ if (sysfs_get_attr(fd, member_path, "%llu", &member_offset, NULL, 0))
+ member_offset = 0;
+ sprintf(member_path, "md/rd%u/block/dev", member);
+ if (sysfs_get_attr(fd, member_path, "%s", buf, NULL, 0))
+ return EINVAL;
+ if (md_major() == (unsigned)atoi(buf)) /* disallow recursive RAIDs */
+ return EINVAL;
+ sprintf(member_path, "md/rd%u/block/start", member);
+ if (sysfs_get_attr(fd, member_path, "%llu", &member_start, NULL, 0))
+ return ENODEV;
+ if (member == 0) {
+ start = member_start;
+ offset = member_offset;
+ } else if (member_start != start || member_offset != offset)
+ return EINVAL;
+ /* FIXME? Should --fibmap should account for member_offset in calculations? */
+ }
+ *start_lba = start;
+ return 0;
+}
+
int get_dev_geometry (int fd, __u32 *cyls, __u32 *heads, __u32 *sects,
__u64 *start_lba, __u64 *nsectors)
{
@@ -64,9 +158,14 @@
* so it cannot be relied upon for start_lba with very large drives >= 2TB.
*/
__u64 result;
- if (0 == sysfs_get_attr(fd, "start", "%llu", &result, NULL, 0)) {
+ if (0 == sysfs_get_attr(fd, "start", "%llu", &result, NULL, 0)
+ || 0 == get_raid1_start_lba(fd, &result))
+ {
*start_lba = result;
- start_lba = NULL;
+ start_lba = NULL;
+ } else if (fd_is_raid(fd)) {
+ *start_lba = START_LBA_UNKNOWN; /* RAID: no such thing as a "start_lba" */
+ start_lba = NULL;
}
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/hdparm.c new/hdparm-9.37/hdparm.c
--- old/hdparm-9.36/hdparm.c 2010-11-11 15:35:38.000000000 +0100
+++ new/hdparm-9.37/hdparm.c 2011-01-24 16:15:17.000000000 +0100
@@ -35,7 +35,7 @@
extern const char *minor_str[];
-#define VERSION "v9.36"
+#define VERSION "v9.37"
#ifndef O_DIRECT
#define O_DIRECT 040000 /* direct disk access, not easily obtained from headers */
@@ -935,11 +935,13 @@
if (start_lba == 0ULL)
return 0;
- if (msg) {
+ if (start_lba == START_LBA_UNKNOWN || fd_is_raid(fd)) {
+ fprintf(stderr, "%s is a RAID device: please specify an absolute LBA of a raw member device instead (raid1 only)\n", devname);
+ } else if (msg) {
fprintf(stderr, "%s\n", msg);
} else {
fprintf(stderr, "Device %s has non-zero LBA starting offset of %llu.\n", devname, start_lba);
- fprintf(stderr, "Please use an absolute LBA with the /dev/ entry for the full device, rather than a partition name.\n");
+ fprintf(stderr, "Please use an absolute LBA with the /dev/ entry for the raw device, rather than a partition or raid name.\n");
fprintf(stderr, "%s is probably a partition of %s (?)\n", devname, fdevname);
fprintf(stderr, "The absolute LBA of sector %llu from %s should be %llu\n", lba, devname, start_lba + lba);
}
@@ -2139,9 +2141,13 @@
__u32 cyls = 0, heads = 0, sects = 0;
__u64 start_lba = 0, nsectors = 0;
err = get_dev_geometry (fd, &cyls, &heads, §s, &start_lba, &nsectors);
- if (!err)
- printf(" geometry = %u/%u/%u, sectors = %lld, start = %lld\n",
- cyls, heads, sects, nsectors, start_lba);
+ if (!err) {
+ printf(" geometry = %u/%u/%u, sectors = %lld, start = ", cyls, heads, sects, nsectors);
+ if (start_lba == START_LBA_UNKNOWN)
+ printf("unknown\n");
+ else
+ printf("%lld\n", start_lba);
+ }
}
if (get_powermode) {
__u8 args[4] = {ATA_OP_CHECKPOWERMODE1,0,0,0};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/hdparm.h new/hdparm-9.37/hdparm.h
--- old/hdparm-9.36/hdparm.h 2009-07-29 21:32:00.000000000 +0200
+++ new/hdparm-9.37/hdparm.h 2010-11-24 22:54:19.000000000 +0100
@@ -23,6 +23,7 @@
int fwdownload(int fd, __u16 *id, const char *fwpath, int xfer_mode);
void dco_identify_print (__u16 *dco);
int set_dvdspeed(int fd, int speed);
+int fd_is_raid (int fd);
extern const char *BuffType[4];
@@ -75,6 +76,8 @@
CDROM__SPEED = 0x5322,
};
+#define START_LBA_UNKNOWN (~0ull)
+
/* Some systems define BLKGETSIZE64 with a "u64" arg,
* but without supplying a typedef for u64.
* The only real workaround here is to define it locally,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/hdparm.lsm new/hdparm-9.37/hdparm.lsm
--- old/hdparm-9.36/hdparm.lsm 2010-11-11 15:38:06.000000000 +0100
+++ new/hdparm-9.37/hdparm.lsm 2011-01-24 16:17:21.000000000 +0100
@@ -1,8 +1,9 @@
Begin4
Title: hdparm
-Version: 9.36
-Entered-date: 2010-11-11
+Version: 9.37
+Entered-date: 2011-01-24
Description: hdparm - get/set hard disk parameters for Linux SATA/IDE drives.
+ v9.37 Enable --fibmap to work on RAID1; other tweaks.
v9.36 manpage updates, wiper.sh version 3.1
v9.35 Fixed CDB breakage from v9.34; -B works again now
v9.34 Fixed CDB transfer length bug that affected some commands
@@ -110,7 +111,7 @@
Maintained-by: mlord@pobox.com (Mark Lord)
Primary-site: http://sourceforge.net/projects/hdparm/
Alternate-site: http://www.ibiblio.org/pub/Linux/system/hardware
- 121K hdparm-9.36.tar.gz
+ 122K hdparm-9.37.tar.gz
4K hdparm.lsm
Platforms: Linux
Copying-policy: BSD License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/wiper/Changelog new/hdparm-9.37/wiper/Changelog
--- old/hdparm-9.36/wiper/Changelog 2010-11-11 15:35:00.000000000 +0100
+++ new/hdparm-9.37/wiper/Changelog 2011-01-24 16:14:26.000000000 +0100
@@ -1,3 +1,9 @@
+wiper.sh-3.3
+ - remove need for external "rdev" utility, to keep Suse/Redhat/Fedora users happy
+
+wiper.sh-3.2
+ -limits the trimmed blocks to the size of the hfsplus/ntfs filesystem
+
wiper.sh-3.1
- updated contrib/raid1ext4trim.sh script to v1.4, courtesy of Chris Caputo
- new flag to enable unattended operation, and handle SIGPIPE
@@ -5,33 +11,24 @@
- support hfsplus and ntfs filesystem types, courtesy of Heiko Wegeler
- hfsplus/ntfs notes from Heiko Wegeler:
- n-7 tests from a kvm installation: ok: "ntfs" raw ssd attached as 2nd drive,
- copy sleuthkit source files with w7 on a 100MB gpt partition. from linux
- compiletest, w7-chkdsk after trim ok "ntfs 8k cluster" same test ok: "ntfs with
- compressed files" same test ok: "ntfs with encrypted files" raw ssd attached as
- 2nd drive, chkdsk after trim on a 100MB gpt partition. compiletest and chkdsk
- after unencryption and trim
+ Icat and fsstat from package sleuthkit version >=3.1.1 is required for hfsplus. A outdated icat is in Debian
+ package tct, the right icat is a link in package sleuthkit to ->/etc/alternatives/icat->/usr/bin/icat-sleuthkit.
+ Sleuthkit from Ubuntu 10.4 LTS is too old, you need a local build in /usr/local/bin. Fedora 14 works.
+ Fedora13+updates should work.
- macos 10.4.5 from 2/2006 secret tests from the macos-installer (in kvm) with
- this wiper 2.5 patched with loopdevice, hfsplus,ntfs support (because attaching
- my raw boot ssd to macos is too risky for me) ok: fstype "mac os extended
- (journaled)" ssd partition sda7 100MB attached as 2nd disk then format, copy
- sleuthkit source files, quit installer. then from linux trim, mount readonly
- (formatted with macos needs a "force" option for readwrite, normal), copy files
- back to btrfs for compile, works. verify disk with the macos installer, works
- ok: fstype "mac os extended" same test ok: fstype "mac os extended (case
- sensitive, journaled)" same test ok: fstype "mac os extended (case sensitive)"
- same test ok: fstype "mac os standard" wiper says:offline TRIM not supported
- for hfs filesystems, aborting. ok: fstype "unix file system" wiper says:
- offline TRIM not supported for ufs filesystems, aborting. not tested: "msdos
- filesystem" and raids
+ Win-7 tests from a kvm installation:
+ ok: "ntfs" compiletest and win-7 checkdsk after trim
+ ok: "ntfs 8k cluster" same test
+ ok: "ntfs with compressed files" same test
+ ok: "ntfs with encrypted files" same test after decrypt
+ Win-XP:
+ ok: Systemdrive boots after trim and chkdsk.
- other checks in the source:
- * check if filesystem is properly unmounted sleuthkit checks and messages:
- * check for fsstat, which is only in sleuthkit. a outdated icat is in debian
- * package tct, the right icat is a link in package sleuthkit to
- * ->/etc/alternatives/icat->/usr/bin/icat-sleuthkit. ubuntu 10.4 LTS needs a
- * local build sleuthkit in /usr/local/bin because ubuntu lts sleuthkit is too
- * old.ubuntu 10.10 works with distribution package, fedora14 has /usr/bin/icat
- * from sleuthkit 3.1.1 and works, fedora13+updates should work (exept rdev)
- * other exit clauses which will never happen
+ MacOS 10.4.5 tests from the MacOS-installer:
+ ok: "mac os extended (journaled)" compiletest and macos-verify after trim
+ ok: "mac os extended" same test
+ ok: "mac os extended (case sensitive, journaled)" same test
+ ok: "mac os extended (case sensitive)" same test
+ ok: "mac os standard" wiper says:offline TRIM not supported for hfs filesystems, aborting.
+ ok: "unix file system" wiper says: offline TRIM not supported for ufs filesystems, aborting.
+ not tested: "msdos filesystem" and raids
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hdparm-9.36/wiper/wiper.sh new/hdparm-9.37/wiper/wiper.sh
--- old/hdparm-9.36/wiper/wiper.sh 2010-11-11 15:28:37.000000000 +0100
+++ new/hdparm-9.37/wiper/wiper.sh 2011-01-16 23:01:28.000000000 +0100
@@ -2,8 +2,8 @@
#
# SATA SSD free-space TRIM utility, by Mark Lord
participants (1)
-
root@hilbert.suse.de