]> git.pld-linux.org Git - packages/lin_tape.git/blobdiff - clean-ifdefs.patch
- up to 3.0.52
[packages/lin_tape.git] / clean-ifdefs.patch
index 118296a47cd7ab650596e23417320bb334fbc485..7f6cb585d90a4e08298bb189f038d3a05c390fa7 100644 (file)
@@ -1,26 +1,37 @@
-diff -ur lin_tape-3.0.8/Makefile lin_tape-3.0.8-norh/Makefile
---- lin_tape-3.0.8/Makefile    2016-06-19 09:57:15.497134019 +0200
-+++ lin_tape-3.0.8-norh/Makefile       2016-06-19 09:53:34.317661494 +0200
-@@ -18,15 +18,6 @@
+diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
+--- lin_tape-3.0.18/Makefile   2017-05-09 21:11:32.977092391 +0200
++++ lin_tape-3.0.18-ifdefs/Makefile    2017-05-09 21:05:59.610307494 +0200
+@@ -20,26 +20,6 @@
  lin_tape-objs := join.o lin_tape_scsi_config.o lin_tape_scsi_tape.o lin_tape_scsi_trace.o \
               lin_tape_ioctl_tape.o lin_tape_ioctl_changer.o lin_tape_extra_ioctl.o
  
 -RHELRELEASE := $(shell [ -f "/etc/redhat-release" ] && echo 1 || echo 0)
 -ifeq ($(RHELRELEASE), 1)
 -KERNELDIR ?= /lib/modules/$(shell uname -r)/build
--KERNELVER = $(shell cd ${KERNELDIR}; make kernelversion 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
+-KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
 -EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER}
 -else
+-UBUNTURELEASE := $(shell [ -f "/etc/os-release" ] && grep -qi Ubuntu /etc/os-release && echo 1 || echo 0)
+-ifeq ($(UBUNTURELEASE), 1)
+-EXTRA_CFLAGS += -DUBUNTUVERSION
+-else
 -EXTRA_CFLAGS += -DSLESVERSION
+-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+-KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
+-EXTRA_CFLAGS += -DSLESKERNEL_${KERNELVER}
+-SLESSP2 := $(shell grep -qi SP2 /etc/*release && echo 1 || echo 0)
+-ifeq ($(SLESSP2), 1)
+-EXTRA_CFLAGS += -DSLESSP2
+-endif
+-endif
 -endif
--             
- PROC := $(shell uname -m)
  
- ifeq ($(PROC), ppc64)
-diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
---- lin_tape-3.0.8/pfo.h       2016-03-17 03:37:58.000000000 +0100
-+++ lin_tape-3.0.8-norh/pfo.h  2016-06-19 09:53:34.000000000 +0200
-@@ -26,82 +26,6 @@
+ ifeq ($(SFMP), 1)
+ EXTRA_CFLAGS += -DSFMPENABLED
+diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
+--- lin_tape-3.0.18/pfo.h      2017-02-23 19:14:41.000000000 +0100
++++ lin_tape-3.0.18-ifdefs/pfo.h       2017-05-09 21:06:34.117699008 +0200
+@@ -26,133 +26,6 @@
   * will build for various releases of Linux.  This is how
   * we track different versions using ifdef in the source.
   */
@@ -32,6 +43,7 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_67 1
 -#define BEFORE_RH_70 1
 -#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_2_6_32_279
 -#define AFTER_RH_62 1
@@ -41,6 +53,7 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_67 1
 -#define BEFORE_RH_70 1
 -#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_2_6_32_358
 -#define AFTER_RH_62 1
@@ -49,7 +62,7 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_66 1
 -#define BEFORE_RH_67 1
 -#define BEFORE_RH_70 1
--#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_2_6_32_431
 -#define AFTER_RH_62 1
@@ -59,6 +72,7 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_67 1
 -#define BEFORE_RH_70 1
 -#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_2_6_32_504
 -#define AFTER_RH_62 1
@@ -68,6 +82,7 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_67 1
 -#define BEFORE_RH_70 1
 -#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_2_6_32_573
 -#define AFTER_RH_62 1
@@ -77,6 +92,30 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define AFTER_RH_66 1
 -#define BEFORE_RH_70 1
 -#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
+-#endif
+-#ifdef KERNELVERSION_2_6_32_642
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define BEFORE_RH_70 1
+-#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
+-#endif
+-#ifdef KERNELVERSION_2_6_32_696
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define AFTER_RH_68 1
+-#define BEFORE_RH_70 1
+-#define BEFORE_RH_71 1
+-#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_3_10_0_123
 -#define AFTER_RH_62 1
@@ -100,104 +139,154 @@ diff -ur lin_tape-3.0.8/pfo.h lin_tape-3.0.8-norh/pfo.h
 -#define BEFORE_RH_72 1
 -#endif
 -#ifdef KERNELVERSION_3_10_0_327
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define AFTER_RH_6x 1
+-#define AFTER_RH_70 1
+-#define AFTER_RH_71 1
+-#endif
+-#ifdef KERNELVERSION_3_10_0_514
+-#define AFTER_RH_62 1
+-#define AFTER_RH_63 1
+-#define AFTER_RH_64 1
+-#define AFTER_RH_65 1
+-#define AFTER_RH_66 1
+-#define AFTER_RH_67 1
+-#define AFTER_RH_6x 1
+-#define AFTER_RH_70 1
+-#define AFTER_RH_71 1
+-#define AFTER_RH_72 1
+-#endif
+-#ifdef KERNELVERSION_3_10_0_693
  #define AFTER_RH_62 1
  #define AFTER_RH_63 1
  #define AFTER_RH_64 1
-@@ -111,7 +35,6 @@
- #define AFTER_RH_6x 1
- #define AFTER_RH_70 1
+@@ -126,7 +35,6 @@
+ #define AFTER_RH_71 1
  #define AFTER_RH_72 1
+ #define AFTER_RH_73 1
 -#endif
  
  /* Misc defines needed so source is same for all versions of Linux */
  #ifndef SDEV_TRANSPORT_OFFLINE
-diff -ur lin_tape-3.0.8/sgmp.c lin_tape-3.0.8-norh/sgmp.c
---- lin_tape-3.0.8/sgmp.c      2016-03-17 04:44:07.000000000 +0100
-+++ lin_tape-3.0.8-norh/sgmp.c 2016-06-19 09:55:40.075920922 +0200
-@@ -262,31 +262,11 @@
- {
-       struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
+--- lin_tape-3.0.52/lin_tape_scsi_config.h~    2020-04-04 21:53:09.000000000 +0200
++++ lin_tape-3.0.52/lin_tape_scsi_config.h     2020-04-04 21:56:46.600032193 +0200
+@@ -64,9 +64,6 @@
+     ("IBM Tape Drives and Libraries");
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION("3.0.52");
+-#if defined(SLESVERSION)
+-MODULE_INFO(supported, "external");
+-#endif // defined
+ /* driver parameters */
+ int support_dio = 1;
+ module_param(support_dio, int, 0);
+--- lin_tape-3.0.52/sgmp.c~    2020-03-05 19:43:09.000000000 +0100
++++ lin_tape-3.0.52/sgmp.c     2020-04-04 21:57:56.793366544 +0200
+@@ -34,7 +34,7 @@
+  */
  
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
--      /* RHEL 7.0 and beyond */
-       struct request_queue *q = sfp->parentdp->device->request_queue;
--#else
--#ifdef AFTER_RH_63
--      /* RHEL 6.4+ */
--      struct request_queue *q = sfp->parentdp->device->request_queue;
--#endif
--#endif
--
-       if (sfp->parentdp->device->type == TYPE_SCANNER)
-               return 0;
+ #include <linux/version.h>
+-#if !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
+ /*
+  *  History:
+  *  Started: Aug 9 by Lawrence Foard (entropy@world.std.com),
+@@ -3012,7 +3012,7 @@
+       return 0;
+ }
+ #endif                                /* CONFIG_SCSI_PROC_FS */
+-#elif !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ static int sg_version_num = 30536;    /* 2 digits for each component */
+ #define SG_VERSION_STR "3.5.36"
  
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
--      /* RHEL 7.0 and beyond */
--      return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
--#else
--#ifdef AFTER_RH_63
--      /* RHEL 6.4+ */
--      return blk_verify_command(q, cmd, filp->f_mode & FMODE_WRITE);
--#else
--      /* RHEL6.3- or SLES11SP3 */
-       return blk_verify_command(cmd, filp->f_mode & FMODE_WRITE);
--#endif
--#endif
+@@ -6026,7 +6026,7 @@
  }
  
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,32)
-diff -ur lin_tape-3.0.8/upper.c lin_tape-3.0.8-norh/upper.c
---- lin_tape-3.0.8/upper.c     2016-02-23 20:19:55.000000000 +0100
-+++ lin_tape-3.0.8-norh/upper.c        2016-06-19 09:56:18.759745753 +0200
-@@ -266,20 +266,7 @@
- {
-       if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
-               return -EFAULT;
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) && (!defined(SLESVERSION))
--      /* RHEL 7.0 and beyond */
--      if (blk_verify_command(q, pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
--#else
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
--#ifdef AFTER_RH_63
--      /* RHEL 6.4+ */
--      if (blk_verify_command(q, pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
--#else
--      /* RHEL 6.3- or SLES11SP3 */
-       if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
--#endif
--#endif
--#endif
-               return -EPERM;
+ #endif                                /* CONFIG_SCSI_PROC_FS */
+-#elif !defined(SLESVERSION) && LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
++#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
+ static int sg_version_num = 30534;    /* 2 digits for each component */
+ #define SG_VERSION_STR "3.5.34"
  
-       /*
---- lin_tape-3.0.8/sgmp.c~     2016-06-19 13:18:16.000000000 +0200
-+++ lin_tape-3.0.8/sgmp.c      2016-06-19 13:21:28.375961483 +0200
-@@ -1544,7 +1544,7 @@
-               if ((sdp->sgdebug > 0) &&
-                   ((CHECK_CONDITION == srp->header.masked_status) ||
-                    (COMMAND_TERMINATED == srp->header.masked_status)))
--#ifdef AFTER_RH_72
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
-                       __scsi_print_sense(sdp->device, "sg_cmd_done", sense, SCSI_SENSE_BUFFERSIZE);
+--- lin_tape-3.0.52/stmp.c~    2020-03-05 19:43:09.000000000 +0100
++++ lin_tape-3.0.52/stmp.c     2020-04-04 21:58:35.473367112 +0200
+@@ -42,7 +42,7 @@
  
- #else
---- lin_tape-3.0.8/stmp.c~     2016-06-19 13:18:16.000000000 +0200
-+++ lin_tape-3.0.8/stmp.c      2016-06-19 13:21:10.882407139 +0200
-@@ -467,7 +467,7 @@
-                      SRpnt->cmd[0], SRpnt->cmd[1], SRpnt->cmd[2],
-                      SRpnt->cmd[3], SRpnt->cmd[4], SRpnt->cmd[5]);
-               if (cmdstatp->have_sense)
--#ifdef AFTER_RH_72
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
-                       __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
+  */
+ #include <linux/version.h>
+-#if !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
+ /*
+    SCSI Tape Driver for Linux version 1.1 and newer. See the accompanying
+    file Documentation/scsi/st.txt for more information.
+@@ -5108,7 +5108,7 @@
  
+       return 0;
+ }
+-#elif !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ #include <linux/module.h>
+ #include <linux/fs.h>
+ #include <linux/kernel.h>
+@@ -10137,7 +10137,7 @@
+       return 0;
+ }
+-#elif !defined(SLESVERSION) && LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
++#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
+ #include <linux/module.h>
+ #include <linux/fs.h>
+ #include <linux/kernel.h>
+--- lin_tape-3.0.52/upper.c~   2020-04-04 21:55:46.000000000 +0200
++++ lin_tape-3.0.52/upper.c    2020-04-04 21:59:12.536700966 +0200
+@@ -273,7 +273,7 @@
+       if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
+               return -EFAULT;
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION))
++#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
+       if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
  #else
-@@ -488,7 +488,7 @@
-                        scode != VOLUME_OVERFLOW &&
-                        SRpnt->cmd[0] != MODE_SENSE &&
-                        SRpnt->cmd[0] != TEST_UNIT_READY) {
--#ifdef AFTER_RH_72
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
-                       __scsi_print_sense(STp->device, name, SRpnt->sense, SCSI_SENSE_BUFFERSIZE);
+       /* RHEL 6.4 and beyond */
+@@ -525,14 +525,12 @@
+               /* SG_IO howto says that the shorter of the two wins */
+               iov_data_len = iov_length((struct iovec *)iov,
+                                       hdr->iovec_count);
+-#if !defined (UBUNTUVERSION)
+               if (hdr->dxfer_len < iov_data_len) {
+                       hdr->iovec_count = iov_shorten((struct iovec *)iov,
+                                                       hdr->iovec_count,
+                                                       hdr->dxfer_len);
+                       iov_data_len = hdr->dxfer_len;
+               }
+-#endif
+               pfo_cmd.buffer = iov;
+               pfo_cmd.bufflen = iov_data_len;
+               pfo_cmd.iov_count = hdr->iovec_count;
+@@ -622,7 +620,7 @@
+       if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
+               goto error;
  
+-#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION))
++#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
+       err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE);
  #else
+       /* RHEL 6.4 and beyond */
+--- lin_tape-3.0.52/intercept.c~       2020-03-05 19:43:09.000000000 +0100
++++ lin_tape-3.0.52/intercept.c        2020-04-04 21:59:43.190034776 +0200
+@@ -2492,9 +2492,6 @@
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(PFO_VERSION_STR);
+ MODULE_INFO(date, PFO_DATE_STR);
+-#if defined(SLESVERSION)
+-MODULE_INFO(supported, "external");
+-#endif
+ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
+ module_param(netbackup, int, 0444);
+ MODULE_PARM_DESC(netbackup, "!=0 to use with NetBackup application");
This page took 0.037205 seconds and 4 git commands to generate.