summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomáš Mózes <hydrapolic@gmail.com>2023-04-14 18:21:01 +0200
committerTomáš Mózes <hydrapolic@gmail.com>2023-04-14 18:21:01 +0200
commit1b2aab0054cd3fe4fd72dad303c3f3b935db42f0 (patch)
tree40cb7bbf1679b605a32469fa3a0da2da6d4143dd /0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch
parentXen 4.15.4-pre-patchset-2 (diff)
downloadxen-upstream-patches-1b2aab0054cd3fe4fd72dad303c3f3b935db42f0.tar.gz
xen-upstream-patches-1b2aab0054cd3fe4fd72dad303c3f3b935db42f0.tar.bz2
xen-upstream-patches-1b2aab0054cd3fe4fd72dad303c3f3b935db42f0.zip
Xen 4.15.5-pre-patchset-04.15.5-pre-patchset-04.15
Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
Diffstat (limited to '0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch')
-rw-r--r--0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch b/0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch
new file mode 100644
index 0000000..779d805
--- /dev/null
+++ b/0008-build-add-full-to-version.sh-to-guess-XEN_FULLVERSIO.patch
@@ -0,0 +1,95 @@
+From b461db64b37f9a04ba5a726b0e474e870226f2ac Mon Sep 17 00:00:00 2001
+From: Anthony PERARD <anthony.perard@citrix.com>
+Date: Thu, 9 Sep 2021 15:33:06 +0100
+Subject: [PATCH 08/13] build: add --full to version.sh to guess
+ $(XEN_FULLVERSION)
+
+Running $(MAKE) like that in a $(shell ) while parsing the Makefile
+doesn't work reliably. In some case, make will complain with
+"jobserver unavailable: using -j1. Add '+' to parent make rule.".
+Also, it isn't possible to distinguish between the output produced by
+the target "xenversion" and `make`'s own output.
+
+Instead of running make, this patch "improve" `version.sh` to try to
+guess the output of `make xenversion`.
+
+In order to have version.sh works in more scenario, it will use
+XEN_EXTRAVERSION and XEN_VENDORVERSION from the environment when
+present. As for the cases were those two variables are overridden by a
+make command line arguments, we export them when invoking version.sh
+via a new $(XEN_FULLVERSION) macro.
+
+That should hopefully get us to having ./version.sh returning the same
+value that `make xenversion` would.
+
+This fix GitLab CI's build job "debian-unstable-gcc-arm64".
+
+Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
+Reviewed-by: Daniel P. Smith <dpsmith@apertussolutions.com>
+Reviewed-by: Ian Jackson <iwj@xenproject.org>
+(cherry picked from commit ab4a83023eda9f04ad864877c1956b087ec6fc4f)
+---
+ tools/Rules.mk | 5 +++++
+ tools/flask/policy/Makefile.common | 2 +-
+ version.sh | 18 +++++++++++++++++-
+ 3 files changed, 23 insertions(+), 2 deletions(-)
+
+diff --git a/tools/Rules.mk b/tools/Rules.mk
+index 444e5bacdd..051a5d3555 100644
+--- a/tools/Rules.mk
++++ b/tools/Rules.mk
+@@ -6,6 +6,11 @@ all:
+ -include $(XEN_ROOT)/config/Tools.mk
+ include $(XEN_ROOT)/Config.mk
+
++XEN_FULLVERSION=$(shell env \
++ XEN_EXTRAVERSION=$(XEN_EXTRAVERSION) \
++ XEN_VENDORVERSION=$(XEN_VENDORVERSION) \
++ $(SHELL) $(XEN_ROOT)/version.sh --full $(XEN_ROOT)/xen/Makefile)
++
+ export _INSTALL := $(INSTALL)
+ INSTALL = $(XEN_ROOT)/tools/cross-install
+
+diff --git a/tools/flask/policy/Makefile.common b/tools/flask/policy/Makefile.common
+index bea5ba4b6a..e5ed58200e 100644
+--- a/tools/flask/policy/Makefile.common
++++ b/tools/flask/policy/Makefile.common
+@@ -35,7 +35,7 @@ OUTPUT_POLICY ?= $(BEST_POLICY_VER)
+ #
+ ########################################
+
+-POLICY_FILENAME = $(FLASK_BUILD_DIR)/xenpolicy-$(shell $(MAKE) -C $(XEN_ROOT)/xen xenversion --no-print-directory)
++POLICY_FILENAME = $(FLASK_BUILD_DIR)/xenpolicy-$(XEN_FULLVERSION)
+ POLICY_LOADPATH = /boot
+
+ # List of policy versions supported by the hypervisor
+diff --git a/version.sh b/version.sh
+index e894ee7e04..c6a5692c19 100755
+--- a/version.sh
++++ b/version.sh
+@@ -1,5 +1,21 @@
+ #!/bin/sh
+
++opt_full=false
++while [ $# -gt 1 ]; do
++ case "$1" in
++ --full) opt_full=true ;;
++ *) break ;;
++ esac
++ shift
++done
++
+ MAJOR=`grep "export XEN_VERSION" $1 | sed 's/.*=//g' | tr -s " "`
+ MINOR=`grep "export XEN_SUBVERSION" $1 | sed 's/.*=//g' | tr -s " "`
+-printf "%d.%d" $MAJOR $MINOR
++
++if $opt_full; then
++ extraversion=$(grep "export XEN_EXTRAVERSION" $1 | sed 's/^.* ?=\s\+//; s/\$([^)]*)//g; s/ //g')
++ : ${XEN_EXTRAVERSION:=${extraversion}${XEN_VENDORVERSION}}
++else
++ unset XEN_EXTRAVERSION
++fi
++printf "%d.%d%s" $MAJOR $MINOR $XEN_EXTRAVERSION
+--
+2.40.0
+