blob: b9668eb099e5165816804797d70f86ec46d33902 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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
12DEPENDS = " \
13 json-c \
14 libdevmapper \
15 popt \
16 util-linux \
17"
18
19RDEPENDS_${PN} = " \
20 libdevmapper \
21"
22
23SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
Andrew Geissler2ee498a2020-05-29 15:52:06 -050024SRC_URI[md5sum] = "6e4ffb6d35a73f7539a5d0c1354654cd"
25SRC_URI[sha256sum] = "a89e13dff0798fd0280e801d5f0cc8cfdb2aa5b1929bec1b7322e13d3eca95fb"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27inherit autotools gettext pkgconfig
28
29# Use openssl because libgcrypt drops root privileges
30# if libgcrypt is linked with libcap support
31PACKAGECONFIG ??= " \
32 keyring \
33 cryptsetup \
34 veritysetup \
35 cryptsetup-reencrypt \
36 integritysetup \
37 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
38 kernel_crypto \
39 internal-argon2 \
40 blkid \
41 luks-adjust-xts-keysize \
42 openssl \
43"
44PACKAGECONFIG_append_class-target = " \
45 udev \
46"
47
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"
57PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,,udev"
58PACKAGECONFIG[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"
67PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
68PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
69PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
70PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
71PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
72PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
73
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"
83# 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"
89
90FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
91
92BBCLASSEXTEND = "native nativesdk"