Gentoo Archives: gentoo-commits

From: Alon Bar-Lev <alonbl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-crypt/bestcrypt/, app-crypt/bestcrypt/files/
Date: Tue, 11 Sep 2018 16:51:37
Message-Id: 1536684674.9c14803bcad24b8d36e5a0bae448284d11975a23.alonbl@gentoo
1 commit: 9c14803bcad24b8d36e5a0bae448284d11975a23
2 Author: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
3 AuthorDate: Tue Sep 11 16:45:31 2018 +0000
4 Commit: Alon Bar-Lev <alonbl <AT> gentoo <DOT> org>
5 CommitDate: Tue Sep 11 16:51:14 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c14803b
7
8 app-crypt/bestcrypt: version bump
9
10 This package is no longer supported by upstream, I could find it in hidden
11 webdav of upstream. Use on your on risk!
12
13 Closes: https://bugs.gentoo.org/show_bug.cgi?id=638592
14 Closes: https://bugs.gentoo.org/show_bug.cgi?id=600770
15 Closes: https://bugs.gentoo.org/show_bug.cgi?id=565064
16 Package-Manager: Portage-2.3.40, Repoman-2.3.9
17
18 app-crypt/bestcrypt/Manifest | 1 +
19 app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild | 2 +-
20 ...crypt-2.0.11.ebuild => bestcrypt-2.0.14.ebuild} | 11 +-
21 .../bestcrypt/files/bestcrypt-2.0.14-build.patch | 522 +++++++++++++++++++++
22 4 files changed, 531 insertions(+), 5 deletions(-)
23
24 diff --git a/app-crypt/bestcrypt/Manifest b/app-crypt/bestcrypt/Manifest
25 index 1f72fa4e33f..13c146edd3a 100644
26 --- a/app-crypt/bestcrypt/Manifest
27 +++ b/app-crypt/bestcrypt/Manifest
28 @@ -1 +1,2 @@
29 DIST BestCrypt-2.0.11.tar.gz 2191182 BLAKE2B 5fe6d18b0c89273491fbcdb9bf7c73332342fca77cdf457c83f106f5cca693532eea6668e04f7c93828b3d5dc4419872066eda22fb10c780a838ddd78cf79255 SHA512 f6848153fc68690c116796bd5feb80dc1776f344327de5ac485dddc5b60280b491e2e5c9f266d6f30b7095396cd06b5bdad5d322b4ac24ab612ec642dbc08fe2
30 +DIST BestCrypt-2.0.14.tar.gz 2211286 BLAKE2B 1ff777a72528ec22ca168492c335ec54be924b653323670619049cc9dfbcd144c28702bf857517c5189c937f3712e749c47ef14006a8883c63419b866b8f48f9 SHA512 1e542f00886413f1519ca5667bb297cce25a46fb5ec90a7e1a61934df3cd34e0d680f32e0b111727865459ef7d89d2761b379b4a557ada6d7ee3e47e32bf762c
31
32 diff --git a/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild b/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild
33 index 4ab00f225f3..86e153ad106 100644
34 --- a/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild
35 +++ b/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild
36 @@ -1,4 +1,4 @@
37 -# Copyright 1999-2017 Gentoo Foundation
38 +# Copyright 1999-2018 Gentoo Foundation
39 # Distributed under the terms of the GNU General Public License v2
40
41 EAPI="6"
42
43 diff --git a/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild b/app-crypt/bestcrypt/bestcrypt-2.0.14.ebuild
44 similarity index 89%
45 copy from app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild
46 copy to app-crypt/bestcrypt/bestcrypt-2.0.14.ebuild
47 index 4ab00f225f3..350edde96ef 100644
48 --- a/app-crypt/bestcrypt/bestcrypt-2.0.11.ebuild
49 +++ b/app-crypt/bestcrypt/bestcrypt-2.0.14.ebuild
50 @@ -1,4 +1,4 @@
51 -# Copyright 1999-2017 Gentoo Foundation
52 +# Copyright 1999-2018 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54
55 EAPI="6"
56 @@ -26,7 +26,7 @@ DOCS=(
57 )
58
59 PATCHES=(
60 - "${FILESDIR}/${PN}-2.0.6-build.patch"
61 + "${FILESDIR}/${P}-build.patch"
62 )
63
64 pkg_setup() {
65 @@ -69,10 +69,13 @@ src_install() {
66 }
67
68 pkg_postinst() {
69 + linux-mod_pkg_postinst
70 +
71 ewarn
72 ewarn "The BestCrypt drivers are not free - Please purchace a license from "
73 ewarn "http://www.jetico.com/"
74 ewarn
75 -
76 - linux-mod_pkg_postinst
77 + ewarn "Upstream do not support this package any more, it was patched to"
78 + ewarn "make it built. Use at your own risk!"
79 + ewarn
80 }
81
82 diff --git a/app-crypt/bestcrypt/files/bestcrypt-2.0.14-build.patch b/app-crypt/bestcrypt/files/bestcrypt-2.0.14-build.patch
83 new file mode 100644
84 index 00000000000..c4ce215e975
85 --- /dev/null
86 +++ b/app-crypt/bestcrypt/files/bestcrypt-2.0.14-build.patch
87 @@ -0,0 +1,522 @@
88 +From 71bd6e496af5990836c34e4dd2d9d0107467349a Mon Sep 17 00:00:00 2001
89 +From: Alon Bar-Lev <alon.barlev@×××××.com>
90 +Date: Tue, 11 Sep 2018 18:49:17 +0300
91 +Subject: [PATCH 1/6] build: do not auto build/install module
92 +
93 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
94 +---
95 + Makefile | 4 ++--
96 + 1 file changed, 2 insertions(+), 2 deletions(-)
97 +
98 +diff --git a/Makefile b/Makefile
99 +index ec0fd7e..d52f509 100644
100 +--- a/Makefile
101 ++++ b/Makefile
102 +@@ -98,7 +98,7 @@ TESTS_TARGET = $(TARGET_DIR)/tests/bctool-tests
103 + #
104 +
105 + # default target builds console tool with modules
106 +-all: Makefile helpers module console
107 ++all: Makefile helpers console
108 + true
109 +
110 + rebuild: clean all
111 +@@ -233,7 +233,7 @@ module-clean:
112 + #
113 +
114 + # install for default target
115 +-install: module-install console-install helpers-install
116 ++install: console-install helpers-install
117 +
118 + # used by RPM creation script
119 + build-install: module-put-files console-install helpers-install
120 +--
121 +2.16.4
122 +
123 +From 42816e0a4e47e77f290b46460e35a1666748f8b0 Mon Sep 17 00:00:00 2001
124 +From: Alon Bar-Lev <alon.barlev@×××××.com>
125 +Date: Tue, 11 Sep 2018 19:35:26 +0300
126 +Subject: [PATCH 2/6] build: remove useless log
127 +
128 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
129 +---
130 + certificate/CertificateLib/symmetricAlgs/cAlgRIJN.cpp | 2 --
131 + 1 file changed, 2 deletions(-)
132 +
133 +diff --git a/certificate/CertificateLib/symmetricAlgs/cAlgRIJN.cpp b/certificate/CertificateLib/symmetricAlgs/cAlgRIJN.cpp
134 +index 3c6fad8..9821073 100644
135 +--- a/certificate/CertificateLib/symmetricAlgs/cAlgRIJN.cpp
136 ++++ b/certificate/CertificateLib/symmetricAlgs/cAlgRIJN.cpp
137 +@@ -78,14 +78,12 @@ cSymAlg * cAlgRIJN::createAlg( BYTE *key, int keySize ) // keySize in bytes
138 + return alg;
139 + }
140 +
141 +-#include "../../../../fs-lib/log.h"
142 + int cAlgRIJN::encryptECB(
143 + const BYTE *inBf, // Input plaintext buffer.
144 + BYTE *outBf, // Output encrypted buffer
145 + int bfSize // In/out buffers' size.
146 + )
147 + {
148 +- LIBLOG_INFO("");
149 + int i;
150 +
151 + if ((bfSize % BC_BLOCK_SIZE) != 0) return sae_invalidBlockSize;
152 +--
153 +2.16.4
154 +
155 +From a0ffdc5a135b549b62e1421fcf75d627e0394529 Mon Sep 17 00:00:00 2001
156 +From: Alon Bar-Lev <alon.barlev@×××××.com>
157 +Date: Tue, 11 Sep 2018 19:41:17 +0300
158 +Subject: [PATCH 3/6] build: do not strip binaries
159 +
160 +---
161 + Makefile | 8 ++++----
162 + 1 file changed, 4 insertions(+), 4 deletions(-)
163 +
164 +diff --git a/Makefile b/Makefile
165 +index d52f509..a93b850 100644
166 +--- a/Makefile
167 ++++ b/Makefile
168 +@@ -243,9 +243,9 @@ uninstall: before-uninstall module-uninstall console-uninstall helpers-uninstall
169 +
170 + helpers-install:
171 + install -o root -m 0755 -d $(PREFIX)/sbin
172 +- install -o root -m 4755 -s $(TARGET_DIR)/bcmount_helper $(PREFIX)/sbin
173 +- install -o root -m 4755 -s $(TARGET_DIR)/bcumount_helper $(PREFIX)/sbin
174 +- install -o root -m 4755 -s $(TARGET_DIR)/bcrrpart_helper $(PREFIX)/sbin
175 ++ install -o root -m 4755 $(TARGET_DIR)/bcmount_helper $(PREFIX)/sbin
176 ++ install -o root -m 4755 $(TARGET_DIR)/bcumount_helper $(PREFIX)/sbin
177 ++ install -o root -m 4755 $(TARGET_DIR)/bcrrpart_helper $(PREFIX)/sbin
178 +
179 + helpers-uninstall:
180 + rm -f $(PREFIX)/sbin/bcmount_helper
181 +@@ -267,7 +267,7 @@ before-uninstall:
182 + .PHONY: console-install
183 + console-install:
184 + install -o root -m 0755 -d $(PREFIX)/usr/bin
185 +- install -o root -m 0755 -s build/bctool $(PREFIX)/usr/bin/
186 ++ install -o root -m 0755 build/bctool $(PREFIX)/usr/bin/
187 + install -o root -m 0755 -d $(PREFIX)/$(MAN_PATH)/man8
188 + install -m 644 bctool.8 $(PREFIX)/$(MAN_PATH)/man8/
189 +
190 +--
191 +2.16.4
192 +
193 +From 7947ac3e152da1ed590364b7c8948deb602a5b50 Mon Sep 17 00:00:00 2001
194 +From: Alon Bar-Lev <alon.barlev@×××××.com>
195 +Date: Tue, 11 Sep 2018 18:52:32 +0300
196 +Subject: [PATCH 4/6] build: allow override programs
197 +
198 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
199 +---
200 + Makefile | 11 +++++++----
201 + certificate/CertificateLib/Makefile | 4 +++-
202 + disk/Makefile | 6 ++++--
203 + fslib/Makefile | 16 +++++++++-------
204 + kernel/Makefile | 5 +++--
205 + keygens/kgghost/Makefile | 7 +++++--
206 + keygens/kgsha/Makefile | 7 +++++--
207 + mount/Makefile | 9 +++++----
208 + spacemap/Makefile | 6 ++++--
209 + tests/Makefile | 12 ++++++------
210 + 10 files changed, 51 insertions(+), 32 deletions(-)
211 +
212 +diff --git a/Makefile b/Makefile
213 +index a93b850..d57ee79 100644
214 +--- a/Makefile
215 ++++ b/Makefile
216 +@@ -56,6 +56,9 @@ KGSHA_LIB = $(KGSHA_BUILD_DIR)/lib$(KGSHA_LIB_NAME).a
217 + KGGHOST_LIB = $(KGGHOST_BUILD_DIR)/lib$(KGGHOST_LIB_NAME).a
218 + SPACEMAP_LIB = $(SPACEMAP_BUILD_DIR)/lib$(SPACEMAP_LIB_NAME).a
219 +
220 ++CC = gcc
221 ++CXX = g++
222 ++
223 + BC_EXTRA_CFLAGS= $(CFLAGS) -D_LARGE_FILES -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
224 + BC_EXTRA_LDFLAGS = $(LDFLAGS)
225 +
226 +@@ -125,7 +128,7 @@ helpers: create-dirs
227 + console: spacemap-lib certificate-lib fs-lib kernel-lib keygen-libs $(TARGET)
228 + true
229 + $(TARGET): $(BCTOOL_OBJS)
230 +- g++ $(BCTOOL_OBJS) $(BCTOOL_CFLAGS) $(BCTOOL_LDFLAGS) -o $(TARGET)
231 ++ $(CXX) $(BCTOOL_OBJS) $(BCTOOL_CFLAGS) $(BCTOOL_LDFLAGS) -o $(TARGET)
232 +
233 + # GUI executable only (w/o console and helpers)
234 + panel: certificate-lib kernel-lib keygen-libs fs-lib
235 +@@ -339,10 +342,10 @@ module-uninstall:
236 + bash ./scripts/remove_mods
237 +
238 + %.o:%.cpp
239 +- g++ -c $(BCTOOL_CFLAGS) $< -o $@
240 ++ $(CXX) -c $(BCTOOL_CFLAGS) $< -o $@
241 +
242 + %.o:%.cc
243 +- g++ -c $(BCTOOL_CFLAGS) $< -o $@
244 ++ $(CXX) -c $(BCTOOL_CFLAGS) $< -o $@
245 +
246 + %.o:%.c
247 +- gcc -c $(BCTOOL_CFLAGS) $< -o $@
248 ++ $(CC) -c $(BCTOOL_CFLAGS) $< -o $@
249 +diff --git a/certificate/CertificateLib/Makefile b/certificate/CertificateLib/Makefile
250 +index 06353bc..19b772c 100644
251 +--- a/certificate/CertificateLib/Makefile
252 ++++ b/certificate/CertificateLib/Makefile
253 +@@ -1,5 +1,7 @@
254 +
255 +-CP = cp
256 ++CC = gcc
257 ++CXX = g++
258 ++AR = ar
259 + CFLAGS += -Wall -fPIC -fno-strict-aliasing
260 + CXXFLAGS = -Wall -fPIC
261 + #-Werror
262 +diff --git a/disk/Makefile b/disk/Makefile
263 +index e3915b0..1a9ff01 100644
264 +--- a/disk/Makefile
265 ++++ b/disk/Makefile
266 +@@ -1,14 +1,16 @@
267 + DISKMON_OBJS = disk.o diskmon.o
268 ++
269 ++CXX = g++
270 + CFLAGS += -Wall -I. -I../ -p -gdwarf-2 #-DBC_DEBUG
271 + LDFLAGS += -ludev
272 +
273 + all:diskmon Makefile
274 +
275 + diskmon:$(DISKMON_OBJS)
276 +- g++ $(DISKMON_OBJS) $(LDFLAGS) -o diskmon
277 ++ $(CXX) $(DISKMON_OBJS) $(LDFLAGS) -o diskmon
278 +
279 + %.o:%.cc
280 +- g++ $(CFLAGS) -c $< -o $@
281 ++ $(CXX) $(CFLAGS) -c $< -o $@
282 +
283 + clean:
284 + rm -rf diskmon *.o
285 +diff --git a/fslib/Makefile b/fslib/Makefile
286 +index 9b99e89..0075a9f 100644
287 +--- a/fslib/Makefile
288 ++++ b/fslib/Makefile
289 +@@ -1,3 +1,5 @@
290 ++CC = gcc
291 ++AR = ar
292 +
293 + FSLIB_CFLAGS = $(CFLAGS) -Wall -fPIC -O0 -DFSLIB_DEBUG -g # -O3
294 + FSLIB_CFLAGS += -I. -D_LARGE_FILES -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 #-fvisibility=hidden
295 +@@ -17,25 +19,25 @@ FSLIB_TOOLS = file_hfs test_hfs test_info test_free_space diskinfo
296 + all: Makefile $(FSLIB) $(FSLIB_TOOLS)
297 +
298 + $(FSLIB): $(OBJS)
299 +- ar rcs $(FSLIB) $(OBJS)
300 ++ $(AR) rcs $(FSLIB) $(OBJS)
301 +
302 + test_hfs: $(FSLIB) test/test_hfs.o
303 +- gcc test/test_hfs.o $(OBJS) $(FSLIB_LDFLAGS) -o test_hfs
304 ++ $(CC) test/test_hfs.o $(OBJS) $(FSLIB_LDFLAGS) -o test_hfs
305 +
306 + file_hfs: $(FSLIB) test/file_hfs.o
307 +- gcc test/file_hfs.o $(OBJS) $(FSLIB_LDFLAGS) -o file_hfs
308 ++ $(CC) test/file_hfs.o $(OBJS) $(FSLIB_LDFLAGS) -o file_hfs
309 +
310 + test_info: $(FSLIB) test/test_info.o
311 +- gcc test/test_info.o $(OBJS) $(FSLIB_LDFLAGS) -o test_info
312 ++ $(CC) test/test_info.o $(OBJS) $(FSLIB_LDFLAGS) -o test_info
313 +
314 + test_free_space: $(FSLIB) test/test_free_space.o
315 +- gcc test/test_free_space.o $(FSLIB_CFLAGS) $(OBJS) $(FSLIB_LDFLAGS) -o test_free_space
316 ++ $(CC) test/test_free_space.o $(FSLIB_CFLAGS) $(OBJS) $(FSLIB_LDFLAGS) -o test_free_space
317 +
318 + diskinfo: $(FSLIB) test/diskinfo.o
319 +- gcc test/diskinfo.o $(OBJS) $(FSLIB_LDFLAGS) -g -o diskinfo
320 ++ $(CC) test/diskinfo.o $(OBJS) $(FSLIB_LDFLAGS) -g -o diskinfo
321 +
322 + .c.o:
323 +- gcc $(FSLIB_CFLAGS) -c $< -o $@
324 ++ $(CC) $(FSLIB_CFLAGS) -c $< -o $@
325 +
326 + clean:
327 + rm -rf *~ *.o test/*.o $(OBJS) $(FSLIB) $(FSLIB_TOOLS)
328 +diff --git a/kernel/Makefile b/kernel/Makefile
329 +index 1a71617..4f9760d 100644
330 +--- a/kernel/Makefile
331 ++++ b/kernel/Makefile
332 +@@ -3,6 +3,7 @@ OBJECTS = $(SOURCES:.cc=.o)
333 + TARGET_DIR = ./build/
334 + TARGET = $(TARGET_DIR)/libbckernel.a
335 + BC_CFLAGS = $(BC_EXTRA_CFLAGS) -fPIC -c -Wall -ludev -L../build/ -lspacemap -I../ -fvisibility=hidden #-fvisibility-inlines-hidden
336 ++CXX = g++
337 +
338 +
339 + ### Build ###
340 +@@ -21,12 +22,12 @@ module: create-dirs force_look
341 +
342 + kernel-lib: create-dirs $(TARGET)
343 + $(TARGET): $(OBJECTS)
344 +- ar rcs $(TARGET) $(OBJECTS)
345 ++ $(AR) rcs $(TARGET) $(OBJECTS)
346 +
347 + $(OBJECTS): Makefile $(SOURCES) BCKernel.h
348 + set -e; \
349 + for i in $(SOURCES); do \
350 +- g++ -c $(BC_CFLAGS) $$i -o $${i%.cc}.o; \
351 ++ $(CXX) -c $(BC_CFLAGS) $$i -o $${i%.cc}.o; \
352 + done
353 +
354 + create-dirs: $(TARGET_DIR)
355 +diff --git a/keygens/kgghost/Makefile b/keygens/kgghost/Makefile
356 +index 65c4bf6..a7b0af8 100644
357 +--- a/keygens/kgghost/Makefile
358 ++++ b/keygens/kgghost/Makefile
359 +@@ -5,10 +5,13 @@ KGGHOST_OBJS = hash.o pbe.o keyblock.o datablock.o kgghost.o
360 + KGGHOST_CFLAGS = -Wall -fPIC -p -ggdb -I. -I../../ -I../../certificate -DBC_LINUX
361 + KGGHOST_CFLAGS += $(BC_EXTRA_CFLAGS)
362 +
363 ++CXX = g++
364 ++AR = ar
365 ++
366 + all: $(KGGHOST) Makefile
367 +
368 + $(KGGHOST):$(KGGHOST_OBJS) $(CERTIFICATE_LIB)
369 +- ar rcs $(KGGHOST) $(KGGHOST_OBJS)
370 ++ $(AR) rcs $(KGGHOST) $(KGGHOST_OBJS)
371 +
372 + $(CERTIFICATE_LIB):
373 + make -C ../../certificate/CertificateLib
374 +@@ -17,7 +20,7 @@ $(KERNEL_LIB):
375 + make -C ../../kernel/build
376 +
377 + %.o:%.cpp
378 +- g++ $(KGGHOST_CFLAGS) -c -o $@ $<
379 ++ $(CXX) $(KGGHOST_CFLAGS) -c -o $@ $<
380 +
381 + clean:
382 + rm -f *.o *.ver *~ $(KGGHOST)
383 +diff --git a/keygens/kgsha/Makefile b/keygens/kgsha/Makefile
384 +index d3a33d0..9c8c688 100644
385 +--- a/keygens/kgsha/Makefile
386 ++++ b/keygens/kgsha/Makefile
387 +@@ -10,10 +10,13 @@ KGSHA_OBJS = hash.o datablock.o kgsha.o
388 + KGSHA_CFLAGS = -Wall -fPIC -p -gdwarf-2 -I. -I../../ -I../../certificate -DBC_LINUX
389 + KGSHA_CFLAGS += $(EXTRA_CFLAGS)
390 +
391 ++CXX = g++
392 ++AR = ar
393 ++
394 + all: $(KGSHA) $(KGSHA_OBJS) Makefile hidden_sector.h defs.h datablock.h
395 +
396 + $(KGSHA): $(KGSHA_OBJS) $(CERTIFICATE_LIB) $(KERN_LIB)
397 +- ar rcs $(KGSHA) $(KGSHA_OBJS)
398 ++ $(AR) rcs $(KGSHA) $(KGSHA_OBJS)
399 +
400 + $(CERT_LIB):
401 + make -C ../../certificate/CertificateLib
402 +@@ -22,7 +25,7 @@ $(KERN_LIB):
403 + make -C ../../kernel/
404 +
405 + %.o:%.cpp
406 +- g++ $(KGSHA_CFLAGS) -c -o $@ $<
407 ++ $(CXX) $(KGSHA_CFLAGS) -c -o $@ $<
408 +
409 + clean:
410 + rm -f *.o *.ver *~ $(KGSHA)
411 +diff --git a/mount/Makefile b/mount/Makefile
412 +index 7a3d66b..0e60095 100644
413 +--- a/mount/Makefile
414 ++++ b/mount/Makefile
415 +@@ -1,22 +1,23 @@
416 +
417 + HELPERS = bcrrpart_helper bcmount_helper bcumount_helper
418 +
419 ++CC = gcc
420 + OBJS = common.o
421 + CFLAGS += -Wall -O3
422 +
423 + all: $(HELPERS) Makefile
424 +
425 + bcrrpart_helper: $(OBJS) rrpart.o
426 +- gcc $(OBJS) rrpart.o $(LDFLAGS) -o bcrrpart_helper
427 ++ $(CC) $(OBJS) rrpart.o $(LDFLAGS) -o bcrrpart_helper
428 +
429 + bcmount_helper: $(OBJS) mount.o
430 +- gcc $(OBJS) mount.o $(LDFLAGS) -o bcmount_helper
431 ++ $(CC) $(OBJS) mount.o $(LDFLAGS) -o bcmount_helper
432 +
433 + bcumount_helper: $(OBJS) umount.o
434 +- gcc $(OBJS) umount.o $(LDFLAGS) -o bcumount_helper
435 ++ $(CC) $(OBJS) umount.o $(LDFLAGS) -o bcumount_helper
436 +
437 + %.o:%.c
438 +- gcc $(CFLAGS) -c -o $@ $<
439 ++ $(CC) $(CFLAGS) -c -o $@ $<
440 +
441 + clean:
442 + rm -f *.o *.ver *~ $(HELPERS)
443 +diff --git a/spacemap/Makefile b/spacemap/Makefile
444 +index 6dff240..7dd2ad9 100644
445 +--- a/spacemap/Makefile
446 ++++ b/spacemap/Makefile
447 +@@ -5,17 +5,19 @@ LIB_NAME = spacemap
448 + STATIC_TARGET = lib$(LIB_NAME).a
449 + OBJECT_CFLAGS = -fPIC -g -c -Wall -ludev -fvisibility=hidden #-fvisibility-inlines-hidden
450 +
451 ++CXX = g++
452 ++AR = ar
453 +
454 + all: static
455 + true
456 +
457 + static: $(OBJECTS)
458 +- ar rcs $(STATIC_TARGET) $(OBJECTS)
459 ++ $(AR) rcs $(STATIC_TARGET) $(OBJECTS)
460 +
461 + $(OBJECTS): $(SOURCES)
462 + set -e; \
463 + for i in $(SOURCES); do \
464 +- g++ $(OBJECT_CFLAGS) $$i -o $${i%.c}.o; \
465 ++ $(CXX) $(OBJECT_CFLAGS) $$i -o $${i%.c}.o; \
466 + done
467 +
468 + clean:
469 +diff --git a/tests/Makefile b/tests/Makefile
470 +index c6d78f0..419020b 100644
471 +--- a/tests/Makefile
472 ++++ b/tests/Makefile
473 +@@ -2,8 +2,8 @@ TESTS_PWD = ../build/tests/
474 + TESTS_TARGET = $(TESTS_PWD)/bctool-tests
475 + TESTS_SOURCES = tests-main.c ../container/cipher.cc ../keygens/kgsha/datablock.cpp ../keygens/kgsha/hash.cpp ../container/linux/file.cpp
476 + TESTS_CFLAGS = -I../ -I../certificate/ -L../build/ -L../build/kernel/ -DBC_LINUX -ludev -g
477 +-CP = gcc
478 +-CPP = g++
479 ++CC = gcc
480 ++CXX = g++
481 + CERT_LIB_NAME = certificate
482 + KERN_LIB_NAME = bckernel
483 + SPACEMAP_LIB_NAME = spacemap
484 +@@ -15,11 +15,11 @@ all: $(TESTS_TARGET)
485 + cp insert-modules.sh remove-modules.sh bcmod-loaded.sh $(TESTS_PWD)
486 +
487 + $(TESTS_TARGET): $(TESTS_SOURCES) Makefile
488 +- $(CPP) -o $(TESTS_TARGET) $(TESTS_CFLAGS) $(TESTS_SOURCES) -l$(CERT_LIB_NAME) -l$(KERN_LIB_NAME) -l$(SPACEMAP_LIB_NAME) -lcunit -ludev
489 ++ $(CXX) -o $(TESTS_TARGET) $(TESTS_CFLAGS) $(TESTS_SOURCES) -l$(CERT_LIB_NAME) -l$(KERN_LIB_NAME) -l$(SPACEMAP_LIB_NAME) -lcunit -ludev
490 + cp kernel/print-struct-size.c $(TESTS_PWD)
491 +- $(CP) -o $(TESTS_PWD)test-data-generator kernel/test-data-generator.c $(TESTS_CFLAGS) -l$(KERN_LIB_NAME) -l$(SPACEMAP_LIB_NAME)
492 +- $(CPP) -o $(TESTS_PWD)kgsha-key-generator kgsha/kgsha-data-generator.cpp ../keygens/kgsha/datablock.cpp ../keygens/kgsha/hash.cpp ../container/cipher.cc $(TESTS_CFLAGS) -l$(KERN_LIB_NAME) -l$(CERT_LIB_NAME) -l$(SPACEMAP_LIB_NAME)
493 +- $(CP) -o $(TESTS_PWD)/bcdevchecker bcdevchecker.c
494 ++ $(CC) -o $(TESTS_PWD)test-data-generator kernel/test-data-generator.c $(TESTS_CFLAGS) -l$(KERN_LIB_NAME) -l$(SPACEMAP_LIB_NAME)
495 ++ $(CXX) -o $(TESTS_PWD)kgsha-key-generator kgsha/kgsha-data-generator.cpp ../keygens/kgsha/datablock.cpp ../keygens/kgsha/hash.cpp ../container/cipher.cc $(TESTS_CFLAGS) -l$(KERN_LIB_NAME) -l$(CERT_LIB_NAME) -l$(SPACEMAP_LIB_NAME)
496 ++ $(CC) -o $(TESTS_PWD)/bcdevchecker bcdevchecker.c
497 +
498 + clean:
499 + rm -rf $(TESTS_PWD)
500 +--
501 +2.16.4
502 +
503 +From a7e9a6048e443b0a592c56b1b48e66d20092cf76 Mon Sep 17 00:00:00 2001
504 +From: Alon Bar-Lev <alon.barlev@×××××.com>
505 +Date: Tue, 11 Sep 2018 19:34:59 +0300
506 +Subject: [PATCH 5/6] build: add missing sys/sysmacros.h
507 +
508 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
509 +---
510 + mount/common.c | 1 +
511 + mount/mount.c | 1 +
512 + mount/rrpart.c | 1 +
513 + 3 files changed, 3 insertions(+)
514 +
515 +diff --git a/mount/common.c b/mount/common.c
516 +index 0a14ea4..d88394e 100644
517 +--- a/mount/common.c
518 ++++ b/mount/common.c
519 +@@ -9,6 +9,7 @@
520 + #include <stdarg.h>
521 + #include <errno.h>
522 + #include <unistd.h>
523 ++#include <sys/sysmacros.h>
524 + #include <sys/types.h>
525 + #include <sys/wait.h>
526 + #include <sys/stat.h>
527 +diff --git a/mount/mount.c b/mount/mount.c
528 +index c57594f..7c802fe 100644
529 +--- a/mount/mount.c
530 ++++ b/mount/mount.c
531 +@@ -10,6 +10,7 @@
532 + #include <string.h>
533 + #include <unistd.h>
534 + #include <errno.h>
535 ++#include <sys/sysmacros.h>
536 + #include <sys/types.h>
537 + #include <sys/wait.h>
538 + #include <sys/stat.h>
539 +diff --git a/mount/rrpart.c b/mount/rrpart.c
540 +index f7ce125..7ba5692 100644
541 +--- a/mount/rrpart.c
542 ++++ b/mount/rrpart.c
543 +@@ -13,6 +13,7 @@
544 + #include <unistd.h>
545 + #include <sys/ioctl.h>
546 + #include <sys/stat.h>
547 ++#include <sys/sysmacros.h>
548 + #include <sys/types.h>
549 + #include <linux/fs.h>
550 +
551 +--
552 +2.16.4
553 +
554 +From 9cb62cc4cbe9cb929aa1fca34d3d807a4e83bcca Mon Sep 17 00:00:00 2001
555 +From: Alon Bar-Lev <alon.barlev@×××××.com>
556 +Date: Tue, 11 Sep 2018 19:12:13 +0300
557 +Subject: [PATCH 6/6] modules: build for kernel-4.14
558 +
559 +Signed-off-by: Alon Bar-Lev <alon.barlev@×××××.com>
560 +---
561 + kernel/kmod/bc_dev.c | 4 +++-
562 + kernel/kmod/bc_mem.c | 1 +
563 + spacemap/defs.h | 1 +
564 + 3 files changed, 5 insertions(+), 1 deletion(-)
565 +
566 +diff --git a/kernel/kmod/bc_dev.c b/kernel/kmod/bc_dev.c
567 +index cddbf49..8b5657b 100644
568 +--- a/kernel/kmod/bc_dev.c
569 ++++ b/kernel/kmod/bc_dev.c
570 +@@ -86,9 +86,11 @@ static void reject_bio(struct bio *bio)
571 + {
572 + #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0))
573 + bio_endio(bio, -EIO);
574 +-#else
575 ++#elif (LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0))
576 + bio->bi_error = -EIO;
577 + bio_endio(bio);
578 ++#else
579 ++ bio_io_error(bio);
580 + #endif
581 + }
582 +
583 +diff --git a/kernel/kmod/bc_mem.c b/kernel/kmod/bc_mem.c
584 +index 0b516c8..69ec832 100644
585 +--- a/kernel/kmod/bc_mem.c
586 ++++ b/kernel/kmod/bc_mem.c
587 +@@ -6,6 +6,7 @@
588 + #include <linux/init.h>
589 + #include <linux/slab.h>
590 + #include <linux/kernel.h>
591 ++#include <linux/sched.h>
592 + #include <asm/uaccess.h>
593 +
594 + #define BC_GET_CALLER_PTR __builtin_return_address(0)
595 +diff --git a/spacemap/defs.h b/spacemap/defs.h
596 +index f0c87ba..7de9052 100644
597 +--- a/spacemap/defs.h
598 ++++ b/spacemap/defs.h
599 +@@ -17,6 +17,7 @@
600 + #include <linux/kernel.h>
601 + #include <linux/module.h>
602 + #include <linux/slab.h>
603 ++#include <linux/sched.h>
604 + #include <asm/uaccess.h>
605 +
606 + typedef int8_t bc_8;
607 +--
608 +2.16.4
609 +