From 8459e33bbcbe70cc08f449c3d46f1310c65680a1 Mon Sep 17 00:00:00 2001
From: Leah Rowe <leah@libreboot.org>
Date: Thu, 17 Aug 2023 00:43:34 +0100
Subject: improve user feedback in blobutil

make it output messages that tell the user important
information. it's only subtle but it makes a difference
to some people, who need confirmation.

Signed-off-by: Leah Rowe <leah@libreboot.org>
---
 resources/scripts/update/blobs/download | 17 ++++++++---------
 resources/scripts/update/blobs/inject   |  4 ++++
 2 files changed, 12 insertions(+), 9 deletions(-)

(limited to 'resources/scripts/update/blobs')

diff --git a/resources/scripts/update/blobs/download b/resources/scripts/update/blobs/download
index 343e2a81..b4b74c1b 100755
--- a/resources/scripts/update/blobs/download
+++ b/resources/scripts/update/blobs/download
@@ -53,19 +53,18 @@ main()
 	board="${1}"
 	boarddir="${cbcfgsdir}/${board}"
 
-	exit_if_no_config="exit 0"
+	[ ! -d "${boarddir}" ] && \
+	    fail "Board target, ${board}, not defined"
+	[ ! -f "${boarddir}/target.cfg" ] && \
+	    fail "Target missing target.cfg"
+
+	no_config="printf \"No config for target, %s\\n\" ${board} 1>&2; exit 0"
 	for x in "${boarddir}"/config/*; do
 		if [ -f "${x}" ]; then
-			exit_if_no_config=""
+			no_config=""
 		fi
 	done
-	eval "${exit_if_no_config}"
-
-	if [ ! -d "${boarddir}" ]; then
-		fail "Target not defined"
-	elif [ ! -f "${boarddir}/target.cfg" ]; then
-		fail "Target missing target.cfg"
-	fi
+	eval "${no_config}"
 	
 	detect_firmware || exit 0
 	scan_sources_config
diff --git a/resources/scripts/update/blobs/inject b/resources/scripts/update/blobs/inject
index 46d83309..1d51ef98 100755
--- a/resources/scripts/update/blobs/inject
+++ b/resources/scripts/update/blobs/inject
@@ -69,6 +69,10 @@ main()
 	check_board
 	build_dependencies
 	inject_blobs
+
+	printf "Friendly reminder (this is *not* an error message):\n"
+	printf "Please always ensure that the files were inserted correctly.\n"
+	printf "Read https://libreboot.org/docs/install/ivy_has_common.html\n"
 }
 
 check_board()
-- 
cgit v1.2.1