diff mbox series

[v2] docs: document the GPG_SIGN_SERIALIZE variable

Message ID 20261202130047.312119-1-adarsh.jagadish.kamini@est.tech
State New
Headers show
Series [v2] docs: document the GPG_SIGN_SERIALIZE variable | expand

Commit Message

Adarsh Jagadish Kamini Dec. 2, 2026, 1 p.m. UTC
OE-Core now serializes GnuPG signing by default. Document the opt-out
and how to configure gpg-agent before using it.

[YOCTO #16480]

AI-Generated: Uses Kiro (claude-opus-5.5)
Signed-off-by: Adarsh Jagadish Kamini <adarsh.jagadish.kamini@est.tech>
---
 documentation/dev-manual/packages.rst  | 10 ++++++--
 documentation/ref-manual/variables.rst | 34 ++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/documentation/dev-manual/packages.rst b/documentation/dev-manual/packages.rst
index 380d806be..3574d87cd 100644
--- a/documentation/dev-manual/packages.rst
+++ b/documentation/dev-manual/packages.rst
@@ -862,7 +862,7 @@  You must also set up the following settings in a
    `passphrase`.
 
 Aside from the ``RPM_GPG_NAME`` and ``RPM_GPG_PASSPHRASE`` variables in
-the previous example, two optional variables related to signing are available:
+the previous example, three optional variables related to signing are available:
 
 -  *GPG_BIN:* Specifies a ``gpg`` binary/wrapper that is executed
    when the package is signed.
@@ -870,6 +870,9 @@  the previous example, two optional variables related to signing are available:
 -  *GPG_PATH:* Specifies the ``gpg`` home directory used when the
    package is signed.
 
+-  :term:`GPG_SIGN_SERIALIZE`: Specifies whether signing operations run
+   one at a time to avoid exhausting the secure memory of ``gpg-agent``.
+
 Processing Package Feeds
 ------------------------
 
@@ -890,7 +893,7 @@  variable. Regarding security, keeping a plain text passphrase out of the
 configuration is more secure.
 
 Aside from the ``PACKAGE_FEED_GPG_NAME`` and
-``PACKAGE_FEED_GPG_PASSPHRASE_FILE`` variables, three optional variables
+``PACKAGE_FEED_GPG_PASSPHRASE_FILE`` variables, four optional variables
 related to signed package feeds are available:
 
 -  *GPG_BIN* Specifies a ``gpg`` binary/wrapper that is executed
@@ -899,6 +902,9 @@  related to signed package feeds are available:
 -  *GPG_PATH:* Specifies the ``gpg`` home directory used when the
    package is signed.
 
+-  :term:`GPG_SIGN_SERIALIZE`: Specifies whether signing operations run
+   one at a time to avoid exhausting the secure memory of ``gpg-agent``.
+
 -  *PACKAGE_FEED_GPG_SIGNATURE_TYPE:* Specifies the type of ``gpg``
    signature. This variable applies only to RPM and IPK package feeds.
    Allowable values for the ``PACKAGE_FEED_GPG_SIGNATURE_TYPE`` are
diff --git a/documentation/ref-manual/variables.rst b/documentation/ref-manual/variables.rst
index bbf0e6d07..99931f9b8 100644
--- a/documentation/ref-manual/variables.rst
+++ b/documentation/ref-manual/variables.rst
@@ -3965,6 +3965,40 @@  system and gives an overview of their function and contents.
       the optional :term:`GO_WORKDIR` variable, defaulting to the value
       of :term:`GO_IMPORT`, allows to specify a different Go working directory.
 
+   :term:`GPG_SIGN_SERIALIZE`
+      When set to "1" (the default), the OpenEmbedded build system uses a
+      lock in :term:`TMPDIR` so that GnuPG signing operations sharing that
+      :term:`TMPDIR`, such as those done by the :ref:`ref-classes-sign_rpm`
+      class or for :doc:`shared state signing
+      </security-manual/sstate-signing>`, run one at a time. Builds or
+      multiconfigs with different :term:`TMPDIR` values are not serialized
+      against each other. Concurrent signing requests can exhaust the secure
+      memory of ``gpg-agent``, causing "Cannot allocate memory" errors,
+      unless the agent was started with the ``auto-expand-secmem`` option.
+
+      Set :term:`GPG_SIGN_SERIALIZE` to "0" to sign in parallel. Only do this
+      if every ``gpg-agent`` serving the GnuPG home directory used for signing
+      runs with ``auto-expand-secmem``. To configure this, add the following
+      line to ``gpg-agent.conf`` in that directory::
+
+         auto-expand-secmem
+
+      A running agent does not pick up this change. Stop any running agent so
+      that the next signing operation starts one with the new configuration:
+
+      .. code-block:: console
+
+         $ gpgconf --homedir /path/to/gpg/home --kill gpg-agent
+
+      Signing tasks that run under pseudo, such as ``do_package_write_rpm``,
+      can use a separate agent whose sockets are in the GnuPG home directory
+      itself, which the above command does not stop. Stop that agent through
+      its socket, for example:
+
+      .. code-block:: console
+
+         $ gpg-connect-agent -S /path/to/gpg/home/S.gpg-agent.yocto-native KILLAGENT /bye
+
    :term:`GROUPADD_PARAM`
       When inheriting the :ref:`ref-classes-useradd` class,
       this variable specifies for a package what parameters should be