diff mbox series

[v4,1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation

Message ID 20251215102041.1630567-1-adam.duskett@amarulasolutions.com
State New
Headers show
Series [v4,1/7] signing-keys.bb: Fix DISTRO_CODENAME truncation | expand

Commit Message

Adam Duskett Dec. 15, 2025, 10:20 a.m. UTC
If DISTRO_CODENAME is not set in the environment, bash quietly
drops the string resulting in a key such as PACKAGEFEED-GPG-KEY-defaultsetup-

However, when python calls self.d.getVar('DISTRO_CODENAME'), the resulting
string is 'None', leading to a configuration file pointing to a key such
as PACKAGEFEED-GPG-KEY-defaultsetup-None

Add a default value in signing-keys.bb to set DISTRO_CODENAME to None if
DISTRO_CODENAME is not set.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
---
 meta/recipes-core/meta/signing-keys.bb | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Mathieu Dubois-Briand Dec. 16, 2025, 10:10 a.m. UTC | #1
On Mon Dec 15, 2025 at 11:20 AM CET, Adam Duskett via lists.openembedded.org wrote:
> If DISTRO_CODENAME is not set in the environment, bash quietly
> drops the string resulting in a key such as PACKAGEFEED-GPG-KEY-defaultsetup-
>
> However, when python calls self.d.getVar('DISTRO_CODENAME'), the resulting
> string is 'None', leading to a configuration file pointing to a key such
> as PACKAGEFEED-GPG-KEY-defaultsetup-None
>
> Add a default value in signing-keys.bb to set DISTRO_CODENAME to None if
> DISTRO_CODENAME is not set.
>
> Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
> ---

Hi Adam,

It looks better overall, but we have a QA issue about some files not
shipped:

ERROR: dnf-5.3.0.0-r0 do_package: QA Issue: dnf: Files/directories were installed but not shipped in any package:
  /usr/lib
  /usr/lib/systemd
  /usr/lib/systemd/system
  /usr/lib/systemd/system/dnf5-makecache.timer
  /usr/lib/systemd/system/dnf5-makecache.service
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
dnf: 5 installed and not shipped files. [installed-vs-shipped]
ERROR: dnf-5.3.0.0-r0 do_package: Fatal QA errors were found, failing task.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/92/builds/2845
https://autobuilder.yoctoproject.org/valkyrie/#/builders/59/builds/2863

Also, it looks like it is generating some errors and some warnings on
do_rootfs:

WARNING: core-image-ptest-libgcrypt-1.0-r0 do_rootfs: [log_check] core-image-ptest-libgcrypt: found 1 warning message in the logfile:
[log_check] Warning: skipped OpenPGP checks for 57 packages from repository: oe-repo

WARNING: core-image-ptest-openssl-1.0-r0 do_rootfs: [log_check] core-image-ptest-openssl: found 1 warning message in the logfile:
[log_check] Warning: skipped OpenPGP checks for 865 packages from repository: oe-repo

ERROR: core-image-ptest-openssl-1.0-r0 do_rootfs: [log_check] core-image-ptest-openssl: found 1 error message in the logfile:
[log_check] [642/865] perl-module-test2-plugin-exit 100% |   7.7 MiB/s |   7.9 KiB |  00m00s
...
ERROR: core-image-ptest-coreutils-1.0-r0 do_rootfs: [log_check] core-image-ptest-coreutils: found 1 error message in the logfile:
[log_check] [649/879] perl-module-test2-plugin-exit 100% |   0.0   B/s |   7.9 KiB |  00m00s
...
ERROR: core-image-ptest-libtest-warnings-perl-1.0-r0 do_rootfs: [log_check] core-image-ptest-libtest-warnings-perl: found 1 error message in the logfile:
[log_check] [631/860] perl-module-test2-plugin-exit 100% |   0.0   B/s |   7.9 KiB |  00m00s
...

https://autobuilder.yoctoproject.org/valkyrie/#/builders/61/builds/2710
https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/2754
https://autobuilder.yoctoproject.org/valkyrie/#/builders/56/builds/837

https://autobuilder.yoctoproject.org/valkyrie/#/builders/16/builds/2886
https://autobuilder.yoctoproject.org/valkyrie/#/builders/68/builds/2935

Can you have a look at these issues?

Thanks,
Mathieu
diff mbox series

Patch

diff --git a/meta/recipes-core/meta/signing-keys.bb b/meta/recipes-core/meta/signing-keys.bb
index 94f4032911..c7713ed4a6 100644
--- a/meta/recipes-core/meta/signing-keys.bb
+++ b/meta/recipes-core/meta/signing-keys.bb
@@ -45,6 +45,10 @@  addtask get_public_keys before do_install
 do_get_public_keys[depends] += "gnupg-native:do_populate_sysroot"
 
 do_install () {
+    # Python evalutes an empty DISTRO_CODENAME to "None" which would cause mismatched files
+    # as the update config file would show GPG-KEY-${DISTRO}-None but the filename is
+    # installed as GPG-KEY-${DISTRO}-
+    DISTRO_CODENAME="${DISTRO_CODENAME:-None}"
     if [ -f "${B}/rpm-key" ]; then
         install -D -m 0644 "${B}/rpm-key" "${D}${sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
     fi
@@ -57,6 +61,7 @@  do_install () {
 }
 
 do_deploy () {
+    DISTRO_CODENAME="${DISTRO_CODENAME:-None}"
     if [ -f "${B}/rpm-key" ]; then
         install -D -m 0644 "${B}/rpm-key" "${DEPLOYDIR}/RPM-GPG-KEY-${DISTRO}-${DISTRO_CODENAME}"
     fi