summaryrefslogtreecommitdiff
path: root/include/vendor.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-01-04 16:15:43 +0000
committerLeah Rowe <leah@libreboot.org>2025-01-04 16:15:43 +0000
commit68299ad05caa68ccf30a52bbb5de0c57a0aa1504 (patch)
tree8e1c4a0eba6137ee448bfdb92815d921f9c02973 /include/vendor.sh
parentb8e6d12f3d90e70b6d7a32cc8dc9d1eb8d96c26d (diff)
vendor.sh: much more verbose errors/confirmation
the user must be well-informed as to the next step, which this script directly influences guide the user accordingly Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/vendor.sh')
-rw-r--r--include/vendor.sh30
1 files changed, 21 insertions, 9 deletions
diff --git a/include/vendor.sh b/include/vendor.sh
index 73293d6e..f3195c75 100644
--- a/include/vendor.sh
+++ b/include/vendor.sh
@@ -33,7 +33,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \
archive EC_url boarddir rom cbdir DL_url nukemode cbfstoolref FSPFD_hash \
_7ztest ME11bootguard ME11delta ME11version ME11sku ME11pch tmpromdir \
IFD_platform ifdprefix cdir sdir _me _metmp mfs TBFW_url_bkup TBFW_url \
- TBFW_hash TBFW_size hashfile xromsize xchanged EC_url_bkup $cv`"
+ TBFW_hash TBFW_size hashfile xromsize xchanged EC_url_bkup need_files $cv`"
vendor_download()
{
@@ -340,6 +340,7 @@ fail_inject()
vendor_inject()
{
+ need_files="n" # will be set to "y" if vendorfiles needed
_olderr="$err"
err="fail_inject"
remkdir "$tmpromdel"
@@ -358,22 +359,33 @@ vendor_inject()
check_release "$archive" || \
$err "You must run this script on a release archive. - $dontflash"
- if readcfg || [ -n "$new_mac" ]; then
+
+ readcfg && need_files="y"
+ if [ "$need_files" = "y" ] || [ -n "$new_mac" ]; then
[ "$nukemode" = "nuke" ] || x_ ./mk download "$board"
patch_release_roms
- else
- printf "Tarball '%s' (board '%s) doesn't need vendorfiles.\n" \
- "$archive" "$board"
fi
+ [ "$need_files" != "y" ] && printf \
+ "\nTarball '%s' (board '%s) doesn't need vendorfiles.\n" \
+ "$archive" "$board" 1>&2
xtype="patched" && [ "$nukemode" = "nuke" ] && xtype="nuked"
- [ "$xchanged" = "y" ] || \
- printf "\nRelease archive '%s' was not modified.\n" "$archive"
+ [ "$xchanged" != "y" ] && \
+ printf "\nRelease archive '%s' was *NOT* modified.\n" \
+ "$archive" && [ "$has_hashes" = "y" ] && \
+ printf "WARNING: '%s' contains file '%s'. DO NOT FLASH!" \
+ "$archive" "$hashfile" 1>&2 && \
+ printf "(vendorfiles may be needed and weren't inserted)" \
+ 1>&2
[ "$xchanged" = "y" ] && \
printf "\nRelease archive '%s' successfully %s.\n" \
- "$archive" "$xtype"
+ "$archive" "$xtype" && [ "$nukemode" != "nuke" ] && \
+ printf "You may now extract '%s' and flash images from it.\n" \
+ "$archive"
[ "$xchanged" = "y" ] && [ "$nukemode" = "nuke" ] && \
- printf "!!!WARNING!!! -> Vendor files removed. DO NOT FLASH.\n"
+ printf "WARNING! Vendorfiles *removed*. DO NOT FLASH.\n" 1>&2 \
+ && printf "DO NOT flash images from '%s'\n" \
+ "$archive" 1>&2
err="$_olderr"
return 0
}