blob: deaede85784c1c5808f9bd84d63b4d051dd74535 [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)} \
Brad Bishop15ae2502019-06-18 21:44:24 -040034 kernel_crypto \
35 internal-argon2 \
36 blkid \
37 luks-adjust-xts-keysize \
38 openssl \
39"
Brad Bishop26bdd442019-08-16 17:08:17 -040040PACKAGECONFIG_append_class-target = " \
41 udev \
42"
Brad Bishop15ae2502019-06-18 21:44:24 -040043
44PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
45PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
46PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
47PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
48PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
49PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
50PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
51PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
52PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
Brad Bishop26bdd442019-08-16 17:08:17 -040053PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,,udev"
Brad Bishop15ae2502019-06-18 21:44:24 -040054PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
55# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
56# recognized.
57PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
58PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
59PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
60PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
61PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
62PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
Brad Bishop19323692019-04-05 15:28:33 -040063PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
64PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
Brad Bishop15ae2502019-06-18 21:44:24 -040065PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
66PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
67PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
Brad Bishop26bdd442019-08-16 17:08:17 -040068PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
Brad Bishop19323692019-04-05 15:28:33 -040069
70RRECOMMENDS_${PN} = "kernel-module-aes-generic \
71 kernel-module-dm-crypt \
72 kernel-module-md5 \
73 kernel-module-cbc \
74 kernel-module-sha256-generic \
75 kernel-module-xts \
76"
77
78EXTRA_OECONF = "--enable-static"
Brad Bishop15ae2502019-06-18 21:44:24 -040079# Building without largefile is not supported by upstream
80EXTRA_OECONF += "--enable-largefile"
81# Requires a static popt library
82EXTRA_OECONF += "--disable-static-cryptsetup"
83# There's no recipe for libargon2 yet
84EXTRA_OECONF += "--disable-libargon2"
Brad Bishop19323692019-04-05 15:28:33 -040085
86FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
87
88BBCLASSEXTEND = "native nativesdk"