Import Debian changes 0.4.5-1
megactl (0.4.5-1) unstable; urgency=medium
.
[ Petter Reinholdtsen ]
* New upstream version 0.4.5
- Dropped all patches now applied upstream.
.
megactl (0.4.4-4) unstable; urgency=medium
.
* Fixed typo in patch metadata.
* Added 0040-hardening.patch to use CPPFLAGS for hardening during build.
.
megactl (0.4.4-3) unstable; urgency=medium
.
[ Petter Reinholdtsen ]
* Added some patches fetched from upstream to improve appstrea
metainfo and compiler warnings.
* Updated Standards-Version from 4.6.2 to 4.7.0.
.
megactl (0.4.4-2) unstable; urgency=medium
.
* Description: mention megacli. Reformat. Closes: #1069175.
.
megactl (0.4.4-1) unstable; urgency=medium
.
* New upstream version 0.4.4
* Drop applied patches
.
megactl (0.4.3+git20240307.6b1fdab-1) unstable; urgency=medium
.
* Initial release (Closes: #1065322).
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 000-No_absolute_pathes_in_examples.dpatch
|
||||
## by Adam Cécile (Le_Vert) <gandalf@le-vert.net>
|
||||
##
|
||||
## 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
|
||||
@@ -9,7 +9,7 @@
|
||||
# Date: 2007/08/20
|
||||
|
||||
VERSION='0.3'
|
||||
-MEGACTL=/root/megactl
|
||||
+MEGACTL=/usr/sbin/megactl
|
||||
DEVICE=/dev/megadev0
|
||||
DEVICENAME=megadev
|
||||
DEVICEPERM=644
|
||||
@@ -32,8 +32,8 @@
|
||||
if [ -e "$DEVICE" ]; then
|
||||
|
||||
WARN=
|
||||
- HOST=`/bin/uname -n`
|
||||
- DATE=`/bin/date '+%Y/%m/%d %H:%M:%S %Z'`
|
||||
+ HOST=`uname -n`
|
||||
+ DATE=`date '+%Y/%m/%d %H:%M:%S %Z'`
|
||||
HC=/tmp/megactl.$$
|
||||
|
||||
$MEGACTL -vH > $HC 2>/dev/null
|
||||
@@ -59,7 +59,7 @@
|
||||
echo "$ME version: $VERSION"
|
||||
echo "megactl version: $MEGACTLVERSION"
|
||||
) 2>/dev/null |
|
||||
- /bin/mail -s "RAID report:$WARN $HOST $DATE" root
|
||||
+ mail -s "RAID report:$WARN $HOST $DATE" root
|
||||
|
||||
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
|
||||
@@ -9,7 +9,7 @@
|
||||
# Date: 2007/08/20
|
||||
|
||||
VERSION='0.3'
|
||||
-MEGACTL=/root/megasasctl
|
||||
+MEGACTL=/usr/sbin/megasasctl
|
||||
DEVICE=/dev/megaraid_sas_ioctl_node
|
||||
DEVICENAME=megaraid_sas_ioctl
|
||||
DEVICEPERM=400
|
||||
@@ -32,8 +32,8 @@
|
||||
if [ -e "$DEVICE" ]; then
|
||||
|
||||
WARN=
|
||||
- HOST=`/bin/uname -n`
|
||||
- DATE=`/bin/date '+%Y/%m/%d %H:%M:%S %Z'`
|
||||
+ HOST=`uname -n`
|
||||
+ DATE=`date '+%Y/%m/%d %H:%M:%S %Z'`
|
||||
HC=/tmp/megactl.$$
|
||||
|
||||
$MEGACTL -vH > $HC 2>/dev/null
|
||||
@@ -59,7 +59,7 @@
|
||||
echo "$ME version: $VERSION"
|
||||
echo "megactl version: $MEGACTLVERSION"
|
||||
) 2>/dev/null |
|
||||
- /bin/mail -s "RAID report:$WARN $HOST $DATE" root
|
||||
+ mail -s "RAID report:$WARN $HOST $DATE" root
|
||||
|
||||
rm -f $HC
|
||||
fi
|
||||
@@ -1,29 +0,0 @@
|
||||
#! /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 @@
|
||||
#include <signal.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/wait.h>
|
||||
-#include <asm/user.h>
|
||||
+#include <sys/user.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
@@ -250,7 +250,7 @@
|
||||
len = sizeof buf;
|
||||
|
||||
if (printregs)
|
||||
- fprintf (stderr, " ebx=%08lx ecx=%08lx edx=%08lx esi=%08lx edi=%08lx ebp=%08lx eax=%08lx ds=%04x __ds=%04x es=%04x __es=%04x fs=%04x __fs=%04x gs=%04x __gs=%04x orig_eax=%08lx eip=%08lx cs=%04x __cs=%04x eflags=%08lx esp=%08lx ss=%04x __ss=%04x\n", r.ebx, r.ecx, r.edx, r.esi, r.edi, r.ebp, r.eax, r.ds, r.__ds, r.es, r.__es, r.fs, r.__fs, r.gs, r.__gs, r.orig_eax, r.eip, r.cs, r.__cs, r.eflags, r.esp, r.ss, r.__ss);
|
||||
+ fprintf (stderr, " ebx=%08lx ecx=%08lx edx=%08lx esi=%08lx edi=%08lx ebp=%08lx eax=%08lx xds=%08lx xes=%08lx xfs=%08lx xgs=%08lx orig_eax=%08lx eip=%08lx xcs=%08lx eflags=%08lx esp=%08lx xss=%08lx\n", r.ebx, r.ecx, r.edx, r.esi, r.edi, r.ebp, r.eax, r.xds, r.xes, r.xfs, r.xgs, r.orig_eax, r.eip, r.xcs, r.eflags, r.esp, r.xss);
|
||||
|
||||
copyout (buf, len, pid, r.edx);
|
||||
|
||||
75
debian/patches/002-No_enclosure_support.dpatch
vendored
75
debian/patches/002-No_enclosure_support.dpatch
vendored
@@ -1,75 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 002-No_enclosure_support by Pat Suwalski <pat@suwalski.net>
|
||||
##
|
||||
## 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 */
|
||||
@@ -1,64 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 003-Fix_disk_enumeration_loop.dpatch by Pat Suwalski <pat@suwalski.net>
|
||||
##
|
||||
## 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.
|
||||
|
||||
@DPATCH@
|
||||
|
||||
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.
|
||||
|
||||
Pat Suwalski <pat@suwalski.net>
|
||||
|
||||
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 @@
|
||||
}
|
||||
qsort (a->channel, a->num_channels, sizeof (*a->channel), cmpChannel);
|
||||
|
||||
- a->num_physicals = pinfo->pd_present_count;
|
||||
+ /* Some notes:
|
||||
+ Different meanings on different models.
|
||||
+ - FC_MAX_PHYSICAL_DEVICES used on older controllers, which is 256
|
||||
+ disks (overallocation)
|
||||
+ - pd_disk_present_count is number of working drives, not counting
|
||||
+ missing drives
|
||||
+ - pd_present_count is unclear. It is pd_disk_present_count + 1 on some
|
||||
+ controllers
|
||||
+ - device_interface.port_count contains number of physical ports on the
|
||||
+ controller
|
||||
+
|
||||
+ pd_present_count was used here, but in some controllers causes segfaults
|
||||
+ when there is a failed drive, and not enough space is allocated.
|
||||
+
|
||||
+ Since there cannot be more devices than there are ports, that is a safe
|
||||
+ number to set without going overboard.
|
||||
+ */
|
||||
+ a->num_physicals = pinfo->device_interface.port_count;
|
||||
+
|
||||
+ /* On some controllers, namely the PERC6e, the controller does not know
|
||||
+ how many ports there are in the enclosure. Fall back to the worst case
|
||||
+ scenario. */
|
||||
+ if (a->num_physicals < pinfo->pd_disk_present_count)
|
||||
+ a->num_physicals = FC_MAX_PHYSICAL_DEVICES;
|
||||
+
|
||||
if ((a->physical = (struct physical_drive_info *) malloc (a->num_physicals * sizeof (*a->physical))) == NULL)
|
||||
return "out of memory (physical drives)";
|
||||
memset (a->physical, 0, a->num_physicals * sizeof (*a->physical));
|
||||
@@ -1,18 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 004-Fix_build_on_recent_distros.dpatch by Adam Cécile (Le_Vert) <gandalf@le-vert.net>
|
||||
##
|
||||
## 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 },
|
||||
33
debian/patches/005-Makefile.dpatch
vendored
33
debian/patches/005-Makefile.dpatch
vendored
@@ -1,33 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 004-Makefile.dpatch by Mario Fetka (geos_one) <mario.fetka@gmail.com>
|
||||
##
|
||||
## 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
|
||||
@@ -1,11 +1,17 @@
|
||||
|
||||
-SRCS= megactl.c adapter.c megaioctl.c megatrace.c callinfo.c dumpbytes.c logpage.c ntrim.c
|
||||
+SRCS= megactl.c adapter.c megaioctl.c callinfo.c dumpbytes.c logpage.c ntrim.c
|
||||
INC= -I./schily -Iincludes-hack
|
||||
HDRS= mega.h adapter.h megaioctl.h callinfo.h logpage.h dumpbytes.h
|
||||
-ARCH= -m32
|
||||
-CFLAGS= -g -Wall $(INC) $(ARCH)
|
||||
-LDFLAGS= -g $(ARCH)
|
||||
-PROGRAMS= megactl megasasctl megatrace
|
||||
+ARCH?= -m32
|
||||
+CFLAGS?= -g -Wall
|
||||
+CFLAGS+= $(INC) $(ARCH)
|
||||
+LDFLAGS?= -g
|
||||
+LDFLAGS+= $(ARCH)
|
||||
+PROGRAMS= megactl megasasctl
|
||||
+ifeq ($(ARCH),-m32)
|
||||
+PROGRAMS+= megatrace
|
||||
+SRCS+= megatrace.c
|
||||
+endif
|
||||
|
||||
all: $(PROGRAMS)
|
||||
|
||||
53
debian/patches/006-gcc-fixes.dpatch
vendored
53
debian/patches/006-gcc-fixes.dpatch
vendored
@@ -1,53 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 004-gcc-fixes.dpatch by Mario Fetka (geos_one) <mario.fetka@gmail.com>
|
||||
##
|
||||
## 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 @@
|
||||
{ SYS_setfsgid32, 0, "setfsgid32" },
|
||||
{ SYS_pivot_root, 0, "pivot_root" },
|
||||
{ SYS_mincore, 0, "mincore" },
|
||||
+#ifdef SYS_madvise
|
||||
+ { SYS_madvise, 0, "madvise" },
|
||||
+#endif
|
||||
+#ifdef SYS_madvise1
|
||||
{ SYS_madvise1, 0, "madvise1" },
|
||||
+#endif
|
||||
{ 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
|
||||
@@ -20,6 +20,8 @@
|
||||
* Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
+#define __STDC_FORMAT_MACROS
|
||||
+#include <inttypes.h>
|
||||
|
||||
#include "megaioctl.h"
|
||||
#include "logpage.h"
|
||||
@@ -107,7 +109,7 @@
|
||||
|
||||
for (k = 0; (b >= 1024) && (k < sizeof (suffix) / sizeof (suffix[0]) - 1); ++k, b /= 1024)
|
||||
;
|
||||
- snprintf (bytes, sizeof bytes, "%3llu%s%s", b, suffix[k], unit);
|
||||
+ snprintf (bytes, sizeof bytes, "%3" PRIu64 "%s%s", b, suffix[k], unit);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@@ -378,7 +380,7 @@
|
||||
default: result = "unknown result"; notice = 0; break;
|
||||
}
|
||||
if (verbosity > notice)
|
||||
- fprintf (f, " %2d: timestamp %4ud%02uh: %10s %-30s seg:%u lba:%-8lld sk:%u asc:%u ascq:%u vs:%u\n", k, t->timestamp / 24, t->timestamp % 24, test, result, t->number, t->lba, t->sense_key, t->additional_sense_code, t->additional_sense_code_qualifier, t->vendor_specific);
|
||||
+ fprintf (f, " %2d: timestamp %4ud%02uh: %10s %-30s seg:%u lba:%-8"PRIu64" sk:%u asc:%u ascq:%u vs:%u\n", k, t->timestamp / 24, t->timestamp % 24, test, result, t->number, t->lba, t->sense_key, t->additional_sense_code, t->additional_sense_code_qualifier, t->vendor_specific);
|
||||
}
|
||||
}
|
||||
break;
|
||||
239
debian/patches/007-tracefix.dpatch
vendored
239
debian/patches/007-tracefix.dpatch
vendored
@@ -1,239 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 004-tracefix.dpatch by Mario Fetka (geos_one) <mario.fetka@gmail.com>
|
||||
##
|
||||
## 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 @@
|
||||
|
||||
********************************************************************/
|
||||
|
||||
+#define __STDC_FORMAT_MACROS
|
||||
+#include <inttypes.h>
|
||||
+
|
||||
#include "mega.h"
|
||||
#include "megaioctl.h"
|
||||
#include "adapter.h"
|
||||
@@ -207,7 +210,7 @@
|
||||
|
||||
for (k = 0; (b >= 1024) && (k < sizeof (suffix) / sizeof (suffix[0]) - 1); ++k, b /= 1024)
|
||||
;
|
||||
- snprintf (bytes, sizeof bytes, "%3llu%s%s", b, suffix[k], unit);
|
||||
+ snprintf (bytes, sizeof bytes, "%3"PRIu64"%s%s", b, suffix[k], unit);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
@@ -604,6 +607,8 @@
|
||||
fprintf (stderr, "megaraid driver version %x too old.\n", driverVersion);
|
||||
return 1;
|
||||
}
|
||||
+#else
|
||||
+ driverVersion = 0;
|
||||
#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 @@
|
||||
m->cmd = cmd;
|
||||
m->opcode = opcode;
|
||||
m->subopcode = subopcode;
|
||||
+#ifdef __x86_64__
|
||||
+ m->xferaddr = (uint64_t) data;
|
||||
+#else
|
||||
m->xferaddr = (uint32_t) data;
|
||||
+#endif
|
||||
if (data)
|
||||
memset (data, 0, len);
|
||||
|
||||
@@ -115,7 +119,11 @@
|
||||
m->cmd = cmd;
|
||||
m->opcode = opcode;
|
||||
m->subopcode = subopcode;
|
||||
+#ifdef __x86_64__
|
||||
+ m->xferaddr = (uint64_t) data;
|
||||
+#else
|
||||
m->xferaddr = (uint32_t) data;
|
||||
+#endif
|
||||
if (data)
|
||||
memset (data, 0, len);
|
||||
|
||||
@@ -178,11 +186,19 @@
|
||||
u.ui.fcs.adapno = MKADAP(adapter->adapno);
|
||||
u.data = data;
|
||||
m->cmd = MBOXCMD_PASSTHRU;
|
||||
+#ifdef __x86_64__
|
||||
+ m->xferaddr = (uint64_t) p;
|
||||
+#else
|
||||
m->xferaddr = (uint32_t) p;
|
||||
+#endif
|
||||
p->timeout = 3;
|
||||
p->ars = 1;
|
||||
p->target = target;
|
||||
- p->dataxferaddr = (uint32_t) data;
|
||||
+#ifdef __x86_64__
|
||||
+ p->dataxferaddr = (uint64_t) data;
|
||||
+#else
|
||||
+ p->dataxferaddr = (uint32_t) data;
|
||||
+#endif
|
||||
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 @@
|
||||
fprintf (stderr, "ptrace:getregs: %s\n", strerror (errno));
|
||||
exit (1);
|
||||
}
|
||||
+#ifdef __x86_64__
|
||||
+ call = r.orig_rax;
|
||||
+#else
|
||||
call = r.orig_eax;
|
||||
+#endif
|
||||
/*printthis = call == SYS_ioctl;*/
|
||||
|
||||
if (state == INBOUND)
|
||||
@@ -188,18 +192,30 @@
|
||||
{
|
||||
if ((call < 0) || (call > callmax) || (callinfo[call].name == NULL))
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ fprintf (stderr, "= 0x%08llx\n", (unsigned long long) r.rax);
|
||||
+#else
|
||||
fprintf (stderr, "= 0x%08lx\n", (unsigned long) r.eax);
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (callinfo[call].ptrval)
|
||||
{
|
||||
if (printcalls || printthis)
|
||||
+#ifdef __x86_64__
|
||||
+ fprintf (stderr, " = 0x%08llx\n", r.rax);
|
||||
+#else
|
||||
fprintf (stderr, " = 0x%08lx\n", r.eax);
|
||||
+#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ long rv = r.rax;
|
||||
+#else
|
||||
long rv = r.eax;
|
||||
+#endif
|
||||
if (rv < 0)
|
||||
{
|
||||
if (printcalls || printthis)
|
||||
@@ -219,16 +235,22 @@
|
||||
unsigned int len = 16;
|
||||
unsigned char buf[65536];
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ unsigned long long fd = r.rbx;
|
||||
+ unsigned long long ioc = r.rcx;
|
||||
+ unsigned long long arg = r.rdx;
|
||||
+#else
|
||||
unsigned long fd = r.ebx;
|
||||
-
|
||||
unsigned long ioc = r.ecx;
|
||||
+ unsigned long arg = r.edx;
|
||||
+#endif
|
||||
+
|
||||
unsigned int iocdir = _IOC_DIR(ioc);
|
||||
unsigned char ioctype = _IOC_TYPE(ioc);
|
||||
unsigned int iocnr = _IOC_NR(ioc);
|
||||
unsigned int iocsize = _IOC_SIZE(ioc);
|
||||
char *iocdirname;
|
||||
|
||||
- unsigned long arg = r.edx;
|
||||
|
||||
switch (iocdir)
|
||||
{
|
||||
@@ -240,7 +262,11 @@
|
||||
|
||||
fprintf (stderr, "%s: ioctl(%ld, _IOC(\"%s\",'%c',0x%02x,0x%02x), 0x%08lx)", tbuf, fd, iocdirname, ioctype, iocnr, iocsize, arg);
|
||||
if (state == OUTBOUND)
|
||||
+#ifdef __x86_64__
|
||||
+ fprintf (stderr, " = %lld\n", r.rax);
|
||||
+#else
|
||||
fprintf (stderr, " = %ld\n", r.eax);
|
||||
+#endif
|
||||
if (getenv ("LOG_INBOUND"))
|
||||
fprintf (stderr, "\n");
|
||||
|
||||
@@ -249,10 +275,18 @@
|
||||
if (len > sizeof buf)
|
||||
len = sizeof buf;
|
||||
|
||||
+#ifdef __x86_64__
|
||||
+ if (printregs)
|
||||
+ fprintf (stderr, " rbx=%08llx rcx=%08llx rdx=%08llx rsi=%08llx rdi=%08llx rbp=%08llx rax=%08llx ds=%08llx es=%08llx fs=%08llx gs=%08llx orig_rax=%08llx rip=%08llx cs=%08llx eflags=%08llx rsp=%08llx ss=%08llx\n", r.rbx, r.rcx, r.rdx, r.rsi, r.rdi, r.rbp, r.rax, r.ds, r.es, r.fs, r.gs, r.orig_rax, r.rip, r.cs, r.eflags, r.rsp, r.ss);
|
||||
+
|
||||
+ copyout (buf, len, pid, r.rdx);
|
||||
+#else
|
||||
if (printregs)
|
||||
fprintf (stderr, " ebx=%08lx ecx=%08lx edx=%08lx esi=%08lx edi=%08lx ebp=%08lx eax=%08lx xds=%08lx xes=%08lx xfs=%08lx xgs=%08lx orig_eax=%08lx eip=%08lx xcs=%08lx eflags=%08lx esp=%08lx xss=%08lx\n", r.ebx, r.ecx, r.edx, r.esi, r.edi, r.ebp, r.eax, r.xds, r.xes, r.xfs, r.xgs, r.orig_eax, r.eip, r.xcs, r.eflags, r.esp, r.xss);
|
||||
|
||||
copyout (buf, len, pid, r.edx);
|
||||
+#endif
|
||||
+
|
||||
|
||||
if ((ioctype == 'm') && (iocnr == 0) && (iocsize == sizeof (struct uioctl_t)))
|
||||
{
|
||||
@@ -405,7 +439,11 @@
|
||||
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);
|
||||
+#ifdef __x86_64__
|
||||
+ dumpbytes (stderr, buf, len, (void *) r.rdx, NULL);
|
||||
+#else
|
||||
dumpbytes (stderr, buf, len, (void *) r.edx, NULL);
|
||||
+#endif
|
||||
}
|
||||
if (log)
|
||||
{
|
||||
@@ -427,23 +465,38 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ dumpbytes (stderr, buf, len, (void *) r.rdx, NULL);
|
||||
+#else
|
||||
dumpbytes (stderr, buf, len, (void *) r.edx, NULL);
|
||||
+#endif
|
||||
}
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
+#ifdef __x86_64__
|
||||
+ static u64 lastrip = 0;
|
||||
+#else
|
||||
static u32 lasteip = 0;
|
||||
+#endif
|
||||
+
|
||||
|
||||
case UNTRACED:
|
||||
/* We don't know whether we were inbound or outbound on the first signal; this
|
||||
appears to differ between kernels. So we defer until we see the same eip in
|
||||
two successive traps, at which point we know we were outbound, so the next
|
||||
trap is inbound. */
|
||||
+#ifdef __x86_64__
|
||||
+ if (lastrip == r.rip)
|
||||
+ state = INBOUND;
|
||||
+ lastrip = r.rip;
|
||||
+#else
|
||||
if (lasteip == r.eip)
|
||||
state = INBOUND;
|
||||
lasteip = r.eip;
|
||||
+#endif
|
||||
break;
|
||||
case INBOUND: state = OUTBOUND; break;
|
||||
case OUTBOUND: state = INBOUND; break;
|
||||
21
debian/patches/008-device_id.dpatch
vendored
21
debian/patches/008-device_id.dpatch
vendored
@@ -1,21 +0,0 @@
|
||||
#! /bin/sh /usr/share/dpatch/dpatch-run
|
||||
## 008-device_id.dpatch by Mario Fetka (geos_one) <mario.fetka@gmail.com>
|
||||
##
|
||||
## 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 @@
|
||||
d->id = info->slot;
|
||||
|
||||
if (d->channel == DISK_NOENC)
|
||||
- snprintf (d->name, sizeof (d->name), "%se*s%u", a->name, d->id);
|
||||
+ snprintf (d->name, sizeof (d->name), "d%u%se*s%u", info->device_id, a->name, d->id);
|
||||
else
|
||||
- snprintf (d->name, sizeof (d->name), "%se%us%u", a->name, d->channel, d->id);
|
||||
+ snprintf (d->name, sizeof (d->name), "d%u%se%us%u", info->device_id, a->name, d->channel, d->id);
|
||||
|
||||
d->inquiry = info->inquiry.inq;
|
||||
strncpy (d->vendor, d->inquiry.vendor_info, sizeof (d->vendor) - 1);
|
||||
8
debian/patches/00list
vendored
8
debian/patches/00list
vendored
@@ -1,8 +0,0 @@
|
||||
000-No_absolute_pathes_in_examples.dpatch
|
||||
001-Drop_obsolete_asm_user.h.dpatch
|
||||
002-No_enclosure_support.dpatch
|
||||
003-Fix_disk_enumeration_loop.dpatch
|
||||
005-Makefile.dpatch
|
||||
006-gcc-fixes.dpatch
|
||||
007-tracefix.dpatch
|
||||
008-device_id.dpatch
|
||||
3
debian/patches/README
vendored
Normal file
3
debian/patches/README
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
0xxx: Grabbed from upstream development.
|
||||
1xxx: Possibly relevant for upstream adoption.
|
||||
2xxx: Only relevant for official Debian release.
|
||||
Reference in New Issue
Block a user