[coreboot-gerrit] Change in coreboot[master]: util/crossgcc: Output apt-get commands on debian

Alex Thiessen (Code Review) gerrit at coreboot.org
Fri Jan 12 03:04:32 CET 2018


Alex Thiessen has uploaded this change for review. ( https://review.coreboot.org/23231


Change subject: util/crossgcc: Output apt-get commands on debian
......................................................................

util/crossgcc: Output apt-get commands on debian

In the buildgcc script, there is a check that the tools required are
installed. When a tool is missing, a message is output suggesting an
installation method, e.g. `sudo apt-get install foo` on debian-based
systems.

When run on a true, vanilla debian system, the error message provides
only a generic hint because the `please_install()` function fails to
detect the OS kind. Detection is based on definition of ID_LIKE in
`/etc/os-release` yet such systems only define `ID` to `debian`.

This commit closes the detection gap. Tested on debian 9 (stretch).

Change-Id: I3c867837e9157bee13010bd0a005028c369ce55f
Signed-off-by: Alex Thiessen <alex.thiessen.de+coreboot at gmail.com>
---
M util/crossgcc/buildgcc
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/23231/1

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 76ed1be..2ee102b 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -184,6 +184,10 @@
 {
 	HALT_FOR_TOOLS=1
 	test -r /etc/os-release && . /etc/os-release
+	# vanilla debian doesn't define `ID_LIKE`, just `ID`
+	if [ -z "${ID_LIKE}" ] && [ -n "${ID}" ]; then
+		ID_LIKE=${ID}
+	fi
 	case "$ID_LIKE" in
 	debian) solution="sudo apt-get install $1" ;;
 	suse) solution="sudo zypper install $1" ;;

-- 
To view, visit https://review.coreboot.org/23231
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c867837e9157bee13010bd0a005028c369ce55f
Gerrit-Change-Number: 23231
Gerrit-PatchSet: 1
Gerrit-Owner: Alex Thiessen <alex.thiessen.de+coreboot at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180112/c3bc8e2b/attachment-0001.html>


More information about the coreboot-gerrit mailing list