All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] osstest: add native FreeBSD build tests
@ 2014-08-12 15:49 Roger Pau Monne
  2014-08-12 15:49 ` [PATCH RFC 1/4] osstest: add routine to execute ssh with password Roger Pau Monne
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Roger Pau Monne @ 2014-08-12 15:49 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson

This series add support for bootstrapping a bare metal FreeBSD install 
using OSS Test and compiling Xen on it (only the kernel and the tools 
so far).

The first patch adds support for executing commands on remote boxes 
using ssh with password, which is needed in order to login into the 
installer. The rest of the patches focus on installing FreeBSD, the 
Xen build dependencies, and finally compiling the Xen kernel and 
tools.

This is a very RFC series, some of the code should use runvars and 
host vars instead of the hardcoded variables on top of the file. I've 
marked this with "TODO".

Also, there's some code duplication in ts-xen-build-freebsd from 
ts-xen-build, but I don't think both files can be merged easily.

I've been manually running the tests using the following runes:

OSSTEST_FLIGHT=standalone OSSTEST_JOB=build-amd64 OSSTEST_HOST=kodo4 ./ts-freebsd-host-install host=kodo4
OSSTEST_FLIGHT=standalone OSSTEST_JOB=build-amd64 OSSTEST_HOST=kodo4 ./ts-xen-build-prep-freebsd host=kodo4
OSSTEST_FLIGHT=standalone OSSTEST_JOB=build-amd64 OSSTEST_HOST=kodo4 ./ts-xen-build-freebsd host=kodo4

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH RFC 1/4] osstest: add routine to execute ssh with password
  2014-08-12 15:49 [PATCH RFC 0/4] osstest: add native FreeBSD build tests Roger Pau Monne
@ 2014-08-12 15:49 ` Roger Pau Monne
  2014-08-12 16:37   ` Ian Jackson
  2014-08-12 15:49 ` [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD Roger Pau Monne
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2014-08-12 15:49 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson; +Cc: Roger Pau Monne

This is needed when bootstrapping FreeBSD, since the installer has ssh
enabled with the root password set to 'root' by default.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 Osstest/TestSupport.pm |   39 ++++++++++++++++++++++++++++++++++-----
 1 files changed, 34 insertions(+), 5 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index fea54d5..57b8a82 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -60,6 +60,7 @@ BEGIN {
                       target_install_packages target_install_packages_norec
                       target_jobdir target_extract_jobdistpath_subdir
                       target_extract_jobdistpath target_guest_lv_name
+                      target_cmd_root_with_password
 
                       poll_loop tcpconnect await_tcp
                       contents_make_cpio file_simple_write_contents
@@ -313,12 +314,11 @@ END
 #---------- running commands eg on targets ----------
 
 sub cmd {
-    my ($timeout,$stdout,@cmd) = @_;
+    my ($timeout,$child_sub,@cmd) = @_;
     my $child= fork;  die $! unless defined $child;
     if (!$child) {
-        if (defined $stdout) {
-            open STDOUT, '>&', $stdout
-                or die "STDOUT $stdout $cmd[0] $!";
+        if (defined $child_sub) {
+            $child_sub->();
         }
         exec @cmd;
         die "$cmd[0]: $!";
@@ -573,9 +573,38 @@ sub tcmd { # $tcmd will be put between '' but not escaped
 sub target_cmd ($$;$) { tcmd(undef,'osstest',@_); }
 sub target_cmd_root ($$;$) { tcmd(undef,'root',@_); }
 
+sub target_cmd_root_with_password {
+    my ($ho,$tcmd,$timeout,$password) = @_;
+
+    open(my $temp_fh, '>', "tmp/t.ssh-password-helper.$flight.$job")
+      or die "Cannot open tmp/t.ssh-password-helper.$flight.$job: $!";
+    print $temp_fh "#!/bin/sh\n\necho \"$password\"\n";
+    chmod 0755, $temp_fh;
+    close $temp_fh;
+
+    my $child_sub = sub {
+                           $ENV{DISPLAY} = ":0";
+                           $ENV{SSH_ASKPASS} = "tmp/t.ssh-password-helper.$flight.$job";
+                           setsid or die "Can't start a new session: $!";
+                        };
+
+    my $ssh_opts = [qw(-o BatchMode=no
+                       -o PasswordAuthentication=yes
+                       -o ChallengeResponseAuthentication=yes),
+                    @{ sshopts() }];
+
+    tcmdex($timeout,$child_sub,
+           'ssh', $ssh_opts,
+           sshuho("root",$ho), $tcmd);
+
+    unlink $temp_fh;
+}
+
 sub tcmdout {
     my $stdout= IO::File::new_tmpfile();
-    tcmd($stdout,@_);
+    my $stdout_sub = sub { open STDOUT, '>&', $stdout
+                              or die "STDOUT $stdout $!"; };
+    tcmd($stdout_sub,@_);
     $stdout->seek(0,0) or die "$stdout $!";
     my $r;
     { local ($/) = undef;
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-12 15:49 [PATCH RFC 0/4] osstest: add native FreeBSD build tests Roger Pau Monne
  2014-08-12 15:49 ` [PATCH RFC 1/4] osstest: add routine to execute ssh with password Roger Pau Monne
@ 2014-08-12 15:49 ` Roger Pau Monne
  2014-08-12 16:42   ` Ian Jackson
  2014-08-12 15:49 ` [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build Roger Pau Monne
  2014-08-12 15:49 ` [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD Roger Pau Monne
  3 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2014-08-12 15:49 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson; +Cc: Roger Pau Monne

This is done using mfsBSD, which can be booted from pxelinux and
contains a script to automatically install FreeBSD using ZFS on root.
After the install the host is set to boot from the local disk.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ts-freebsd-host-install |  150 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100755 ts-freebsd-host-install

diff --git a/ts-freebsd-host-install b/ts-freebsd-host-install
new file mode 100755
index 0000000..1a702df
--- /dev/null
+++ b/ts-freebsd-host-install
@@ -0,0 +1,150 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use POSIX;
+
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::Logtailer;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+exit 0 if $ho->{Flags}{'no-reinstall'};
+exit 0 if $ho->{SharedReady};
+
+our %timeout= qw(ReadPreseed  350
+                 Sshd        2400);
+
+# TODO: all this should be runvars
+our $version = '10.0-RELEASE';
+our $ftp = 'ftp.freebsd.org';
+
+# TODO: this has to be set on a per-host basis.
+# It should probably come from $ho?
+our $disk = 'da0';
+our $nic = 'bce0';
+
+sub install () {
+    my $authkeys= authorized_keys();
+
+    power_state($ho, 0);
+
+    setup_pxeboot_firstboot();
+
+    logm('Booting into mfsBSD');
+
+    sleep(power_cycle_time($ho));
+
+    power_state($ho, 1);
+
+    logm('Waiting for host to boot');
+    await_tcp(get_timeout($ho,'boot',$timeout{Sshd}), 22, $ho);
+
+    logm('Setting host to boot from local disk on next boot');
+    setup_pxeboot_local($ho);
+
+    logm('Setting up ssh keys for remote access');
+    target_cmd_root_with_password($ho, <<END, 900, "root");
+        mkdir -p ~/.ssh
+        cat <<ENDKEYS >~/.ssh/authorized_keys
+$authkeys
+ENDKEYS
+END
+
+    logm('Install of base system using ZFS on root');
+    target_cmd_root($ho, <<END,2400);
+            gpart destroy -F $disk
+            zfsinstall -d $disk -u ftp://$ftp/pub/FreeBSD/releases/$r{arch}/$version -s 4g
+END
+
+    logm('Setting up ssh and keys for the installed system');
+    target_cmd_root($ho, <<END, 900);
+            echo 'sshd_enable="YES"' >> /mnt/etc/rc.conf
+            echo 'PermitRootLogin yes' >> /mnt/etc/ssh/sshd_config
+            mkdir -p /mnt/root/.ssh
+            cat <<ENDKEYS >/mnt/root/.ssh/authorized_keys
+$authkeys
+ENDKEYS
+END
+
+    logm('Setting up serial console');
+    target_cmd_root($ho, <<END, 900);
+            echo "-Dh" >> /mnt/boot.config
+            cat <<ENDB >>/mnt/boot/loader.conf
+boot_multicons="YES"
+boot_serial="YES"
+comconsole_speed="$c{Baud}"
+console="comconsole,vidconsole"
+boot_verbose="YES"
+ENDB
+END
+
+    logm('Setting up network');
+    target_cmd_root($ho, <<END, 900);
+            echo 'cloned_interfaces="bridge0"' >> /mnt/etc/rc.conf
+            echo 'ifconfig_bridge0="addm $nic up"' >> /mnt/etc/rc.conf
+            echo 'ifconfig_$nic="DHCP"' >> /mnt/etc/rc.conf
+END
+
+    logm('Setting up miscellaneous settings');
+    target_cmd_root($ho, <<END, 900);
+            cp /mnt/usr/share/zoneinfo/Europe/London /mnt/etc/localtime
+            echo 'sendmail_enable="NONE"' >> /mnt/etc/rc.conf
+END
+
+    logm('Rebooting into the installed system');
+    target_reboot($ho);
+
+    # Remove the known hosts file, since the keys will be regenerated after
+    # rebooting into the installed system
+    unlink "tmp/t.known_hosts_$flight.$job";
+
+    logm('Adding osstest user');
+    target_cmd_root($ho, 'pw useradd osstest -m', 900);
+    target_cmd_root($ho, <<END, 900);
+            mkdir -p /home/osstest/.ssh
+            cat <<ENDKEYS >/home/osstest/.ssh/authorized_keys
+$authkeys
+ENDKEYS
+END
+
+    logm('OK: install completed');
+}
+
+sub setup_pxeboot_firstboot() {
+    my $mfs= 'freebsd/'.$version.'/'.$r{arch}.'/'.'mfsbsd-'.$version.'-'.$r{arch}.'.img';
+
+    logm('Using mfsBSD image: ' . $mfs);
+
+    setup_pxeboot($ho, <<END);
+serial 0 $c{Baud}
+timeout 5
+label overwrite
+	menu label ^Overwrite
+	menu default
+	kernel memdisk
+	append initrd=$mfs
+default overwrite
+END
+}
+
+install();
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build
  2014-08-12 15:49 [PATCH RFC 0/4] osstest: add native FreeBSD build tests Roger Pau Monne
  2014-08-12 15:49 ` [PATCH RFC 1/4] osstest: add routine to execute ssh with password Roger Pau Monne
  2014-08-12 15:49 ` [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD Roger Pau Monne
@ 2014-08-12 15:49 ` Roger Pau Monne
  2014-08-12 16:44   ` Ian Jackson
  2014-08-12 15:49 ` [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD Roger Pau Monne
  3 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2014-08-12 15:49 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson; +Cc: Roger Pau Monne

Install pkg (the binary package management tool) and the dependencies
needed to build Xen.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ts-xen-build-prep-freebsd |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100755 ts-xen-build-prep-freebsd

diff --git a/ts-xen-build-prep-freebsd b/ts-xen-build-prep-freebsd
new file mode 100755
index 0000000..326b194
--- /dev/null
+++ b/ts-xen-build-prep-freebsd
@@ -0,0 +1,44 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use POSIX;
+
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::Logtailer;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+exit 0 if $ho->{SharedReady};
+
+#TODO: should be a runvar
+our $compiler = 'gcc47';
+
+sub install_depends () {
+    logm('Installing Xen build dependencies');
+    target_cmd_root($ho, <<END, 2400);
+        setenv ASSUME_ALWAYS_YES "YES"
+        pkg install -y mercurial git bash python bcc glib pkgconf yajl gmake pixman $compiler
+END
+}
+
+install_depends();
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD
  2014-08-12 15:49 [PATCH RFC 0/4] osstest: add native FreeBSD build tests Roger Pau Monne
                   ` (2 preceding siblings ...)
  2014-08-12 15:49 ` [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build Roger Pau Monne
@ 2014-08-12 15:49 ` Roger Pau Monne
  2014-08-12 16:45   ` Ian Jackson
  3 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monne @ 2014-08-12 15:49 UTC (permalink / raw)
  To: xen-devel, Ian.Jackson; +Cc: Roger Pau Monne

This is a compile-test only, and only tests that the Xen kernel and
the tools can be build.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ts-xen-build-freebsd |   91 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 91 insertions(+), 0 deletions(-)
 create mode 100755 ts-xen-build-freebsd

diff --git a/ts-xen-build-freebsd b/ts-xen-build-freebsd
new file mode 100755
index 0000000..020e4bc
--- /dev/null
+++ b/ts-xen-build-freebsd
@@ -0,0 +1,91 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2014 Citrix Inc.
+# 
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+# 
+# You should have received a copy of the GNU Affero General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict qw(vars);
+use DBI;
+use POSIX;
+
+use Osstest;
+use Osstest::TestSupport;
+use Osstest::BuildSupport;
+use Osstest::Logtailer;
+
+tsreadconfig();
+
+our ($whhost) = @ARGV;
+$whhost ||= 'host';
+our $ho= selecthost($whhost);
+exit 0 if $ho->{SharedReady};
+
+# TODO: should be a runvar
+our $compiler = 'gcc47';
+
+builddirsprops();
+
+sub checkout () {
+    prepbuilddirs();
+
+    build_clone($ho, 'xen', $builddir, 'xen');
+
+    my $debug_build = $r{xen_build_debug} || 'y';
+
+    target_cmd_build($ho, 100, $builddir, <<END.
+        cd $builddir/xen
+    >.config
+    echo >>.config debug=$debug_build
+    echo >>.config GIT_HTTP=y
+    echo >>.config QEMU_REMOTE='$r{tree_qemu}'
+END
+               (nonempty($r{revision_qemu}) ? <<END : '').
+    echo >>.config QEMU_TAG='$r{revision_qemu}'
+END
+               (nonempty($r{tree_qemuu}) ? <<END : '').
+    echo >>.config QEMU_UPSTREAM_URL='$r{tree_qemuu}'
+END
+               (nonempty($r{revision_qemuu}) ? <<END : '').
+    echo >>.config QEMU_UPSTREAM_REVISION='$r{revision_qemuu}'
+END
+               (nonempty($r{tree_seabios}) ? <<END : '').
+    echo >>.config SEABIOS_UPSTREAM_URL='$r{tree_seabios}'
+END
+               (nonempty($r{revision_seabios}) ? <<END : '')
+    echo >>.config SEABIOS_UPSTREAM_TAG='$r{revision_seabios}'
+END
+               );
+}
+
+sub build () {
+    logm('Running configure');
+    target_cmd_build($ho, 400, $builddir, <<END);
+        cd xen
+        ./configure CC=$compiler HOSTCC=$compiler
+END
+    logm('Building Xen');
+    target_cmd_build($ho, 900, $builddir, <<END);
+        cd xen
+        gmake $makeflags xen CC=$compiler HOSTCC=$compiler
+END
+    logm('Building Tools');
+    target_cmd_build($ho, 2400, $builddir, <<END);
+        cd xen
+        gmake $makeflags tools CC=$compiler HOSTCC=$compiler
+END
+    logm('OK: Build successful');
+}
+
+checkout();
+build();
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 1/4] osstest: add routine to execute ssh with password
  2014-08-12 15:49 ` [PATCH RFC 1/4] osstest: add routine to execute ssh with password Roger Pau Monne
@ 2014-08-12 16:37   ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 16:37 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH RFC 1/4] osstest: add routine to execute ssh with password"):
> This is needed when bootstrapping FreeBSD, since the installer has ssh
> enabled with the root password set to 'root' by default.

> +    open(my $temp_fh, '>', "tmp/t.ssh-password-helper.$flight.$job")
> +      or die "Cannot open tmp/t.ssh-password-helper.$flight.$job: $!";

Put this pathname in a variable so that you don't have to write it
three times.

> +    print $temp_fh "#!/bin/sh\n\necho \"$password\"\n";

or die $!;

> +    chmod 0755, $temp_fh;

You should probably chmod the path, not the fh.  That's more usual,
although all of our hosts do in fact have fchmod(2).

> +    close $temp_fh;

or die $!;


Otherwise, this is fine.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-12 15:49 ` [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD Roger Pau Monne
@ 2014-08-12 16:42   ` Ian Jackson
  2014-08-12 16:59     ` Roger Pau Monné
  2014-08-13 13:31     ` Roger Pau Monné
  0 siblings, 2 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 16:42 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD"):
> This is done using mfsBSD, which can be booted from pxelinux and
> contains a script to automatically install FreeBSD using ZFS on root.
> After the install the host is set to boot from the local disk.
...
> +# TODO: all this should be runvars
> +our $version = '10.0-RELEASE';
> +our $ftp = 'ftp.freebsd.org';

Does this mean that this script will fail if ftp.freebsd.org is down ?
Is there a way of avoiding that ?  We try to keep to a minimum the
number of different servers that osstest's production instance depends
on.

> +# TODO: this has to be set on a per-host basis.
> +# It should probably come from $ho?
> +our $disk = 'da0';
> +our $nic = 'bce0';

Does this mean that this has to be manually configured, rather than
detected ?  It could be a host property but really it would be better
not to have to set these kind of freebsd-specific host properties.

> +    target_cmd_root_with_password($ho, <<END, 900, "root");
> +        mkdir -p ~/.ssh

Missing `set -e'.  (Throughout.)

> +    logm('Setting up serial console');
> +    target_cmd_root($ho, <<END, 900);
> +            echo "-Dh" >> /mnt/boot.config

Does FreeBSD's echo really simploy print things that look like
options ?  I would use printf(1).

> +    # Remove the known hosts file, since the keys will be regenerated after
> +    # rebooting into the installed system
> +    unlink "tmp/t.known_hosts_$flight.$job";

Can you instead arrange for the fixed keys to be installed on the
host ?  Otherwise manually sshing into these test boxes is very
annoying because the ssh keys keep changing.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build
  2014-08-12 15:49 ` [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build Roger Pau Monne
@ 2014-08-12 16:44   ` Ian Jackson
  2014-08-12 17:11     ` Roger Pau Monné
  0 siblings, 1 reply; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 16:44 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

Roger Pau Monne writes ("[PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build"):
> Install pkg (the binary package management tool) and the dependencies
> needed to build Xen.
...
> +        pkg install -y mercurial git bash python bcc glib pkgconf yajl gmake pixman $compiler

This list is _much_ shorter than the one in ts-xen-build-prep.
Why ?

Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD
  2014-08-12 15:49 ` [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD Roger Pau Monne
@ 2014-08-12 16:45   ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 16:45 UTC (permalink / raw)
  To: Roger Pau Monne; +Cc: xen-devel

;5;9~Roger Pau Monne writes ("[PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD"):
> This is a compile-test only, and only tests that the Xen kernel and
> the tools can be build.

Why can't ts-xen-build be used ?  I think it should be used.

Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-12 16:42   ` Ian Jackson
@ 2014-08-12 16:59     ` Roger Pau Monné
  2014-08-12 17:38       ` Ian Jackson
  2014-08-13 13:31     ` Roger Pau Monné
  1 sibling, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2014-08-12 16:59 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On 12/08/14 18:42, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD"):
>> This is done using mfsBSD, which can be booted from pxelinux and
>> contains a script to automatically install FreeBSD using ZFS on root.
>> After the install the host is set to boot from the local disk.
> ...
>> +# TODO: all this should be runvars
>> +our $version = '10.0-RELEASE';
>> +our $ftp = 'ftp.freebsd.org';
> 
> Does this mean that this script will fail if ftp.freebsd.org is down ?

Yes, it will fail to fetch the sets.

> Is there a way of avoiding that ?  We try to keep to a minimum the
> number of different servers that osstest's production instance depends
> on.

I see two ways to solve this, either we create our own internal http/ftp
mirror, or we could iterate over the list of official mirrors, expecting
that at least one of them is accessible.

> 
>> +# TODO: this has to be set on a per-host basis.
>> +# It should probably come from $ho?
>> +our $disk = 'da0';
>> +our $nic = 'bce0';
> 
> Does this mean that this has to be manually configured, rather than
> detected ?  It could be a host property but really it would be better
> not to have to set these kind of freebsd-specific host properties.

I think I could probably come up with a way to detect the primary disk
if the box doesn't contain multiple disk controllers. For the nic I
could also see which one has the host IP assigned, and used that. It's
probably going to be a little hacky, let me send another iteration with
this and then let's decide.

>> +    target_cmd_root_with_password($ho, <<END, 900, "root");
>> +        mkdir -p ~/.ssh
> 
> Missing `set -e'.  (Throughout.)
> 
>> +    logm('Setting up serial console');
>> +    target_cmd_root($ho, <<END, 900);
>> +            echo "-Dh" >> /mnt/boot.config
> 
> Does FreeBSD's echo really simploy print things that look like
> options ?  I would use printf(1).

Yes:

# echo "-Dh"
-Dh

Ok, I will switch it to printf.

> 
>> +    # Remove the known hosts file, since the keys will be regenerated after
>> +    # rebooting into the installed system
>> +    unlink "tmp/t.known_hosts_$flight.$job";
> 
> Can you instead arrange for the fixed keys to be installed on the
> host ?  Otherwise manually sshing into these test boxes is very
> annoying because the ssh keys keep changing.

The ssh key is only going to change one time, the key we have previous
to this point is the key from the installer. I will look into copying
this key into the installed system in order to prevent it from
generating a new key.

Thanks, Roger.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build
  2014-08-12 16:44   ` Ian Jackson
@ 2014-08-12 17:11     ` Roger Pau Monné
  2014-08-12 17:39       ` Ian Jackson
  0 siblings, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2014-08-12 17:11 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On 12/08/14 18:44, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build"):
>> Install pkg (the binary package management tool) and the dependencies
>> needed to build Xen.
> ...
>> +        pkg install -y mercurial git bash python bcc glib pkgconf yajl gmake pixman $compiler
> 
> This list is _much_ shorter than the one in ts-xen-build-prep.
> Why ?

The base system already contains some of the utilities that we need:

flex, iasl, libssl, uuid.

Then bcc already contains bin86 on FreeBSD, and then there are some
dependencies that I'm not sure why we need them: autoconf and automake
are not used during the build, x11 and sdl are also not required.

I've missed to add libpci, ncurses, getttext, gawk and libtool. And I'm
not sure about the xml2 and xslt ones, where they only used by xend?
Because I seem to be able to compile the tools fine without them.

Thanks, Roger.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-12 16:59     ` Roger Pau Monné
@ 2014-08-12 17:38       ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 17:38 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD"):
> I see two ways to solve this, either we create our own internal http/ftp
> mirror, or we could iterate over the list of official mirrors, expecting
> that at least one of them is accessible.

The latter will do I think.

> >> +    # Remove the known hosts file, since the keys will be regenerated after
> >> +    # rebooting into the installed system
> >> +    unlink "tmp/t.known_hosts_$flight.$job";
> > 
> > Can you instead arrange for the fixed keys to be installed on the
> > host ?  Otherwise manually sshing into these test boxes is very
> > annoying because the ssh keys keep changing.
> 
> The ssh key is only going to change one time, the key we have previous
> to this point is the key from the installer. I will look into copying
> this key into the installed system in order to prevent it from
> generating a new key.

Right.

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build
  2014-08-12 17:11     ` Roger Pau Monné
@ 2014-08-12 17:39       ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-12 17:39 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build"):
> The base system already contains some of the utilities that we need:
> 
> flex, iasl, libssl, uuid.

OK, good.

> Then bcc already contains bin86 on FreeBSD, and then there are some
> dependencies that I'm not sure why we need them: autoconf and automake
> are not used during the build, x11 and sdl are also not required.

Do we not run autogen.sh ?  I think you're right that X11 and SDL are
strictly speaking optional.

> I've missed to add libpci, ncurses, getttext, gawk and libtool. And I'm
> not sure about the xml2 and xslt ones, where they only used by xend?
> Because I seem to be able to compile the tools fine without them.

I haven't done a survey of what's strictly needed.  ncurses is for
things like xentop (and there may be others).

Thanks,
Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-12 16:42   ` Ian Jackson
  2014-08-12 16:59     ` Roger Pau Monné
@ 2014-08-13 13:31     ` Roger Pau Monné
  2014-08-13 13:45       ` Ian Jackson
  1 sibling, 1 reply; 15+ messages in thread
From: Roger Pau Monné @ 2014-08-13 13:31 UTC (permalink / raw)
  To: Ian Jackson; +Cc: xen-devel

On 12/08/14 18:42, Ian Jackson wrote:
> Roger Pau Monne writes ("[PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD"):
>> +    logm('Setting up serial console');
>> +    target_cmd_root($ho, <<END, 900);
>> +            echo "-Dh" >> /mnt/boot.config
> 
> Does FreeBSD's echo really simploy print things that look like
> options ?  I would use printf(1).

Using echo seems better than printf:

# echo "-Dh"
-Dh
# printf "-Dh"
printf: Illegal option -D

So I will leave that as-is.

Roger.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD
  2014-08-13 13:31     ` Roger Pau Monné
@ 2014-08-13 13:45       ` Ian Jackson
  0 siblings, 0 replies; 15+ messages in thread
From: Ian Jackson @ 2014-08-13 13:45 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel

Roger Pau Monné writes ("Re: [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD"):
> Using echo seems better than printf:
...
> # printf "-Dh"
> printf: Illegal option -D

You want
  printf "%s" "-Dh"

$ echo -h
-h
$ echo -n
$ echo -nDh
-nDh
$ echo -n Dh
Dh$
$ printf %s -Dh
-Dh$
$ type echo
echo is a shell builtin
$ echo $SHELL
/bin/bash
$ /bin/echo -n
$ dpkg -S /bin/echo
coreutils: /bin/echo
$

Ian.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-08-13 13:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12 15:49 [PATCH RFC 0/4] osstest: add native FreeBSD build tests Roger Pau Monne
2014-08-12 15:49 ` [PATCH RFC 1/4] osstest: add routine to execute ssh with password Roger Pau Monne
2014-08-12 16:37   ` Ian Jackson
2014-08-12 15:49 ` [PATCH RFC 2/4] osstest: add support for installing bare metal FreeBSD Roger Pau Monne
2014-08-12 16:42   ` Ian Jackson
2014-08-12 16:59     ` Roger Pau Monné
2014-08-12 17:38       ` Ian Jackson
2014-08-13 13:31     ` Roger Pau Monné
2014-08-13 13:45       ` Ian Jackson
2014-08-12 15:49 ` [PATCH RFC 3/4] osstest: prepare FreeBSD host for Xen build Roger Pau Monne
2014-08-12 16:44   ` Ian Jackson
2014-08-12 17:11     ` Roger Pau Monné
2014-08-12 17:39       ` Ian Jackson
2014-08-12 15:49 ` [PATCH RFC 4/4] osstest: add script to build Xen on FreeBSD Roger Pau Monne
2014-08-12 16:45   ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.