[coreboot-gerrit] Change in coreboot[master]: Linuxboot: check go version
Philipp Deppenwiese (Code Review)
gerrit at coreboot.org
Mon Nov 5 21:56:52 CET 2018
Philipp Deppenwiese has submitted this change and it was merged. ( https://review.coreboot.org/29445 )
Change subject: Linuxboot: check go version
......................................................................
Linuxboot: check go version
Check if the installed Golang version is >= 1.9.
Change-Id: I9fd74fa8dc5e906e8b54ff5afaf69609fe957960
Signed-off-by: Marcello Sylvester Bauer <info at marcellobauer.com>
Reviewed-on: https://review.coreboot.org/29445
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
---
M payloads/external/LinuxBoot/targets/u-root.mk
1 file changed, 12 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Philipp Deppenwiese: Looks good to me, approved
diff --git a/payloads/external/LinuxBoot/targets/u-root.mk b/payloads/external/LinuxBoot/targets/u-root.mk
index 001f7c4..27f184e 100644
--- a/payloads/external/LinuxBoot/targets/u-root.mk
+++ b/payloads/external/LinuxBoot/targets/u-root.mk
@@ -14,7 +14,10 @@
uroot_git_repo=https://github.com/u-root/u-root.git
uroot_dir=$(project_dir)/go/src/github.com/u-root/u-root
-go_check=$(shell command -v go 1>/dev/null 2>&1 && echo go)
+go_version=$(shell go version | sed -nr 's/.*go([0-9]+\.[0-9]+.?[0-9]?).*/\1/p' )
+go_version_major=$(shell echo $(go_version) | sed -nr 's/^([0-9]+)\.([0-9]+)\.?([0-9]*)$$/\1/p')
+go_version_minor=$(shell echo $(go_version) | sed -nr 's/^([0-9]+)\.([0-9]+)\.?([0-9]*)$$/\2/p')
+
project_dir=$(shell pwd)/linuxboot
project_name=u-root
go_path_dir=$(shell pwd)/linuxboot/go
@@ -22,10 +25,17 @@
all: build
check:
-ifneq ($(go_check),go)
+ifeq ("$(go_version)","")
printf "\n<<Please install Golang >= 1.9 for u-root mode>>\n\n"
exit 1
endif
+ifeq ($(shell if [ $(go_version_major) -eq 1 ]; then echo y; fi),y)
+ifeq ($(shell if [ $(go_version_minor) -lt 9 ]; then echo y; fi),y)
+ printf "\n Golang version $(go_version) currently installed.\n\
+ <<Please install Golang >= 1.9 for u-root mode>>\n\n"
+ exit 1
+endif
+endif
mkdir -p $(project_dir)/go/src/github.com/u-root
$(uroot_dir)/.git:
--
To view, visit https://review.coreboot.org/29445
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9fd74fa8dc5e906e8b54ff5afaf69609fe957960
Gerrit-Change-Number: 29445
Gerrit-PatchSet: 4
Gerrit-Owner: Marcello Sylvester Bauer <info at marcellobauer.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181105/0845d658/attachment.html>
More information about the coreboot-gerrit
mailing list