From d84d127f91186082df2a786c7e20fe2af55dfa3b Mon Sep 17 00:00:00 2001 From: Andrii Klymenko Date: Thu, 23 Apr 2026 15:59:30 +0300 Subject: T8542: Add functionality to generate SBOM file from ISO image Apply suggestion, add validation that the Syft binary was copied with success. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- scripts/check-qemu-install | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 98b49a64..507b1ea6 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -1315,10 +1315,18 @@ try: raise Exception('Failed to mount SBOM transfer disk inside VM') c.expect(op_mode_prompt) - # Copy the syft binary to the transfer disk and check the version to verify it works before running the SBOM generation process - c.sendline('sudo cp /mnt/sbom_transfer/syft /tmp/syft && sudo chmod +x /tmp/syft') + # Copy the syft binary from the transfer disk and verify it is available before running the SBOM generation process + c.sendline('test -x /mnt/sbom_transfer/syft && echo SYFT_SRC_OK || echo SYFT_SRC_FAIL') + i = c.expect(['SYFT_SRC_OK', 'SYFT_SRC_FAIL']) + if i != 0: + raise Exception('Syft binary is missing or not executable on the SBOM transfer disk') c.expect(op_mode_prompt) + c.sendline('sudo cp /mnt/sbom_transfer/syft /tmp/syft && sudo chmod +x /tmp/syft && test -x /tmp/syft && echo SYFT_COPY_OK || echo SYFT_COPY_FAIL') + i = c.expect(['SYFT_COPY_OK', 'SYFT_COPY_FAIL']) + if i != 0: + raise Exception('Failed to copy Syft binary from SBOM transfer disk to /tmp/syft') + c.expect(op_mode_prompt) c.sendline('TERM=dumb /tmp/syft --version') c.expect(op_mode_prompt) lines = c.before.decode(errors='replace').strip().splitlines() -- cgit v1.2.3