0008-util-genbuild_h-Update-IASL-location-finding-code.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. From aba6235d16b87706357d0fdb35afaf52968fac53 Mon Sep 17 00:00:00 2001
  2. From: Martin Roth <martin@coreboot.org>
  3. Date: Sun, 9 May 2021 11:44:15 -0600
  4. Subject: [PATCH 08/19] util/genbuild_h: Update IASL location finding code
  5. Update the iasl path finding code to use XGCCPATH if it's set, and to
  6. look for iasl on the path if it's not set and not under util/crossgcc.
  7. On the jenkins builders, iasl is in the path, not in util/crossgcc/xgcc.
  8. On the systems of people who have multiple copies of coreboot, it makes
  9. sense to just have a single copy of the toolchain and define XGCCPATH in
  10. the environment to point to it.
  11. Previously, either of these situations resulted in a warning from the
  12. genbuild_h tool that iasl was not found under util/crossgcc, which was
  13. true, but not particularly relevant, and generated confusion.
  14. If xcompile already existed before make was run, the correct path would
  15. be found, but on an initial build, this check couldn't find iasl.
  16. BUG=None
  17. TEST=Build with iasl in /util/crossgcc/xgcc/bin, in the path and in a
  18. directory pointed to with XGCCPATH.
  19. Signed-off-by: Martin Roth <martin@coreboot.org>
  20. Change-Id: Ic2f8dca0be8bfb54d3c672fab6cf6f005bb394c3
  21. Reviewed-on: https://review.coreboot.org/c/coreboot/+/54001
  22. Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
  23. Reviewed-by: Angel Pons <th3fanbus@gmail.com>
  24. Reviewed-by: Patrick Georgi <pgeorgi@google.com>
  25. ---
  26. util/genbuild_h/genbuild_h.sh | 12 ++++++++++--
  27. 1 file changed, 10 insertions(+), 2 deletions(-)
  28. diff --git a/util/genbuild_h/genbuild_h.sh b/util/genbuild_h/genbuild_h.sh
  29. index 10ca0c5fa3..c898fb6e3f 100755
  30. --- a/util/genbuild_h/genbuild_h.sh
  31. +++ b/util/genbuild_h/genbuild_h.sh
  32. @@ -5,6 +5,7 @@
  33. DATE=""
  34. GITREV=""
  35. TIMESOURCE=""
  36. +XGCCPATH="${XGCCPATH:-util/crossgcc/xgcc/bin/}"
  37. export LANG=C
  38. export LC_ALL=C
  39. @@ -47,8 +48,15 @@ NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
  40. esac
  41. }
  42. -IASL=util/crossgcc/xgcc/bin/iasl
  43. +# Look for IASL in XGCCPATH and xcompile. Unfortunately,
  44. +# xcompile isn't available on the first build.
  45. +# If neither of those gives a valid iasl, check the path.
  46. +IASL="${XGCCPATH}iasl"
  47. eval $(grep ^IASL:= "$XCOMPILE" 2>/dev/null | sed s,:=,=,)
  48. +if [ ! -x "${IASL}" ]; then
  49. + IASL=$(command -v iasl)
  50. +fi
  51. +IASLVERSION="$(${IASL} -v | grep version | sed 's/.*version //')" >/dev/null
  52. #Print out the information that goes into build.h
  53. printf "/* build system definitions (autogenerated) */\n"
  54. @@ -72,5 +80,5 @@ printf "#define COREBOOT_BUILD_EPOCH \"$(our_date "$DATE" +%s)\"\n"
  55. printf "#define COREBOOT_DMI_DATE \"$(our_date "$DATE" +%m/%d/%Y)\"\n"
  56. printf "\n"
  57. printf "#define COREBOOT_COMPILE_TIME \"$(our_date "$DATE" +%T)\"\n"
  58. -printf "#define ASL_VERSION 0x%d\n" `$IASL -v | grep version | sed 's/.*version //'`
  59. +printf "#define ASL_VERSION 0x%d\n" "${IASLVERSION}"
  60. printf "#endif\n"
  61. --
  62. 2.25.1