Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Julien ROZO (92509e825d4d3bb873811350387c037ebe7fefa3)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Julien ROZO <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Julien ROZO (92509e825d4d3bb873811350387c037ebe7fefa3)
  • Date: Tue, 2 Dec 2008 16:28:59 -0600

GIT changes to master grimoire by Julien ROZO <julien AT rozo.org>:

disk/hdparm/CONFIGURE | 2
disk/hdparm/HISTORY | 6 +
disk/hdparm/PRE_BUILD | 2
disk/hdparm/hdparm-8.9-dvd.patch | 184
--------------------------------------
disk/hdparm/hdparm-dvdspeed.patch | 183
+++++++++++++++++++++++++++++++++++++
5 files changed, 191 insertions(+), 186 deletions(-)

New commits:
commit 92509e825d4d3bb873811350387c037ebe7fefa3
Author: Julien ROZO <julien AT rozo.org>
Commit: Julien ROZO <julien AT rozo.org>

hdparm: renamed hdparm-8.9-dvd.patch to hdparm-dvdspeed.patch
This patch has been modified so it can be applied on hdparm 9.3

Removed reference in CONFIGURE to online patch, which is outdated

diff --git a/disk/hdparm/CONFIGURE b/disk/hdparm/CONFIGURE
index 1bf86b1..025fd14 100755
--- a/disk/hdparm/CONFIGURE
+++ b/disk/hdparm/CONFIGURE
@@ -1,3 +1,3 @@
config_query HDPARM_DVD \
-"Add patch for DVD speed setting via -E (certain drives need this,
http://sobukus.de/hdparm-8.9-dvd.patch)?" \
+"Add patch for DVD speed setting via -E (certain drives need this) ?" \
n
diff --git a/disk/hdparm/HISTORY b/disk/hdparm/HISTORY
index 497c70a..4873bd8 100644
--- a/disk/hdparm/HISTORY
+++ b/disk/hdparm/HISTORY
@@ -1,3 +1,9 @@
+2008-12-02 Julien "_kaze_" ROZO <julien AT rozo.org>
+ * hdparm-8.9-dvd.patch: renamed to hdparm-dvdspeed.patch
+ * hdparm-dvdspeed.patch: changed so it can be applied on hdparm 9.3
+ * PRE_BUILD: apply hdparm-dvdspeed.patch instead of
hdparm-8.9-dvd.patch
+ * CONFIGURE: removed reference to online patch, which is outdated
+
2008-11-04 Treeve Jelbert <treeve AT sourcemage.org>
* DETAILS: version 9.3

diff --git a/disk/hdparm/PRE_BUILD b/disk/hdparm/PRE_BUILD
index b117e12..09219a1 100755
--- a/disk/hdparm/PRE_BUILD
+++ b/disk/hdparm/PRE_BUILD
@@ -3,5 +3,5 @@ cd "$SOURCE_DIRECTORY" &&
if [[ "$HDPARM_DVD" = y ]]; then
message "${MESSAGE_COLOR}Applying DVD speed patch.$DEFAULT_COLOR" &&
#
http://sourceforge.net/tracker/index.php?func=detail&aid=2043579&group_id=136732&atid=736684
- patch -Np1 < "$SCRIPT_DIRECTORY/hdparm-8.9-dvd.patch"
+ patch -Np1 < "$SCRIPT_DIRECTORY/hdparm-dvdspeed.patch"
fi
diff --git a/disk/hdparm/hdparm-8.9-dvd.patch
b/disk/hdparm/hdparm-8.9-dvd.patch
deleted file mode 100644
index 1c04df0..0000000
--- a/disk/hdparm/hdparm-8.9-dvd.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-Dateien hdparm-8.9/dvdspeed und hdparm-8.9-dvd/dvdspeed sind verschieden.
-diff -ruN hdparm-8.9/dvdspeed.c hdparm-8.9-dvd/dvdspeed.c
---- hdparm-8.9/dvdspeed.c 1970-01-01 01:00:00.000000000 +0100
-+++ hdparm-8.9-dvd/dvdspeed.c 2008-08-08 23:13:57.000000000 +0200
-@@ -0,0 +1,129 @@
-+#include <stdio.h>
-+#include <stdlib.h>
-+#include <fcntl.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <sys/ioctl.h>
-+#include <linux/cdrom.h>
-+/*
-+ * dvdspeed - use SET STREAMING command to set the speed of DVD-drives
-+ *
-+ *
-+ * Copyright (c) 2004 Thomas Fritzsche <tf AT noto.de>
-+ * A bit mangled in 2006 and 2008 by Thomas Orgis <thomas AT orgis.org>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ *
-+ */
-+
-+#include "dvdspeed.h" /* just to silence a stupid warning */
-+
-+#ifdef DVDSPEED_STANDALONE
-+/* Just error handling. */
-+void dump_sense(unsigned char *cdb, struct request_sense *sense)
-+{
-+ int i;
-+ printf("Command failed: ");
-+
-+ for (i=0; i<12; i++)
-+ fprintf(stderr, "%02x ", cdb[i]);
-+
-+ if(sense)
-+ {
-+ fprintf(stderr, " - sense: %02x.%02x.%02x\n",
-+ sense->sense_key, sense->asc, sense->ascq);
-+ }
-+ else
-+ {
-+ fprintf(stderr, ", no sense\n");
-+ }
-+}
-+#endif
-+
-+/* This is the interesting code. */
-+int set_dvd_speed(int fd, int speed)
-+{
-+ struct cdrom_generic_command cgc;
-+ struct request_sense sense;
-+ unsigned char buffer[28];
-+ memset(&cgc, 0, sizeof(cgc));
-+ memset(&sense, 0, sizeof(sense));
-+ memset(&buffer, 0, sizeof(buffer));
-+
-+ /* SET STREAMING command */
-+ cgc.cmd[0] = 0xb6;
-+ /* 28 byte parameter list length */
-+ cgc.cmd[10] = 28;
-+ cgc.sense = &sense;
-+ cgc.buffer = buffer;
-+ cgc.buflen = sizeof(buffer);
-+ cgc.data_direction = CGC_DATA_WRITE;
-+
-+ buffer[8] = 0xff;
-+ buffer[9] = 0xff;
-+ buffer[10] = 0xff;
-+ buffer[11] = 0xff;
-+
-+ buffer[15] = 177*speed;
-+ buffer[18] = 0x03;
-+ buffer[19] = 0xE8;
-+
-+ buffer[23] = 177*speed;
-+ buffer[26] = 0x03;
-+ buffer[27] = 0xE8;
-+
-+ if(ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0)
-+ {
-+#ifdef DVDSPEED_STANDALONE
-+ printf("OK\n");
-+#endif
-+ return 0;
-+ }
-+ else
-+ {
-+#ifdef DVDSPEED_STANDALONE
-+ fprintf(stderr, "Error!\n");
-+ dump_sense(cgc.cmd, cgc.sense);
-+#endif
-+ return -1;
-+ }
-+}
-+
-+#ifdef DVDSPEED_STANDALONE
-+/* main()... should I explain? */
-+int main(int argc, char *argv[])
-+{
-+ int c;
-+ int speed = 0;
-+ int fd;
-+
-+ if(argc != 3)
-+ {
-+ printf("dvdspeed - use SET STREAMING command to set the speed
of DVD-drives\n");
-+ printf("(c) 2004 Thomas Fritzsche, this version (restructure,
help text) prepared by Thomas Orgis\n");
-+ printf("free use under the GPL2, no warranties of any
kind\n\n");
-+ printf("\tusage: dvdspeed <speed> <device>\n\n");
-+ printf("\texample: dvdspeed 8 /dev/hdc\n");
-+ printf("Makes my media box more calm and me happier during
dvd movie watching.\n\n");
-+ printf("This tool may be necessary for (newer) drives that
don't apply the CDROM speed setting of hdparm to DVDs.\n");
-+ printf("One example is my NEC ND-4550, while the ND-1100A
applied the hdparm CDROM speed setting to DVDs as well.\n");
-+ exit(-1);
-+ }
-+
-+ speed = atoi(argv[1]);
-+ fd = open(argv[2], O_RDONLY | O_NONBLOCK);
-+ return set_dvd_speed(fd, speed);
-+}
-+#endif
-diff -ruN hdparm-8.9/dvdspeed.h hdparm-8.9-dvd/dvdspeed.h
---- hdparm-8.9/dvdspeed.h 1970-01-01 01:00:00.000000000 +0100
-+++ hdparm-8.9-dvd/dvdspeed.h 2008-08-08 23:05:20.000000000 +0200
-@@ -0,0 +1 @@
-+int set_dvd_speed(int fd, int speed);
-diff -ruN hdparm-8.9/hdparm.c hdparm-8.9-dvd/hdparm.c
---- hdparm-8.9/hdparm.c 2008-06-17 01:39:34.000000000 +0200
-+++ hdparm-8.9-dvd/hdparm.c 2008-08-08 23:12:08.000000000 +0200
-@@ -21,6 +21,7 @@
- #include <asm/byteorder.h>
-
- #include "hdparm.h"
-+#include "dvdspeed.h"
- #include "sgio.h"
-
- extern const char *minor_str[];
-@@ -1275,6 +1276,12 @@
- err = errno;
- perror(" CDROM_SELECT_SPEED failed");
- }
-+ /* A fix? Applying SET STREAMING command. */
-+ printf("also setting dvd streaming speed to %d\n",
cdromspeed);
-+ if(set_dvd_speed(fd, cdromspeed) != 0)
-+ {
-+ perror(" dvd speed setting failed");
-+ }
- }
- if (set_acoustic) {
- __u8 args[4];
-diff -ruN hdparm-8.9/Makefile hdparm-8.9-dvd/Makefile
---- hdparm-8.9/Makefile 2008-06-02 18:58:29.000000000 +0200
-+++ hdparm-8.9-dvd/Makefile 2008-08-08 23:11:42.000000000 +0200
-@@ -23,7 +23,7 @@
- INSTALL_DIR = $(INSTALL) -m 755 -d
- INSTALL_PROGRAM = $(INSTALL)
-
--OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fibmap.o
-+OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fibmap.o dvdspeed.o
-
- all: hdparm
-
-@@ -37,6 +37,8 @@
-
- identify.o: hdparm.h
-
-+dvdspeed.o: dvdspeed.c
-+
- sgio.o: sgio.c sgio.h hdparm.h
-
- install: all hdparm.8
diff --git a/disk/hdparm/hdparm-dvdspeed.patch
b/disk/hdparm/hdparm-dvdspeed.patch
new file mode 100644
index 0000000..df4d87c
--- /dev/null
+++ b/disk/hdparm/hdparm-dvdspeed.patch
@@ -0,0 +1,183 @@
+diff -Naur hdparm-9.3/dvdspeed.c hdparm-9.3-dvd/dvdspeed.c
+--- hdparm-9.3/dvdspeed.c 1970-01-01 01:00:00.000000000 +0100
++++ hdparm-9.3-dvd/dvdspeed.c 2008-12-02 23:22:55.000000000 +0100
+@@ -0,0 +1,129 @@
++#include <stdio.h>
++#include <stdlib.h>
++#include <fcntl.h>
++#include <string.h>
++#include <unistd.h>
++#include <sys/ioctl.h>
++#include <linux/cdrom.h>
++/*
++ * dvdspeed - use SET STREAMING command to set the speed of DVD-drives
++ *
++ *
++ * Copyright (c) 2004 Thomas Fritzsche <tf AT noto.de>
++ * A bit mangled in 2006 and 2008 by Thomas Orgis <thomas AT orgis.org>
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ *
++ */
++
++#include "dvdspeed.h" /* just to silence a stupid warning */
++
++#ifdef DVDSPEED_STANDALONE
++/* Just error handling. */
++void dump_sense(unsigned char *cdb, struct request_sense *sense)
++{
++ int i;
++ printf("Command failed: ");
++
++ for (i=0; i<12; i++)
++ fprintf(stderr, "%02x ", cdb[i]);
++
++ if(sense)
++ {
++ fprintf(stderr, " - sense: %02x.%02x.%02x\n",
++ sense->sense_key, sense->asc, sense->ascq);
++ }
++ else
++ {
++ fprintf(stderr, ", no sense\n");
++ }
++}
++#endif
++
++/* This is the interesting code. */
++int set_dvd_speed(int fd, int speed)
++{
++ struct cdrom_generic_command cgc;
++ struct request_sense sense;
++ unsigned char buffer[28];
++ memset(&cgc, 0, sizeof(cgc));
++ memset(&sense, 0, sizeof(sense));
++ memset(&buffer, 0, sizeof(buffer));
++
++ /* SET STREAMING command */
++ cgc.cmd[0] = 0xb6;
++ /* 28 byte parameter list length */
++ cgc.cmd[10] = 28;
++ cgc.sense = &sense;
++ cgc.buffer = buffer;
++ cgc.buflen = sizeof(buffer);
++ cgc.data_direction = CGC_DATA_WRITE;
++
++ buffer[8] = 0xff;
++ buffer[9] = 0xff;
++ buffer[10] = 0xff;
++ buffer[11] = 0xff;
++
++ buffer[15] = 177*speed;
++ buffer[18] = 0x03;
++ buffer[19] = 0xE8;
++
++ buffer[23] = 177*speed;
++ buffer[26] = 0x03;
++ buffer[27] = 0xE8;
++
++ if(ioctl(fd, CDROM_SEND_PACKET, &cgc) == 0)
++ {
++ #ifdef DVDSPEED_STANDALONE
++ printf("OK\n");
++ #endif
++ return 0;
++ }
++ else
++ {
++ #ifdef DVDSPEED_STANDALONE
++ fprintf(stderr, "Error!\n");
++ dump_sense(cgc.cmd, cgc.sense);
++ #endif
++ return -1;
++ }
++}
++
++#ifdef DVDSPEED_STANDALONE
++/* main()... should I explain? */
++int main(int argc, char *argv[])
++{
++ int c;
++ int speed = 0;
++ int fd;
++
++ if(argc != 3)
++ {
++ printf("dvdspeed - use SET STREAMING command to set the speed
of DVD-drives\n");
++ printf("(c) 2004 Thomas Fritzsche, this version (restructure,
help text) prepared by Thomas Orgis\n");
++ printf("free use under the GPL2, no warranties of any
kind\n\n");
++ printf("\tusage: dvdspeed <speed> <device>\n\n");
++ printf("\texample: dvdspeed 8 /dev/hdc\n");
++ printf("Makes my media box more calm and me happier during
dvd movie watching.\n\n");
++ printf("This tool may be necessary for (newer) drives that
don't apply the CDROM speed setting of hdparm to DVDs.\n");
++ printf("One example is my NEC ND-4550, while the ND-1100A
applied the hdparm CDROM speed setting to DVDs as well.\n");
++ exit(-1);
++ }
++
++ speed = atoi(argv[1]);
++ fd = open(argv[2], O_RDONLY | O_NONBLOCK);
++ return set_dvd_speed(fd, speed);
++}
++#endif
+diff -Naur hdparm-9.3/dvdspeed.h hdparm-9.3-dvd/dvdspeed.h
+--- hdparm-9.3/dvdspeed.h 1970-01-01 01:00:00.000000000 +0100
++++ hdparm-9.3-dvd/dvdspeed.h 2008-12-02 23:18:12.000000000 +0100
+@@ -0,0 +1 @@
++int set_dvd_speed(int fd, int speed);
+diff -Naur hdparm-9.3/hdparm.c hdparm-9.3-dvd/hdparm.c
+--- hdparm-9.3/hdparm.c 2008-11-04 18:58:32.000000000 +0100
++++ hdparm-9.3-dvd/hdparm.c 2008-12-02 23:17:25.000000000 +0100
+@@ -21,6 +21,7 @@
+ #include <asm/byteorder.h>
+
+ #include "hdparm.h"
++#include "dvdspeed.h"
+ #include "sgio.h"
+
+ extern const char *minor_str[];
+@@ -1369,6 +1370,12 @@
+ err = errno;
+ perror(" CDROM_SELECT_SPEED failed");
+ }
++ /* A fix? Applying SET STREAMING command. */
++ printf("also setting dvd streaming speed to %d\n",
cdromspeed);
++ if(set_dvd_speed(fd, cdromspeed) != 0)
++ {
++ perror(" dvd speed setting failed");
++ }
+ }
+ if (set_acoustic) {
+ __u8 args[4];
+diff -Naur hdparm-9.3/Makefile hdparm-9.3-dvd/Makefile
+--- hdparm-9.3/Makefile 2008-11-02 23:18:05.000000000 +0100
++++ hdparm-9.3-dvd/Makefile 2008-12-02 23:15:28.000000000 +0100
+@@ -23,7 +23,7 @@
+ INSTALL_DIR = $(INSTALL) -m 755 -d
+ INSTALL_PROGRAM = $(INSTALL)
+
+-OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fibmap.o fwdownload.o
++OBJS = hdparm.o identify.o sgio.o sysfs.o geom.o fibmap.o fwdownload.o
dvdspeed.o
+
+ all: hdparm
+
+@@ -33,6 +33,8 @@
+
+ hdparm.o: hdparm.h sgio.h
+
++dvdspeed.o: dvdspeed.c
++
+ identify.o: hdparm.h
+
+ sgio.o: sgio.c sgio.h hdparm.h



  • [SM-Commit] GIT changes to master grimoire by Julien ROZO (92509e825d4d3bb873811350387c037ebe7fefa3), Julien ROZO, 12/02/2008

Archive powered by MHonArc 2.6.24.

Top of Page