Skip to content

Commit

Permalink
Merge branch 'cryptsetup-2.3' of https://github.com/hardenedvault/heads
Browse files Browse the repository at this point in the history
… into tpm2
  • Loading branch information
osresearch committed Nov 20, 2020
2 parents 67fe5c2 + 057cc3c commit aebcdbf
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 98 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ heads_cc := $(CROSS)gcc \
-fdebug-prefix-map=$(pwd)=heads \
-gno-record-gcc-switches \
-D__MUSL__ \
-I$(INSTALL)/include \
-isystem $(INSTALL)/include \
-L$(INSTALL)/lib \

CROSS_TOOLS_NOCC := \
Expand Down
Empty file.
18 changes: 10 additions & 8 deletions modules/cryptsetup
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
modules-$(CONFIG_CRYPTSETUP) += cryptsetup

cryptsetup_depends := util-linux popt lvm2 $(musl_dep)
cryptsetup_depends := util-linux popt lvm2 json-c $(musl_dep)

cryptsetup_version := 1.7.3
cryptsetup_version := 2.3.3
cryptsetup_dir := cryptsetup-$(cryptsetup_version)
cryptsetup_tar := cryptsetup-$(cryptsetup_version).tar.xz
cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v1.7/cryptsetup-$(cryptsetup_version).tar.xz
cryptsetup_hash := af2b04e8475cf40b8d9ffd97a1acfa73aa787c890430afd89804fb544d6adc02
cryptsetup_url := https://www.kernel.org/pub/linux/utils/cryptsetup/v2.3/cryptsetup-$(cryptsetup_version).tar.xz
cryptsetup_hash := 3bca4ffe39e2f94cef50f6ea65acb873a6dbce5db34fc6bcefe38b6d095e82df

# Use an empty prefix so that the executables will not include the
# build path.
cryptsetup_configure := ./configure \
$(CROSS_TOOLS) \
--host i386-elf-linux \
--prefix "/" \
--disable-rpath \
--disable-gcrypt-pbkdf2 \
--enable-cryptsetup-reencrypt \
--with-crypto_backend=kernel \
--with-tmpfilesdir=$(INSTALL)/lib/tmpfiles.d

# but after building, replace prefix so that they will be installed
# in the correct directory.
Expand All @@ -28,10 +30,10 @@ cryptsetup_target := \
install

cryptsetup_output := \
src/.libs/cryptsetup \
src/.libs/cryptsetup-reencrypt \
src/.libs/veritysetup \
.libs/cryptsetup \
.libs/cryptsetup-reencrypt \
.libs/veritysetup \

cryptsetup_libraries := \
lib/.libs/libcryptsetup.so.4 \
.libs/libcryptsetup.so.12 \

37 changes: 37 additions & 0 deletions modules/json-c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
modules-$(CONFIG_CRYPTSETUP) += json-c

json-c_version := 0.14
json-c_dir := json-c-$(json-c_version)
json-c_tar := json-c-$(json-c_version).tar.gz
json-c_url := https://s3.amazonaws.com/json-c_releases/releases/json-c-$(json-c_version)-nodoc.tar.gz
json-c_hash := 99914e644a25201d82ccefa20430f7515c110923360f9ef46755527c02412afa

# there is a bug in cmake-configure so that it can not be used with a "=", fxed in next
# release though (then it needs to read '--prefix="$(INSTALL)"' here instead
define toolchain_file =
set\(CMAKE_SYSTEM_NAME Linux\)\n\
set\(CMAKE_SYSROOT $(INSTALL)\)\n\
set\(CMAKE_C_COMPILER $(CROSS)gcc\)\n\
set\(CMAKE_AR $(CROSS)ar\)\n\
set\(CMAKE_LINKER $(CROSS)ld\)\n\
set\(CMAKE_NM $(CROSS)nm\)\n\
set\(CMAKE_OBJCOPY $(CROSS)objcopy\)\n\
set\(CMAKE_OBJDUMP $(CROSS)objdump\)\n\
set\(INSTALL_PKGCONFIG_DIR $(INSTALL)/lib/pkgconfig\)\n\
set\(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER\)\n\
set\(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY\)\n\
set\(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY\)\n\
set\(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY\)
endef

json-c_configure := \
echo -e "$(toolchain_file)" | sed 's/\\//g' > toolchain && \
mkdir -p build && \
cd build && \
cmake .. -DCMAKE_INSTALL_PREFIX="$(INSTALL)" -DCMAKE_TOOLCHAIN_FILE=../toolchain

json-c_target := \
$(CROSS_TOOLS) -C $(build)/$(json-c_dir)/build \
all install

json-c_libraries := build/libjson-c.so.5
11 changes: 6 additions & 5 deletions modules/util-linux
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ util-linux_target := \
$(MAKE_JOBS) \
$(CROSS_TOOLS) \
DESTDIR="$(INSTALL)" \
install
install && \
rm $(INSTALL)/lib/libblkid.la && \
rm $(INSTALL)/lib/libuuid.la

util-linux_libraries += .libs/libuuid.so.1

# libblkid is not needed by lvm2, so it is not installed now
#util-linux_libraries += .libs/libblkid.so.1
util-linux_libraries += \
.libs/libuuid.so.1 \
.libs/libblkid.so.1 \

util-linux_depends := $(musl_dep)
Loading

0 comments on commit aebcdbf

Please sign in to comment.