blob: 8f9f663a33e09a875eff6d6d17b1a742e49c48ee [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001SUMMARY = "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-libuuid \
17 libssh \
18"
19
20DEPENDS:append:libc-musl = " argp-standalone"
21LDFLAGS:append:libc-musl = " -largp"
22
23SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
24SRC_URI[sha256sum] = "fc0df945188172264ec5bf1d0bda08264fadc8a3f856d47eba91f31fe354b507"
25
26inherit autotools gettext pkgconfig
27
28# Use openssl because libgcrypt drops root privileges
29# if libgcrypt is linked with libcap support
30PACKAGECONFIG ??= " \
31 keyring \
32 cryptsetup \
33 veritysetup \
34 cryptsetup-reencrypt \
35 integritysetup \
36 ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
37 kernel_crypto \
38 internal-argon2 \
39 blkid \
40 luks-adjust-xts-keysize \
41 openssl \
42"
43PACKAGECONFIG:append:class-target = " \
44 udev \
45"
46
47PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
48PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
49PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
50PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
51PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
52PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
53PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
54PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
55PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
56PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,,udev lvm2-udevrules"
57PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
58# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
59# recognized.
60PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
61PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
62PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
63PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
64PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
65PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
66PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
67PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
68PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
69PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
70PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
71PACKAGECONFIG[luks2] = "--with-default-luks-format=LUKS2,--with-default-luks-format=LUKS1"
72
73EXTRA_OECONF = "--enable-static"
74# Building without largefile is not supported by upstream
75EXTRA_OECONF += "--enable-largefile"
76# Requires a static popt library
77EXTRA_OECONF += "--disable-static-cryptsetup"
78# There's no recipe for libargon2 yet
79EXTRA_OECONF += "--disable-libargon2"
80
81FILES:${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
82
83RDEPENDS:${PN} = " \
84 libdevmapper \
85"
86
87RRECOMMENDS:${PN}:class-target = " \
88 kernel-module-aes-generic \
89 kernel-module-dm-crypt \
90 kernel-module-md5 \
91 kernel-module-cbc \
92 kernel-module-sha256-generic \
93 kernel-module-xts \
94"
95
96BBCLASSEXTEND = "native nativesdk"