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>
This commit is contained in:
Alex Thiessen 2018-01-12 01:45:53 +00:00 committed by Stefan Reinauer
parent a17796e601
commit 72d1089fac
1 changed files with 4 additions and 0 deletions

View File

@ -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" ;;