blob: 51cecf5d23a87c01ec3c8b5a8a1bd85634da9663 [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
19SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
20SRC_URI[md5sum] = "41d8b985ef69242852b93e95d53e8e28"
21SRC_URI[sha256sum] = "a3eeb2741f8f3376d16585191f3c60e067dd987e096c3c4b073fab7748b1c897"
22
23inherit autotools gettext pkgconfig
24
25# Use openssl because libgcrypt drops root privileges
26# if libgcrypt is linked with libcap support
Brad Bishop15ae2502019-06-18 21:44:24 -040027PACKAGECONFIG ??= " \
28 keyring \
29 cryptsetup \
30 veritysetup \
31 cryptsetup-reencrypt \
32 integritysetup \
33 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
34 udev \
35 kernel_crypto \
36 internal-argon2 \
37 blkid \
38 luks-adjust-xts-keysize \
39 openssl \
40"
41
42PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
43PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
44PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
45PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
46PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
47PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
48PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
49PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
50PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
51PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
52PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
53# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
54# recognized.
55PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
56PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
57PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
58PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
59PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
60PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
Brad Bishop19323692019-04-05 15:28:33 -040061PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
62PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
Brad Bishop15ae2502019-06-18 21:44:24 -040063PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
64PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
65PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
Brad Bishop19323692019-04-05 15:28:33 -040066
67RRECOMMENDS_${PN} = "kernel-module-aes-generic \
68 kernel-module-dm-crypt \
69 kernel-module-md5 \
70 kernel-module-cbc \
71 kernel-module-sha256-generic \
72 kernel-module-xts \
73"
74
75EXTRA_OECONF = "--enable-static"
Brad Bishop15ae2502019-06-18 21:44:24 -040076# Building without largefile is not supported by upstream
77EXTRA_OECONF += "--enable-largefile"
78# Requires a static popt library
79EXTRA_OECONF += "--disable-static-cryptsetup"
80# There's no recipe for libargon2 yet
81EXTRA_OECONF += "--disable-libargon2"
Brad Bishop19323692019-04-05 15:28:33 -040082
83FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
84
85BBCLASSEXTEND = "native nativesdk"