1 diff -ur lin_tape-3.0.18/Makefile lin_tape-3.0.18-ifdefs/Makefile
2 --- lin_tape-3.0.18/Makefile 2017-05-09 21:11:32.977092391 +0200
3 +++ lin_tape-3.0.18-ifdefs/Makefile 2017-05-09 21:05:59.610307494 +0200
5 lin_tape-objs := join.o lin_tape_scsi_config.o lin_tape_scsi_tape.o lin_tape_scsi_trace.o \
6 lin_tape_ioctl_tape.o lin_tape_ioctl_changer.o lin_tape_extra_ioctl.o
8 -RHELRELEASE := $(shell [ -f "/etc/redhat-release" ] && echo 1 || echo 0)
9 -ifeq ($(RHELRELEASE), 1)
10 -KERNELDIR ?= /lib/modules/$(shell uname -r)/build
11 -KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
12 -EXTRA_CFLAGS += -DKERNELVERSION_${KERNELVER}
14 -UBUNTURELEASE := $(shell [ -f "/etc/os-release" ] && grep -qi Ubuntu /etc/os-release && echo 1 || echo 0)
15 -ifeq ($(UBUNTURELEASE), 1)
16 -EXTRA_CFLAGS += -DUBUNTUVERSION
18 -EXTRA_CFLAGS += -DSLESVERSION
19 -KERNELDIR ?= /lib/modules/$(shell uname -r)/build
20 -KERNELVER = $(shell uname -r 2>/dev/null|sed "s/[\.-]/_/g"|sed "s/\([0-9]*_[0-9]*_[0-9]*_[0-9]*\).*/\1/")
21 -EXTRA_CFLAGS += -DSLESKERNEL_${KERNELVER}
22 -SLESSP2 := $(shell grep -qi SP2 /etc/*release && echo 1 || echo 0)
24 -EXTRA_CFLAGS += -DSLESSP2
30 EXTRA_CFLAGS += -DSFMPENABLED
31 diff -ur lin_tape-3.0.18/pfo.h lin_tape-3.0.18-ifdefs/pfo.h
32 --- lin_tape-3.0.18/pfo.h 2017-02-23 19:14:41.000000000 +0100
33 +++ lin_tape-3.0.18-ifdefs/pfo.h 2017-05-09 21:06:34.117699008 +0200
35 * will build for various releases of Linux. This is how
36 * we track different versions using ifdef in the source.
38 -#ifdef KERNELVERSION_2_6_32_220
39 -#define BEFORE_RH_63 1
40 -#define BEFORE_RH_64 1
41 -#define BEFORE_RH_65 1
42 -#define BEFORE_RH_66 1
43 -#define BEFORE_RH_67 1
44 -#define BEFORE_RH_70 1
45 -#define BEFORE_RH_71 1
46 -#define BEFORE_RH_72 1
48 -#ifdef KERNELVERSION_2_6_32_279
49 -#define AFTER_RH_62 1
50 -#define BEFORE_RH_64 1
51 -#define BEFORE_RH_65 1
52 -#define BEFORE_RH_66 1
53 -#define BEFORE_RH_67 1
54 -#define BEFORE_RH_70 1
55 -#define BEFORE_RH_71 1
56 -#define BEFORE_RH_72 1
58 -#ifdef KERNELVERSION_2_6_32_358
59 -#define AFTER_RH_62 1
60 -#define AFTER_RH_63 1
61 -#define BEFORE_RH_65 1
62 -#define BEFORE_RH_66 1
63 -#define BEFORE_RH_67 1
64 -#define BEFORE_RH_70 1
65 -#define BEFORE_RH_72 1
67 -#ifdef KERNELVERSION_2_6_32_431
68 -#define AFTER_RH_62 1
69 -#define AFTER_RH_63 1
70 -#define AFTER_RH_64 1
71 -#define BEFORE_RH_66 1
72 -#define BEFORE_RH_67 1
73 -#define BEFORE_RH_70 1
74 -#define BEFORE_RH_71 1
75 -#define BEFORE_RH_72 1
77 -#ifdef KERNELVERSION_2_6_32_504
78 -#define AFTER_RH_62 1
79 -#define AFTER_RH_63 1
80 -#define AFTER_RH_64 1
81 -#define AFTER_RH_65 1
82 -#define BEFORE_RH_67 1
83 -#define BEFORE_RH_70 1
84 -#define BEFORE_RH_71 1
85 -#define BEFORE_RH_72 1
87 -#ifdef KERNELVERSION_2_6_32_573
88 -#define AFTER_RH_62 1
89 -#define AFTER_RH_63 1
90 -#define AFTER_RH_64 1
91 -#define AFTER_RH_65 1
92 -#define AFTER_RH_66 1
93 -#define BEFORE_RH_70 1
94 -#define BEFORE_RH_71 1
95 -#define BEFORE_RH_72 1
97 -#ifdef KERNELVERSION_2_6_32_642
98 -#define AFTER_RH_62 1
99 -#define AFTER_RH_63 1
100 -#define AFTER_RH_64 1
101 -#define AFTER_RH_65 1
102 -#define AFTER_RH_66 1
103 -#define AFTER_RH_67 1
104 -#define BEFORE_RH_70 1
105 -#define BEFORE_RH_71 1
106 -#define BEFORE_RH_72 1
108 -#ifdef KERNELVERSION_2_6_32_696
109 -#define AFTER_RH_62 1
110 -#define AFTER_RH_63 1
111 -#define AFTER_RH_64 1
112 -#define AFTER_RH_65 1
113 -#define AFTER_RH_66 1
114 -#define AFTER_RH_67 1
115 -#define AFTER_RH_68 1
116 -#define BEFORE_RH_70 1
117 -#define BEFORE_RH_71 1
118 -#define BEFORE_RH_72 1
120 -#ifdef KERNELVERSION_3_10_0_123
121 -#define AFTER_RH_62 1
122 -#define AFTER_RH_63 1
123 -#define AFTER_RH_64 1
124 -#define AFTER_RH_65 1
125 -#define AFTER_RH_66 1
126 -#define AFTER_RH_67 1
127 -#define AFTER_RH_6x 1
128 -#define BEFORE_RH_71 1
130 -#ifdef KERNELVERSION_3_10_0_229
131 -#define AFTER_RH_62 1
132 -#define AFTER_RH_63 1
133 -#define AFTER_RH_64 1
134 -#define AFTER_RH_65 1
135 -#define AFTER_RH_66 1
136 -#define AFTER_RH_67 1
137 -#define AFTER_RH_6x 1
138 -#define AFTER_RH_70 1
139 -#define BEFORE_RH_72 1
141 -#ifdef KERNELVERSION_3_10_0_327
142 -#define AFTER_RH_62 1
143 -#define AFTER_RH_63 1
144 -#define AFTER_RH_64 1
145 -#define AFTER_RH_65 1
146 -#define AFTER_RH_66 1
147 -#define AFTER_RH_67 1
148 -#define AFTER_RH_6x 1
149 -#define AFTER_RH_70 1
150 -#define AFTER_RH_71 1
152 -#ifdef KERNELVERSION_3_10_0_514
153 -#define AFTER_RH_62 1
154 -#define AFTER_RH_63 1
155 -#define AFTER_RH_64 1
156 -#define AFTER_RH_65 1
157 -#define AFTER_RH_66 1
158 -#define AFTER_RH_67 1
159 -#define AFTER_RH_6x 1
160 -#define AFTER_RH_70 1
161 -#define AFTER_RH_71 1
162 -#define AFTER_RH_72 1
164 -#ifdef KERNELVERSION_3_10_0_693
165 #define AFTER_RH_62 1
166 #define AFTER_RH_63 1
167 #define AFTER_RH_64 1
169 #define AFTER_RH_71 1
170 #define AFTER_RH_72 1
171 #define AFTER_RH_73 1
174 /* Misc defines needed so source is same for all versions of Linux */
175 #ifndef SDEV_TRANSPORT_OFFLINE
176 --- lin_tape-3.0.52/lin_tape_scsi_config.h~ 2020-04-04 21:53:09.000000000 +0200
177 +++ lin_tape-3.0.52/lin_tape_scsi_config.h 2020-04-04 21:56:46.600032193 +0200
179 ("IBM Tape Drives and Libraries");
180 MODULE_LICENSE("GPL");
181 MODULE_VERSION("3.0.56");
182 -#if defined(SLESVERSION)
183 -MODULE_INFO(supported, "external");
185 /* driver parameters */
187 module_param(support_dio, int, 0);
188 --- lin_tape-3.0.52/sgmp.c~ 2020-03-05 19:43:09.000000000 +0100
189 +++ lin_tape-3.0.52/sgmp.c 2020-04-04 21:57:56.793366544 +0200
193 #include <linux/version.h>
194 -#if !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
195 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
198 * Started: Aug 9 by Lawrence Foard (entropy@world.std.com),
199 @@ -3012,7 +3012,7 @@
202 #endif /* CONFIG_SCSI_PROC_FS */
203 -#elif !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
204 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
205 static int sg_version_num = 30536; /* 2 digits for each component */
206 #define SG_VERSION_STR "3.5.36"
208 @@ -6026,7 +6026,7 @@
211 #endif /* CONFIG_SCSI_PROC_FS */
212 -#elif !defined(SLESVERSION) && LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
213 +#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
214 static int sg_version_num = 30534; /* 2 digits for each component */
215 #define SG_VERSION_STR "3.5.34"
217 --- lin_tape-3.0.52/stmp.c~ 2020-03-05 19:43:09.000000000 +0100
218 +++ lin_tape-3.0.52/stmp.c 2020-04-04 21:58:35.473367112 +0200
222 #include <linux/version.h>
223 -#if !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
224 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)
226 SCSI Tape Driver for Linux version 1.1 and newer. See the accompanying
227 file Documentation/scsi/st.txt for more information.
228 @@ -5108,7 +5108,7 @@
232 -#elif !defined(SLESVERSION) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
233 +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
234 #include <linux/module.h>
235 #include <linux/fs.h>
236 #include <linux/kernel.h>
237 @@ -10137,7 +10137,7 @@
241 -#elif !defined(SLESVERSION) && LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
242 +#elif LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
243 #include <linux/module.h>
244 #include <linux/fs.h>
245 #include <linux/kernel.h>
246 --- lin_tape-3.0.52/upper.c~ 2020-04-04 21:55:46.000000000 +0200
247 +++ lin_tape-3.0.52/upper.c 2020-04-04 21:59:12.536700966 +0200
249 if (copy_from_user(pfo_cmd->scsi_cmd, hdr->cmdp, hdr->cmd_len))
252 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION))
253 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
254 if (blk_verify_command(pfo_cmd->scsi_cmd, mode & FMODE_WRITE))
256 /* RHEL 6.4 and beyond */
257 @@ -525,14 +525,12 @@
258 /* SG_IO howto says that the shorter of the two wins */
259 iov_data_len = iov_length((struct iovec *)iov,
261 -#if !defined (UBUNTUVERSION)
262 if (hdr->dxfer_len < iov_data_len) {
263 hdr->iovec_count = iov_shorten((struct iovec *)iov,
266 iov_data_len = hdr->dxfer_len;
269 pfo_cmd.buffer = iov;
270 pfo_cmd.bufflen = iov_data_len;
271 pfo_cmd.iov_count = hdr->iovec_count;
273 if (in_len && copy_from_user(buffer, sic->data + cmdlen, in_len))
276 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0) && (defined(SLESVERSION) || defined(UBUNTUVERSION))
277 +#if LINUX_VERSION_CODE > KERNEL_VERSION(3,12,0)
278 err = blk_verify_command(scsi_cmd, mode & FMODE_WRITE);
280 /* RHEL 6.4 and beyond */
281 --- lin_tape-3.0.52/intercept.c~ 2020-03-05 19:43:09.000000000 +0100
282 +++ lin_tape-3.0.52/intercept.c 2020-04-04 21:59:43.190034776 +0200
283 @@ -2492,9 +2492,6 @@
284 MODULE_LICENSE("GPL");
285 MODULE_VERSION(PFO_VERSION_STR);
286 MODULE_INFO(date, PFO_DATE_STR);
287 -#if defined(SLESVERSION)
288 -MODULE_INFO(supported, "external");
290 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,32)
291 module_param(netbackup, int, 0444);
292 MODULE_PARM_DESC(netbackup, "!=0 to use with NetBackup application");