From 6f6d92b6598bcac71155cbaf669b105d549bf676 Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 24 Oct 2024 15:41:21 -0400 Subject: [PATCH] Try to verify output file for stock builds --- README.md | 19 ++++++++++--------- openwrtbuilder | 13 +++++++++---- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index fdcfdd6..1a2eb5d 100755 --- a/README.md +++ b/README.md @@ -11,20 +11,21 @@ Sanely build and deploy OpenWRT images using the Image Builder or from source co ```(text) --profile,-p PROFILE --release,-r,--version,-v RELEASE ("snapshot", "22.03.3") ---buildroot,-b PATH - Default: location of openwrtbuilder script +--buildroot,-b PATH (Default: script directory) --source - Build image from source, not from Image Builder - Allows make config options to be passed + Build image from source, not from Image Builder + Allows make config options to be passed in profile --ssh-upgrade HOST - Example: root@192.168.1.1 + Example: root@192.168.1.1 --ssh-backup SSH_PATH - Enabled by default for --ssh-upgrade + Enabled by default for --ssh-upgrade --flash,-f DEVICE - Example: /dev/sdX + Example: /dev/sdX --reset - Cleanup all source and output files - Can be combined with -p to reset a specific profile + Cleanup all source and output files + Can be combined with -p to reset a specific profile +--yes,-y + Assume yes for all questions (automatic mode) --debug,-d --help,-h ``` diff --git a/openwrtbuilder b/openwrtbuilder index 331119c..1eefe12 100755 --- a/openwrtbuilder +++ b/openwrtbuilder @@ -772,10 +772,15 @@ main() { extract "$ib_file" "$BUILDDIR" || return $? add_repos make_images - # Verify output iamges - for outfile in "$BINDIR"/*.img.gz; do - verify "$outfile" "$ib_sha256_file" || return 1 - done + # Verify output image for stock builds (in testing) + if [[ ! -v P_ARR[packages] || -z ${P_ARR[packages]} ]]; then + shopt -s nullglob + local -a outfiles=("$BINDIR"/*.img.gz "$BINDIR"/*.img) + shopt -u nullglob + for outfile in "${outfiles[@]}"; do + verify "$outfile" "$ib_sha256_file" || return 1 + done + fi #copyFiles fi