diff --git a/debian/patches/000-No_absolute_pathes_in_examples.dpatch b/debian/patches/000-No_absolute_pathes_in_examples.patch old mode 100755 new mode 100644 similarity index 63% rename from debian/patches/000-No_absolute_pathes_in_examples.dpatch rename to debian/patches/000-No_absolute_pathes_in_examples.patch index 2200bbc..88fbc49 --- a/debian/patches/000-No_absolute_pathes_in_examples.dpatch +++ b/debian/patches/000-No_absolute_pathes_in_examples.patch @@ -1,15 +1,8 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 000-No_absolute_pathes_in_examples.dpatch -## by Adam Cécile (Le_Vert) -## -## DP: Drop all absolute pathes to binaries in megarpt and megasasrpt -## DP: example scripts. - -@DPATCH@ - -diff -u megactl-0.4.1/src/megarpt megactl-0.4.1/src.new/megarpt ---- megactl-0.4.1/src/megarpt 2007-08-21 09:19:53.000000000 +0200 -+++ megactl-0.4.1/src.new/megarpt 2007-09-26 11:07:05.584181968 +0200 +Author: +Description: Drop all absolute pathes to binaries in megarpt and megasasrpt +example scripts. +--- megactl.orig/src/megarpt ++++ megactl/src/megarpt @@ -9,7 +9,7 @@ # Date: 2007/08/20 @@ -19,7 +12,7 @@ diff -u megactl-0.4.1/src/megarpt megactl-0.4.1/src.new/megarpt DEVICE=/dev/megadev0 DEVICENAME=megadev DEVICEPERM=644 -@@ -32,8 +32,8 @@ +@@ -32,8 +32,8 @@ fi if [ -e "$DEVICE" ]; then WARN= @@ -30,7 +23,7 @@ diff -u megactl-0.4.1/src/megarpt megactl-0.4.1/src.new/megarpt HC=/tmp/megactl.$$ $MEGACTL -vH > $HC 2>/dev/null -@@ -59,7 +59,7 @@ +@@ -59,7 +59,7 @@ if [ -e "$DEVICE" ]; then echo "$ME version: $VERSION" echo "megactl version: $MEGACTLVERSION" ) 2>/dev/null | @@ -39,10 +32,8 @@ diff -u megactl-0.4.1/src/megarpt megactl-0.4.1/src.new/megarpt rm -f $HC fi - -diff -u megactl-0.4.1/src/megasasrpt megactl-0.4.1/src.new/megasasrpt ---- megactl-0.4.1/src/megasasrpt 2007-08-21 09:19:53.000000000 +0200 -+++ megactl-0.4.1/src.new/megasasrpt 2007-09-26 11:07:05.584181968 +0200 +--- megactl.orig/src/megasasrpt ++++ megactl/src/megasasrpt @@ -9,7 +9,7 @@ # Date: 2007/08/20 @@ -52,7 +43,7 @@ diff -u megactl-0.4.1/src/megasasrpt megactl-0.4.1/src.new/megasasrpt DEVICE=/dev/megaraid_sas_ioctl_node DEVICENAME=megaraid_sas_ioctl DEVICEPERM=400 -@@ -32,8 +32,8 @@ +@@ -32,8 +32,8 @@ fi if [ -e "$DEVICE" ]; then WARN= @@ -63,7 +54,7 @@ diff -u megactl-0.4.1/src/megasasrpt megactl-0.4.1/src.new/megasasrpt HC=/tmp/megactl.$$ $MEGACTL -vH > $HC 2>/dev/null -@@ -59,7 +59,7 @@ +@@ -59,7 +59,7 @@ if [ -e "$DEVICE" ]; then echo "$ME version: $VERSION" echo "megactl version: $MEGACTLVERSION" ) 2>/dev/null | diff --git a/debian/patches/001-Drop_obsolete_asm_user.h.dpatch b/debian/patches/001-Drop_obsolete_asm_user.h.patch old mode 100755 new mode 100644 similarity index 66% rename from debian/patches/001-Drop_obsolete_asm_user.h.dpatch rename to debian/patches/001-Drop_obsolete_asm_user.h.patch index eda81e2..6e73fb4 --- a/debian/patches/001-Drop_obsolete_asm_user.h.dpatch +++ b/debian/patches/001-Drop_obsolete_asm_user.h.patch @@ -1,15 +1,8 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 001-Drop_obsolete_asm_user.h.dpatch -## by wschlich (Gentoo) -## -## DP: Stolen on Gentoo VCS, thanks a lot Gentoo guys :) -## DP: http://sources.gentoo.org:80/viewcvs.py/gentoo-x86/sys-block/megactl/files/ - -@DPATCH@ -diff -urN megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c ---- megactl-0.4.1.orig/src/megatrace.c 2007-08-21 09:19:53.000000000 +0200 -+++ megactl-0.4.1/src/megatrace.c 2008-02-10 21:27:24.416919438 +0100 -@@ -49,7 +49,7 @@ +Author: +Description: Stolen on Gentoo VCS, thanks a lot Gentoo guys :) +--- megactl.orig/src/megatrace.c ++++ megactl/src/megatrace.c +@@ -49,7 +49,7 @@ Fixes for 64-bit systems. #include #include #include @@ -18,7 +11,7 @@ diff -urN megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c #include #include #include -@@ -250,7 +250,7 @@ +@@ -250,7 +250,7 @@ int main (int argc, char **argv, char ** len = sizeof buf; if (printregs) diff --git a/debian/patches/002-No_enclosure_support.dpatch b/debian/patches/002-No_enclosure_support.dpatch deleted file mode 100755 index 630d912..0000000 --- a/debian/patches/002-No_enclosure_support.dpatch +++ /dev/null @@ -1,75 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 002-No_enclosure_support by Pat Suwalski -## -## DP: The root of the problem is that a lot of the logic behind building -## DP: the enclosure map and printing the disk list compares directly the -## DP: adapter channel list with the physical disk enclosure number, like so: -## DP: -## DP: if (device->device[k].enclosure == a->channel[j]) -## DP: -## DP: The problem is that one is a uint16_t and the other is a uint8_t. -## DP: When an enclosure is not present, the value comes back as all-ones. -## DP: So, the code was trying in numerous places to compare 0xffff with -## DP: 0xff. Adjusting the struct so both members are uint16_t fixes this. -## DP: -## DP: The patch also changes the output when no enclosure is present to -## DP: put an asterisk as the enclosure ID in the output. -## DP: The output on the same machine now looks like this: -## DP: -## DP: a0 PERC 5/i Integrated encl:1 ldrv:2 batt:good -## DP: a0d0 19GiB RAID 5 1x4 DEGRADED -## DP: a0d1 5567GiB RAID 5 1x4 DEGRADED -## DP: a0e*s0 1863GiB a0d0+ online errs: media:0 other:28 -## DP: a0e*s1 1863GiB a0d0+ rebuild errs: media:0 other:26 -## DP: a0e*s2 1863GiB a0d0+ online errs: media:0 other:28 -## DP: a0e*s3 1863GiB a0d0+ online errs: media:0 other:28 - -@DPATCH@ -Index: adapter.c -=================================================================== ---- a/src/adapter.c (revision 6) -+++ b/src/adapter.c (working copy) -@@ -192,7 +192,10 @@ - d->channel = info->enclosure; - d->id = info->slot; - -- snprintf (d->name, sizeof (d->name), "%se%us%u", a->name, d->channel, d->id); -+ if (d->channel == DISK_NOENC) -+ snprintf (d->name, sizeof (d->name), "%se*s%u", a->name, d->id); -+ else -+ snprintf (d->name, sizeof (d->name), "%se%us%u", a->name, d->channel, d->id); - - d->inquiry = info->inquiry.inq; - strncpy (d->vendor, d->inquiry.vendor_info, sizeof (d->vendor) - 1); -@@ -691,6 +694,7 @@ - for (j = 0; j < a->num_channels; ++j) - if (device->device[k].enclosure == a->channel[j]) - break; -+ - if (j < a->num_channels) - continue; - -Index: mega.h -=================================================================== ---- a/src/mega.h (revision 6) -+++ b/src/mega.h (working copy) -@@ -114,7 +114,10 @@ - #define SCSI_SELFTEST_FOREGROUND_SHORT 0x05 - #define SCSI_SELFTEST_FOREGROUND_LONG 0x06 - -+/* Drives without enclosure report this as the enclosure ID */ -+#define DISK_NOENC 0xffff - -+ - /* megaraid2 header file gets this wrong. */ - typedef struct { - uint8_t max_commands; -@@ -545,7 +548,7 @@ - uint16_t dram_size; /* size of DRAM in MB */ - uint16_t rebuild_rate; /* rebuild rate as percentage */ - uint16_t num_channels; /* number of channels or enclosures */ -- uint8_t *channel; /* channel/enclosure map */ -+ uint16_t *channel; /* channel/enclosure map */ - uint16_t num_physicals; - struct physical_drive_info *physical; - struct physical_drive_info **physical_list; /* ordered list of physical devices */ diff --git a/debian/patches/002-No_enclosure_support.patch b/debian/patches/002-No_enclosure_support.patch new file mode 100644 index 0000000..ee694c7 --- /dev/null +++ b/debian/patches/002-No_enclosure_support.patch @@ -0,0 +1,66 @@ +Author: +Description: The root of the problem is that a lot of the logic behind building +the enclosure map and printing the disk list compares directly the +adapter channel list with the physical disk enclosure number, like so: + +if (device->device[k].enclosure == a->channel[j]) + +The problem is that one is a uint16_t and the other is a uint8_t. +When an enclosure is not present, the value comes back as all-ones. +So, the code was trying in numerous places to compare 0xffff with +0xff. Adjusting the struct so both members are uint16_t fixes this. + +The patch also changes the output when no enclosure is present to +put an asterisk as the enclosure ID in the output. +The output on the same machine now looks like this: + +a0 PERC 5/i Integrated encl:1 ldrv:2 batt:good +a0d0 19GiB RAID 5 1x4 DEGRADED +a0d1 5567GiB RAID 5 1x4 DEGRADED +a0e*s0 1863GiB a0d0+ online errs: media:0 other:28 +a0e*s1 1863GiB a0d0+ rebuild errs: media:0 other:26 +a0e*s2 1863GiB a0d0+ online errs: media:0 other:28 +a0e*s3 1863GiB a0d0+ online errs: media:0 other:28 +--- megactl.orig/src/adapter.c ++++ megactl/src/adapter.c +@@ -192,7 +192,10 @@ struct physical_drive_info *getPhysicalD + d->channel = info->enclosure; + d->id = info->slot; + +- snprintf (d->name, sizeof (d->name), "%se%us%u", a->name, d->channel, d->id); ++ if (d->channel == DISK_NOENC) ++ snprintf (d->name, sizeof (d->name), "%se*s%u", a->name, d->id); ++ else ++ snprintf (d->name, sizeof (d->name), "%se%us%u", a->name, d->channel, d->id); + + d->inquiry = info->inquiry.inq; + strncpy (d->vendor, d->inquiry.vendor_info, sizeof (d->vendor) - 1); +@@ -691,6 +694,7 @@ static char *getAdapterConfig5 (struct a + for (j = 0; j < a->num_channels; ++j) + if (device->device[k].enclosure == a->channel[j]) + break; ++ + if (j < a->num_channels) + continue; + +--- megactl.orig/src/mega.h ++++ megactl/src/mega.h +@@ -114,6 +114,9 @@ struct list_head { + #define SCSI_SELFTEST_FOREGROUND_SHORT 0x05 + #define SCSI_SELFTEST_FOREGROUND_LONG 0x06 + ++/* Drives without enclosure report this as the enclosure ID */ ++#define DISK_NOENC 0xffff ++ + + /* megaraid2 header file gets this wrong. */ + typedef struct { +@@ -545,7 +548,7 @@ struct adapter_config + uint16_t dram_size; /* size of DRAM in MB */ + uint16_t rebuild_rate; /* rebuild rate as percentage */ + uint16_t num_channels; /* number of channels or enclosures */ +- uint8_t *channel; /* channel/enclosure map */ ++ uint16_t *channel; /* channel/enclosure map */ + uint16_t num_physicals; + struct physical_drive_info *physical; + struct physical_drive_info **physical_list; /* ordered list of physical devices */ diff --git a/debian/patches/003-Fix_disk_enumeration_loop.dpatch b/debian/patches/003-Fix_disk_enumeration_loop.patch old mode 100755 new mode 100644 similarity index 52% rename from debian/patches/003-Fix_disk_enumeration_loop.dpatch rename to debian/patches/003-Fix_disk_enumeration_loop.patch index 6ff80f3..0b823f7 --- a/debian/patches/003-Fix_disk_enumeration_loop.dpatch +++ b/debian/patches/003-Fix_disk_enumeration_loop.patch @@ -1,35 +1,20 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 003-Fix_disk_enumeration_loop.dpatch by Pat Suwalski -## -## DP: When my controller has a failed disk, megasasctl fails. -## DP: -## DP: I have tracked the problem down to a bad assumption, that the various -## DP: disk enumeration loops would use the number of currently online drives -## DP: as the basis for the iterator. -## DP: -## DP: This number decreases when a disk fails. It is not noticeable in many -## DP: cases, because on many some controllers pinfo->pd_present_count is -## DP: one higher than the actual number of disks. -## DP: However, the same situation would be encountered in a RAID1 system with -## DP: two failed disks. -## DP: -## DP: The attached one-line patch uses the number of ports -## DP: on the controller as the basis. +Author: Pat Suwalski +Description: When my controller has a failed disk, megasasctl fails. -@DPATCH@ +I have tracked the problem down to a bad assumption, that the various +disk enumeration loops would use the number of currently online drives +as the basis for the iterator. -This patch fixes a segfault based on an incorrect assumption that the number -of physical drives to loop over is the number of currently online drives -connected to the controller. This change plays it safe and makes it use the -number of ports on the controller, with a fallback for the worst case -scenario. +This number decreases when a disk fails. It is not noticeable in many +one higher than the actual number of disks. +However, the same situation would be encountered in a RAID1 system with +two failed disks. -Pat Suwalski - -diff -ur megactl-code/src/adapter.c megactl-code2/src/adapter.c ---- a/src/adapter.c 2014-01-20 11:13:48.114598462 -0500 -+++ b/src/adapter.c 2014-01-20 14:33:32.950851825 -0500 -@@ -706,7 +706,31 @@ +The attached one-line patch uses the number of ports +on the controller as the basis. +--- megactl.orig/src/adapter.c ++++ megactl/src/adapter.c +@@ -706,7 +706,31 @@ static char *getAdapterConfig5 (struct a } qsort (a->channel, a->num_channels, sizeof (*a->channel), cmpChannel); diff --git a/debian/patches/004-Fix_build_on_recent_distros.dpatch b/debian/patches/004-Fix_build_on_recent_distros.dpatch deleted file mode 100755 index 50491a7..0000000 --- a/debian/patches/004-Fix_build_on_recent_distros.dpatch +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 004-Fix_build_on_recent_distros.dpatch by Adam Cécile (Le_Vert) -## -## DP: SYS_madvise1 has been renamed to SYS_madvise a long time ago (btw, it's -## DP: not used anywhere) - -@DPATCH@ ---- a/src/callinfo.c 2007-08-21 08:47:29.000000000 +0200 -+++ b/src/callinfo.c 2014-01-21 22:51:59.788201043 +0100 -@@ -255,7 +255,7 @@ - { SYS_setfsgid32, 0, "setfsgid32" }, - { SYS_pivot_root, 0, "pivot_root" }, - { SYS_mincore, 0, "mincore" }, -- { SYS_madvise1, 0, "madvise1" }, -+ { SYS_madvise, 0, "madvise" }, - { SYS_getdents64, 0, "getdents64" }, - { SYS_fcntl64, 0, "fcntl64" }, - { 222, 0, NULL }, diff --git a/debian/patches/005-Makefile.dpatch b/debian/patches/005-Makefile.patch old mode 100755 new mode 100644 similarity index 59% rename from debian/patches/005-Makefile.dpatch rename to debian/patches/005-Makefile.patch index 196971f..7c86182 --- a/debian/patches/005-Makefile.dpatch +++ b/debian/patches/005-Makefile.patch @@ -1,13 +1,8 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 004-Makefile.dpatch by Mario Fetka (geos_one) -## -## DP: megatrace must be build with m32 on 64bit hosts -## DP: thx. to gentoo devs - -@DPATCH@ -diff -urN megactl-0.4.1.orig/src/Makefile megactl-0.4.1/src/Makefile ---- megactl-0.4.1.orig/src/Makefile 2007-08-21 09:19:53.000000000 +0200 -+++ megactl-0.4.1/src/Makefile 2009-11-21 12:30:44.242501898 +0100 +Author: Mario Fetka (geos_one) +Description: megatrace must be build with m32 on 64bit hosts +thx. to gentoo devs +--- megactl.orig/src/Makefile ++++ megactl/src/Makefile @@ -1,11 +1,17 @@ -SRCS= megactl.c adapter.c megaioctl.c megatrace.c callinfo.c dumpbytes.c logpage.c ntrim.c diff --git a/debian/patches/006-gcc-fixes.dpatch b/debian/patches/006-gcc-fixes.patch old mode 100755 new mode 100644 similarity index 66% rename from debian/patches/006-gcc-fixes.dpatch rename to debian/patches/006-gcc-fixes.patch index 6d5c0e1..0da9eec --- a/debian/patches/006-gcc-fixes.dpatch +++ b/debian/patches/006-gcc-fixes.patch @@ -1,14 +1,9 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 004-gcc-fixes.dpatch by Mario Fetka (geos_one) -## -## DP: get it build on newer kernels -## DP: thx. to gentoo devs - -@DPATCH@ -diff -Nuar --exclude '*.swp' --exclude '*.o' megactl-0.4.1.orig/src/callinfo.c megactl-0.4.1/src/callinfo.c ---- megactl-0.4.1.orig/src/callinfo.c 2007-08-21 00:19:53.000000000 -0700 -+++ megactl-0.4.1/src/callinfo.c 2014-07-13 22:05:06.585598812 -0700 -@@ -255,7 +255,12 @@ +Author: Mario Fetka (geos_one) +Description: get it build on newer kernels +thx. to gentoo devs +--- megactl.orig/src/callinfo.c ++++ megactl/src/callinfo.c +@@ -255,7 +255,12 @@ struct callinfo callinfo[] = { SYS_setfsgid32, 0, "setfsgid32" }, { SYS_pivot_root, 0, "pivot_root" }, { SYS_mincore, 0, "mincore" }, @@ -21,9 +16,8 @@ diff -Nuar --exclude '*.swp' --exclude '*.o' megactl-0.4.1.orig/src/callinfo.c m { SYS_getdents64, 0, "getdents64" }, { SYS_fcntl64, 0, "fcntl64" }, { 222, 0, NULL }, -diff -Nuar --exclude '*.swp' --exclude '*.o' megactl-0.4.1.orig/src/logpage.c megactl-0.4.1/src/logpage.c ---- megactl-0.4.1.orig/src/logpage.c 2007-08-21 00:19:53.000000000 -0700 -+++ megactl-0.4.1/src/logpage.c 2014-07-13 21:58:34.010848677 -0700 +--- megactl.orig/src/logpage.c ++++ megactl/src/logpage.c @@ -20,6 +20,8 @@ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ @@ -33,7 +27,7 @@ diff -Nuar --exclude '*.swp' --exclude '*.o' megactl-0.4.1.orig/src/logpage.c me #include "megaioctl.h" #include "logpage.h" -@@ -107,7 +109,7 @@ +@@ -107,7 +109,7 @@ static char *friendlySize (uint64_t b, c for (k = 0; (b >= 1024) && (k < sizeof (suffix) / sizeof (suffix[0]) - 1); ++k, b /= 1024) ; @@ -42,7 +36,7 @@ diff -Nuar --exclude '*.swp' --exclude '*.o' megactl-0.4.1.orig/src/logpage.c me return bytes; } -@@ -378,7 +380,7 @@ +@@ -378,7 +380,7 @@ void dumpLogPage (FILE *f, struct logDat default: result = "unknown result"; notice = 0; break; } if (verbosity > notice) diff --git a/debian/patches/007-tracefix.dpatch b/debian/patches/007-tracefix.patch old mode 100755 new mode 100644 similarity index 83% rename from debian/patches/007-tracefix.dpatch rename to debian/patches/007-tracefix.patch index 20887e0..8751581 --- a/debian/patches/007-tracefix.dpatch +++ b/debian/patches/007-tracefix.patch @@ -1,14 +1,9 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 004-tracefix.dpatch by Mario Fetka (geos_one) -## -## DP: megatrace fixup for 64bit systems -## DP: thx. to gentoo devs - -@DPATCH@ -diff -Nuar megactl-0.4.1.orig/src/megactl.c megactl-0.4.1/src/megactl.c ---- megactl-0.4.1.orig/src/megactl.c 2007-08-21 00:19:53.000000000 -0700 -+++ megactl-0.4.1/src/megactl.c 2014-07-14 11:15:14.538745305 -0700 -@@ -45,6 +45,9 @@ +Author: Mario Fetka (geos_one) +Description: megatrace fixup for 64bit systems +thx. to gentoo devs +--- megactl.orig/src/megactl.c ++++ megactl/src/megactl.c +@@ -45,6 +45,9 @@ Fixes for 64-bit systems. Currently buil ********************************************************************/ @@ -18,7 +13,7 @@ diff -Nuar megactl-0.4.1.orig/src/megactl.c megactl-0.4.1/src/megactl.c #include "mega.h" #include "megaioctl.h" #include "adapter.h" -@@ -207,7 +210,7 @@ +@@ -207,7 +210,7 @@ static char *friendlySize (uint64_t b, c for (k = 0; (b >= 1024) && (k < sizeof (suffix) / sizeof (suffix[0]) - 1); ++k, b /= 1024) ; @@ -27,7 +22,7 @@ diff -Nuar megactl-0.4.1.orig/src/megactl.c megactl-0.4.1/src/megactl.c return bytes; } -@@ -604,6 +607,8 @@ +@@ -604,6 +607,8 @@ int main (int argc, char **argv) fprintf (stderr, "megaraid driver version %x too old.\n", driverVersion); return 1; } @@ -36,10 +31,9 @@ diff -Nuar megactl-0.4.1.orig/src/megactl.c megactl-0.4.1/src/megactl.c #endif if (megaGetNumAdapters (fd, &numAdapters, sas) < 0) -diff -Nuar megactl-0.4.1.orig/src/megaioctl.c megactl-0.4.1/src/megaioctl.c ---- megactl-0.4.1.orig/src/megaioctl.c 2014-07-14 11:30:03.590781305 -0700 -+++ megactl-0.4.1/src/megaioctl.c 2014-07-14 11:31:36.410258930 -0700 -@@ -87,7 +87,11 @@ +--- megactl.orig/src/megaioctl.c ++++ megactl/src/megaioctl.c +@@ -87,7 +87,11 @@ static int oldCommand (struct mega_adapt m->cmd = cmd; m->opcode = opcode; m->subopcode = subopcode; @@ -51,7 +45,7 @@ diff -Nuar megactl-0.4.1.orig/src/megaioctl.c megactl-0.4.1/src/megaioctl.c if (data) memset (data, 0, len); -@@ -115,7 +119,11 @@ +@@ -115,7 +119,11 @@ static int newCommand (struct mega_adapt m->cmd = cmd; m->opcode = opcode; m->subopcode = subopcode; @@ -63,7 +57,7 @@ diff -Nuar megactl-0.4.1.orig/src/megaioctl.c megactl-0.4.1/src/megaioctl.c if (data) memset (data, 0, len); -@@ -178,11 +186,19 @@ +@@ -178,11 +186,19 @@ static int passthruCommand (struct mega_ u.ui.fcs.adapno = MKADAP(adapter->adapno); u.data = data; m->cmd = MBOXCMD_PASSTHRU; @@ -84,10 +78,9 @@ diff -Nuar megactl-0.4.1.orig/src/megaioctl.c megactl-0.4.1/src/megaioctl.c p->dataxferlen = len; p->scsistatus = 239; /* HMMM */ memcpy (p->cdb, cdb, cdblen); -diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c ---- megactl-0.4.1.orig/src/megatrace.c 2014-07-14 01:31:47.704312799 -0700 -+++ megactl-0.4.1/src/megatrace.c 2014-07-14 11:37:20.570755832 -0700 -@@ -170,7 +170,11 @@ +--- megactl.orig/src/megatrace.c ++++ megactl/src/megatrace.c +@@ -170,7 +170,11 @@ int main (int argc, char **argv, char ** fprintf (stderr, "ptrace:getregs: %s\n", strerror (errno)); exit (1); } @@ -99,7 +92,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c /*printthis = call == SYS_ioctl;*/ if (state == INBOUND) -@@ -188,18 +192,30 @@ +@@ -188,18 +192,30 @@ int main (int argc, char **argv, char ** { if ((call < 0) || (call > callmax) || (callinfo[call].name == NULL)) { @@ -130,7 +123,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c if (rv < 0) { if (printcalls || printthis) -@@ -219,16 +235,22 @@ +@@ -219,16 +235,22 @@ int main (int argc, char **argv, char ** unsigned int len = 16; unsigned char buf[65536]; @@ -155,7 +148,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c switch (iocdir) { -@@ -240,7 +262,11 @@ +@@ -240,7 +262,11 @@ int main (int argc, char **argv, char ** fprintf (stderr, "%s: ioctl(%ld, _IOC(\"%s\",'%c',0x%02x,0x%02x), 0x%08lx)", tbuf, fd, iocdirname, ioctype, iocnr, iocsize, arg); if (state == OUTBOUND) @@ -167,7 +160,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c if (getenv ("LOG_INBOUND")) fprintf (stderr, "\n"); -@@ -249,10 +275,18 @@ +@@ -249,10 +275,18 @@ int main (int argc, char **argv, char ** if (len > sizeof buf) len = sizeof buf; @@ -186,7 +179,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c if ((ioctype == 'm') && (iocnr == 0) && (iocsize == sizeof (struct uioctl_t))) { -@@ -405,7 +439,11 @@ +@@ -405,7 +439,11 @@ if ((f->opcode == 0x05010000) && (state else { fprintf (stderr, " host %d, off 0x%04x, count %d, sense_off 0x%08x, sense_len 0x%08x\n", iocp->host_no, iocp->sgl_off, iocp->sge_count, iocp->sense_off, iocp->sense_len); @@ -198,7 +191,7 @@ diff -Nuar megactl-0.4.1.orig/src/megatrace.c megactl-0.4.1/src/megatrace.c } if (log) { -@@ -427,23 +465,38 @@ +@@ -427,23 +465,38 @@ if ((f->opcode == 0x05010000) && (state } else { diff --git a/debian/patches/008-device_id.dpatch b/debian/patches/008-device_id.patch old mode 100755 new mode 100644 similarity index 60% rename from debian/patches/008-device_id.dpatch rename to debian/patches/008-device_id.patch index 7a6074a..fc92704 --- a/debian/patches/008-device_id.dpatch +++ b/debian/patches/008-device_id.patch @@ -1,13 +1,9 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 008-device_id.dpatch by Mario Fetka (geos_one) -## -## DP: add device_id to output -## DP: thx. to gentoo devs - -@DPATCH@ ---- megactl/src/adapter.c.orig 2017-04-22 17:15:55.068000000 +0200 -+++ megactl/src/adapter.c 2017-04-22 17:17:17.624000000 +0200 -@@ -193,9 +193,9 @@ +Author: Mario Fetka (geos_one) +Description: add device_id to output +thx. to gentoo devs +--- megactl.orig/src/adapter.c ++++ megactl/src/adapter.c +@@ -193,9 +193,9 @@ struct physical_drive_info *getPhysicalD d->id = info->slot; if (d->channel == DISK_NOENC) diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..7b15977 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,8 @@ +000-No_absolute_pathes_in_examples.patch +001-Drop_obsolete_asm_user.h.patch +002-No_enclosure_support.patch +003-Fix_disk_enumeration_loop.patch +005-Makefile.patch +006-gcc-fixes.patch +007-tracefix.patch +008-device_id.patch