[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v4 10/11] osstest: add a script to install Xen on FreeBSD hosts
This scripts takes care of installing the run-time dependencies, unpacking the Xen files and setup the right configuration in order to boot a FreeBSD PVH Dom0. Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> --- ts-xen-install-freebsd | 128 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 ts-xen-install-freebsd diff --git a/ts-xen-install-freebsd b/ts-xen-install-freebsd new file mode 100644 index 0000000..2e0c35d --- /dev/null +++ b/ts-xen-install-freebsd @@ -0,0 +1,128 @@ +#!/usr/bin/perl -w +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2009-2015 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 Osstest; +use POSIX; +use Osstest::TestSupport; + +my $checkmode= 0; + +tsreadconfig(); + +our @hos; + +if (@ARGV and $ARGV[0] eq '--check') { + $checkmode= 1; + shift @ARGV; + logm("checking builds are done..."); +} else { + if (!@ARGV) { + push @ARGV, 'host'; + } + foreach my $k (@ARGV) { + push @hos, selecthost($k); + } +} + +our $ho; + +my %distpath; + +our $run_deps = "yajl python curl glib gettext pixman libiconv"; + +sub packages () { + logm('Installing Xen runtime dependencies'); +target_cmd_root($ho, <<END, 2400); + set -e + export ASSUME_ALWAYS_YES="YES" + pkg install -y $run_deps +END +} + +sub extract () { + my @parts = ('', 'xen'); + + foreach my $part (@parts) { + target_extract_jobdistpath($ho, $part, "path_${part}dist", + $r{"${part}buildjob"}, \%distpath); + } + target_cmd_root($ho, 'gunzip -c `readlink -f /boot/xen.gz` > /boot/xen', 100); +} + +sub adjustconfig () { + target_cmd_root($ho, <<END, 100); + set -e + mkdir -p /usr/local/etc/rc.conf.d + echo 'XENCONSOLED_TRACE=guest' >> /usr/local/etc/rc.conf.d/xencommons + mkdir -p /var/log/xen/console + mkdir -p /var/lock + mkdir -p /var/run/xen + echo 'vm.max_wired=-1' >> /etc/sysctl.conf + echo 'xc0 "/usr/libexec/getty Pc" xterm on secure' >> /etc/ttys + echo 'xencommons_enable="YES"' >> /etc/rc.conf +END +} + +sub setupboot () { + my $xenhopt = "dom0pvh=1"; + + my $cons= get_host_property($ho, 'XenSerialConsole', 'com1'); + + if ( $cons eq "com1" ) { + $xenhopt .= " com1=$c{Baud},8n1 console=com1,vga gdb=com1"; + } elsif ( $cons eq "dtuart" ) { + $xenhopt .= " console=dtuart"; + my $dtuart= get_host_property($ho, 'XenDTUARTPath', undef); + $xenhopt .= " dtuart=$dtuart" if $dtuart; + } else { + logm("No Xen console device defined for host"); + } + if (toolstack()->{Dom0MemFixed}) { + $xenhopt .= " dom0_mem=2048M,max:2048M"; + } + my $append= $r{xen_boot_append}; + $xenhopt .= " $append" if defined $append; + $append = get_host_property($ho, 'xen-commandline-append', undef); + $xenhopt .= " $append" if defined $append; + + die "pci-passthrough is not supported" if host_involves_pcipassthrough($ho); + + target_cmd_root($ho, <<END, 100); + set -e + cat <<ENDB >>/boot/loader.conf +vfs.zfs.arc_max="1G" +xen_cmdline="$xenhopt" +xen_kernel="/boot/xen" +ENDB +END + + logm("ready to boot Xen"); +} + +if ($checkmode) { + extract(); +} else { + die if @hos > 1; + $ho= $hos[0]; + + packages(); + extract(); + adjustconfig(); + setupboot(); +} -- 1.9.3 (Apple Git-50) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |