build-tools: package reuse + secureboot signing doesn't work correctly

Bug #2017763 reported by hqbai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
In Progress
Undecided
Unassigned

Bug Description

Brief Description
-----------------
using build-pkgs --reuse together with secureboot signing results in failed builds, the reason is that there are no the needed deb packages in local build directory after building with '--reuse'.

Severity
--------
Provide the severity of the defect.

Major

Steps to Reproduce
------------------
export STX_SHARED_RPEO=<url to remote build repo>
export STX_SHARED_SOURCE=<url to remote source repo>
build-pkgs --reuse
export SIGNING_SERVER=<xxx>
export PATH=$MY_REPO/build-tools:$PATH
sign-secure-boot_debian

Expected Behavior
------------------
The sign script works

Actual Behavior
----------------
The error messages is:
10:43:01 sign-secure-boot_debian: start
10:43:01 ls: cannot access '<path to>/std/shim/shim-unsigned_*_amd64.deb': No such file or directory
10:43:01 No shim-unsigned deb!

Reproducibility
---------------
100%

System Configuration
--------------------
'--reuse' is enabled.

Branch/Pull Time/Commit
-----------------------
master

Last Pass
---------
NA

Timestamp/Logs
--------------
NA

Test Activity
-------------
NA
Workaround
----------
build-pkgs -c -p shim,grub-efi
Then run:
sign-secure-boot_debian

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tools (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/tools/+/881545

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to root (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/root/+/882338

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tools (master)

Reviewed: https://review.opendev.org/c/starlingx/tools/+/881545
Committed: https://opendev.org/starlingx/tools/commit/ce558761fe076ed568930bc856e53d7911af41be
Submitter: "Zuul (22348)"
Branch: master

commit ce558761fe076ed568930bc856e53d7911af41be
Author: hqbai <email address hidden>
Date: Wed Apr 26 18:23:24 2023 +0800

    Add never_reuse.lst for some special packages

    There are some special packages which are only available
    to the local project like 'build-info', or are signed
    locally and should not be reused between projects like
    'grub-efi' and 'shim', all these packages can be added
    into the never_reuse.lst and they are built locally even
    the 'reuse' feature is enabled.

    Partial-Bug: 2017763

    Change-Id: I7b70298dc3cd3cc5b7223c83987f80b9dae2d3cc
    Signed-off-by: hqbai <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to root (master)

Reviewed: https://review.opendev.org/c/starlingx/root/+/882338
Committed: https://opendev.org/starlingx/root/commit/add2c84a28ed7b371c0c20ab1be1a55e0ca7410f
Submitter: "Zuul (22348)"
Branch: master

commit add2c84a28ed7b371c0c20ab1be1a55e0ca7410f
Author: hqbai <email address hidden>
Date: Thu May 4 10:33:40 2023 +0800

    build-pkgs: Fixed the deb packages missing issue after reuse

    The '--reuse|--reuse_maximum' feature mirrors the remote
    shared repository and imports all debs from the mirror
    to the local repository, there are no deb packages in the
    local build directory for the reused packages which make
    some tasks like building docker images and secure boot
    signing fail for the missing deb packages.
    This commit supports the below functions to fix the above
    issues:
    a. If '--dl_reused' option is enabled for option '--reuse'
    or '--reuse_maximum', all the reused deb packages will be
    downloaded to their local build directory.
    b. 'never_reuse.lst' will be checked and the packages listed
    in it will be built locally instead of reusing them if the
    option '--reuse' is enabled. And it will be ignored if the
    option '--reuse_maximum' is enabled.

    Test Plan:
    Pass: build-pkgs (make sure the normal build-pkgs works)
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --reuse
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --reuse --dl_reused
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --clean --reuse --dl_reused
          Run the secure boot signing script
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --clean --reuse --dl_reused
          build-pkgs (Make sure this build will not build from scratch)
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --clean --reuse_maximum --dl_reused
    Pass: export STX_SHARED_REPO=<url to shard repo>
          export STX_SHARED_SOURCE=<url to shared source>
          build-pkgs --reuse_maximum --dl_reused

    Partial-Bug: 2017763

    Signed-off-by: hqbai <email address hidden>
    Change-Id: I8cd84dbe6fe8f0262dde12befb0b16367e261968

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.