--- scsitools-0.10.orig/rescan-scsi-bus.sh +++ scsitools-0.10/rescan-scsi-bus.sh @@ -182,7 +182,7 @@ # echo -e "\e[A\e[A\e[A${yellow}Test existence of $SGDEV = $RC ${norm} \n\n\n" if test $RC = 1; then return $RC; fi # OK, device online, compare INQUIRY string - INQ=`sg_inq -36 /dev/$SGDEV` + INQ=`sg_inq --len=36 /dev/$SGDEV` IVEND=`echo "$INQ" | grep 'Vendor identification:' | sed 's/^[^:]*: \(.*\)$/\1/'` IPROD=`echo "$INQ" | grep 'Product identification:' | sed 's/^[^:]*: \(.*\)$/\1/'` IPREV=`echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/'` --- scsitools-0.10.orig/scsi-spin.c +++ scsitools-0.10/scsi-spin.c @@ -0,0 +1,420 @@ +/* + File: scsi-spin.c + + A simple program to manually spin up and down a scsi device. + + Copyright 1998 Rob Browning + Copyright 2001 Eric Delaunay + + This source is covered by the terms the GNU Public License. + + Some of the original code came from + The Linux SCSI programming HOWTO + Heiko Eifeldt heiko@colossus.escape.de + v1.5, 7 May 1996 + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define SCSI_DISK_MAJOR(M) ((M) == SCSI_DISK0_MAJOR || \ + ((M) >= SCSI_DISK1_MAJOR && \ + (M) <= SCSI_DISK7_MAJOR) || \ + ((M) >= SCSI_DISK8_MAJOR && \ + (M) <= SCSI_DISK15_MAJOR)) + +#define SCSI_BLK_MAJOR(M) \ + (SCSI_DISK_MAJOR(M) || \ + (M) == SCSI_CDROM_MAJOR) + +/* define USE_SG_IO to send commands using scsi generic interface + */ +#define USE_SG_IO + +#ifdef USE_SG_IO +int opt_oldioctl = 0; +int opt_verbose = 0; + +const char* SENSE_KEY_STR[16] = { + "NO SENSE", + "RECOVERED ERROR", + "NOT READY", + "MEDIUM ERROR", + "HARDWARE ERROR", + "ILLEGAL REQUEST", + "UNIT ATTENTION", + "DATA PROJECT", + "BLANK CHECK", + "VENDOR-SPECIFIC", + "COPY ARBORTED", + "ABORTED COMMAND", + "EQUAL", + "VOLUME OVERFLOW", + "MISCOMPARED", + "RESERVED" +}; + +/* process a complete SCSI cmd. Use the generic SCSI interface. */ +static int handle_SCSI_cmd(const int fd, + const unsigned cmd_len, /* command length */ + unsigned char *cmd, /* command buffer */ + const unsigned in_size, /* input data size */ + const unsigned out_size, /* output data size */ + unsigned char *io_buff, /* i/o buffer */ + unsigned sense_size, /* sense buf length */ + unsigned char* sense_buff, /* sense buffer */ + const unsigned timeout /* timeout in s */ + ) { + ssize_t status = 0; + int k, err; + sg_io_hdr_t sg_hdr; + unsigned char sense[16]; + + /* safety checks */ + if (!cmd_len) return -1; /* need a cmd_len != 0 */ + if (in_size > 0 && io_buff == NULL) return -1; /* need an input buffer != NULL */ + /* generic SCSI device header construction */ + memset(&sg_hdr, 0, sizeof(sg_hdr)); + sg_hdr.interface_id = 'S'; + sg_hdr.dxfer_direction = SG_DXFER_NONE; + sg_hdr.cmd_len = cmd_len; + sg_hdr.cmdp = cmd; + sg_hdr.dxfer_len = in_size; + sg_hdr.dxferp = io_buff; + sg_hdr.timeout = (timeout ? timeout : 2)*1000; /* timeout in ms */ + if (sense_buff == NULL) { + sense_buff = sense; + sense_size = sizeof(sense); + } + sg_hdr.mx_sb_len = sense_size; + sg_hdr.sbp = sense_buff; + + if (opt_verbose > 1) { + fprintf( stderr, " cmd = " ); + for( k = 0 ; k < cmd_len ; k++ ) + fprintf( stderr, " %02x", cmd[k] ); + fputc( '\n', stderr ); + } + /* send command */ + status = ioctl( fd, SG_IO, &sg_hdr ); + if (status < 0 || sg_hdr.masked_status == CHECK_CONDITION) { + /* some error happened */ + fprintf( stderr, "SG_IO: status = 0x%x cmd = 0x%x\n", + sg_hdr.status, cmd[0] ); + if (opt_verbose > 0) { + fprintf( stderr, " sense = " ); + for( k = 0 ; k < sg_hdr.sb_len_wr ; k++ ) + fprintf( stderr, " %02x", sense_buff[k] ); + fputc( '\n', stderr ); + err = sense_buff[0] & 0x7f; + if (err == 0x70 || err == 0x71) { + fprintf( stderr, " (%s)\n", SENSE_KEY_STR[sense_buff[2] & 0xf] ); + } + } + perror(""); + } + return status; /* 0 means no error */ +} +#endif + +static void +scsi_spin(const int fd, const int desired_state, const int load_eject, const int wait) { +#ifdef USE_SG_IO + if (! opt_oldioctl) { + unsigned char cmdblk [6] = + { START_STOP, /* command */ + (wait ? 0 : 1), /* lun(3 bits)/reserved(4 bits)/immed(1 bit) */ + 0, /* reserved */ + 0, /* reserved */ + (load_eject ? 2 : 0) + | (desired_state ? 1 : 0), /* reserved(6)/LoEj(1)/Start(1)*/ + 0 };/* reserved/flag/link */ + + if (handle_SCSI_cmd(fd, sizeof(cmdblk), cmdblk, 0, 0, NULL, 0, NULL, wait)) { + fprintf( stderr, "start/stop failed\n" ); + exit(2); + } + return; + } +#endif + int ret; + if (desired_state != 0) + ret = ioctl( fd, SCSI_IOCTL_START_UNIT ); + else + ret = ioctl( fd, SCSI_IOCTL_STOP_UNIT ); + if (ret < 0) + perror( "scsi_spin: ioctl" ); +} + +static void +scsi_lock(const int fd, const int door_lock) { +#ifdef USE_SG_IO + if (! opt_oldioctl) { + unsigned char cmdblk [6] = + { ALLOW_MEDIUM_REMOVAL, /* command */ + 0, /* lun(3 bits)/reserved(5 bits) */ + 0, /* reserved */ + 0, /* reserved */ + (door_lock ? 1 : 0), /* reserved(7)/Prevent(1)*/ + 0 };/* control */ + + if (handle_SCSI_cmd(fd, sizeof(cmdblk), cmdblk, 0, 0, NULL, 0, NULL, 2)) { + fprintf( stderr, "lock/unlock failed\n" ); + exit(2); + } + return; + } +#endif + int ret; + if (door_lock != 0) + ret = ioctl( fd, SCSI_IOCTL_DOORLOCK ); + else + ret = ioctl( fd, SCSI_IOCTL_DOORUNLOCK ); + if (ret < 0) + perror( "scsi_lock: ioctl" ); +} + +/* -- [ED] -- + * Check if the device has some of its partitions mounted. + * The check is done by comparison between device major and minor numbers so it + * even works when the device name of the mount point is not the same of the + * one passed to scsi-spin (for example, scsidev creates device aliases under + * /dev/scsi). + */ +static int +is_mounted( const char* device, int use_proc, int devmaj, int devmin ) +{ + struct mntent *mnt; + struct stat devstat; + int mounted = 0; + struct { + __uint32_t dev_id; + __uint32_t host_unique_id; + } scsi_dev_id, scsi_id; + FILE *mtab; + char *mtabfile = use_proc ? "/proc/mounts" : "/etc/mtab"; + + if (devmaj == SCSI_GENERIC_MAJOR) { + /* scsi-spin device arg is /dev/sgN */ + int fd = open( device, O_RDONLY ); + if (fd >= 0) { + int ret = ioctl( fd, SCSI_IOCTL_GET_IDLUN, &scsi_dev_id ); + close( fd ); + if (ret < 0) + return -1; + } + } + /*printf("devid=%x\n",scsi_dev_id.dev_id);*/ + + mtab = setmntent( mtabfile, "r" ); + if (mtab == NULL) + return -1; + + while ((mnt = getmntent( mtab )) != 0) { + char * mdev = mnt->mnt_fsname; + if (stat( mdev, &devstat ) == 0) { + int maj = major(devstat.st_rdev); + int min = minor(devstat.st_rdev); + if (SCSI_DISK_MAJOR(maj) && SCSI_DISK_MAJOR(devmaj)) { + if (maj == devmaj && (min & ~15) == (devmin & ~15)) { + mounted = 1; + break; + } + } + else if (devmaj == SCSI_GENERIC_MAJOR && SCSI_BLK_MAJOR(maj)) { + /* scsi-spin device arg is /dev/sgN */ + int fd = open( mdev, O_RDONLY ); + if (fd >= 0) { + int ret = ioctl( fd, SCSI_IOCTL_GET_IDLUN, &scsi_id ); + close( fd ); + /*printf("id=%x\n",scsi_id.dev_id);*/ + if (ret == 0 && scsi_id.dev_id == scsi_dev_id.dev_id) { + /* same SCSI ID => same device */ + mounted = 1; + break; + } + } + } + else if (maj == SCSI_CDROM_MAJOR && maj == devmaj && min == devmin) { + mounted = 1; + break; + } + } + } + + endmntent( mtab ); + return mounted; +} + +static void +usage() +{ + static char usage_string[] = + "usage: scsi-spin {-u,-d} [-nfpe] device\n" + " -u, --up spin up device.\n" + " -d, --down spin down device.\n" + " -v, --verbose[=n] verbose mode (1: normal, 2: debug).\n" +#ifdef SG_IO + " -e, --loej load (-u) or eject (-d) removable medium.\n" + " -w, --wait=[n] wait the spin up/down operation to be completed\n" + " (n is the number of seconds to timeout).\n" + " -I, --oldioctl use legacy ioctl instead of SG I/O (-e,-w ignored).\n" +#endif + " -l, --lock prevent medium removal.\n" + " -L, --unlock allow medium removal.\n" + " -n, --noact do nothing but check if the device is in use.\n" + " -f, --force force spinning up/down even if the device is in use.\n" + " -p, --proc use /proc/mounts instead of /etc/mtab to do the check.\n" + " device is one of /dev/sd[a-z], /dev/scd[0-9]* or /dev/sg[0-9]*.\n"; + + fputs(usage_string, stderr); +} + +int +main(int argc, char *argv[]) +{ + int result = 0; + int fd; + int opt_up = 0; + int opt_down = 0; + int opt_loej = 0; + int opt_wait = 0; + int opt_force = 0; + int opt_noact = 0; + int opt_proc = 0; + int opt_lock = 0; + int opt_unlock = 0; + struct option cmd_line_opts[] = { + {"verbose", 2, NULL, 'v'}, + {"up", 0, NULL, 'u'}, + {"down", 0, NULL, 'd'}, +#ifdef SG_IO + {"loej", 0, NULL, 'e'}, + {"wait", 2, NULL, 'w'}, + {"oldioctl", 0, NULL, 'I'}, +#endif + {"lock", 0, NULL, 'l'}, + {"unlock", 0, NULL, 'L'}, + {"force", 0, NULL, 'f'}, + {"noact", 0, NULL, 'n'}, + {"proc", 0, NULL, 'p'}, + {0, 0, 0, 0}, + }; + char* endptr = ""; + char* device; + struct stat devstat; + + char c; + while((c = getopt_long(argc, argv, "vudewlLfnp", cmd_line_opts, NULL)) != EOF) { + switch (c) { + case 'v': opt_verbose = optarg ? strtol(optarg, &endptr, 10) : opt_verbose+1; + if (*endptr) goto error; + break; + case 'u': opt_up = 1; break; + case 'd': opt_down = 1; break; +#ifdef SG_IO + case 'e': opt_loej = 1; break; + case 'w': opt_wait = optarg ? strtol(optarg, &endptr, 10) : opt_wait+1; + if (*endptr) goto error; + break; + case 'I': opt_oldioctl = 1; break; +#endif + case 'f': opt_force = 1; break; + case 'l': opt_lock = 1; break; + case 'L': opt_unlock = 1; break; + case 'n': opt_noact = 1; break; + case 'p': opt_proc = 1; break; + default: +error: + usage(); + exit(1); + } + } + + if(opt_up && opt_down) { + fputs("scsi-spin: specified both --up and --down. " + "Is this some kind of test?\n", stderr); + exit(1); + } + if(opt_lock && opt_unlock) { + fputs("scsi-spin: specified both --lock and --unlock. " + "Is this some kind of test?\n", stderr); + exit(1); + } + if (opt_oldioctl && (opt_wait || opt_loej)) { + fputs("scsi-spin: -e or -w not working in old ioctl mode.\n", stderr); + exit(1); + } + if(!(opt_up || opt_down || opt_lock || opt_unlock)) { + fputs("scsi-spin: must specify --up, --down, --lock or --unlock at least.\n", stderr); + exit(1); + } + + if(optind != (argc - 1)) { + usage(); + exit(1); + } + + device = argv[optind]; + + if(stat(device, &devstat) == -1) { + fprintf(stderr, "scsi-spin [stat]: %s: %s\n", device, strerror(errno)); + result = 1; + } + + if (is_mounted( device, opt_proc, major(devstat.st_rdev), minor(devstat.st_rdev) )) { + if (! opt_force) { + fprintf( stderr, "scsi-spin: device already in use (mounted partition)\n" ); + exit(1); + } + else { + fprintf( stderr, "scsi-spin [warning]: device is mounted but --force is passed\n" ); + } + } + + /* first try to open the device r/w */ + fd = open(device, O_RDWR); + if (fd < 0) { + /* if it's fail, then try ro */ + fd = open(device, O_RDONLY); + if (fd < 0) { + fprintf(stderr, "scsi-spin [open]: %s: %s\n", device, strerror(errno)); + exit(1); + } + } + + if ((S_ISBLK(devstat.st_mode) && + SCSI_BLK_MAJOR(major(devstat.st_rdev))) || + (S_ISCHR(devstat.st_mode) && + major(devstat.st_rdev) == SCSI_GENERIC_MAJOR)) + { + if (! opt_noact) { + if (opt_lock || opt_unlock) + scsi_lock(fd, opt_lock); + if (opt_up || opt_down) + scsi_spin(fd, opt_up, opt_loej, opt_wait); + } + } + else { + fprintf(stderr, "scsi-spin: %s is not a disk or generic SCSI device.\n", device); + result = 1; + } + + close(fd); + return result; +} --- scsitools-0.10.orig/scsi-spin.README +++ scsitools-0.10/scsi-spin.README @@ -0,0 +1,45 @@ +To: submit@bugs.debian.org +Subject: hwtools: scsi-spin -- an additional program for hwtools... +From: Rob Browning +Date: 04 Apr 1998 17:15:14 -0600 + +Package: hwtools +Version: 0.3-4 +Severity: wishlist + +Here's a small program I wrote called scsi-spin that lets you spin up +and down scsi drives. I thought you might consider it for inclusion +in the debian hwtools package, and perhaps from there into the +upstream source somewhere. Thanks... + +This command is particularly useful if you've got noisy (or hot) +drives in a machine that you rarely need to access. This is *not* the +same as the kernel patch that's floating around that will +automatically spin down the drive after some time. scsi-spin is +completely manual, and spinning down a drive that's in use, especially +the one containing the scsi-spin binary, it probably a *really* bad +idea. + +You can build it with GNU make, and this command: + + make CC=g++ CFLAGS="-g -Wall -O2 -I/usr/src/linux/include" scsi-spin + +It doesn't really need g++, but I just wanted the extra type +checking... + +-- +Rob Browning +PGP fingerprint = E8 0E 0D 04 F5 21 A0 94 53 2B 97 F5 D6 4E 39 30 + + +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +Date: Thu, 6 Sep 2001 23:46:56 +0200 + +Many enhancements for scsi-spin were written by Eric Delaunay +. +See man page for more informations. + +-- + Eric Delaunay | Le travail est trop srieux pour le confier + delaunay@debian.org | ceux qui veulent se tuer avec. Jissey. --- scsitools-0.10.orig/scsi-spin.8 +++ scsitools-0.10/scsi-spin.8 @@ -0,0 +1,121 @@ +.TH scsi-spin 8 "03 September 2001" +.SH NAME +scsi-spin \- spin up and down a SCSI device +.SH SYNOPSIS +.BI "scsi-spin [-" "options..." "] [" device ] +.SH DESCRIPTION +.B scsi-spin +let the user to manually spin up and down a SCSI device. + +This command is particularly useful if you've got noisy (or hot) +drives in a machine that you rarely need to access. This is +.B not +the same as the kernel patch that's floating around that will +automatically spin down the drive after some time. +.B scsi-spin +is completely manual, and spinning down a drive that's in use, especially +the one containing the scsi-spin binary, is probably a +.B really +bad idea. + +To avoid running in trouble with such cases, +.B scsi-spin +verifies that the device to work on is not currently in use by scanning the +mounted file system description file for a partition living on it and issue an +error if this the case. + +.SH OPTIONS +.TP +.B -u, --up +spin up device. +.TP +.B -d, --down +spin down device. +.TP +.B -e, --loej +load or eject medium from drive (use along with +.B -u +or +.B -d +) +.TP +.B -w, --wait=[n] +wait up to +.B n +seconds for the spin up/down command to complete. Default is to return +immediately after the command was sent to the device. +Either repeat +.B -w +n times or set +.B n +to define the time to wait before to report a timeout. +.TP +.B -l, --lock +prevent removal of medium from device. +.TP +.B -L, --unlock +allow removal of medium from device. +.TP +.B -I, --oldioctl +use legacy ioctl interface instead of SG_IO to dialog with device +(could not be supported on all platforms). +.B -e +and +.B -w +are not allowed with this option. +.TP +.B -v, --verbose=[n] +verbose mode. Either repeat +.B -v +or set +.B n +accordingly to increase verbosity. 1 is verbose, 2 is debug (dump SCSI +commands and Sense buffer). +.TP +.B -f, --force +force spinning up/down the device even if it is in use. +.TP +.B -n, --noact +do nothing but check if the device is in use. +.TP +.TP +.B -p, --proc +use /proc/mounts instead of /etc/mtab to determine if the device is in use or +not. +.TP +.B device +the device is any name in the filesystem which points to a SCSI block device +(sd, scd) or generic SCSI device (sg). See section below. + +.SH SCSI devices naming convention +.SS Old kernel naming convention +It is typically +.I /dev/sd[a-z] +, +.I /dev/scd[0-9]* +or +.I /dev/sg[0-9]*. + +.SS scsidev naming convention +It is typically +.I /dev/scsi/s[rdg]h[0-9]*-e????c?i?l? +or +.I /dev/scsi/. + +.SS devfs naming convention +It is typically +/dev/scsi/host[0-9]/bus[0-9]/target[0-9]/lun[0-9]/disc (same for cd and generic +devices) or short name /dev/sd/c[0-9]b[0-9]t[0-9]u[0-9] when +.B devfsd +"new compatibility entries" naming scheme is enabled. + +.SH SEE ALSO +.BR scsiinfo (8), +.BR sg_start (8), +.BR sd (4), +.BR proc (5), + +.SH AUTHORS +Eric Delaunay , 2001 +.br +Rob Browning , 1998 --- scsitools-0.10.orig/debian/copyright +++ scsitools-0.10/debian/copyright @@ -0,0 +1,28 @@ +This is the Debian Linux prepackaged version of several SCSI tools. +It was previously maintained by Christoph Lameter (as part of hwtools). +It's currently maintained by Eric Delaunay . + +Original sources and copyrights: + +scsiinfo: + Copyright (C) 1993 Eric Youngdale + Copyright (C) 1994, 1997 Michael Weller (eowmob@exp-math.uni-essen.de) + ftp://tsx-11.mit.edu/pub/linux/ALPHA/scsi/ +sraw: + Copyright (C) 1993 Eric Youngdale + ftp://tsx-11.mit.edu/pub/linux/ALPHA/scsi/ +scsidev: + Copyright (C) 1994--1997 Eric Youngdale + Copyright (C) 2000 Kurt Garloff + http://www.garloff.de/kurt/linux/scsidev/ +scsifmt: + Copyright (C) 1996 Alex Butcher (Alex.Butcher@bris.ac.uk) + based on the work of Grant R. Guenther (grant@torque.net) and Itai + Nahshon. FORMAT_UNIT mechanism taken from FreeBSD's scsifmt.sh. + ftp://metalab.unc.edu/pub/Linux/system/hardware/ +scsi-spin: Debian native utility, + Copyright (C) 1998 Rob Browning + ftp://ftp.debian.org/debian/pool/main/s/scsitools/ + +All programs are licensed under the GNU GPL licence, full text of which +can on Debian systems be found in /usr/share/common-licenses/GPL file. --- scsitools-0.10.orig/debian/rules +++ scsitools-0.10/debian/rules @@ -0,0 +1,86 @@ +#!/usr/bin/make -f +# Derived from debhelper/dh_make example, and Cristoph Lameter's file. -joy + +include /usr/share/quilt/quilt.make + +#export DH_VERBOSE=1 +CFLAGS = -g -O2 -Wall -fsigned-char + +architecture := $(shell dpkg-architecture -qDEB_HOST_ARCH) +p = scsitools + +build: build-stamp +build-stamp: patch + dh_testdir + cd scsiinfo && $(MAKE) KERNEL_INCLUDES="-fsigned-char" + cd scsidev && CFLAGS="$(CFLAGS)" ./configure --prefix=/usr \ + --mandir='${prefix}'/share/man && $(MAKE) + cd sraw && gcc $(CFLAGS) -s -o sraw srawread.c + #cd scsistop && gcc -I/usr/src/linux/include $(CFLAGS) scsistop-0.3.3.c -o scsistop + gcc $(CFLAGS) -o scsi-spin scsi-spin.c + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + for i in scsiinfo scsidev ; do $(MAKE) -C $$i clean || true ; done + dh_clean build-stamp scsi-spin scsidev/Makefile sraw/sraw \ + # scsistop/scsistop + +install: build-stamp + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs sbin lib usr/sbin usr/lib/scsitools usr/lib/scsi usr/share/doc/scsitools etc/init.d usr/share/lintian/overrides + install -m 755 -p debian/scsitools-pre.sh debian/$(p)/etc/init.d/ + install -m 755 -p debian/scsitools.sh debian/$(p)/etc/init.d/ + cd scsiinfo && $(MAKE) install DESTDIR=../debian/$(p) + install -m 755 scsidev/scsidev debian/$(p)/sbin + #install -m 755 scsidev/scsidevfs.so debian/$(p)/lib + #install -m 644 scsidev/devfsd.conf debian/$(p)/etc/devfs/conf.d/scsitools + install -m 755 sraw/sraw debian/$(p)/usr/sbin + install -m 755 scsi-spin debian/$(p)/sbin + install -m 755 rescan-scsi-bus.sh debian/$(p)/sbin + install -m 644 debian/lintian-overrides debian/$(p)/usr/share/lintian/overrides/scsitools + # Documentation + cp -a scsiinfo/0-TODO debian/$(p)/usr/share/doc/scsitools/TODO.scsiinfo + cp -a scsiinfo/0-CHANGES debian/$(p)/usr/share/doc/scsitools/CHANGES.scsiinfo + cp -a scsiinfo/0-README.first debian/$(p)/usr/share/doc/scsitools/README.scsiinfo + cp -a scsidev/README debian/$(p)/usr/share/doc/scsitools/README.scsidev + awk '/#include/ {exit};{print}' scsidev/scsidev.c > debian/$(p)/usr/share/doc/scsitools/CHANGES.scsidev + ln -s CHANGES.scsidev debian/$(p)/usr/share/doc/scsitools/changelog + cp -a sraw/README debian/$(p)/usr/share/doc/scsitools/README.sraw + cp -a sraw/kpatch debian/$(p)/usr/share/doc/scsitools/kpatch.sraw + cp -a scsi-spin.README debian/$(p)/usr/share/doc/scsitools/README.scsi-spin + cp -a debian/kernel-source-2.2.14.espfix debian/$(p)/usr/share/doc/scsitools/ + +binary-indep: +# There are no architecture-independent files to be uploaded +# generated by this package. If there were any they would be +# made here. + +binary-arch: build install + dh_testdir + dh_testroot + dh_installdebconf + dh_installdocs scsidev/scsi.alias + dh_installman scsiinfo/man8/scsiinfo.8 scsiinfo/man8/scsiformat.8 \ + scsiinfo/man8/tk_scsiformat.8 scsiinfo/man8/scsi-config.8 \ + scsidev/scsidev.8 \ + sraw/sraw.8 scsi-spin.8 + # install rescan-scsi-bus.sh manpage manually due to .sh suffix not + # processed the right way by dh_installman + install -m 644 debian/rescan-scsi-bus.sh.8 debian/$(p)/usr/share/man/man8/ + # + dh_installchangelogs #debian/upstream.changelog + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- scsitools-0.10.orig/debian/upstream.changelog +++ scsitools-0.10/debian/upstream.changelog @@ -0,0 +1,4 @@ + +Please refer to CHANGES.scsiinfo to get history of scsiinfo subpackage +and CHANGES.scsidev to get history of scsidev subpackage. + --- scsitools-0.10.orig/debian/postinst +++ scsitools-0.10/debian/postinst @@ -0,0 +1,16 @@ +#!/bin/sh -e + +#DEBHELPER# + +if [ "$1" = "configure" ]; then + test -d /dev/scsi || mkdir --mode=755 /dev/scsi + # first part before activating swap & remounting / rw + update-rc.d scsitools-pre.sh start 09 S . >/dev/null + # second part after modutils was run but before mounting other devices + update-rc.d scsitools.sh start 22 S . >/dev/null +fi + +# Source debconf library. +. /usr/share/debconf/confmodule + +[ "$2" ] || db_get scsitools/info || true --- scsitools-0.10.orig/debian/config +++ scsitools-0.10/debian/config @@ -0,0 +1,7 @@ +#!/bin/sh -e + +# Source debconf library. +. /usr/share/debconf/confmodule + +[ "$2" ] || db_input low scsitools/info || true +db_go --- scsitools-0.10.orig/debian/lintian-overrides +++ scsitools-0.10/debian/lintian-overrides @@ -0,0 +1,2 @@ +scsitools: shell-script-fails-syntax-check ./usr/sbin/scsi-config +scsitools: shell-script-fails-syntax-check ./usr/sbin/tk_scsiformat --- scsitools-0.10.orig/debian/postrm +++ scsitools-0.10/debian/postrm @@ -0,0 +1,9 @@ +#!/bin/sh -e + +if [ "$1" = "purge" ] ; then + update-rc.d scsitools-pre.sh remove >/dev/null + update-rc.d scsitools.sh remove >/dev/null +fi + +#DEBHELPER# + --- scsitools-0.10.orig/debian/README.Debian +++ scsitools-0.10/debian/README.Debian @@ -0,0 +1,69 @@ +SCSI Tools for Debian notes +--------------------------- + +scsiinfo: +--------- +Comes both with text interface and advanced X interface. Textmode usage +with "scsiinfo". X-Startup with "scsi-config", but you must have wish +installed to make it work. + + -- Christoph Lameter + +scsitools is a fork of hwtools previously maintained by Christoph Lameter +(in 1996-1997) & Josip Rodin and Robert Woodcock acting on behalf of the +Debian QA Team (in 1999). It was needed to open the SCSI tools provided by +hwtools to other Debian architectures than i386 (in effect, hwtools is a +collection of tools mainly designed for i386). + +scsidev & /dev/scsi: +-------------------- +/dev/scsi directory is now supported on 2.2 kernels through a set of init +scripts. Even the root partition could use /dev/scsi notation but the kernel +should support ramdisk compiled in in this case. +Populating /dev/scsi is done in 2 steps: + 1. in S09scsitools-pre.sh, before remounting / rw, a ramdisk is set up, + mounted on /dev/scsi and filled in according to /etc/scsi.alias. + This way, further references to /dev/scsi could be made, even for root + and swap partitions. + 2. in S20scsitools.sh, the ramdisk is freed and the real /dev/scsi refilled + accordingly. + +If you switch on a SCSI device after the boot up sequence, you can run + /etc/init.d/scsitools.sh restart +to rescan the SCSI chain. It uses the rescan-scsi-bus.sh script which is +based on add-single-device feature of the Linux SCSI driver. + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +CAUTION: This is not for hotplugging your peripherals. As SCSI was not designed +for this you could damage your hardware! +However perhaps it is legal to switch on an already connected device. It is +perhaps not guaranteed this device doesn't corrupt an ongoing data transfer. +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + +Furthermore, this feature does not work very well with all SCSI host adapters. +Some Linux SCSI drivers do not acknowledge the removal of a peripheral when +using the remove-single-device feature. In such kind of driver, the low level +directly maintains a cache of available peripherals but there is no +communication with the mid level when removing a peripheral, so the low level +still think the device is alive and, at the time rescan-scsi-bus.sh check for +its removal, the kernel is displaying indefinitely a message like this one: + + esp0: Warning, live target 4 not responding to selection. + +This bug was discovered during the test of scsitools in the ESP100 driver +(sparc) on 2.2 kernels. I wrote a fix for it and reported it upstream (to the +linux-sparc mailing list). It is provided here in kernel-source-2.2.14.espfix +file. The way it works is generic by adding a revoke function call to the mid +level driver to tell the low level that the peripheral was removed, but this +revoke function have to be written for all problematic low level drivers. +Note that this bug could also exist for NCR5380 and NCR53C9x drivers at least, +since they are based on the same design than the Sparc ESP one. + + +TODO: +----- + + scsidev: compatibility with devfs (2.4 linux kernel)? + + + register scsi-config & tk_scsiformat with menu? + + -- Eric Delaunay --- scsitools-0.10.orig/debian/scsitools-pre.sh +++ scsitools-0.10/debian/scsitools-pre.sh @@ -0,0 +1,77 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: scsitools-pre +# Required-Start: mountdevsubfs +# Required-Stop: +# X-Start-Before: checkroot +# Default-Start: S +# Default-Stop: +# Short-Description: Create aliases for SCSI devices under /dev/scsi +### END INIT INFO +# +# This script is run early at boot time (before S10checkroot.sh), so / is not +# yet writable. Therefore it is needed to set up a ramdisk for /dev/scsi. +# The ramdisk will be removed later, after / has been remounted rw and swap +# activated (see scsitools.sh). +# +# Written by Eric Delaunay based on sources found in +# scsidev 2.10 from Kurt Garloff . +# +# Licensed under GPL. + +. /etc/default/rcS + +scsidevrw=0 # is /dev/scsi writable at boot time? +needscsidev=0 # is scsidev needed at all? + + +# if no mount points on /dev/scsi in /etc/fstab, scsidev might be not needed +# NB: does not work with devfs +if [ ! -e /dev/.devfsd ]; then + if grep -q '^/dev/scsi' /etc/fstab; then + needscsidev=1 + fi +fi + +# check for writable /dev/scsi +if [ $needscsidev -eq 1 ]; then + : 2> /dev/null > /dev/scsi/__try || true + if [ -f /dev/scsi/__try ]; then + scsidevrw=1 + rm -f /dev/scsi/__try + fi +fi + +case "$1" in +start) + if [ -x /sbin/scsidev -a "$needscsidev" = 1 ]; then + if [ "$scsidevrw" = 0 ]; then + echo "Setting up SCSI devices (first part)..." + # /dev is not writable, setup a small ramdisk (128kB) + # (ignore all errors in case there is no ramdisk support compiled + # in the kernel). + dd if=/dev/zero of=/dev/ram3 bs=1024 count=128 > /dev/null 2>&1 + mke2fs -q -F -i1024 -g4096 /dev/ram3 128 > /dev/null 2>&1 + mount -n -t ext2 /dev/ram3 /dev/scsi > /dev/null 2>&1 + if [ ! -d /dev/scsi/lost+found ]; then + echo "Error creating ramdisk on /dev/scsi. Is ramdisk supported by the kernel?" + fi + else + echo "Setting up SCSI devices..." + fi + /sbin/scsidev -r -q + fi + ;; +reload | restart | force-reload | stop) + echo "This script is not designed to work with <$0> argument." + echo "Use /etc/init.d/scsitools.sh instead." + exit 1 + ;; +*) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" + exit 1 + ;; +esac + +unset needscsidev scsidevrw + --- scsitools-0.10.orig/debian/rescan-scsi-bus.sh.8 +++ scsitools-0.10/debian/rescan-scsi-bus.sh.8 @@ -0,0 +1,85 @@ +.\" -*- nroff -*- +.TH RESCAN\-SCSI\-BUS.SH 8 "March 1998" +.SH NAME +rescan-scsi-bus.sh \- rescan the SCSI bus. +.SH SYNOPSIS +.B rescan-scsi-bus.sh +[ +.B \-l +] +[ +.B \-w +] +[ +.B \-c +] +[ +.B \-r +] +[ +.B host... +] +.SH DESCRIPTION +.B rescan-scsi-bus.sh +is a program that is used to rescan the SCSI bus using the SCSI +add-single-device feature of the Linux SCSI layer. +.SH OPTIONS +.TP +\fB\-l\fR +Activates scanning for LUNs 0 .. 7 (default: 0). +.TP +\fB\-L\fR \fINUM\fR +Activates scanning for LUNs 0 .. LUN (default: 0). +.TP +\fB\-\-luns\fR=\fILIST\fR +Scan only LUNs in \fILIST\fR. +.TP +\fB\-w\fR +Enables scanning for device IDs 0 .. 15 (default: 0 .. 7). +.TP +\fB\-\-ids\fR=\fILIST\fR +Scan only device IDs in \fILIST\fR. +.TP +\fB\-i\fR, \fB--issue-lip\fR +Issue a FibreChannel LIP reset (default: disabled). +.TP +\fB\-r\fR, \fB--remove\fR +Enables removing of devices (default: disabled). +.TP +\fB--forceremove\fR +Remove and readd every device (dangerous). +.TP +\fB\-c\fR +Enables scanning of channels 0 1 (default: 0). +.TP +\fB\-\-channels\fR=\fILIST\fR +Scan only channels in \fILIST\fR. +.TP +\fBhost\fR, \fB--hosts\fR=\fILIST\fR +If host adapters are given, only these are scanned (default: all). +.TP +\fB--nooptscan\fR +Don't stop looking for LUNs if 0 is not found. +.TP +\fB--color\fR +Use coloured prefixes OLD/NEW/DEL. +.P +\fILIST\fR is a comma separated list of single values and ranges (no spaces +allowed), e.g. 0,2-3,8,10-15. +.SH AUTHOR +.B rescan-scsi-bus.sh +was written by Kurt Garloff . +.SH COPYRIGHT +This program is free software. You can use it under the terms of the +.B GNU GPL +(General Public License) Version 2 (or any later version, at your option). +Note, that the GNU GPL implies, that there is +.B NO WARRANTY +at all. +Full text of the GPL can be found in /usr/share/common-licenses/GPL file. +.SH AVAILABILITY +.B rescan-scsi-bus.sh +is available from +.nf +.B http://www.garloff.de/kurt/linux/scsidev/ +.fi --- scsitools-0.10.orig/debian/scsitools.sh +++ scsitools-0.10/debian/scsitools.sh @@ -0,0 +1,96 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: scsitools +# Required-Start: checkroot +# Required-Stop: +# X-Start-Before: checkfs +# Default-Start: S +# Default-Stop: +# Short-Description: Create aliases for SCSI devices under /dev/scsi +### END INIT INFO +# +# This is the second part of populating /dev/scsi. Now / is writable, so +# remove the ramdisk and recreate the tree. +# When used with restart/force-reload argument, also rescan the SCSI bus to be +# sure the contents of /dev/scsi is in sync with accessible hardware. +# +# Written by Eric Delaunay based on sources found in +# scsidev 2.10 from Kurt Garloff . +# +# Licensed under GPL. + + +. /etc/default/rcS + +scsidevrw=0 # is /dev/scsi writable at boot time? +needscsidev=0 # is scsidev needed at all? +swapdev=0 # is there swap device on /dev/scsi/... ? + + +# set needscsidev to 1 if /dev/scsi is referenced in /etc/fstab and set +# scsidevrw to 1 if /dev/scsi is a ramdisk (mounted from scsitools-pre.sh) +if [ ! -e /dev/.devfsd ]; then + if grep -q '^/dev/scsi' /etc/fstab; then + needscsidev=1 + if [ ! -d /dev/scsi/lost+found ]; then + scsidevrw=1 + fi + fi +fi + +case "$1" in +start) + # if running from rcS, needscsidev & scsidevrw are already set by + # scsitools-pre.sh to either 0 or 1. + if [ -x /sbin/scsidev -a "$needscsidev" = 1 -a "$scsidevrw" = 0 ]; then + # no need to rerun scsidev if previously done on a writable fs by + # scsitools-pre.sh, otherwise... + echo "Setting up SCSI devices (second part)..." + # disable swap in case it is using a device under /dev/scsi + # (/dev/scsi/swapdev used to be living on a ramdisk that have to be + # destroyed) + if grep -q '^/dev/scsi/' /proc/swaps; then + swapoff -a + swapdev=1 + fi + # if using a ramdisk, free it first + # (test is always true except when no support for ramdisk in kernel) + if grep -q "/dev/ram3 .*/dev/scsi" /proc/mounts; then + umount -n /dev/scsi + blockdev --flushbufs /dev/ram3 + fi + /sbin/scsidev -r -q + # execute swapon again, in case we want to swap to another device + # residing out of the boot disk. + if [ $swapdev = 1 ]; then + swapon -a + fi + fi + ;; +restart | force-reload) + if [ -x /sbin/scsidev -a "$needscsidev" = 1 ]; then + echo "Setting up SCSI devices..." + # rescan the SCSI bus first + /sbin/rescan-scsi-bus.sh -r -w + # then fills /dev/scsi again according to detected devices + /sbin/scsidev -r -q + fi + ;; +reload) + if [ -x /sbin/scsidev -a "$needscsidev" = 1 ]; then + echo "Setting up SCSI devices..." + # only sets up /dev/scsi contents again + /sbin/scsidev -r -q + fi + ;; +stop) + # nothing to stop here. + ;; +*) + echo "Usage: $0 {start|stop|restart|reload|force-reload}" + exit 1 + ;; +esac + +unset needscsidev scsidevrw + --- scsitools-0.10.orig/debian/templates +++ scsitools-0.10/debian/templates @@ -0,0 +1,6 @@ +Template: scsitools/info +Type: note +_Description: scsitools package: + You will most probably want to read /usr/share/doc/scsitools/README.Debian + and the rest of the files in that directory, before using any of the + programs included in this package. --- scsitools-0.10.orig/debian/kernel-source-2.2.14.espfix +++ scsitools-0.10/debian/kernel-source-2.2.14.espfix @@ -0,0 +1,57 @@ +diff -ur kernel-source-2.2.14.orig/drivers/scsi/esp.c kernel-source-2.2.14/drivers/scsi/esp.c +--- kernel-source-2.2.14.orig/drivers/scsi/esp.c Tue Jan 4 19:12:20 2000 ++++ kernel-source-2.2.14/drivers/scsi/esp.c Sat Mar 25 13:46:04 2000 +@@ -4313,3 +4313,11 @@ + spin_unlock_irqrestore(&io_request_lock, flags); + } + #endif ++ ++int esp_revoke(Scsi_Device* SDptr) ++{ ++ struct Sparc_ESP *esp = (struct Sparc_ESP *) SDptr->host->hostdata; ++ esp->targets_present &= ~(1 << SDptr->id); ++ return 0; ++} ++ +diff -ur kernel-source-2.2.14.orig/drivers/scsi/esp.h kernel-source-2.2.14/drivers/scsi/esp.h +--- kernel-source-2.2.14.orig/drivers/scsi/esp.h Sun Mar 28 20:04:13 1999 ++++ kernel-source-2.2.14/drivers/scsi/esp.h Sat Mar 25 01:27:17 2000 +@@ -413,6 +413,7 @@ + extern int esp_reset(Scsi_Cmnd *, unsigned int); + extern int esp_proc_info(char *buffer, char **start, off_t offset, int length, + int hostno, int inout); ++extern int esp_revoke(Scsi_Device* SDptr); + + extern struct proc_dir_entry proc_scsi_esp; + +@@ -421,6 +422,7 @@ + proc_info: &esp_proc_info, \ + name: "Sun ESP 100/100a/200", \ + detect: esp_detect, \ ++ revoke: esp_revoke, \ + info: esp_info, \ + command: esp_command, \ + queuecommand: esp_queue, \ +diff -ur kernel-source-2.2.14.orig/drivers/scsi/hosts.h kernel-source-2.2.14/drivers/scsi/hosts.h +--- kernel-source-2.2.14.orig/drivers/scsi/hosts.h Sun Mar 28 20:04:03 1999 ++++ kernel-source-2.2.14/drivers/scsi/hosts.h Sat Mar 25 01:32:37 2000 +@@ -95,6 +95,7 @@ + * especially that scsi_malloc/scsi_free must not be called. + */ + int (* detect)(struct SHT *); ++ int (*revoke)(Scsi_Device *); + + /* Used with loadable modules to unload the host structures. Note: + * there is a default action built into the modules code which may +diff -ur kernel-source-2.2.14.orig/drivers/scsi/scsi.c kernel-source-2.2.14/drivers/scsi/scsi.c +--- kernel-source-2.2.14.orig/drivers/scsi/scsi.c Tue Jan 4 19:12:21 2000 ++++ kernel-source-2.2.14/drivers/scsi/scsi.c Sat Mar 25 01:25:47 2000 +@@ -2492,6 +2492,8 @@ + * Nobody is using this device any more. + * Free all of the command structures. + */ ++ if (HBA_ptr->hostt->revoke) ++ HBA_ptr->hostt->revoke(scd); + for(SCpnt=scd->device_queue; SCpnt; SCpnt = scd->device_queue) + { + scd->device_queue = SCpnt->next; --- scsitools-0.10.orig/debian/control +++ scsitools-0.10/debian/control @@ -0,0 +1,25 @@ +Source: scsitools +Section: utils +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Eric Delaunay +Standards-Version: 3.6.1 +Build-Depends: tk8.4, debhelper (>= 5), quilt + +Package: scsitools +Architecture: any +Depends: ${shlibs:Depends}, util-linux (>= 2.11b-3), sg3-utils (>= 1.24), ${misc:Depends} +Conflicts: hwtools (<< 0.6) +Recommends: tk8.4 | wish +Description: Collection of tools for SCSI hardware management + This package is a collection of tools for manipulating SCSI hardware: + . + scsiinfo: displays SCSI drive low-level information and modifies SCSI + drive settings, + scsidev: makes permanent SCSI LUN -> devicename connections, + scsifmt: low-level SCSI formatter, + sraw: benchmarks raw SCSI I/O rates bypassing the buffer cache, + scsi-spin: program to manually spin up and down a SCSI device. + . + Beware that, to be used properly, these tools require some knowledge of + what they're doing as they can cause damage to your system. --- scsitools-0.10.orig/debian/changelog +++ scsitools-0.10/debian/changelog @@ -0,0 +1,289 @@ +scsitools (0.10-1.2ubuntu1) jaunty; urgency=low + + * Add quilt support. + * Add debian/patches/01_ubuntu-toolchain.diff, fix FTBFS caused by + -D_FORTIFY_SOURCE=2 compiler flag enabled in Ubuntu. + + -- Devid Antonio Filoni Mon, 23 Feb 2009 11:27:17 +0100 + +scsitools (0.10-1.2) unstable; urgency=low + + * Non-maintainer upload to fix pending l10n issues. + * Debconf translations: + - Galician. Closes: #482134 + - Basque. Closes: #495039 + + -- Christian Perrier Tue, 19 Aug 2008 09:58:32 +0200 + +scsitools (0.10-1.1) unstable; urgency=low + + * Non-maintainer upload to solve release goal issues. + * Add LSB dependency header to init.d scripts (Closes: #458649) + + -- Petter Reinholdtsen Sat, 15 Mar 2008 10:53:29 +0100 + +scsitools (0.10-1) unstable; urgency=low + + * Updated scsidev to 2.37 which supports sysfs filenames from linux kernel + 2.6.17+. + * Updated rescan-scsi-bus.sh to 1.25 which better supports 2.6 kernels, + and allows REPORT_LUNS scan and optional LIP reset. + * Fixed syntax error in rescan-scsi-bus.sh due to change in command line + syntax of sg_inq (from sg3-utils). Closes: #430200. + * Added missing dependency against sg3-utils (required by + rescan-scsi-bus.sh). + + -- Eric Delaunay Tue, 24 Jul 2007 17:30:57 +0200 + +scsitools (0.9-1.1) unstable; urgency=low + + * Non-maintainer upload, with maintainer's agreement, to fix pending l10n issues. + * Debconf translations: + - Portuguese. Closes: #381711 + + -- Christian Perrier Tue, 13 Feb 2007 07:22:11 +0100 + +scsitools (0.9-1) unstable; urgency=low + + * scsiformat, scsiinfo, sraw, scsi-spin: updated to use SG_IO to get rid of + kernel warnings on latest 2.6.9+ kernels. + Closes: #293964, #345779. + * Put scsiinfo in /sbin instead of /usr/sbin as it can be useful at boot + time. Improved it to detect more than 8 devices. Closes: #288052, #304777. + * scsiformat: updated sanity checks before starting formating which does not + work well with 2.6 kernels. Closes: #289154. + * sraw: Added -v option. + * scsi-spin: Added -vewIlL (verbose, load/eject, wait/immed, lock/unlock) + options. + * Removed references to scsistop in documentation as it is not provided for + years and scsi-spin is doing better job. Closes: #288836. + * Updated rescan-scsi-bus.sh to 1.18 (oct-2005). See manpage for new + features. Closes: #290882, #316773. + * Updated scsidev to 2.36. + * Get rid of many gcc warnings about signedness of chars. + * Fixed sentence in README.Debian. Closes: #316777. + * Added translations for Vietnamese (courtesy of Clytie Siddall + ). Closes: #317927. + * Updated translations for German (courtesy of Daniel Knabl + ), Swedish (courtesy of Daniel Nylander + ). Closes: #333440, #338857. + * Fixed typos in scsidev manpage. Closes: #357442. + * Fixed typos in scsiformat manpage. Closes: #357443. + * Fixed types in scsiinfo manpage. Closes: #357444. + * Fixed spelling mistake in package's summary. Closes: #306651. + + -- Eric Delaunay Wed, 22 Mar 2006 13:28:27 +0100 + +scsitools (0.8-2) unstable; urgency=high + + * Don't unmount /proc if it is already mounted at the time scsitools-pre.sh + is run, otherwise it lets a LVM system unbootable. Thanks to Jörg Sommer + and Andrea Borgia who pointed + out this problem. Closes: #285831. + * Allow to use cdebconf as replacement to debconf. Closes: #332090. + + -- Eric Delaunay Mon, 17 Oct 2005 21:19:20 +0000 + +scsitools (0.8-1) unstable; urgency=low + + * Updated to scsidev 2.35. + * Removed unneeded 'cat' statements from rescan-scsi-bus.sh script. + Closes: #256390. + * Added Czech template translations. Closes: #275505. + * Fixed lintian reports (converted Debian changelog to UTF8, added real + package dependency to virtual package "wish", added changelog file for + scsidev). + + -- Eric Delaunay Sun, 21 Nov 2004 19:27:00 +0100 + +scsitools (0.7-2) unstable; urgency=low + + * Fixed scsiformat bug. Closes: #251426. + Thanks to Erik Mouw for providing a patch. + * Fixed not detected removable devices in scsiinfo. Closes: #255715. + * Added italian template translations. Closes: #251740. + * Renamed ca_ES.po to ca.po as there is no need in specifying a country part + for the Catalan language. Closes: #255875. + + -- Eric Delaunay Fri, 25 Jun 2004 00:59:11 +0200 + +scsitools (0.7-1) unstable; urgency=low + + * Updated to scsidev 2.33. Closes: #239662. + * Added catalan template translations. Closes: #236641. + + -- Eric Delaunay Sun, 4 Apr 2004 17:12:24 +0200 + +scsitools (0.6-1) unstable; urgency=low + + * Updated to scsidev 2.32. Closes: #233754. + + -- Eric Delaunay Sat, 21 Feb 2004 19:33:19 +0100 + +scsitools (0.5-4) unstable; urgency=low + + * Updated Build-depends on tk8.4, as tk8.2 is no longer available. + Closes: #228740. + + -- Eric Delaunay Tue, 20 Jan 2004 21:03:21 +0100 + +scsitools (0.5-3) unstable; urgency=low + + * Fixed compiler errors due to kernel includes (thanks to Daniel Schepler + for the patch). Closes: #224877. + + -- Eric Delaunay Thu, 15 Jan 2004 00:46:58 +0100 + +scsitools (0.5-2) unstable; urgency=low + + * Added Japanese template translation. Closes: #224186. + + -- Eric Delaunay Wed, 17 Dec 2003 00:48:38 +0100 + +scsitools (0.5-1) unstable; urgency=low + + * Updated to scsidev 2.31. Closes: #216416. + - provides compatibility with 2.6 kernel: Use sysfs to gather some + information. Unfortunately, only block devs provide what we need, + so far. + * Fixed man pages installation. Closes: #216415. + * Marked init.d scripts as conffiles. + * Added lintian overrides file to avoid Lintian reporting errors on TK + script files disguised into shell scripts. + + -- Eric Delaunay Wed, 19 Nov 2003 00:11:46 +0100 + +scsitools (0.4-2) unstable; urgency=low + + * Fixed postinst (devfsd is still not supported). Closes: #205612. + * Added dutch template. Closes: #205169. + + -- Eric Delaunay Sun, 17 Aug 2003 18:23:18 +0200 + +scsitools (0.4-1) unstable; urgency=low + + * Updated to scsidev 2.29. + * Fixed detection of devfs mounted filesystem at boot time. + * New maintainer address. + * Switched to po-debconf (thanks to Christian Perrier + for the patch). Closes: #202547. + * Added russian & spanish templates. Closes: #136444, #136606. + + -- Eric Delaunay Fri, 1 Aug 2003 00:49:28 +0200 + +scsitools (0.3-2) unstable; urgency=low + + * Better way to detect devfs mounted filesystem (now works for me on potato + running 2.4.18 kernel compiled with DEVFS enabled but not mounted). + + -- Eric Delaunay Sun, 21 Apr 2002 23:51:27 +0200 + +scsitools (0.3-1) unstable; urgency=low + + * Uncompressed the man pages of scsiinfo package in .orig.tar.gz so that + dpkg-source can handle the change in scsiformat.8. + * Fixed documentation bug in scsiformat man page (I finally discovered the + right groff sequence to write). Closes: #31376. + * Brazilian portuguese (pt_BR) debconf template translation. Closes: #108550. + * Added Build-depends on debhelper. Closes: #105030. + * many scsi-spin enhancements: + - now send SCSI_IOCTL_{START,STOP}_UNIT therefore it supports sd, scd & sg + device names. It is based on device major/minor number so it even works + with scsidev or devfs device naming convention. + - also supports short options (-u, -d, ...). + - does not spin up/down when the device is in use (has mounted partitions) + unless -f/--force is passed. + - can use /proc/mounts instead of /etc/mtab to do the check of mounted + partitions (-p/--proc option). + - scanning for device in use is done on comparison of devices major/minor + numbers and SCSI ID/LUN if the first method is not enoughly accurate. + - compiled with GNU C compiler instead of C++ because it is really C code. + - added man page. + Closes: #102412. + * Install sraw documentation. + * Fixed rescan-scsi-bus.sh man page location. + + -- Eric Delaunay Thu, 6 Sep 2001 23:08:30 +0200 + +scsitools (0.2-2) unstable; urgency=low + + * depends on util-linux >= 2.11b-3 to make use of blockdev instead of unknown + freeramdisk. Closes: #75217. + + -- Eric Delaunay Wed, 13 Jun 2001 23:27:19 +0200 + +scsitools (0.2-1) unstable; urgency=low + + * updated to scsidev 2.22. Closes: #79906. + * run the init script before raid script at boot time. Closes: #75219. + * scsitools.sh: don't run swapoff when there is no swap entry in /etc/fstab. + Closes: #75218. + * Recommends wish instead of suggesting it (I don't want to depend on it + because the package is still useful without scsi-config and tk-scsiformat). + scsi-config and tk-scsiformat now suggest the user to install a tk package + if no /usr/bin/wish found. + Closes: #74550. + * fixed compiler warnings in scsiformat.c, tworands.c and scsi-spin.C. + * added German translations. Thanks to Joerg Rieger + . Closes: #83928. + * added Swedish translations. Thanks to André Dahlqvist . + Closes: #83684. + * Build-depends on tk8.2 to compile cleanly. + + -- Eric Delaunay Mon, 12 Feb 2001 22:50:50 +0100 + +scsitools (0.1-3) unstable; urgency=low + + * fixed cosmetic bug in scsi-spin. + Closes: #67181. + + -- Eric Delaunay Mon, 17 Jul 2000 23:02:46 +0200 + +scsitools (0.1-2) unstable; urgency=low + + * scsi-spin moved to /sbin to allowing its use in /etc/init.d/halt. + Closes: #66328. + * Added boot time support for scsidev. + * Fixed a bug when parsing hexadecimal numbers (0xnnn) in scsidev. + * Fixed tcl/tk problems in tk_scsiformat (surely due to language + improvements). tk_scsiformat is hopefully running with tk8.2 but I can't + try to go further and format my scsi disk ;-( Feel free to report any new + bug. Closes: #23397. + * Document how to create the hostid= parameter in /etc/scsi.alias in scsidev + manpage. Closes: #48305. + * Added manpage for rescan-scsi-bus.sh. + * Closing most bug reports after the upgrade to scsidev 2.10. + - temp file is written to /dev/scsi instead of possibly unavailable /tmp. + Closes: #49509. + - display error msg if /etc/scsi.alias does not exists. + Closes: #30554, #46622, #47340, #48306. + + -- Eric Delaunay Sat, 8 Jul 2000 22:26:24 +0200 + +scsitools (0.1-1.1) unstable; urgency=low + + * Non-maintainer upload, to get it accepted it into the archive, + sorry Eric :) + * Fixed copyright file to include all authors and copyrights. + * Worked around important problems on PowerPC due to signed chars by + adding -fsigned-char to $CFLAGS. + * Lowered debconf question priority to medium, and made it display the + note only on new installs, not upgrades. + * Updated rules file to match hwtools, removed some cruft. Added rcw's + name to the short list of people who maintained hwtools on behalf of + the quality assurance group. + * Removed prerm, didn't contain anything useful. + * Added rescan-scsi-bus.sh.1 to undocumented list. + + -- Josip Rodin Thu, 13 Apr 2000 19:35:06 +0200 + +scsitools (0.1-1) unstable; urgency=low + + * first release (fork of hwtools 0.5-0.2 that provides scsidev, scsifmt, + scsiformat, scsiinfo, scsistop and sraw). + * non-i386 aware. + * updated to scsidev 2.10. Closes: #46622, #47340, #48306, #30554. + * added rescan-scsi-bus.sh. + * using debconf for displaying a note. + + -- Eric Delaunay Tue, 12 Apr 2000 21:07:00 +0200 --- scsitools-0.10.orig/debian/compat +++ scsitools-0.10/debian/compat @@ -0,0 +1 @@ +5 --- scsitools-0.10.orig/debian/po/gl.po +++ scsitools-0.10/debian/po/gl.po @@ -0,0 +1,33 @@ +# Galician translation of scsitools's debconf templates +# This file is distributed under the same license as the scsitools package. +# Jacobo Tarrio , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2008-05-20 23:13+0100\n" +"Last-Translator: Jacobo Tarrio \n" +"Language-Team: Galician \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Paquete scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"O máis probable é que deba consultar o ficheiro /usr/share/doc/scsitools/" +"README.Debian e o resto dos ficheiros dese directorio antes de empregar " +"calquera dos programas incluídos neste paquete." --- scsitools-0.10.orig/debian/po/vi.po +++ scsitools-0.10/debian/po/vi.po @@ -0,0 +1,35 @@ +# Vietnamese translation for scsitools. +# Copyright © 2005 Free Software Foundation, Inc. +# Clytie Siddall , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.8-1\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2005-07-12 22:44+0930\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0\n" +"X-Generator: BBEdit 8.2.2\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "gói tin scsitools" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Khuyến khích bạn đọc tập tin Đọc đi «/usr/share/doc/scsitools/README.Debian» " +"và các tập tin khác trong thư mục ấy, trước khi dùng chương trình nào có " +"trong gói tin này." --- scsitools-0.10.orig/debian/po/ja.po +++ scsitools-0.10/debian/po/ja.po @@ -0,0 +1,43 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2003-11-21 06:53+0900\n" +"Last-Translator: Hideki Yamane \n" +"Language-Team: Japanese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=EUC-JP\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "scsitools ѥå: " + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Υѥå˴ޤޤƤץѤˡ/usr/share/doc/" +"scsitools/README.Debian ȤΥǥ쥯ȥˤ¾ΥեɤΤɤ" +"礦" --- scsitools-0.10.orig/debian/po/POTFILES.in +++ scsitools-0.10/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] templates --- scsitools-0.10.orig/debian/po/de.po +++ scsitools-0.10/debian/po/de.po @@ -0,0 +1,41 @@ +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# Developers do not need to manually edit POT or PO files. +# , fuzzy +# +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2005-10-12 00:26+0200\n" +"Last-Translator: Daniel Knabl \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Paket scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Bevor Sie irgendeines der Programme in diesem Paket benutzen, werden Sie /" +"usr/share/doc/scsitools/README.Debian und die restlichen Dateien in diesem " +"Verzeichnis lesen wollen." --- scsitools-0.10.orig/debian/po/templates.pot +++ scsitools-0.10/debian/po/templates.pot @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" --- scsitools-0.10.orig/debian/po/es.po +++ scsitools-0.10/debian/po/es.po @@ -0,0 +1,43 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: valyag@teleline.es\n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "documentacin del paquete scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Antes de utilizar cualquiera de los programas incluidos en este paquete es " +"muy posible que quiera leer /usr/share/doc/scsitools/README.Debian y el " +"resto de ficheros de ese directorio." --- scsitools-0.10.orig/debian/po/nl.po +++ scsitools-0.10/debian/po/nl.po @@ -0,0 +1,41 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2003-08-12 17:18+0100\n" +"Last-Translator: Bart Cornelis \n" +"Language-Team: dutch \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "scsitools pakket:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Vooraleer de in dit pakket omsloten programmas te gebruiken kunt u best /usr/" +"share/doc/scsitools/README.Debian en de andere bestanden in die map nalezen." --- scsitools-0.10.orig/debian/po/ca.po +++ scsitools-0.10/debian/po/ca.po @@ -0,0 +1,33 @@ +# scsitools (debconf) translation to Catalan. +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +# Aleix Badia i Bosch 2004 +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools_0.4-2_templates\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2004-01-31 19:32GMT\n" +"Last-Translator: Aleix Badia i Bosch >\n" +"Language-Team: Debian L10n Catalan \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "paquet de l'scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Abans d'utilitzar cap dels programes inclosos en aquest paquet, segurament " +"us interessar fer una llegida al document /usr/share/doc/scsitools/README." +"Debian i a la resta de fitxers del directori." --- scsitools-0.10.orig/debian/po/it.po +++ scsitools-0.10/debian/po/it.po @@ -0,0 +1,29 @@ +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.7(templates)\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2004-05-26 21:41+0200\n" +"Last-Translator: Luca Monducci \n" +"Language-Team: Italian \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Pacchetto scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Molto probabilmente si ha bisogno di leggere /usr/share/doc/scsitools/README." +"Debian e gli altri file nella stessa directory prima di usare uno qualsiasi " +"dei programmi inclusi in questo pacchetto." --- scsitools-0.10.orig/debian/po/sv.po +++ scsitools-0.10/debian/po/sv.po @@ -0,0 +1,44 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.8-2\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2005-11-13 12:51+0100\n" +"Last-Translator: Daniel Nylander \n" +"Language-Team: Swedish \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: swe\n" +"X-Poedit-Country: swe\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "scsitools-paketet:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Du vill frmodligen lsa /usr/share/doc/scsitools/README.Debian och resten " +"av filerna i den katalogen innan du anvnder ngon av de inkluderade " +"programmen i detta paket." --- scsitools-0.10.orig/debian/po/pt_BR.po +++ scsitools-0.10/debian/po/pt_BR.po @@ -0,0 +1,43 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Pacote scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Voc provavelmente ir querer ler /usr/share/doc/scsitools/README.Debian e o " +"restante dos arquivos neste diretrio antes de usar quaisquer programas " +"inclusos neste pacote." --- scsitools-0.10.orig/debian/po/ru.po +++ scsitools-0.10/debian/po/ru.po @@ -0,0 +1,42 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.3-2\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Ilgiz Kalmetev \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=koi8-r\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr " scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +" /usr/" +"share/doc/scsitools/README.Debian ." --- scsitools-0.10.orig/debian/po/fr.po +++ scsitools-0.10/debian/po/fr.po @@ -0,0 +1,44 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +# Initial translator was Eric Delaunay +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.3-2\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2003-07-23 07:19+0100\n" +"Last-Translator: Christian Perrier \n" +"Language-Team: French \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Note relative au paquet scsitools" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Il est recommand de lire les documents tels que /usr/share/doc/scsitools/" +"README.Debian ainsi que les autres de ce rpertoire avant d'utiliser l'un " +"des programmes fournis." --- scsitools-0.10.orig/debian/po/eu.po +++ scsitools-0.10/debian/po/eu.po @@ -0,0 +1,35 @@ +# translation of scsitools-eu.po to Euskara +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Piarres Beobide , 2008. +msgid "" +msgstr "" +"Project-Id-Version: scsitools-eu\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2008-08-14 09:32+0200\n" +"Last-Translator: Piarres Beobide \n" +"Language-Team: Euskara \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "scsitools paketea:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Ziurrenik /usr/share/doc/scsitools/README.Debian eta direktorio horretako " +"beste fitxategiak irakurri beharko zenituzke pakete honetan banatzen diren " +"programetako bat erabili aurretik." --- scsitools-0.10.orig/debian/po/pt.po +++ scsitools-0.10/debian/po/pt.po @@ -0,0 +1,33 @@ +# Portuguese translation for scsitools debconf messages. +# This file is distributed under the same license as the scsitools package. +# Luísa Lourenço , 2006 +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools 0.9-1\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Luísa Lourenço \n" +"Language-Team: Native Portuguese \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "Pacote scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Irá muito provavelmente querer ler /usr/share/doc/scsitools/README.Debian e " +"o resto dos ficheiros nesse directório antes de usar qualquer um dos " +"programas incluídos neste pacote." --- scsitools-0.10.orig/debian/po/cs.po +++ scsitools-0.10/debian/po/cs.po @@ -0,0 +1,42 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: scsitools\n" +"Report-Msgid-Bugs-To: scsitools@packages.debian.org\n" +"POT-Creation-Date: 2008-08-12 17:26-0300\n" +"PO-Revision-Date: 2004-10-08 16:41+0200\n" +"Last-Translator: Jan Outrata \n" +"Language-Team: Czech \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-2\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "scsitools package:" +msgstr "balek scsitools:" + +#. Type: note +#. Description +#: ../templates:1001 +msgid "" +"You will most probably want to read /usr/share/doc/scsitools/README.Debian " +"and the rest of the files in that directory, before using any of the " +"programs included in this package." +msgstr "" +"Ped pouitm jakhokoliv programu z tohoto balku si budete chtt s " +"nejvt pravdpodobnost pest /usr/share/doc/scsitools/README.Debian a " +"ostatn souboryv tomto adresi." --- scsitools-0.10.orig/debian/patches/series +++ scsitools-0.10/debian/patches/series @@ -0,0 +1 @@ +01_ubuntu-toolchain.diff --- scsitools-0.10.orig/debian/patches/01_ubuntu-toolchain.diff +++ scsitools-0.10/debian/patches/01_ubuntu-toolchain.diff @@ -0,0 +1,13 @@ +Index: scsitools-0.10/scsidev/scsidev.c +=================================================================== +--- scsitools-0.10.orig/scsidev/scsidev.c 2009-02-23 11:31:38.000000000 +0100 ++++ scsitools-0.10/scsidev/scsidev.c 2009-02-23 11:33:43.000000000 +0100 +@@ -747,7 +747,7 @@ + return; + + if (status) { +- int fd = open (shadow, O_RDWR | O_CREAT | O_EXCL); ++ int fd = open (shadow, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + close (fd); + } + apply_perm (shadow, stbuf, 0); --- scsitools-0.10.orig/sraw/sraw.8 +++ scsitools-0.10/sraw/sraw.8 @@ -0,0 +1,82 @@ +.\" -*- nroff -*- +.TH SRAW 8 "Nov 1993" +.SH NAME +sraw \- benchmark raw scsi I/O performance under linux +.SH SYNOPSIS +.B sraw +[ +.B -fiv6 +] +.B scsi-device +[ +.B bstart +[ +.B bstep +] ] +.SH DESCRIPTION +This program basically reads the specified scsi device and measures the +throughput. Note that the filesystem *AND* the buffer cache are +bypassed by this code, this program was designed to benchmark the naked +scsi drivers by themselves without the need to account for the overhead +of any other portion of the kernel. It also could be used to benchmark +disk read throughput. +.P +This program does a series of reads of the disk, of consecutive +areas on the disk. The device is first queried to determine the +sector size for the device, and then the series of reads is begun. +About 5.0 Mb is read from the device, and then the performance numbers +are reported. Note that since the buffer cache is completely bypassed, +there is no need to be concerned about cache hits or anything. +.P +Output of +.B sraw +is a set of lines, 4 numbers per line: +.I blocksize, elapsed time, nblocks +and +.I throughput +(in bytes per second). +.P +.B scsi-device +is either a block device (e.g. /dev/sda, /dev/scd0) or a generic SCSI +device (e.g. /dev/sg0). +.SH OPTIONS +.TP +.I -f +set FUA (Force Unit Access) bit during read. Data is then read from +media instead of internal drive cache. +.TP +.I -i +use legacy ioctl instead of new SG I/O layer (will not work on 2.6 +kernel and block devices). +.TP +.I -v +more verbose output. +.TP +.I -6 +use 6-bytes instead of 10-bytes read command. In this case, only the +first GB of data could be read from media. +.TP +.I bstart +starting block to check different zones on ZBR discs +.TP +.I bstep +factor for sequential stepping, default 1. +Use 0 for reading always the same blocks (from cache) +.SH ERRORS +.B sraw +could issue input/output errors when reading too many blocks at the +same time from a block device like /dev/sda. To get rid of them, use +/dev/sgN instead. +.SH AUTHOR +.B sraw +was first written by Eric Youngdale. +Extensions (-v, -f, -6, SG IO, man page) were written by Eric Delaunay. +.SH SEE ALSO +.B sg_dd(8) +from sg3-utils package. +.SH AVAILABILITY +.B sraw +is available at +.nf +.B ftp://tsx-11.mit.edu/pub/linux/ALPHA/scsi/ +.fi --- scsitools-0.10.orig/sraw/srawread.c +++ scsitools-0.10/sraw/srawread.c @@ -79,19 +79,25 @@ * */ -#define USE_READ_10 -#undef SET_FUA /* "force unit access" for READ(10): don't read from cache but from media */ -#define LESS_VERBOSE_OUTPUT #define USE_GETTIMEOFDAY /* please, always! gettimeofday(2) is much more accurate */ +#define USE_SG_IO #include +#include #include +#include +#include #include #include +#include +#include +#ifdef USE_SG_IO +# include +#endif -FILE *infile, *ptable; -unsigned char buffer[2*64*1024]; +FILE *infile = NULL; +unsigned char buffer[2*64*1024+8]; int read_size=32768; @@ -121,54 +127,99 @@ int main( int argc, char *argv[] ) { int b,bstart=0,bstep=1; + int c=1,verbose=0; int status, i; unsigned char *cmd; - int capacity, sectorsize; + unsigned int capacity, sectorsize; int this_count, block; int rate; double starttime, endtime; - - if (argc==1) { - printf("usage: srawread scsi-device [ bstart [ bstop ] ]\n"); - exit(0); + int read_len = 10; /* length of read command */ + int fua = 0; /* "force unit access" for READ(10): don't read from cache but from media */ +#ifdef USE_SG_IO + sg_io_hdr_t sgbuf; + int legacy_ioctl=0; +#endif + + while (argc>c && argv[c][0] == '-') { + for(i=1; i < strlen(argv[c]); i++) + switch (argv[c][i]) { + case 'v': verbose = 1; break; +#ifdef USE_SG_IO + case 'i': legacy_ioctl = 1; break; +#endif + case 'f': fua = 1; break; + case '6': read_len = 6; break; + default: goto error; + } + c++; + } + if (argc>c) { + infile = fopen( argv[c], "r" ); + if (!infile) { + perror(argv[c]); + return 2; + } } + if (argc>c+1) bstart = atoi(argv[c+1]); + if (argc>c+2) bstep = atoi(argv[c+2]); - infile = fopen( argv[1], "r" ); - if(!infile) exit(0); + if (infile == NULL || argc==1 || argc>c+3) { +error: + printf("usage: sraw [-v]%s scsi-device [ bstart [ bstep ] ]\n", +#ifdef USE_SG_IO + "[-i]" +#else + "" +#endif + ); + return 1; + } - if (argc>2) bstart = atoi(argv[2]); - if (argc>3) bstep = atoi(argv[2]); + memset(buffer, 0, sizeof(buffer)); - for (i=0; i<10*1024; i++) - { - buffer[i] = 0; - } - *( (int *) buffer ) = 0; /* length of input data */ *( ((int *) buffer) + 1 ) = read_size; /* length of output buffer */ - cmd = (char *) ( ((int *) buffer) + 2 ); + cmd = (unsigned char *) ( ((int *) buffer) + 2 ); - cmd[0] = 0x25; /* INQUIRY */ - cmd[1] = 0x00; /* lun=0, evpd=0 */ - cmd[2] = 0x00; /* page code = 0 */ - cmd[3] = 0x00; /* (reserved) */ - cmd[4] = 0x00; /* allocation length */ - cmd[5] = 0x00; /* control */ - + cmd[0] = 0x25; /* READ CAPICTY (10 bytes)*/ + cmd[1] = 0x00; /* b7-5: lun=0, b4-1: reserved, b0: reladdr=0 */ + /* cmd[2..5] = 0x00; logical block address = 0 */ + /* cmd[6..8] = 0x00; (reserved), cmd[8].b0=PMI(0) */ + /* cmd[9] = 0x00; control */ + +#ifdef USE_SG_IO + if (! legacy_ioctl) { + memset(&sgbuf, 0, sizeof(sgbuf)); + sgbuf.interface_id = 'S'; /* SCSI Generic Interface */ + sgbuf.dxfer_direction = SG_DXFER_FROM_DEV; + sgbuf.cmd_len = 10; + sgbuf.cmdp = cmd; + sgbuf.dxfer_len = 8; /* send back 8 bytes of data (capacity, sectorsize) */ + sgbuf.dxferp = cmd; + sgbuf.timeout = 2000; + status = ioctl( fileno(infile), SG_IO, &sgbuf ); + } + else +#endif status = ioctl( fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */, buffer ); - + if (status < 0) { + perror("ioctl"); + return 3; + } capacity = (buffer[8] << 24) | (buffer[9] << 16) | (buffer[10] << 8) | buffer[11]; sectorsize = (buffer[12] << 24) | (buffer[13] << 16) | (buffer[14] << 8) | buffer[15]; - printf("Size %d sectorsize %d\n", capacity * (sectorsize >> 9), sectorsize); - + if (verbose) + printf("Size %llu bytes, sectorsize %u\n", ((uint64_t)capacity) * sectorsize, sectorsize); do{ +/* for (i=0; i<10*1024; i++) { buffer[i] = 0; } - +*/ block = 0; this_count = read_size / sectorsize; starttime = time_so_far(); @@ -176,45 +227,62 @@ *( (int *) buffer ) = 0; /* length of input data */ *( ((int *) buffer) + 1 ) = read_size; /* length of output buffer */ - cmd = (char *) ( ((int *) buffer) + 2 ); + cmd = (unsigned char *) ( ((int *) buffer) + 2 ); b = bstart + bstep * block; -#ifdef USE_READ_10 - cmd[0] = 0x28; /* read_10 */ - cmd[1] = 0x00; -#ifdef SET_FUA - cmd[1] |= 0x08; -#endif /* SET_FUA */ - cmd[2] = (b >> 24) & 0xff; - cmd[3] = (b >> 16) & 0xff; - cmd[4] = (b >> 8) & 0xff; - cmd[5] = b & 0xff; - cmd[6] = 0; - cmd[7] = (this_count >> 8) & 0xff; /* transfer length */ - cmd[8] = this_count & 0xff; - cmd[9] = 0x00; /* control */ -#else /* USE_READ_10 */ - cmd[0] = 0x08; /* read_6 */ - cmd[1] = (b >> 16) & 0x1f; - cmd[2] = (b >> 8) & 0xff; - cmd[3] = b & 0xff; - cmd[4] = this_count; - cmd[5] = 0x00; -#endif /* USE_READ_10 */ - + if (read_len == 10) { + cmd[0] = 0x28; /* read_10 */ + cmd[1] = 0x00; + if (fua) + cmd[1] |= 0x08; + cmd[2] = (b >> 24) & 0xff; + cmd[3] = (b >> 16) & 0xff; + cmd[4] = (b >> 8) & 0xff; + cmd[5] = b & 0xff; + cmd[6] = 0; + cmd[7] = (this_count >> 8) & 0xff; /* transfer length */ + cmd[8] = this_count & 0xff; + cmd[9] = 0x00; /* control */ + } + else { + cmd[0] = 0x08; /* read_6 */ + cmd[1] = (b >> 16) & 0x1f; + cmd[2] = (b >> 8) & 0xff; + cmd[3] = b & 0xff; + cmd[4] = this_count; + cmd[5] = 0x00; + } +#ifdef USE_SG_IO + if (! legacy_ioctl) { + memset(&sgbuf, 0, sizeof(sgbuf)); + sgbuf.interface_id = 'S'; /* SCSI Generic Interface */ + sgbuf.dxfer_direction = SG_DXFER_FROM_DEV; + sgbuf.cmd_len = read_len; + sgbuf.cmdp = cmd; + sgbuf.dxfer_len = read_size; + sgbuf.dxferp = cmd; + sgbuf.timeout = 2000; + status = ioctl( fileno(infile), SG_IO, &sgbuf ); + } + else +#endif status = ioctl( fileno(infile), 3 /* SCSI_IOCTL_BENCHMARK_COMMAND */, buffer ); - if(status) fprintf(stderr,"%x ", status); + if (status < 0) { + if (verbose) + printf("ioctl: %s\n", strerror(errno)); + else + printf("(%d) ", status); + } block += this_count; } while(block < (10000 / (sectorsize >> 9))); endtime = time_so_far() - starttime; rate = (block * sectorsize) / endtime; -#ifdef LESS_VERBOSE_OUTPUT - printf("%6d %10.4f %6d %8d \n", + if (!verbose) + printf("%6d %10.4f %6d %8d \n", read_size, endtime, block, rate); -#else /* LESS_VERBOSE_OUTPUT */ - printf("Blocksize %d, time elapsed %1.4f seconds, %d blocks. Throughput = %d bytes/sec\n", + else + printf("Blocksize %d, time elapsed %1.4f seconds, %d blocks. Throughput = %d bytes/sec\n", read_size, endtime, block, rate); -#endif /* LESS_VERBOSE_OUTPUT */ read_size += 4096; } while(read_size <= 2*64*1024); --- scsitools-0.10.orig/scsidev/scsidev.c +++ scsitools-0.10/scsidev/scsidev.c @@ -1792,7 +1792,7 @@ unsigned int find_ioport (const char* nm) { - unsigned char lnbuf[128]; + char lnbuf[128]; char nm2[64]; char *nmptr; char * buf; FILE * iop = fopen ("/proc/ioports", "r"); @@ -2945,7 +2945,7 @@ } -char* getstr (char* page, int start, int stop) +char* getstr (unsigned char* page, int start, int stop) { int ln; char* str; @@ -3060,7 +3060,7 @@ return no_wwid; } -#ifndef SG_IO +//#ifndef SG_IO void my_memmove(unsigned char* dst, unsigned char* src, unsigned int ln) { if (src > dst) { @@ -3072,7 +3072,7 @@ *(--dst) = *(--src); } } -#endif +//#endif int scsi_cmd(int file, int rlen, unsigned char* cmd, int cmdlen, @@ -3098,21 +3098,27 @@ memset(buf, 0, buflen); ret = ioctl(file, SG_IO, &sghdr); + if (ret >= 0) { + if (verbose >= 2) + printf("SG_IO %02x %02x %02x: ret=%i, status=%i (host %i, drv %i), read=%i/%i\n", + cmd[0], cmd[1], cmd[2], + ret, sghdr.status, sghdr.host_status, sghdr.driver_status, + rlen-sghdr.resid, rlen); + return ret + sghdr.status; + } if (verbose >= 2) - printf("SG_IO %02x %02x %02x: ret=%i, status=%i (host %i, drv %i), read=%i/%i\n", - cmd[0], cmd[1], cmd[2], - ret, sghdr.status, sghdr.host_status, sghdr.driver_status, - rlen-sghdr.resid, rlen); - return ret + sghdr.status; -#else + printf("SG_IO error: %i, fallback to old SCSI_IOCTL_SEND_COMMAND\n", errno); +#endif memset(buf, 0, buflen); *( (int *) buf) = 0; /* Length of input data */ - *( ((int *) buf+1) ) = rlen; /* Length of output data */ + *( ((int *) buf+1) ) = rlen-8; /* Length of output data */ memcpy(buf+8, cmd, cmdlen); ret = ioctl(file, SCSI_IOCTL_SEND_COMMAND, buf); + if (ret < 0 && verbose >= 2) + printf("SCSI_IOCTL_SEND_COMMAND %02x %02x %02x: ret=%i, errno=%i\n", + cmd[0], cmd[1], cmd[2], ret, errno); my_memmove(buf, buf+8, buflen-8); return ret; -#endif } #define INQBUFSZ 512 --- scsitools-0.10.orig/scsidev/scsidev.8 +++ scsitools-0.10/scsidev/scsidev.8 @@ -61,7 +61,7 @@ is a utility that is used to guarantee that the same device node can be used for the same scsi device, no matter what other scsi devices are added or removed from the scsi chain. The need for this tool arose because device -numbers are assigned dynamicly at boot time, and if a new disk were added +numbers are assigned dynamically at boot time, and if a new disk were added to the system (or if some disk didn't spin up), then fixed device nodes would cause the wrong filesystems to be mounted, checked, etc. This can also result in security holes, as some device nodes may have permissions that allow @@ -112,7 +112,8 @@ an Adaptec 1542. The "-334" is a means of identifying which 1542 the device is attached to (since linux supports more than one 1542 in the system at the same time) and (in this case) corresponds to the IO -Port number (hex) of the controller. The "c0" represents the channel +Port number (hex) of the controller (this is the host adapter id number). +The "c0" represents the channel number (since some host adapters can drive multiple scsi busses). The "i0l0" indicates that this device is scsi ID 0, with lun 0. Finally the "p1" indicated partition number 1. @@ -183,7 +184,7 @@ Instructs .B scsidev to use devfs like names, i.e. using the cbtu (controller, bus, target -unit) chraracters instead of hcil (host, channel, scsi Id, scsi Lun) to +unit) characters instead of hcil (host, channel, scsi Id, scsi Lun) to build the device name. .TP .I \-o @@ -280,7 +281,8 @@ the alias will match all partitions on the disk. .TP .I hostid= -Specifies the host adapter id number. +Specifies the host adapter id number (0x334 part of sdh4-334c0i0l0p1 for +example). .TP .I hostnum= Specifies the unique number that each host adpater driver returns. @@ -320,9 +322,8 @@ (General Public License) Version 2 (or any later version, at your option). Note, that the GNU GPL implies, that there is .B NO WARRANTY -at all. See file -.B COPYING -for details. +at all. +Full text of the GPL can be found in /usr/share/common-licenses/GPL file. .SH AVAILABILITY .B scsidev is available from --- scsitools-0.10.orig/scsiinfo/scsiinfo.md5.asc +++ scsitools-0.10/scsiinfo/scsiinfo.md5.asc @@ -0,0 +1,12 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +0bc8c2358bef36ca3465a3dd78d4721b scsiinfo +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.0.6 (GNU/Linux) +Comment: Pour information voir http://www.gnupg.org + +iD8DBQFA2KnZrnfgQbnVapERAjp7AJ97KUf3CXesxa4gJG9WgOldrIKQgQCgmIb5 +pPUq0N+tFF5jutyeX8MyCV4= +=rOXP +-----END PGP SIGNATURE----- --- scsitools-0.10.orig/scsiinfo/scsi-config +++ scsitools-0.10/scsiinfo/scsi-config @@ -1,3 +1,7 @@ +#!/bin/sh +# the next lines restarts using wish or abort with a message \ +type wish > /dev/null 2>&1 && exec wish -f "$0" "$@" || \ +echo "no /usr/bin/wish found: please install a tk8.x package." && exit 1 #!/usr/bin/wish -f # Copyright 1993 Yggdrasil Computing, Incorporated # You may copy this file according to the terms and conditions of version 2 @@ -42,11 +46,11 @@ pack .select.h.l .select.h.m -side left -padx 10 pack .select.h .select.f -pady 10 pack .select - exec /usr/bin/scsiinfo -l > /tmp/devices - if {[catch {set file [open /tmp/devices r]}] == 1} return; + exec /sbin/scsiinfo -l > /var/run/devices + if {[catch {set file [open /var/run/devices r]}] == 1} return; gets $file line close $file - exec rm /tmp/devices + exec rm /var/run/devices set n 0 foreach x $line { radiobutton .select.$n -text "$x" -width 10 -variable sdevice -value $x -anchor w @@ -102,7 +106,7 @@ .defects.f.msg delete 1.0 end raise .defects } - catch {exec /usr/bin/scsiinfo -d $flag $sdevice} results + catch {exec /sbin/scsiinfo -d $flag $sdevice} results .defects.f.msg insert end "$results" tkwait window .defects } @@ -117,14 +121,14 @@ frame .f_top set line {} -exec /usr/bin/scsiinfo -X -L $sdevice > /tmp/cachepage -if {[catch {set file [open /tmp/cachepage r]}] == 1} return; +exec /sbin/scsiinfo -X -L $sdevice > /var/run/cachepage +if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line set pages_sup [lindex $line 0] set pages_notch [lindex $line 1] set curr_not [lindex $line 2] close $file -exec rm /tmp/cachepage +exec rm /var/run/cachepage button .f_top.info -text "Device Info" -command "exec /usr/lib/scsi/inquiry $sdevice" \ -activebackground green @@ -202,12 +206,12 @@ exec /usr/lib/scsi/notch $sdevice set line {} - exec /usr/bin/scsiinfo -X -L $sdevice > /tmp/cachepage - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X -L $sdevice > /var/run/cachepage + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line set curr_not [lindex $line 2] close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage .notchinfo.notchnum configure -text $curr_not } --- scsitools-0.10.orig/scsiinfo/scsiinfo.md5 +++ scsitools-0.10/scsiinfo/scsiinfo.md5 @@ -0,0 +1 @@ +0bc8c2358bef36ca3465a3dd78d4721b scsiinfo --- scsitools-0.10.orig/scsiinfo/Makefile +++ scsitools-0.10/scsiinfo/Makefile @@ -1,11 +1,11 @@ -CFLAGS=-O2 -fomit-frame-pointer -Wall -fno-strength-reduce +CFLAGS=${KERNEL_INCLUDES} -g -O2 -Wall -fomit-frame-pointer -fno-strength-reduce -D_GNU_SOURCE #CFLAGS=-g -Wall -fno-strength-reduce LDFLAGS=-s #do not modify this without changing the tcl/tk scripts -BINDIR=/usr/lib/scsi -MANDIR=/usr/man +BINDIR=$(DESTDIR)/usr/lib/scsi +MANDIR=$(DESTDIR)/usr/share/man WISHEXECS=tk/cache tk/control tk/disconnect tk/error tk/format\ tk/inquiry tk/notch tk/peripheral tk/rigid tk/save-changes tk/verify\ tk/save-file tk/overview @@ -16,13 +16,18 @@ all: $(TARGETS) install: $(TARGETS) $(WISHEXECS) scsi-config tk_scsiformat - cp scsiinfo scsiformat /usr/bin - if [ ! -d $(BINDIR) ]; then mkdir -p $(BINDIR); fi + test -d $(DESTDIR)/sbin || mkdir -p $(DESTDIR)/sbin + test -d $(DESTDIR)/usr/sbin || mkdir -p $(DESTDIR)/usr/sbin + test -d $(BINDIR) || mkdir -p $(BINDIR) + cp scsiinfo $(DESTDIR)/sbin + cp scsiformat $(DESTDIR)/usr/sbin cp tworands $(BINDIR) - install-wish $(BINDIR) $(WISHEXECS) - install-wish /usr/bin scsi-config tk_scsiformat + ./install-wish $(BINDIR) $(WISHEXECS) + #./install-wish $(DESTDIR)/usr/sbin scsi-config tk_scsiformat + cp scsi-config tk_scsiformat $(DESTDIR)/usr/sbin cp tk/generic $(BINDIR) - cp man8/* $(MANDIR)/man8 + # manuals are installed by dh_installmanpages in debian/rules + #cp man8/* $(MANDIR)/man8 clean: rm -f core *~ *.o $(TARGETS) --- scsitools-0.10.orig/scsiinfo/scsiformat.c +++ scsitools-0.10/scsiinfo/scsiformat.c @@ -45,10 +45,22 @@ #include #include #include -#include -#include +#include +#include #include -#include + +struct partition { + unsigned char boot_ind; /* 0x80 - active */ + unsigned char head; /* starting head */ + unsigned char sector; /* starting sector */ + unsigned char cyl; /* starting cylinder */ + unsigned char sys_ind; /* What partition type */ + unsigned char end_head; /* end head */ + unsigned char end_sector; /* end sector */ + unsigned char end_cyl; /* end cylinder */ + unsigned int start_sect; /* starting sector counting from 0 */ + unsigned int nr_sects; /* nr of sectors in partition */ +} __attribute__((packed)); #define TEST_UNIT_READY (0x00) #define FORMAT_UNIT (0x04) @@ -67,7 +79,7 @@ pid_t child = -1; time_t start; -char tmpfname[] = "/tmp/scsiformat.XX:XX:XX:XX:XXXXXXXX"; +char tmpfname[] = "/var/run/scsiformat.XX:XX:XX:XX:XXXXXXXX"; char *devicename, *linebuf, *givendevice; long scsiunid[2]; @@ -97,7 +109,7 @@ unsigned par_defectlen = 0; unsigned par_interleave = 0; unsigned char par_initpattern[65536 + 5]; -unsigned long par_defects[65536 / sizeof(unsigned long) + 3]; +unsigned int par_defects[65536 / sizeof(unsigned long) + 3]; struct winsize wins; @@ -143,6 +155,48 @@ fprintf(stderr, ": %s\n", strerror(locerr)); } +int send_scsi_cmd(int fileno, int cmd_len, unsigned char* buffer) +{ + int status; +#ifdef SG_IO + if (use_sgio) { + sg_io_hdr_t sgh; + char sense_buffer[16]; + int dir = SG_DXFER_NONE; + int in_len = *((int*)buffer); + int out_len = *(((int*)buffer)+1); + if (in_len != 0) + dir = SG_DXFER_FROM_DEV; + else if (out_len != 0) + dir = SG_DXFER_TO_DEV; + memset(&sgh, 0, sizeof(sgh)); + sgh.interface = 'S'; + sgh.dxfer_direction = dir; + sgh.dxferp = buffer+(dir == SG_DXFER_TO_DEV ? cmd_len : 0)+8; + sgh.dxfer_len = dir == SG_DXFER_TO_DEV ? in_len : out_len; + sgh.cmd_len = cmd_len; + sgh.cmdp = buffer+8; + sgh.sbp = sense_buffer; + sgh.m_sb_len = sizeof(sense_buffer); + sgh.timeout = 2000; /* 2s */ + status = ioctl(fileno, SG_IO, &sgh); + if (status < 0) { + /* scsi error: dump sense buffer into output area */ + memcpy(buffer+8, sense_buffer, sgh.sb_len_wr); + /* return a status similar to the one returned by legacy ioctl */ + status = sgh.driver_status << 24 | sgh.host_status << 16 | sgh.msg_status << 8 || sgh.masked_status; + } + else { + status = 0; + } + } + else +#else + status = ioctl(fileno, 1 /* SCSI_IOCTL_SEND_COMMAND */, buffer); +#endif + return status; +} + /* return -1 for ready, -2 for no progress indication available) and progress indicator else. */ /* BUG/MISFEATURE: The linux device driver stores the sense data into another @@ -161,7 +215,7 @@ *((int *) buffer) = 6; /* length of input data */ *(((int *) buffer) + 1) = 18; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = TEST_UNIT_READY; cmd[1] = 0x00; /* LUN / (reserved) */ @@ -174,7 +228,7 @@ printf("Sending TEST_UNIT_READY command:\n"); dump(stdout, ((int *) buffer) + 2, *((int *) buffer)); } - status = ioctl(fd, 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + status = send_scsi_cmd(fd, 6, buffer); if ((status == EAGAIN) || (status == EBUSY)) return -2; if (status < 0) { @@ -424,7 +478,7 @@ *(((int *) buffer) + 1) = 255; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = FORMAT_UNIT; cmd[1] = 0x00; /* LUN / FmtData / CmpList / Defectformat */ @@ -445,25 +499,25 @@ if (par_erasedefs) cmd[1] |= 0x08; if (par_initpattern[0] | par_initpattern[1]) { - data[0] |= 0x08; + data[1] |= 0x08; par_fov = 1; memcpy(end, par_initpattern, par_patternlen); end += par_patternlen; } if (par_fov) { hasdata = 1; - data[0] |= 0x80; + data[1] |= 0x80; if (par_disprim) - data[0] |= 0x40; + data[1] |= 0x40; if (par_discert) - data[0] |= 0x20; + data[1] |= 0x20; if (par_stop) - data[0] |= 0x10; + data[1] |= 0x10; if (par_dissav) - data[0] |= 0x04; + data[1] |= 0x04; } if (!par_blockmode) { - data[0] |= 2; + data[1] |= 2; hasdata = 1; } if (par_defectlen) { @@ -490,7 +544,7 @@ exit(2); } #ifndef DONT_FORMAT - status = ioctl(fd, 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + status = send_scsi_cmd(fd, 6, buffer); if (status < 0) { argperr("scsiformat (sending FORMAT_UNIT to %s)", devicename); exit(1); @@ -527,7 +581,7 @@ " will need about n seconds and provides some progress indication\n" " according to that. -b0 does not print any process indication.\n" " -T just test for a running format command and output statistics.\n" - " A file /tmp/scsiformat.* is used to hold the starting time of\n" + " A file /var/run/scsiformat.* is used to hold the starting time of\n" " the format operation. If formatting completes, this file is\n" " removed by scsiformat. The exit state is true as long as\n" " the format operation is still in progress.\n" @@ -736,7 +790,7 @@ if (!par_deflistform) { fprintf(fh, "\nUser supplied defect logical blocks:\n"); for (i = off = 0; off < par_defectlen; i++, off += 4) { - fprintf(fh, " %9lu", ntohl(par_defects[i])); + fprintf(fh, " %9u", ntohl(par_defects[i])); if ((i & 7) == 7) { fprintf(fh, "\n"); flag = 1; @@ -747,8 +801,8 @@ fprintf(fh, "\nUser supplied defects in Cylinder:Head:%s format:\n", par_deflistform == 5 ? "PhysicalSector" : "BytesFromIndex"); for (i = off = 0; off < par_defectlen; i += 2, off += 8) { - sprintf(buffer, " %lu:%lu:%ld", ntohl(par_defects[i]) >> 8, - ntohl(par_defects[i]) & 255, (long) ntohl(par_defects[i + 1])); + sprintf(buffer, " %u:%u:%d", ntohl(par_defects[i]) >> 8, + ntohl(par_defects[i]) & 255, (int) ntohl(par_defects[i + 1])); fprintf(fh, "%20s", buffer); if ((i & 3) == 3) { fprintf(fh, "\n"); @@ -905,7 +959,11 @@ unsigned char sig2catch[] = {SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, SIGUSR1, SIGUSR2, SIGTRAP, - SIGIOT, SIGBUS, SIGSTKFLT, SIGIO, SIGXCPU, SIGXFSZ, SIGVTALRM, + SIGIOT, SIGBUS, +#ifdef SIGSTKFLT + SIGSTKFLT, +#endif + SIGIO, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPROF, SIGPWR}; siga.sa_handler = term_handler; @@ -1102,7 +1160,7 @@ void parse_pattern() { - unsigned char *ptr = optarg; + char *ptr = optarg; int len; len = strlen(ptr); @@ -1162,7 +1220,7 @@ sprintf(partdev + o, "%d", i); if (!swapoff(partdev)) { fprintf(stderr, "Warning, turned swap off on %s!\n", partdev); - } else if ((errno != ENOENT) && (errno != EINVAL)) { + } else if ((errno != ENOENT) && (errno != EINVAL) && (errno != ENXIO)) { fprintf(stderr, "Warning, unable to turn swap off on %s!\n", partdev); flag = 1; } @@ -1172,7 +1230,7 @@ for (partdev[o] = 'a'; partdev[o] <= 'z'; partdev[o]++) { if (!swapoff(partdev)) { fprintf(stderr, "Warning, turned swap off on %s!\n", partdev); - } else if ((errno != ENOENT) && (errno != EINVAL)) { + } else if ((errno != ENOENT) && (errno != EINVAL) && (errno != ENXIO)) { fprintf(stderr, "Warning, unable to turn swap off on %s!\n", partdev); flag = 1; } --- scsitools-0.10.orig/scsiinfo/tk_scsiformat +++ scsitools-0.10/scsiinfo/tk_scsiformat @@ -1,3 +1,7 @@ +#!/bin/sh +# the next lines restarts using wish or abort with a message \ +type wish > /dev/null 2>&1 && exec wish -f "$0" "$@" || \ +echo "no /usr/bin/wish found: please install a tk8.x package." && exit 1 #!/usr/bin/wish -f # Based in parts on scsi-config by: # Copyright 1993 Yggdrasil Computing, Incorporated @@ -108,15 +112,15 @@ if { [string compare $par_partmin ""] == 0} then { set par_partmin 0 } - .f_def.part.menu entryconfigure 8 -label "Maximal Partion Size ${par_partmin}MB" + .f_def.part.menu entryconfigure 9 -label "Maximal Partition Size ${par_partmin}MB" } proc change_geom {geomdetect heads sectors} { if { [string compare $geomdetect "-G"] == 0} then { - .f_def.part.menu entryconfigure 7 -label \ + .f_def.part.menu entryconfigure 8 -label \ "Disk Geometry is ${heads} Heads and ${sectors} Sectors" } else { - .f_def.part.menu entryconfigure 7 -label "Autodetect Disk Geometry" + .f_def.part.menu entryconfigure 8 -label "Autodetect Disk Geometry" } } @@ -128,7 +132,7 @@ } else { set label "Other ($par_mkfs)" } - .f_def.part.menu.mkfs entryconfigure [expr [llength $par_mkfscmds] + 1] -label "$label" + .f_def.part.menu.mkfs entryconfigure [expr [llength $par_mkfscmds] + 2] -label "$label" } proc bind_eedit {w} { @@ -686,9 +690,9 @@ frame .mkfs.f_inter scrollbar .mkfs.f_inter.s -relief sunken -orient horiz -command \ - ".mkfs.f_inter.t view" + ".mkfs.f_inter.t xview" entry .mkfs.f_inter.t -background white -relief sunken -borderwidth 2 \ - -exportselection 1 -scroll ".mkfs.f_inter.s set" + -exportselection 1 -xscrollcommand ".mkfs.f_inter.s set" .mkfs.f_inter.t insert 0 $par_mkfs bind_eedit .mkfs.f_inter.t @@ -802,7 +806,7 @@ pack .conf.f_bot -side top -padx 15 pack .conf.dismiss -side top -pady 10 - set format_cmd "/usr/bin/scsiformat $par_erase -i$par_inter" + set format_cmd "/usr/sbin/scsiformat $par_erase -i$par_inter" regsub -all "\x0a" [string trim $par_defects] " " tmpstr regsub -all " +" $tmpstr "," tmpstr @@ -874,15 +878,15 @@ set security "-F'Ene Mene Meck, und Du bist weg!'" append fcmd " $security -t0 -X $sdevice" - if { [catch {exec sh -c "$fcmd" >& /tmp/scsiformat.[pid] } err] != 0 } then { - set fd [open /tmp/scsiformat.[pid] r] + if { [catch {exec sh -c "$fcmd" >& /var/run/scsiformat.[pid] } err] != 0 } then { + set fd [open /var/run/scsiformat.[pid] r] set err "$err\x0a[read $fd]" close $fd - exec rm /tmp/scsiformat.[pid] + exec rm /var/run/scsiformat.[pid] show_err scsiformat $err return; } - exec rm /tmp/scsiformat.[pid] + exec rm /var/run/scsiformat.[pid] set format_initiator 1 show_busy } @@ -928,7 +932,7 @@ proc query_prog {} { global sdevice errorCode wasbusy format_initiator par_mkfs - set check_cmd "/usr/bin/scsiformat -T -t1 -X $sdevice" + set check_cmd "/usr/sbin/scsiformat -T -t1 -X $sdevice" if { [winfo exists .showprog] != 1 } { return; @@ -1075,7 +1079,7 @@ pack .select.h.l .select.h.m -side left -padx 10 pack .select.h -pady 10 pack .select - set line [exec /usr/bin/scsiinfo -l] + set line [exec /sbin/scsiinfo -l] set n 0 foreach x $line { if {[string first "/dev/sd" "$x"] != 0} continue; --- scsitools-0.10.orig/scsiinfo/scsiinfo.c +++ scsitools-0.10/scsiinfo/scsiinfo.c @@ -60,18 +60,26 @@ * 08/23/97 fix problems with defect lists * */ +#define USE_SGIO #include +#include #include #include #include +#include #include #include +#ifdef USE_SGIO +# include +int use_sgio = 1; +#endif -FILE *infile; +int infile; char *device_name; unsigned char buffer[64 * 1024 + 100]; unsigned char buffer1[10 * 1024 + 100]; +char verbose = 0; char cache = 0; char defect = 0; char geometry = 0; @@ -279,7 +287,7 @@ printf("%-35s%d\n", text, !((*pageaddr >> shift) & mask)); } -void intfield(char *pageaddr, int nbytes, char *text) +void intfield(unsigned char *pageaddr, int nbytes, char *text) { if (x_interface && replace) { check_parm_type(0); @@ -290,7 +298,7 @@ printf("%-35s%d\n", text, getnbyte(pageaddr, nbytes)); } -void hexfield(char *pageaddr, int nbytes, char *text) +void hexfield(unsigned char *pageaddr, int nbytes, char *text) { if (x_interface && replace) { check_parm_type(0); @@ -335,7 +343,7 @@ if (nbytes) { illegal: fputs("scsiinfo: incorrect number of bytes in @hexdatafield.\n", stderr); - exit(2); + exit(3); } } else if (x_interface) { putchar('@'); @@ -350,6 +358,46 @@ } } +int send_scsi_cmd(int fileno, int cmd_len, unsigned char* buffer) +{ + int status; +#ifdef USE_SGIO + if (use_sgio) { + sg_io_hdr_t sgh; + unsigned char sense_buffer[16]; + int dir = SG_DXFER_NONE; + int in_len = *((int*)buffer); + int out_len = *(((int*)buffer)+1); + if (in_len != 0) + dir = SG_DXFER_TO_DEV; + else if (out_len != 0) + dir = SG_DXFER_FROM_DEV; + memset(&sgh, 0, sizeof(sgh)); + sgh.interface_id = 'S'; + sgh.dxfer_direction = dir; + sgh.dxferp = buffer+(dir == SG_DXFER_TO_DEV ? cmd_len : 0)+8; + sgh.dxfer_len = dir == SG_DXFER_TO_DEV ? in_len : out_len; + sgh.cmd_len = cmd_len; + sgh.cmdp = buffer+8; + sgh.sbp = sense_buffer; + sgh.mx_sb_len = sizeof(sense_buffer); + sgh.timeout = 1000; /* 2s */ + status = ioctl(fileno, SG_IO, &sgh); + if (status >= 0) { + /* return a status similar to the one returned by legacy ioctl */ + status = sgh.driver_status << 24 | sgh.host_status << 16 | sgh.msg_status << 8 || sgh.masked_status; + } + if (status) { + /* scsi error: dump sense buffer into output area */ + memcpy(buffer+8, sense_buffer, sgh.sb_len_wr); + } + } + else +#endif + status = ioctl(fileno, 1 /* SCSI_IOCTL_SEND_COMMAND */, buffer); + return status; +} + int get_mode_page(int page, int page_code) { int status, quiet; @@ -363,7 +411,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = 0xff; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = MODE_SENSE; /* MODE SENSE (6) */ cmd[1] = 0x00; /* lun = 0, inhibitting BD makes this fail for me */ @@ -372,9 +420,14 @@ cmd[4] = 0xff; /* allocation length */ cmd[5] = 0x00; /* control */ - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); - if (status && (!quiet)) + status = send_scsi_cmd(infile, 6, buffer); + if (status && (!quiet)) { fprintf(stderr, "Unable to read %s Page %02xh\n", get_page_name(page), page); + if (verbose > 1) { + printf("sense buffer: "); + dump(buffer+8, 16); + } + } return status; } @@ -392,7 +445,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = 0xffff; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = MODE_SENSE_10; /* MODE SENSE (10) */ cmd[1] = 0x00; /* lun = 0, inhibitting BD makes this fail for me */ @@ -405,10 +458,15 @@ cmd[8] = 0xff; /* allocation length lo */ cmd[9] = 0x00; /* control */ - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); - if (status && (!quiet)) + status = send_scsi_cmd(infile, 10, buffer); + if (status && (!quiet)) { fprintf(stderr, "Unable to read %s Page %02xh with MODESENSE(10)\n", get_page_name(page), page); + if (verbose > 1) { + printf("sense buffer: "); + dump(buffer+8, 16); + } + } return status; } @@ -426,7 +484,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = 0xff; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = LOG_SENSE; /* LOG SENSE */ cmd[1] = 0x00 | (save_values & 1); /* lun = 0, Parameter pointer control 0 for full page */ @@ -440,7 +498,7 @@ cmd[9] = 0x00; /* control */ dump(buffer, 200); - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + status = send_scsi_cmd(infile, 10, buffer); if (status && (!quiet)) fprintf(stderr, "Unable to read %sLog Page %02xh\n", get_log_name(page), page); dump(buffer, 400); @@ -452,7 +510,7 @@ in a prior read operation. This way we do not have to work out the format of the beast */ -int put_mode_page(int page, char *contents, int page_code) +int put_mode_page(int page, unsigned char *contents, int page_code) { int status; int pagelen, pagelen1; @@ -466,7 +524,7 @@ *((int *) buffer1) = pagelen1; /* length of input data */ *(((int *) buffer1) + 1) = pagelen1; /* length of output buffer */ - cmd = (char *) (((int *) buffer1) + 2); + cmd = (unsigned char *) (((int *) buffer1) + 2); cmd[0] = MODE_SELECT; cmd[1] = 0x10 | (page_code ? 1 : 0); @@ -482,7 +540,7 @@ cmd[6 + pagelen] &= 0x3f; /* Mask off this reserved field in page code */ /* dump (buffer1, 48); */ - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer1); + status = send_scsi_cmd(infile, 6, buffer1); if (status) { fprintf(stderr, "Unable to store %s Page %02xh\n", get_page_name(page), page); @@ -500,7 +558,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -gXR %s ", device_name); + printf("scsiinfo -gXR %s ", device_name); SETUP_MODE_PAGE(4, 9); @@ -532,7 +590,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -DXR %s ", device_name); + printf("scsiinfo -DXR %s ", device_name); SETUP_MODE_PAGE(2, 7); @@ -562,7 +620,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -CXR %s ", device_name); + printf("scsiinfo -CXR %s ", device_name); SETUP_MODE_PAGE(10, 9); @@ -594,7 +652,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -eXR %s ", device_name); + printf("scsiinfo -eXR %s ", device_name); SETUP_MODE_PAGE(1, 14); if (!x_interface && !replace) { @@ -629,7 +687,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -nXR %s ", device_name); + printf("scsiinfo -nXR %s ", device_name); SETUP_MODE_PAGE(0xc, 7); @@ -692,7 +750,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = len; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = 0x37; /* READ DEFECT DATA */ cmd[1] = 0x00; /* lun=0 */ @@ -705,7 +763,7 @@ cmd[8] = (len & 0xff); /* Alloc len */ cmd[9] = 0x00; /* control */ - i = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + i = send_scsi_cmd(infile, 10, buffer); if ((i & 0xF000000) == 0x8000000) { /* sense is available: */ if (((buffer[8] & ~1) == 0x70) && ((buffer[10] & 0x0f) == 0x1)) @@ -714,6 +772,10 @@ if (i) { fprintf(stderr, "Unable to read %s defect data.\n", (table ? "grown" : "manufacturer")); + if (verbose > 1) { + printf("sense buffer: "); + dump(buffer+8, 16); + } status |= i; } else { len = (buffer[10] << 8) | buffer[11]; @@ -731,7 +793,7 @@ i = 0; if (len) { while (len) { - sprintf(buffer, "%u:%u:%d", getnbyte(df, 3), df[3], getnbyte(df + 4, 4)); + sprintf((char *) buffer, "%u:%u:%d", getnbyte(df, 3), df[3], getnbyte(df + 4, 4)); printf(" %15s", buffer); len -= 8; df += 8; @@ -770,7 +832,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -cXR %s ", device_name); + printf("scsiinfo -cXR %s ", device_name); SETUP_MODE_PAGE(8, 9); @@ -801,7 +863,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -fXR %s ", device_name); + printf("scsiinfo -fXR %s ", device_name); SETUP_MODE_PAGE(3, 13); @@ -837,7 +899,7 @@ unsigned char *pagestart; if (save_mode) - printf("/usr/bin/scsiinfo -VXR %s ", device_name); + printf("scsiinfo -VXR %s ", device_name); SETUP_MODE_PAGE(7, 7); @@ -877,7 +939,7 @@ char *name; if (save_mode) - printf("/usr/bin/scsiinfo -pXR %s ", device_name); + printf("scsiinfo -pXR %s ", device_name); SETUP_MODE_PAGE(9, 2); @@ -935,7 +997,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = 1024; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = 0x12; /* INQUIRY */ cmd[1] = 0x00; /* lun=0, evpd=0 */ @@ -944,9 +1006,9 @@ cmd[4] = 0xff; /* allocation length */ cmd[5] = 0x00; /* control */ - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + status = send_scsi_cmd(infile, 6, buffer); if (status) - printf("ioctl(SCSI_IOCTL_SEND_COMMAND) status\t= %d\n", status); + printf("INQUIRY command status\t= %d\n", status); if (status) return status; @@ -1009,7 +1071,7 @@ *((int *) buffer) = 0; /* length of input data */ *(((int *) buffer) + 1) = 1024; /* length of output buffer */ - cmd = (char *) (((int *) buffer) + 2); + cmd = (unsigned char *) (((int *) buffer) + 2); cmd[0] = 0x12; /* INQUIRY */ cmd[1] = 0x01; /* lun=0, evpd=1 */ @@ -1018,9 +1080,9 @@ cmd[4] = 0xff; /* allocation length */ cmd[5] = 0x00; /* control */ - status = ioctl(fileno(infile), 1 /* SCSI_IOCTL_SEND_COMMAND */ , buffer); + status = send_scsi_cmd(infile, 6, buffer); if (status) - printf("ioctl(SCSI_IOCTL_SEND_COMMAND) status\t= %d\n", status); + printf("INQUIRY command status\t= %d\n", status); if (status) return status; @@ -1036,20 +1098,42 @@ } -char *devices[] = -{"/dev/sda", "/dev/sdb", "/dev/sdc", "/dev/sdd", "/dev/sde", "/dev/sdf", "/dev/sdg", - "/dev/sdh", "/dev/scd0", "/dev/scd1", "/dev/nst0", "/dev/nst1"}; /* Print out a list of the known devices on the system */ void show_devices() { int i; - FILE *test; - for (i = 0; i < sizeof(devices) / sizeof(char *); i++) { - test = fopen(devices[i], "r"); - if (!test) + int test; + char devname[16]; + char* sep = ""; + /* test for scsi disks */ + for (i = 0; i < 26; i++) { + snprintf(devname, sizeof(devname), "/dev/sd%c", 'a'+i); + test = open(devname, O_NDELAY | O_RDONLY, 0); + if (test < 0) /* ENOENT? ENODEV? */ continue; - printf("%s ", devices[i]); - fclose(test); + printf("%s%s", sep, devname); + close(test); + sep = " "; + }; + /* test for scsi cdroms */ + for (i = 0; i < 26; i++) { + snprintf(devname, sizeof(devname), "/dev/scd%d", i); + test = open(devname, O_NDELAY | O_RDONLY, 0); + if (test < 0) /* ENOENT? ENODEV? */ + continue; + printf("%s%s", sep, devname); + close(test); + sep = " "; + }; + /* test for scsi tapes */ + for (i = 0; i < 26; i++) { + snprintf(devname, sizeof(devname), "/dev/nst%d", i); + test = open(devname, O_NDELAY | O_RDONLY, 0); + if (test < 0) /* ENOENT? ENODEV? */ + continue; + printf("%s%s", sep, devname); + close(test); + sep = " "; }; printf("\n"); } @@ -1064,8 +1148,8 @@ unsigned char *pagestart; if (save_mode) { - printf("set -- `/usr/bin/scsiinfo -nX %s`\n", device_name); - printf("/usr/bin/scsiinfo -nXR %s $1 $2 $3 %d $5 $6 $7\n", device_name, notch); + printf("set -- `scsiinfo -nX %s`\n", device_name); + printf("scsiinfo -nXR %s $1 $2 $3 %d $5 $6 $7\n", device_name, notch); } SETUP_MODE_PAGE(0xc, 0); putnbyte(pagestart + 6, notch, 2); @@ -1293,8 +1377,13 @@ if (argc < 2) usage("too few arguments"); - while ((c = getopt(argc, argv, "agdcfisDeCXmMSRvlnLpVF:")) != EOF) { + while ((c = getopt(argc, argv, "agdcfisDeCXmMSRvlnLpVIF:")) != EOF) { switch (c) { +#ifdef USE_SGIO + case 'I': + use_sgio = 0; + break; +#endif case 'F': if (!strcasecmp(optarg, "logical")) defectformat = 0x0; @@ -1378,7 +1467,8 @@ notch = 1; /* fall through */ case 'v': - fprintf(stderr, " Scsiinfo version 1.7(eowmob)\n"); + if (verbose++ == 0) + fprintf(stderr, " Scsiinfo version 1.7(eowmob)\n"); break; default: fprintf(stderr, "Unknown option '-%c' (ascii %02xh)\n", c, c); @@ -1434,15 +1524,15 @@ } if (optind >= argc) usage("no device name given"); - infile = fopen(device_name = argv[optind], "r"); - if (!infile) { - perror("scsiinfo(fopen)"); + infile = open(device_name = argv[optind], O_NDELAY | O_RDONLY, 0); + if (infile < 0) { + perror("scsiinfo(open)"); exit(1); } /* Save the current parameters in NOVRAM on the device */ if (saved && replace && !list_pages) { replace_parameters(); - fclose(infile); + close(infile); exit(0); }; --- scsitools-0.10.orig/scsiinfo/tworands.c +++ scsitools-0.10/scsiinfo/tworands.c @@ -6,7 +6,7 @@ #include #include -int main(int argc) { +int main(int argc, char **argv) { struct timeval tv; if (argc != 1) { --- scsitools-0.10.orig/scsiinfo/tk/save-changes +++ scsitools-0.10/scsiinfo/tk/save-changes @@ -21,6 +21,6 @@ # This should do it. Do not come and complain to me if this # does not work -exec /usr/bin/scsiinfo -R -S -X $argv +exec /sbin/scsiinfo -R -S -X $argv exit --- scsitools-0.10.orig/scsiinfo/tk/peripheral +++ scsitools-0.10/scsiinfo/tk/peripheral @@ -29,12 +29,12 @@ global text_list global switch set line {} - exec /usr/bin/scsiinfo -X $switch $option $device > /tmp/cachepage 2> /dev/null - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X $switch $option $device > /var/run/cachepage 2> /dev/null + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line gets $file asciidesc close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage .ident.text delete 1.0 end .ident.text insert end [lindex $line 0] @@ -51,11 +51,11 @@ global text_list global switch set line {} - exec /usr/bin/scsiinfo -X -m $switch $device > /tmp/cachepage - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X -m $switch $device > /var/run/cachepage + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage if { [ string compare [lindex $line 0] "0" ] == 0} \ then { .ident.text configure -state disabled } \ @@ -82,11 +82,11 @@ set r3 [concat $r3 @[.vendor.text get 1.0 end]] - set file [open /tmp/wrscsi w] - puts $file "/usr/bin/scsiinfo $r3" + set file [open /var/run/wrscsi w] + puts $file "/sbin/scsiinfo $r3" close $file - exec sh < /tmp/wrscsi - exec rm /tmp/wrscsi + exec sh < /var/run/wrscsi + exec rm /var/run/wrscsi } --- scsitools-0.10.orig/scsiinfo/tk/generic +++ scsitools-0.10/scsiinfo/tk/generic @@ -48,11 +48,11 @@ global text_list global switch set line {} - exec /usr/bin/scsiinfo -X $switch $option $device > /tmp/cachepage 2> /dev/null - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X $switch $option $device > /var/run/cachepage 2> /dev/null + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage set first [lindex $line 0] set second [lindex $line 1] set lineno 0 @@ -73,11 +73,11 @@ global text_list global switch set line {} - exec /usr/bin/scsiinfo -X -m $switch $device > /tmp/cachepage - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X -m $switch $device > /var/run/cachepage + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage set lineno 0 foreach x $button_list { if { [ string compare [lindex $line $lineno] "0" ] == 0} then { .$x configure -state disabled } @@ -109,10 +109,10 @@ set r3 [concat $r3 [.$x.text get 1.0 end]] set lineno [expr $lineno+1] } - set file [open /tmp/wrscsi w] - puts $file "/usr/bin/scsiinfo $r3" + set file [open /var/run/wrscsi w] + puts $file "/sbin/scsiinfo $r3" close $file - exec sh < /tmp/wrscsi - exec rm /tmp/wrscsi + exec sh < /var/run/wrscsi + exec rm /var/run/wrscsi } --- scsitools-0.10.orig/scsiinfo/tk/inquiry +++ scsitools-0.10/scsiinfo/tk/inquiry @@ -154,8 +154,8 @@ global text_list global switch set line {} - exec /usr/bin/scsiinfo -X $switch $option $device > /tmp/cachepage - if {[catch {set file [open /tmp/cachepage r]}] == 1} return; + exec /sbin/scsiinfo -X $switch $option $device > /var/run/cachepage + if {[catch {set file [open /var/run/cachepage r]}] == 1} return; gets $file line set first [lindex $line 0] set second [lindex $line 1] @@ -185,7 +185,7 @@ .revision.text insert end $line .revision.text configure -state disabled close $file - exec rm /tmp/cachepage + exec rm /var/run/cachepage } read_page $argv "-X" --- scsitools-0.10.orig/scsiinfo/tk/save-file +++ scsitools-0.10/scsiinfo/tk/save-file @@ -23,7 +23,7 @@ set base [exec basename $sdevice] .win.fname.text delete 1.0 end -.win.fname.text insert end "/tmp/scsi-config.$base" +.win.fname.text insert end "/var/run/scsi-config.$base" frame .win.f radiobutton .win.cur -text "Current values" -width 20 -variable flag -value "-LXR" -anchor w @@ -36,7 +36,7 @@ -activebackground red -activeforeground white button .win.f.continue -width 10 -text "Save" \ -activebackground green \ - -command {global fname; set fname [.win.fname.text get 1.0 end]; destroy .win} + -command {global fname; set fname [.win.fname.text get 1.0 "end -1 chars"]; destroy .win} pack .win.f.continue .win.f.quit -side left -padx 30 -ipadx 2 -ipady 2 pack .win.f -pady 10 pack .win --- scsitools-0.10.orig/scsiinfo/man8/scsiformat.8 +++ scsitools-0.10/scsiinfo/man8/scsiformat.8 @@ -223,7 +223,7 @@ made. Defaults to .BR 99999 . -.SS e) Miscanellous +.SS e) Miscellaneous .TP .B -H print some command line help to stdout. @@ -236,7 +236,7 @@ forced operation, do not ask prior to format. .I arg must be -.B Ene Mene Meck, und Du bist weg! +.B 'Ene\ Mene\ Meck,\ und\ Du\ bist\ weg!' with proper spaces and capitalisation. (this is a German child rhyme kissing someone goodbye...) @@ -262,7 +262,7 @@ or one of these flags some factory default is used. Specifying .B -o -explictly will allow you to not use any of these options which might not be +explicitly will allow you to not use any of these options which might not be the default chosen by the target device otherwise. .SH RETURN CODES @@ -279,8 +279,8 @@ .B -T option. However, they are removed after 48 hours. -I were unable to get hold of a disk supporting querying the progress status (and which I could -stand to loose all data on). Therefore I commented out the support for this from the +I was unable to get hold of a disk supporting querying the progress status (and which I could +stand to lose all data on). Therefore I commented out the support for this from the source code using a .BR BLOCKING_ONLY #define. You are welcome to try and make this work. --- scsitools-0.10.orig/scsiinfo/man8/scsiinfo.8 +++ scsitools-0.10/scsiinfo/man8/scsiinfo.8 @@ -153,13 +153,16 @@ .B -m displays modifiable fields instead of current values (All bits set in modifiable fields). -.SS Miscanellous +.SS Miscellaneous .TP .B -v Show .B scsiinfo version. .TP +.B -vv +Dump sense buffer in case of error. +.TP .B -a All of the above (expect listing defects). .TP