From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian.Jackson@eu.citrix.com, Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v5 09/17] osstest: introduce build helpers for FreeBSD
Date: Sat, 8 Jul 2017 08:47:04 +0100 [thread overview]
Message-ID: <20170708074712.44451-10-roger.pau@citrix.com> (raw)
In-Reply-To: <20170708074712.44451-1-roger.pau@citrix.com>
Some steps of the FreeBSD build process need to be done as root, so
introduce some helpers to perform those steps:
buildcmd_stamped_logged_root and target_cmd_build_root. They behave
exactly the same as the non-root counterparts.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes since v3:
- New in this version.
---
Osstest/BuildSupport.pm | 26 ++++++++++++++++++++++----
Osstest/TestSupport.pm | 27 +++++++++++++++++++++++----
2 files changed, 45 insertions(+), 8 deletions(-)
diff --git a/Osstest/BuildSupport.pm b/Osstest/BuildSupport.pm
index 4c2b658b..b96ce766 100644
--- a/Osstest/BuildSupport.pm
+++ b/Osstest/BuildSupport.pm
@@ -36,7 +36,7 @@ BEGIN {
$whhost $ho
builddirsprops
- buildcmd_stamped_logged
+ buildcmd_stamped_logged buildcmd_stamped_logged_root
$builddir $makeflags
$buildcmd_global_prefix
@@ -60,9 +60,9 @@ our ($xendist);
our $buildcmd_global_prefix //= '';
-sub buildcmd_stamped_logged ($$$$$$) {
- my ($timeout, $component, $stampname, $prefix, $cmd, $suffix) = @_;
- target_cmd_build($ho, $timeout, $builddir, <<END);
+sub buildcmd_stamped_logged_script ($$$$$) {
+ my ($component, $stampname, $prefix, $cmd, $suffix) = @_;
+ my $script = <<END;
cd $component
$buildcmd_global_prefix
$prefix
@@ -73,6 +73,24 @@ sub buildcmd_stamped_logged ($$$$$$) {
echo ok.
END
#/;
+
+ return $script;
+}
+
+sub buildcmd_stamped_logged_root ($$$$$$) {
+ my ($timeout, $component, $stampname, $prefix, $cmd, $suffix) = @_;
+ my $script = buildcmd_stamped_logged_script($component, $stampname,
+ $prefix, $cmd, $suffix);
+
+ target_cmd_build_root($ho, $timeout, $builddir, $script);
+}
+
+sub buildcmd_stamped_logged ($$$$$$) {
+ my ($timeout, $component, $stampname, $prefix, $cmd, $suffix) = @_;
+ my $script = buildcmd_stamped_logged_script($component, $stampname,
+ $prefix, $cmd, $suffix);
+
+ target_cmd_build($ho, $timeout, $builddir, $script);
}
sub selectbuildhost {
diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 77585562..ab8495a9 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -56,6 +56,7 @@ BEGIN {
target_cmd_root_status target_cmd_output_root_status
target_cmd_root target_cmd target_cmd_build
+ target_cmd_build_root
target_cmd_output_root target_cmd_output
target_cmd_inputfh_root sshuho
target_getfile target_getfile_root
@@ -669,8 +670,8 @@ sub target_editfile ($$$;$$) { teditfileex('osstest',@_); }
# my ($ho,$rfile, $lleaf,$rdest) = @_;
# ^^^^^^^^^^^^^ optional
-sub target_cmd_build ($$$$) {
- my ($ho,$timeout,$builddir,$script) = @_;
+sub target_cmd_build_script ($$$) {
+ my ($ho, $builddir, $script) = @_;
my $distcc_hosts = get_host_property($ho,'DistccHosts',undef);
my $distcc = defined($distcc_hosts) ? <<END : "";
@@ -682,8 +683,8 @@ END
my $httpproxy = http_proxy_envsettings($ho);
- target_cmd($ho, <<END.$distcc.<<END.$script, $timeout);
- set -xe
+ my $cmd = <<END.$distcc.<<END.$script;
+ set -xe
LC_ALL=C; export LC_ALL
PATH=/usr/lib/ccache:\$PATH:/usr/lib/git-core
$httpproxy
@@ -692,6 +693,24 @@ END
cd $builddir
rm -f build-ok-stamp
END
+
+ return $cmd;
+}
+
+sub target_cmd_build ($$$$) {
+ my ($ho,$timeout,$builddir,$script) = @_;
+
+ my $cmd = target_cmd_build_script($ho, $builddir, $script);
+
+ target_cmd($ho, $cmd, $timeout);
+}
+
+sub target_cmd_build_root ($$$$) {
+ my ($ho,$timeout,$builddir,$script) = @_;
+
+ my $cmd = target_cmd_build_script($ho, $builddir, $script);
+
+ target_cmd_root($ho, $cmd, $timeout);
}
sub target_ping_check_core {
--
2.11.0 (Apple Git-81)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-07-08 7:48 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-08 7:46 [PATCH v5 00/17] osstest: initial FreeBSD support Roger Pau Monne
2017-07-08 7:46 ` [PATCH v5 01/17] osstest: make built_stash_file store a path_ runvar for each file Roger Pau Monne
2017-07-08 7:46 ` [PATCH v5 02/17] osstest: move known_hosts generation to TestSupport Roger Pau Monne
2017-07-08 7:46 ` [PATCH v5 03/17] osstest: introduce helper to get per-host tftp prefix Roger Pau Monne
2017-07-08 7:46 ` [PATCH v5 04/17] osstest: introduce a helper to calculate the sha256 of a given file Roger Pau Monne
2017-07-08 7:47 ` [PATCH v5 05/17] osstest: introduce a helper to setup a host to boot using memdisk Roger Pau Monne
2017-07-08 7:47 ` [PATCH v5 06/17] osstest: add executive prefix to resource_shared_mark_ready Roger Pau Monne
2017-07-19 15:33 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 07/17] osstest: introduce rename_shared_mark_ready Roger Pau Monne
2017-07-19 15:34 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 08/17] osstest: add a FreeBSD host install script Roger Pau Monne
2017-07-19 15:35 ` Ian Jackson
2017-07-08 7:47 ` Roger Pau Monne [this message]
2017-07-08 7:47 ` [PATCH v5 10/17] osstest: add support for the FreeBSD package manager Roger Pau Monne
2017-07-19 15:38 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 11/17] osstest: introduce a FreeBSD build script Roger Pau Monne
2017-07-19 15:40 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 12/17] osstest: add support for runtime_IDENT_hostflags Roger Pau Monne
2017-07-19 15:41 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 13/17] osstest: introduce a script to set the runtime hostflags runvar for FreeBSD jobs Roger Pau Monne
2017-07-19 15:44 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 14/17] osstest: change the meaning of need_build_host Roger Pau Monne
2017-07-19 15:48 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 15/17] osstest: add support for FreeBSD buildjobs to sg-run-job Roger Pau Monne
2017-07-19 15:49 ` Ian Jackson
2017-07-19 15:50 ` Ian Jackson
2017-07-08 7:47 ` [PATCH v5 16/17] osstest: introduce a script to create a FreeBSD flight Roger Pau Monne
2017-07-08 7:47 ` [PATCH v5 17/17] osstest: hook FreeBSD flight into cr-daily-branch Roger Pau Monne
2017-07-20 15:15 ` Missing bits for production usage (was: [PATCH v5 00...) Roger Pau Monne
2017-07-20 15:57 ` Ian Jackson
2017-07-20 16:11 ` Roger Pau Monne
2017-07-24 14:41 ` [OSSTEST PATCH 0/3] Introduce anointments Ian Jackson
2017-07-24 14:41 ` [OSSTEST PATCH 1/3] README.planner: Improve internals documentation a bit Ian Jackson
2017-07-24 14:41 ` [OSSTEST PATCH 2/3] schema updates: mg-schema-test-database: Cope with breaking updates Ian Jackson
2017-07-24 14:41 ` [OSSTEST PATCH 3/3] anointments: Introduce anointment scheme, and mg-anoint script Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170708074712.44451-10-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).