summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Thiessen <alex.thiessen.de+coreboot@gmail.com>2018-01-12 01:45:53 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2018-01-15 01:08:42 +0000
commit72d1089fac4d68207c8360ab7b4663b41b16c44e (patch)
tree206d30b15b176e3477cdb3b78923c16772a9ba83
parenta17796e6012041e2d8ebe16b0bde0b99809ee87c (diff)
downloadcoreboot-72d1089fac4d68207c8360ab7b4663b41b16c44e.tar.xz
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@gmail.com> Reviewed-on: https://review.coreboot.org/23231 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
-rwxr-xr-xutil/crossgcc/buildgcc4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 76ed1be9bf..2ee102beb1 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -184,6 +184,10 @@ please_install()
{
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" ;;