flash-script: avoid cleanup trap exit on iso/img runs#1855
Merged
brianmcgillion merged 1 commit intomainfrom Mar 26, 2026
Merged
flash-script: avoid cleanup trap exit on iso/img runs#1855brianmcgillion merged 1 commit intomainfrom
brianmcgillion merged 1 commit intomainfrom
Conversation
writeShellApplication wraps flash-script with 'set -euo pipefail'. After 71740ef, cleanup() was added as: [ -n "" ] && rm -rf "" The .iso and .img paths never set TEMP_DIR, so the EXIT trap runs this test with an empty variable after the script has already printed 'Flashing complete'. Under the strict wrapper, that status 1 becomes the script exit code. In CI this makes installer flashing look successful, but Jenkins then reports exit code 1 and skips the next stage. Use an explicit if block so cleanup() returns success when there is nothing to remove. Signed-off-by: Henri Rosten <henri.rosten@unikie.com>
vunnyso
approved these changes
Mar 26, 2026
milva-unikie
approved these changes
Mar 26, 2026
milva-unikie
left a comment
There was a problem hiding this comment.
Tested in Jenkins that flashing installer images works again. Thank you!
@brianmcgillion can we get this merged asap?
brianmcgillion
approved these changes
Mar 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nix
writeShellApplicationwrapsflash-scriptwithset -euo pipefail. After 71740ef (from #1848),cleanup()was added as:[ -n "$TEMP_DIR" ] && rm -rf "$TEMP_DIR"The .iso and .img paths never set
TEMP_DIR, so theEXITtrap runs this test with an empty variable after the script has already printedFlashing complete. Under the strict wrapper, that status 1 becomes the script exit code.In CI this makes installer flashing look successful, but Jenkins then reports exit code 1 and skips the next stage.
Use an explicit
ifblock socleanup()returns success when there is nothing to remove.Description of Changes
Type of Change
Related Issues / Tickets
Checklist
make-checksand it passesTesting Instructions
Applicable Targets
aarch64aarch64x86_64x86_64x86_64Installation Method
nixos-rebuild ... switchTest Steps To Verify: