[meta-oe] cryptsetup: Add PACKAGECONFIG options

Submitted by Robert Joslyn on June 2, 2019, 11:12 p.m. | Patch ID: 161904

Details

Message ID 20190602231221.24148-1-robert.joslyn@redrectangle.org
State Accepted
Commit 1ce71d6ec31195280073adec0e400dda7c0dd8a7
Headers show

Commit Message

Robert Joslyn June 2, 2019, 11:12 p.m.
Add various PACKAGECONFIG options, keeping the default options enabled.
---
 .../cryptsetup/cryptsetup_2.1.0.bb            | 51 ++++++++++++++++++-
 1 file changed, 49 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
index cf1d22242..51cecf5d2 100644
--- a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
+++ b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
@@ -9,7 +9,12 @@  SECTION = "console"
 LICENSE = "GPL-2.0-with-OpenSSL-exception"
 LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
 
-DEPENDS = "util-linux libdevmapper popt libgcrypt json-c"
+DEPENDS = " \
+    json-c \
+    libdevmapper \
+    popt \
+    util-linux \
+"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
 SRC_URI[md5sum] = "41d8b985ef69242852b93e95d53e8e28"
@@ -19,9 +24,45 @@  inherit autotools gettext pkgconfig
 
 # Use openssl because libgcrypt drops root privileges
 # if libgcrypt is linked with libcap support
-PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG ??= " \
+    keyring \
+    cryptsetup \
+    veritysetup \
+    cryptsetup-reencrypt \
+    integritysetup \
+    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
+    udev \
+    kernel_crypto \
+    internal-argon2 \
+    blkid \
+    luks-adjust-xts-keysize \
+    openssl \
+"
+
+PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
+PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
+PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
+PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
+PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
+PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
+PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
+PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
+PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
+PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
+PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
+# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
+# recognized.
+PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
+PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
+PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
+PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
+PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
+PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
 PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
 PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
+PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
+PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
+PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
 
 RRECOMMENDS_${PN} = "kernel-module-aes-generic \
                      kernel-module-dm-crypt \
@@ -32,6 +73,12 @@  RRECOMMENDS_${PN} = "kernel-module-aes-generic \
 "
 
 EXTRA_OECONF = "--enable-static"
+# Building without largefile is not supported by upstream
+EXTRA_OECONF += "--enable-largefile"
+# Requires a static popt library
+EXTRA_OECONF += "--disable-static-cryptsetup"
+# There's no recipe for libargon2 yet
+EXTRA_OECONF += "--disable-libargon2"
 
 FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
 

Comments

Armin Kuster June 6, 2019, 2:24 p.m.
On 6/2/19 4:12 PM, Robert Joslyn wrote:
> Add various PACKAGECONFIG options, keeping the default options enabled.
the PACKCONFIG went from openssl to a lot more, how is that keeping the
defaults?
> ---
>  .../cryptsetup/cryptsetup_2.1.0.bb            | 51 ++++++++++++++++++-
>  1 file changed, 49 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> index cf1d22242..51cecf5d2 100644
> --- a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> +++ b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> @@ -9,7 +9,12 @@ SECTION = "console"
>  LICENSE = "GPL-2.0-with-OpenSSL-exception"
>  LIC_FILES_CHKSUM = "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
>  
> -DEPENDS = "util-linux libdevmapper popt libgcrypt json-c"
> +DEPENDS = " \
> +    json-c \
> +    libdevmapper \
> +    popt \
> +    util-linux \
> +"
>  
>  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
>  SRC_URI[md5sum] = "41d8b985ef69242852b93e95d53e8e28"
> @@ -19,9 +24,45 @@ inherit autotools gettext pkgconfig
>  
>  # Use openssl because libgcrypt drops root privileges
>  # if libgcrypt is linked with libcap support
> -PACKAGECONFIG ??= "openssl"
> +PACKAGECONFIG ??= " \
> +    keyring \
> +    cryptsetup \
> +    veritysetup \
> +    cryptsetup-reencrypt \
> +    integritysetup \
> +    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
> +    udev \
> +    kernel_crypto \
> +    internal-argon2 \
> +    blkid \
> +    luks-adjust-xts-keysize \
> +    openssl \
> +"
> +
> +PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
> +PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
> +PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-pwquality,libpwquality"
> +PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-passwdqc,passwdqc"
> +PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-cryptsetup"
> +PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-veritysetup"
> +PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-reencrypt,--disable-cryptsetup-reencrypt"
> +PACKAGECONFIG[integritysetup] = "--enable-integritysetup,--disable-integritysetup"
> +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
> +PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
> +PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-kernel_crypto"
> +# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag isn't
> +# recognized.
> +PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
> +PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,--disable-internal-argon2"
> +PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-argon2,--disable-internal-sse-argon2"
> +PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
> +PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-random"
> +PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-xts-keysize,--disable-luks-adjust-xts-keysize"
>  PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
>  PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
> +PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
> +PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
> +PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
>  
>  RRECOMMENDS_${PN} = "kernel-module-aes-generic \
>                       kernel-module-dm-crypt \
> @@ -32,6 +73,12 @@ RRECOMMENDS_${PN} = "kernel-module-aes-generic \
>  "
>  
>  EXTRA_OECONF = "--enable-static"
> +# Building without largefile is not supported by upstream
> +EXTRA_OECONF += "--enable-largefile"
> +# Requires a static popt library
> +EXTRA_OECONF += "--disable-static-cryptsetup"
> +# There's no recipe for libargon2 yet
> +EXTRA_OECONF += "--disable-libargon2"
>  
>  FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
>
Robert Joslyn June 7, 2019, 3:46 a.m.
On Thu, 2019-06-06 at 07:24 -0700, akuster808 wrote:
> 
> On 6/2/19 4:12 PM, Robert Joslyn wrote:
> > Add various PACKAGECONFIG options, keeping the default options
> > enabled.
> the PACKCONFIG went from openssl to a lot more, how is that keeping
> the
> defaults?

My intent was to add PACKAGECONFIG options, but to keep the resulting
build the same as before. This should match the default options that
are set by upstream when you don't specify any --enable or --disable
options.

I can send a v2 with a better description if desired.

Thanks,
Robert

> > ---
> >  .../cryptsetup/cryptsetup_2.1.0.bb            | 51
> > ++++++++++++++++++-
> >  1 file changed, 49 insertions(+), 2 deletions(-)
> > 
> > diff --git a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> > b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> > index cf1d22242..51cecf5d2 100644
> > --- a/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> > +++ b/meta-oe/recipes-crypto/cryptsetup/cryptsetup_2.1.0.bb
> > @@ -9,7 +9,12 @@ SECTION = "console"
> >  LICENSE = "GPL-2.0-with-OpenSSL-exception"
> >  LIC_FILES_CHKSUM =
> > "file://COPYING;md5=32107dd283b1dfeb66c9b3e6be312326"
> >  
> > -DEPENDS = "util-linux libdevmapper popt libgcrypt json-c"
> > +DEPENDS = " \
> > +    json-c \
> > +    libdevmapper \
> > +    popt \
> > +    util-linux \
> > +"
> >  
> >  SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/v${@d.getVar('PV
> > ').split('.')[0]}.${@d.getVar('PV').split('.')[1]}/${BP}.tar.xz"
> >  SRC_URI[md5sum] = "41d8b985ef69242852b93e95d53e8e28"
> > @@ -19,9 +24,45 @@ inherit autotools gettext pkgconfig
> >  
> >  # Use openssl because libgcrypt drops root privileges
> >  # if libgcrypt is linked with libcap support
> > -PACKAGECONFIG ??= "openssl"
> > +PACKAGECONFIG ??= " \
> > +    keyring \
> > +    cryptsetup \
> > +    veritysetup \
> > +    cryptsetup-reencrypt \
> > +    integritysetup \
> > +    ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)} \
> > +    udev \
> > +    kernel_crypto \
> > +    internal-argon2 \
> > +    blkid \
> > +    luks-adjust-xts-keysize \
> > +    openssl \
> > +"
> > +
> > +PACKAGECONFIG[keyring] = "--enable-keyring,--disable-keyring"
> > +PACKAGECONFIG[fips] = "--enable-fips,--disable-fips"
> > +PACKAGECONFIG[pwquality] = "--enable-pwquality,--disable-
> > pwquality,libpwquality"
> > +PACKAGECONFIG[passwdqc] = "--enable-passwdqc,--disable-
> > passwdqc,passwdqc"
> > +PACKAGECONFIG[cryptsetup] = "--enable-cryptsetup,--disable-
> > cryptsetup"
> > +PACKAGECONFIG[veritysetup] = "--enable-veritysetup,--disable-
> > veritysetup"
> > +PACKAGECONFIG[cryptsetup-reencrypt] = "--enable-cryptsetup-
> > reencrypt,--disable-cryptsetup-reencrypt"
> > +PACKAGECONFIG[integritysetup] = "--enable-integritysetup,
> > --disable-integritysetup"
> > +PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
> > +PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
> > +PACKAGECONFIG[kernel_crypto] = "--enable-kernel_crypto,--disable-
> > kernel_crypto"
> > +# gcrypt-pkbdf2 requries --with-crypto_backend=gcrypt or the flag
> > isn't
> > +# recognized.
> > +PACKAGECONFIG[gcrypt-pbkdf2] = "--enable-gcrypt-pbkdf2"
> > +PACKAGECONFIG[internal-argon2] = "--enable-internal-argon2,
> > --disable-internal-argon2"
> > +PACKAGECONFIG[internal-sse-argon2] = "--enable-internal-sse-
> > argon2,--disable-internal-sse-argon2"
> > +PACKAGECONFIG[blkid] = "--enable-blkid,--disable-blkid,util-linux"
> > +PACKAGECONFIG[dev-random] = "--enable-dev-random,--disable-dev-
> > random"
> > +PACKAGECONFIG[luks-adjust-xts-keysize] = "--enable-luks-adjust-
> > xts-keysize,--disable-luks-adjust-xts-keysize"
> >  PACKAGECONFIG[openssl] = "--with-crypto_backend=openssl,,openssl"
> >  PACKAGECONFIG[gcrypt] = "--with-crypto_backend=gcrypt,,libgcrypt"
> > +PACKAGECONFIG[nss] = "--with-crypto_backend=nss,,nss"
> > +PACKAGECONFIG[kernel] = "--with-crypto_backend=kernel"
> > +PACKAGECONFIG[nettle] = "--with-crypto_backend=nettle,,nettle"
> >  
> >  RRECOMMENDS_${PN} = "kernel-module-aes-generic \
> >                       kernel-module-dm-crypt \
> > @@ -32,6 +73,12 @@ RRECOMMENDS_${PN} = "kernel-module-aes-generic \
> >  "
> >  
> >  EXTRA_OECONF = "--enable-static"
> > +# Building without largefile is not supported by upstream
> > +EXTRA_OECONF += "--enable-largefile"
> > +# Requires a static popt library
> > +EXTRA_OECONF += "--disable-static-cryptsetup"
> > +# There's no recipe for libargon2 yet
> > +EXTRA_OECONF += "--disable-libargon2"
> >  
> >  FILES_${PN} += "${@bb.utils.contains('DISTRO_FEATURES','systemd','
> > ${exec_prefix}/lib/tmpfiles.d/cryptsetup.conf', '', d)}"
> >