diff --git a/cross/argon2/Makefile b/cross/argon2/Makefile new file mode 100644 index 00000000000..dcf4aac4b50 --- /dev/null +++ b/cross/argon2/Makefile @@ -0,0 +1,28 @@ +PKG_NAME = argon2 +PKG_VERS = 20190702 +PKG_EXT = tar.gz +PKG_DOWNLOAD_METHOD = git +PKG_GIT_HASH = 62358ba +PKG_DIST_SITE = https://github.com/P-H-C/phc-winner-$(PKG_NAME).git +PKG_DIR = $(PKG_NAME)-git$(PKG_GIT_HASH) +PKG_DIST_FILE = $(PKG_DIR).$(PKG_EXT) + +HOMEPAGE = https://www.password-hashing.net/ +COMMENT = The password hash Argon2, winner of PHC +LICENSE = Apache-2.0 + +include ../../mk/spksrc.archs.mk +ifneq ($(filter $(ARCH),$(i686_ARCHS)),) +OPTTARGET = i686 +else ifneq ($(filter $(ARCH),$(x64_ARCHS)),) +OPTTARGET = x86-64 +else +OPTTARGET = none +endif + +CONFIGURE_TARGET = nope + +COMPILE_MAKE_OPTIONS = ARGON2_VERSION=$(PKG_VERS) OPTTARGET=$(OPTTARGET) LIBRARY_REL=lib +INSTALL_MAKE_OPTIONS = install DESTDIR=$(INSTALL_DIR) PREFIX=$(INSTALL_PREFIX) LIBRARY_REL=lib + +include ../../mk/spksrc.cross-cc.mk diff --git a/cross/argon2/PLIST b/cross/argon2/PLIST new file mode 100644 index 00000000000..c157174dc73 --- /dev/null +++ b/cross/argon2/PLIST @@ -0,0 +1,2 @@ +lnk:lib/libargon2.so +lib:lib/libargon2.so.1 diff --git a/cross/argon2/digests b/cross/argon2/digests new file mode 100644 index 00000000000..794c6eb8b50 --- /dev/null +++ b/cross/argon2/digests @@ -0,0 +1,3 @@ +argon2-git62358ba.tar.gz SHA1 d5003c577ee17a7e50e1a03d399fe038c0d2b64e +argon2-git62358ba.tar.gz SHA256 a8c99f5e3728e27f9de48801e3df8160537e9340e5559b8862a923126674cd14 +argon2-git62358ba.tar.gz MD5 fcfda9f5726843bc347e9d7d73a08f01 diff --git a/cross/cryptsetup/Makefile b/cross/cryptsetup/Makefile new file mode 100644 index 00000000000..56392196777 --- /dev/null +++ b/cross/cryptsetup/Makefile @@ -0,0 +1,29 @@ +PKG_NAME = cryptsetup +PKG_VERS = 2.6.1 +PKG_EXT = tar.xz +PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://www.kernel.org/pub/linux/utils/cryptsetup/v$(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS))) +PKG_DIR = $(PKG_NAME)-$(PKG_VERS) + +DEPENDS = cross/device-mapper cross/json-c cross/libblkid cross/libuuid cross/openssl3 cross/popt + +HOMEPAGE = https://gitlab.com/cryptsetup/cryptsetup +COMMENT = Open-source utility used to conveniently set up disk encryption based on the dm-crypt kernel module. +LICENSE = GPLv2 + +GNU_CONFIGURE = 1 +CONFIGURE_ARGS = --disable-asciidoc +CONFIGURE_ARGS += --disable-external-tokens +CONFIGURE_ARGS += --disable-ssh-token +CONFIGURE_ARGS += --disable-veritysetup +CONFIGURE_ARGS += --disable-integritysetup +CONFIGURE_ARGS += --disable-selinux + +include ../../mk/spksrc.archs.mk +ifneq ($(filter $(ARCH),$(i686_ARCHS) $(x64_ARCHS)),) +# external argon2 is recommended for CPUs with SSE/AVX +DEPENDS += cross/argon2 +CONFIGURE_ARGS += --enable-libargon2 +endif + +include ../../mk/spksrc.cross-cc.mk diff --git a/cross/cryptsetup/PLIST b/cross/cryptsetup/PLIST new file mode 100644 index 00000000000..a5f15bbd54a --- /dev/null +++ b/cross/cryptsetup/PLIST @@ -0,0 +1,4 @@ +lnk:lib/libcryptsetup.so +lnk:lib/libcryptsetup.so.12 +lib:lib/libcryptsetup.so.12.9.0 +bin:sbin/cryptsetup diff --git a/cross/cryptsetup/digests b/cross/cryptsetup/digests new file mode 100644 index 00000000000..611424e7413 --- /dev/null +++ b/cross/cryptsetup/digests @@ -0,0 +1,3 @@ +cryptsetup-2.6.1.tar.xz SHA1 cee2f56968cd8cb2e171e3d5d3418ba7531a139f +cryptsetup-2.6.1.tar.xz SHA256 410ded65a1072ab9c8e41added37b9729c087fef4d2db02bb4ef529ad6da4693 +cryptsetup-2.6.1.tar.xz MD5 f9451ea928dc600eb34dd9f4d9ca34e5 diff --git a/cross/device-mapper/Makefile b/cross/device-mapper/Makefile new file mode 100644 index 00000000000..759627ffd38 --- /dev/null +++ b/cross/device-mapper/Makefile @@ -0,0 +1,29 @@ +PKG_NAME = device-mapper +PKG_REAL_NAME = LVM2 +PKG_VERS = 1.02.195 +PKG_REAL_VERS = 2.03.21 +PKG_EXT = tgz +PKG_DIST_NAME = $(PKG_REAL_NAME).$(PKG_REAL_VERS).$(PKG_EXT) +PKG_DIST_SITE = https://mirrors.kernel.org/sourceware/lvm2 +PKG_DIR = $(PKG_REAL_NAME).$(PKG_REAL_VERS) + +DEPENDS = cross/libblkid + +HOMEPAGE = https://sourceware.org/lvm2/ +COMMENT = Device-mapper userspace library +LICENSE = GPLv2 + +GNU_CONFIGURE = 1 +CONFIGURE_ARGS = --with-thin=no +CONFIGURE_ARGS += --with-cache=no +CONFIGURE_ARGS += --with-vdo-format=no +CONFIGURE_ARGS += --with-optimisation=-O2 +CONFIGURE_ARGS += --enable-pkgconfig +CONFIGURE_ARGS += --disable-selinux +CONFIGURE_ARGS += --disable-readline + +COMPILE_MAKE_OPTIONS = $(PKG_NAME) + +INSTALL_MAKE_OPTIONS = install_$(PKG_NAME) DESTDIR=$(INSTALL_DIR) prefix=$(INSTALL_PREFIX) + +include ../../mk/spksrc.cross-cc.mk diff --git a/cross/device-mapper/PLIST b/cross/device-mapper/PLIST new file mode 100644 index 00000000000..58c8c5c3534 --- /dev/null +++ b/cross/device-mapper/PLIST @@ -0,0 +1,2 @@ +lnk:lib/libdevmapper.so +lib:lib/libdevmapper.so.1.02 diff --git a/cross/device-mapper/digests b/cross/device-mapper/digests new file mode 100644 index 00000000000..4a298ede2ab --- /dev/null +++ b/cross/device-mapper/digests @@ -0,0 +1,3 @@ +LVM2.2.03.21.tgz SHA1 b6d4a84bf1f0306f43f447c7531021d5c126edbf +LVM2.2.03.21.tgz SHA256 1e261921d621998adc37960c615de784c6145c7f737a80b781f3108fbec67a7e +LVM2.2.03.21.tgz MD5 1730b322321bed204487ba241105e005 diff --git a/kernel/syno-apollolake-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-apollolake-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..81032771cd2 --- /dev/null +++ b/kernel/syno-apollolake-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-06-30 09:42:42.032779745 +1200 ++++ crypto/Makefile 2023-06-30 09:42:49.276112996 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-avoton-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-avoton-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..986c1a0b98b --- /dev/null +++ b/kernel/syno-avoton-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-06-30 09:55:43.629438063 +1200 ++++ crypto/Makefile 2023-06-30 09:56:13.772771070 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-braswell-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-braswell-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..bb8c73baa48 --- /dev/null +++ b/kernel/syno-braswell-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-06-30 10:30:08.576082738 +1200 ++++ crypto/Makefile 2023-06-30 10:30:25.792749224 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-broadwell-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-broadwell-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..78553443fb7 --- /dev/null +++ b/kernel/syno-broadwell-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-06-30 12:00:29.259359310 +1200 ++++ crypto/Makefile 2023-06-30 12:00:37.409359216 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-broadwellnk-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-broadwellnk-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..be8ec77d0e6 --- /dev/null +++ b/kernel/syno-broadwellnk-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-06-30 13:51:13.399288749 +1200 ++++ crypto/Makefile 2023-06-30 13:51:19.819288681 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-bromolow-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-bromolow-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..5ae31fbaa90 --- /dev/null +++ b/kernel/syno-bromolow-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-06-30 15:27:00.802560983 +1200 ++++ crypto/Makefile 2023-06-30 15:27:04.682560937 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-cedarview-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-cedarview-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..52a0d74fa3b --- /dev/null +++ b/kernel/syno-cedarview-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-06-30 17:01:19.155833951 +1200 ++++ crypto/Makefile 2023-06-30 17:01:21.952500587 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-denverton-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-denverton-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..ba0b048404d --- /dev/null +++ b/kernel/syno-denverton-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-07-01 10:43:43.629163211 +1200 ++++ crypto/Makefile 2023-07-01 10:43:46.989163297 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-geminilake-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-geminilake-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..3106d0843e6 --- /dev/null +++ b/kernel/syno-geminilake-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-07-01 11:19:18.048631169 +1200 ++++ crypto/Makefile 2023-07-01 11:19:21.398631134 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-grantley-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-grantley-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..f9bc831e8c9 --- /dev/null +++ b/kernel/syno-grantley-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-07-01 11:29:08.185291659 +1200 ++++ crypto/Makefile 2023-07-01 11:29:10.401958302 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/kernel/syno-kvmx64-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-kvmx64-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..aac5685a37c --- /dev/null +++ b/kernel/syno-kvmx64-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-07-01 11:37:03.865286671 +1200 ++++ crypto/Makefile 2023-07-01 11:37:07.011953307 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-purley-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-purley-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..67cfd6f1de3 --- /dev/null +++ b/kernel/syno-purley-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-07-01 11:45:34.201947974 +1200 ++++ crypto/Makefile 2023-07-01 11:45:37.641947937 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-v1000-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-v1000-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..9dc1c9ea32f --- /dev/null +++ b/kernel/syno-v1000-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,9 @@ +--- crypto/Makefile.orig 2023-07-01 11:57:01.681940743 +1200 ++++ crypto/Makefile 2023-07-01 11:57:04.495274047 +1200 +@@ -134,6 +134,5 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ + obj-$(CONFIG_CRYPTO_HASH_INFO) += hash_info.o + obj-$(CONFIG_CRYPTO_ABLK_HELPER) += ablk_helper.o diff --git a/kernel/syno-x86-6.2.4/patches/remove-hydrogen.patch b/kernel/syno-x86-6.2.4/patches/remove-hydrogen.patch new file mode 100644 index 00000000000..c4d5c5a89c8 --- /dev/null +++ b/kernel/syno-x86-6.2.4/patches/remove-hydrogen.patch @@ -0,0 +1,7 @@ +--- crypto/Makefile.orig 2023-07-01 12:11:46.298598026 +1200 ++++ crypto/Makefile 2023-07-01 12:11:48.845264667 +1200 +@@ -103,4 +103,3 @@ + obj-$(CONFIG_XOR_BLOCKS) += xor.o + obj-$(CONFIG_ASYNC_CORE) += async_tx/ + obj-$(CONFIG_ASYMMETRIC_KEY_TYPE) += asymmetric_keys/ +-obj-$(CONFIG_SYNO_RAMDISK_INTEGRITY_CHECK) += hydrogen/ diff --git a/mk/spksrc.archs.mk b/mk/spksrc.archs.mk index 9d3bd10c189..2b8db6ede38 100644 --- a/mk/spksrc.archs.mk +++ b/mk/spksrc.archs.mk @@ -37,6 +37,8 @@ ARCHS_WITH_GENERIC_SUPPORT = $(sort $(foreach version, $(AVAILABLE_TCVERSIONS), # PPC_ARCHS except qoriq OLD_PPC_ARCHS = powerpc ppc824x ppc853x ppc854x +SRM_ARCHS = $(SRM_ARMv7_ARCHS) + # outdated unsupported archs DEPRECATED_ARCHS = powerpc ppc824x ppc854x ppc853x diff --git a/mk/spksrc.depend.mk b/mk/spksrc.depend.mk index 7bfd73f3ccf..2abed8dff30 100644 --- a/mk/spksrc.depend.mk +++ b/mk/spksrc.depend.mk @@ -51,8 +51,7 @@ depend_msg_target: pre_depend_target: depend_msg_target depend_target: $(PRE_DEPEND_TARGET) - @set -e; \ - for depend in $(BUILD_DEPENDS) $(KERNEL_DEPEND) $(TOOLKIT_DEPEND) $(DEPENDS); \ + @for depend in $(BUILD_DEPENDS) $(KERNEL_DEPEND) $(TOOLKIT_DEPEND) $(DEPENDS); \ do \ env $(ENV) $(MAKE) -C ../../$$depend ; \ done diff --git a/mk/spksrc.spk.mk b/mk/spksrc.spk.mk index f9787aab614..550ca0cf5c5 100644 --- a/mk/spksrc.spk.mk +++ b/mk/spksrc.spk.mk @@ -599,11 +599,10 @@ kernel-modules-%: archs2process=$* ; \ fi ; \ $(MSG) ARCH to be processed: $${archs2process} ; \ - set -e ; \ for arch in $${archs2process} ; do \ $(MSG) "Processing $${arch} ARCH" ; \ MAKEFLAGS= $(PSTAT_TIME) $(MAKE) WORK_DIR=$(PWD)/work-$* ARCH=$$(echo $${arch} | cut -f1 -d-) TCVERSION=$$(echo $${arch} | cut -f2 -d-) strip 2>&1 | tee --append build-$*.log ; \ - [ $${PIPESTATUS[0]} -eq 0 ] || false ; \ + [ $${PIPESTATUS[0]} -eq 0 ] || continue ; \ $(MAKE) spkclean ; \ rm -fr $(PWD)/work-$*/$(addprefix linux-, $${arch}) ; \ $(MAKE) -C ../../toolchain/syno-$${arch} clean ; \ diff --git a/spk/cryptsetup/Makefile b/spk/cryptsetup/Makefile new file mode 100644 index 00000000000..a54b33c007a --- /dev/null +++ b/spk/cryptsetup/Makefile @@ -0,0 +1,84 @@ +SPK_NAME = cryptsetup +SPK_VERS = 2.6.1 +SPK_REV = 1 +SPK_ICON = src/papirus-folder-locked.png + +UNSUPPORTED_ARCHS = 88f6281 comcerto2k qoriq +REQUIRED_MIN_DSM = 6.2.4 +REQUIRED_MAX_DSM = 6.2.4 +REQUIRED_MIN_SRM = 1.3.1 + +include ../../mk/spksrc.archs.mk + +REQUIRE_KERNEL := 1 + +# User-space interface for hash/symmetric key cipher algorithms +REQUIRE_KERNEL_MODULE = CONFIG_CRYPTO_USER_API:crypto:af_alg +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_USER_API_HASH:crypto:algif_hash +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_USER_API_SKCIPHER:crypto:algif_skcipher + +# AES cipher algorithms +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_CRYPTD:crypto:cryptd +ifneq ($(filter $(ARCH),hi3535 evansport),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES:crypto:aes_generic +endif +ifneq ($(filter $(ARCH),avoton braswell broadwell bromolow cedarview grantley x86),) +# ABLK_HELPER_X86 was introduced in 3.6 +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_ABLK_HELPER_X86:arch/x86/crypto:ablk_helper +else ifeq ($(filter $(ARCH),alpine alpine4k armada370 armada375 armada38x armadaxp evansport hi3535 monaco),) +# ABLK_HELPER was introduced in 3.13 +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_ABLK_HELPER:crypto:ablk_helper +endif +ifneq ($(filter $(ARCH),$(i686_ARCHS)),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_586:arch/x86/crypto:aes-i586 +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_NI_INTEL:arch/x86/crypto:aesni-intel +else ifneq ($(filter $(ARCH),$(x64_ARCHS)),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_X86_64:arch/x86/crypto:aes-x86_64 +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_GLUE_HELPER_X86:arch/x86/crypto:glue_helper +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_GF128MUL:crypto:gf128mul +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_LRW:crypto:lrw +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_XTS:crypto:xts +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_NI_INTEL:arch/x86/crypto:aesni-intel +else ifneq ($(filter $(ARCH),ipq806x),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_ARM:arch/arm/crypto:aes-arm +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_ARM_BS:arch/arm/crypto:aes-arm-bs +else ifneq ($(filter $(ARCH),$(ARMv8_ARCHS)),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_ARM64_CE:arch/arm64/crypto:aes-ce-cipher +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_AES_ARM64_CE_BLK:arch/arm64/crypto:aes-ce-blk +endif + +# Crypt target support +ifeq ($(filter $(ARCH),alpine alpine4k armada370 armada375 armada38x armadaxp ipq806x),) +REQUIRE_KERNEL_MODULE += CONFIG_CRYPTO_CBC:crypto:cbc +endif +ifneq ($(filter $(ARCH),ipq806x),) +REQUIRE_KERNEL_MODULE += CONFIG_BLK_DEV_DM_BUILTIN:drivers/md:dm-builtin +# MD required because of Synology patches +REQUIRE_KERNEL_MODULE += CONFIG_BLK_DEV_MD:drivers/md:md-mod +REQUIRE_KERNEL_MODULE += CONFIG_BLK_DEV_DM:drivers/md:dm-mod +endif +ifneq ($(filter $(ARCH),armada375),) +REQUIRE_KERNEL_MODULE += CONFIG_DM_CRYPT:drivers/md:dm-crypt-armada +else +REQUIRE_KERNEL_MODULE += CONFIG_DM_CRYPT:drivers/md:dm-crypt +endif + +DEPENDS = cross/$(SPK_NAME) + +MAINTAINER = jonathan-conder +DESCRIPTION = Open-source utility used to conveniently set up disk encryption based on the dm-crypt kernel module. Use the dm-crypt-ctl command to load the required kernel modules, then use cryptsetup as normal. +DISPLAY_NAME = Cryptsetup +HOMEPAGE = https://gitlab.com/cryptsetup/cryptsetup +LICENSE = GPLv2 + +STARTABLE = no +SPK_COMMANDS = sbin/cryptsetup sbin/dm-crypt-ctl + +POST_STRIP_TARGET = cryptsetup_extra_install + +include ../../mk/spksrc.spk.mk + +.PHONY: cryptsetup_extra_install +cryptsetup_extra_install: + install -m 755 -d $(STAGING_DIR)/sbin + install -m 755 src/dm-crypt-ctl.sh $(STAGING_DIR)/sbin/dm-crypt-ctl diff --git a/spk/cryptsetup/PLIST b/spk/cryptsetup/PLIST new file mode 100644 index 00000000000..4501b79c86b --- /dev/null +++ b/spk/cryptsetup/PLIST @@ -0,0 +1 @@ +rsc:lib/modules/** diff --git a/spk/cryptsetup/src/dm-crypt-ctl.sh b/spk/cryptsetup/src/dm-crypt-ctl.sh new file mode 100644 index 00000000000..acbc4cd9231 --- /dev/null +++ b/spk/cryptsetup/src/dm-crypt-ctl.sh @@ -0,0 +1,124 @@ +#!/bin/sh + +set -e + +maybe_insmod() { + [ ! -e "${KPATH}/${1}.ko" ] || /sbin/insmod "${KPATH}/${1}.ko" +} + +maybe_rmmod() { + [ ! -e "${KPATH}/${1}.ko" ] || /sbin/rmmod "${KPATH}/${1}.ko" +} + +grepmod() { + /sbin/lsmod | grep -q "^${1}\\>" +} + +insmod_all() { + maybe_insmod crypto/af_alg + maybe_insmod crypto/algif_hash + maybe_insmod crypto/algif_skcipher + + maybe_insmod crypto/cryptd + maybe_insmod crypto/aes_generic + maybe_insmod arch/x86/crypto/ablk_helper + maybe_insmod crypto/ablk_helper + maybe_insmod arch/x86/crypto/aes-i586 + maybe_insmod arch/x86/crypto/aes-x86_64 + maybe_insmod arch/x86/crypto/glue_helper + maybe_insmod crypto/gf128mul + maybe_insmod crypto/lrw + maybe_insmod crypto/xts + maybe_insmod arch/x86/crypto/aesni-intel + maybe_insmod arch/arm/crypto/aes-arm + maybe_insmod arch/arm/crypto/aes-arm-bs + maybe_insmod arch/arm64/crypto/aes-ce-cipher + maybe_insmod arch/arm64/crypto/aes-ce-blk + + maybe_insmod crypto/cbc + # dm_builtin is unsafe to unload so it may already be loaded + grepmod dm_builtin || maybe_insmod drivers/md/dm-builtin + maybe_insmod drivers/md/md-mod + maybe_insmod drivers/md/dm-mod + maybe_insmod drivers/md/dm-crypt + maybe_insmod drivers/md/dm-crypt-armada +} + +rmmod_all() { + maybe_rmmod drivers/md/dm-crypt-armada + maybe_rmmod drivers/md/dm-crypt + maybe_rmmod drivers/md/dm-mod + maybe_rmmod drivers/md/md-mod + maybe_rmmod crypto/cbc + + maybe_rmmod arch/arm64/crypto/aes-ce-blk + maybe_rmmod arch/arm64/crypto/aes-ce-cipher + maybe_rmmod arch/arm/crypto/aes-arm-bs + maybe_rmmod arch/arm/crypto/aes-arm + maybe_rmmod arch/x86/crypto/aesni-intel + maybe_rmmod crypto/xts + maybe_rmmod crypto/lrw + maybe_rmmod crypto/gf128mul + maybe_rmmod arch/x86/crypto/glue_helper + maybe_rmmod arch/x86/crypto/aes-x86_64 + maybe_rmmod arch/x86/crypto/aes-i586 + maybe_rmmod crypto/ablk_helper + maybe_rmmod arch/x86/crypto/ablk_helper + maybe_rmmod crypto/aes_generic + maybe_rmmod crypto/cryptd + + maybe_rmmod crypto/algif_skcipher + maybe_rmmod crypto/algif_hash + maybe_rmmod crypto/af_alg +} + +grepmod_all() { + if { grepmod dm_crypt || grepmod dm_crypt_armada; } && \ + grepmod algif_hash && \ + grepmod algif_skcipher; then + + if grepmod aesni_intel || \ + grepmod aes_arm_bs || \ + grepmod aes_ce_blk; then + echo 'dm-crypt is loaded with AES acceleration' + else + echo 'dm-crypt is loaded without AES acceleration' + fi + else + echo 'dm-crypt is not loaded' + return 1 + fi +} + +ARCH="$(uname -a | awk '{print $NF}' | cut -f2 -d_)" +DSM_VERSION="$(sed -n 's/^productversion=\(.*\)/\1/p' /etc/VERSION)" +KVER="$(uname -r | awk -F. '{print $1 "." $2 "." $3}')" + +DSM_VERSION="${DSM_VERSION#\"}" +DSM_VERSION="${DSM_VERSION%\"}" + +KPATH="/var/packages/cryptsetup/target/lib/modules/${ARCH}-${DSM_VERSION}/${KVER}" +if [ ! -d "$KPATH" ]; then + KPATH="${KPATH}+" + if [ ! -d "$KPATH" ]; then + echo 'Failed to locate kernel modules' + exit 1 + fi +fi + +case $1 in + insmod|start) + insmod_all + grepmod_all + ;; + rmmod|stop) + rmmod_all + ;; + status) + grepmod_all + ;; + *) + echo "Usage: $0 " + exit 1 + ;; +esac diff --git a/spk/cryptsetup/src/papirus-folder-locked.png b/spk/cryptsetup/src/papirus-folder-locked.png new file mode 100644 index 00000000000..63c0505115a Binary files /dev/null and b/spk/cryptsetup/src/papirus-folder-locked.png differ