blob: 07736711fc8ce16f1908ef32bfd06bad3a822de7 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Manage plain dm-crypt and LUKS encrypted volumes"
2DESCRIPTION = "Cryptsetup is used to conveniently setup dm-crypt managed \
3device-mapper mappings. These include plain dm-crypt volumes and \
4LUKS volumes. The difference is that LUKS uses a metadata header \
5and can hence offer more features than plain dm-crypt. On the other \
6hand, the header is visible and vulnerable to damage."
7HOMEPAGE = "https://gitlab.com/cryptsetup/cryptsetup"
8SECTION = "console"
9LICENSE = "GPL-2.0-with-OpenSSL-exception"
10LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
11
Brad Bishop15ae2502019-06-18 21:44:24 -040012DEPENDS = " \
13 json-c \
14 libdevmapper \
15 popt \
16 util-linux \
17"
Brad Bishop19323692019-04-05 15:28:33 -040018
Brad Bishop0f291cc2019-09-01 15:16:57 -040019RDEPENDS_${PN} = " \
20 libdevmapper \
21"
22
Brad Bishop19323692019-04-05 15:28:33 -040023SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
Brad Bishop665fd022019-08-26 01:32:28 -040024SRC_URI[md5sum] = "f7818082056e5bc0be12e4c7fc20345a"
25SRC_URI[sha256sum] = "9d8f8cac2836a1623c075b5cba96032271dc81a28b2aa27fbd8331e831416bb1"
Brad Bishop19323692019-04-05 15:28:33 -040026
27inherit autotools gettext pkgconfig
28
29# Use openssl because libgcrypt drops root privileges
30# if libgcrypt is linked with libcap support
Brad Bishop15ae2502019-06-18 21:44:24 -040031PACKAGECONFIG ??= " \
32 keyring \
33 cryptsetup \
34 veritysetup \
35 cryptsetup-reencrypt \
36 integritysetup \
37 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
Brad Bishop15ae2502019-06-18 21:44:24 -040038 kernel_crypto \
39 internal-argon2 \
40 blkid \
41 luks-adjust-xts-keysize \
42 openssl \
43"
Brad Bishop26bdd442019-08-16 17:08:17 -040044PACKAGECONFIG_append_class-target = " \
45 udev \
46"
Brad Bishop15ae2502019-06-18 21:44:24 -040047
48PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
49PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
50PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
51PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
52PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
53PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
54PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
55PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
56PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
Brad Bishop26bdd442019-08-16 17:08:17 -040057PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,,udev"
Brad Bishop15ae2502019-06-18 21:44:24 -040058PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
59# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
60# recognized.
61PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
62PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
63PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
64PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
65PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
66PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
Brad Bishop19323692019-04-05 15:28:33 -040067PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
68PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
Brad Bishop15ae2502019-06-18 21:44:24 -040069PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
70PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
71PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
Brad Bishop26bdd442019-08-16 17:08:17 -040072PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
Brad Bishop19323692019-04-05 15:28:33 -040073
74RRECOMMENDS_${PN} = "kernel-module-aes-generic \
75 kernel-module-dm-crypt \
76 kernel-module-md5 \
77 kernel-module-cbc \
78 kernel-module-sha256-generic \
79 kernel-module-xts \
80"
81
82EXTRA_OECONF = "--enable-static"
Brad Bishop15ae2502019-06-18 21:44:24 -040083# Building without largefile is not supported by upstream
84EXTRA_OECONF += "--enable-largefile"
85# Requires a static popt library
86EXTRA_OECONF += "--disable-static-cryptsetup"
87# There's no recipe for libargon2 yet
88EXTRA_OECONF += "--disable-libargon2"
Brad Bishop19323692019-04-05 15:28:33 -040089
90FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
91
92BBCLASSEXTEND = "native nativesdk"