This series allows installing a FreeBSD guest from OSS-Test. The following change by Ian Jackson is needed in order to run the newly added FreeBSD installer script: http://xenbits.xen.org/gitweb/?p=people/iwj/osstest.git;a=commit;h=a55ebaf5cd49b0c2bf7538b373ecbd9c871fc20b The series can be found at: git://xenbits.xen.org/people/royger/osstest.git freebsd http://xenbits.xen.org/gitweb/?p=people/royger/osstest.git;a=shortlog;h=refs/heads/freebsd Thanks, Roger.
Roger Pau Monne
2013-Nov-21 11:48 UTC
[PATCH 1/2] oss-test: add UFS rw support to pvops kernel
This is needed in order to mount and modify the FreeBSD VM images. Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> Cc: Ian Jackson <Ian.Jackson@eu.citrix.com> Cc: Ian Campbell <ian.campbell@citrix.com> --- ts-kernel-build | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ts-kernel-build b/ts-kernel-build index 43d9db7..478d912 100755 --- a/ts-kernel-build +++ b/ts-kernel-build @@ -171,6 +171,8 @@ setopt CONFIG_IGB m setopt CONFIG_PCI_IOV y setopt CONFIG_EXT4_FS m +setopt CONFIG_UFS_FS m +setopt CONFIG_UFS_FS_WRITE y END -- 1.7.7.5 (Apple Git-26) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
Images have to be placed in $freebsd_vm_repo, currently it expects to
find:
ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/10.0-BETA3/i386/20131103/FreeBSD-10.0-BETA3-i386-20131103-r257580.qcow2.xz
as
FreeBSD-10.0-BETA3-i386.qcow2.xz
and
ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/10.0-BETA3/amd64/20131103/FreeBSD-10.0-BETA3-amd64-20131103-r257580.qcow2.xz
as
FreeBSD-10.0-BETA3-amd64.qcow2.xz
---
ts-freebsd-install | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 109 insertions(+), 0 deletions(-)
create mode 100644 ts-freebsd-install
diff --git a/ts-freebsd-install b/ts-freebsd-install
new file mode 100644
index 0000000..4e32b6c
--- /dev/null
+++ b/ts-freebsd-install
@@ -0,0 +1,109 @@
+#!/usr/bin/perl -w
+# This is part of "osstest", an automated testing framework for Xen.
+# Copyright (C) 2009-2013 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 Osstest::TestSupport;
+
+tsreadconfig();
+
+our ($whhost,$gn) = @ARGV;
+$whhost ||= 'host';
+$gn ||= 'freebsd';
+
+our $ho= selecthost($whhost);
+
+our $ram_mb= 1024;
+our $disk_mb= 20480;
+
+our $guesthost= "$gn.guest.osstest";
+our $gho;
+
+our $xl= toolstack()->{Command};
+
+our $freebsd_qcow2= '/root/freebsd.qcow2';
+our $freebsd_raw= '/root/freebsd.raw';
+
+our $freebsd_mount= '/root/freebsd_root';
+
+our $freebsd_version= "10.0-BETA3";
+
+# Folder where the FreeBSD VM images are stored inside of the host
+#
+# The naming convention of the stored images is:
+# FreeBSD-$freebsd_version-$arch.qcow2.xz
+# ie: FreeBSD-10.0-BETA3-amd64.qcow2.xz
+our $freebsd_vm_repo= '/var/images';
+
+sub prep () {
+ my $authkeys= authorized_keys();
+
+ target_install_packages_norec($ho, qw(lvm2 wget qemu-utils xz-utils
kpartx));
+
+ $gho= prepareguest($ho, $gn, $guesthost, 22,
+ $disk_mb + 1,
+ 100);
+
+ more_prepareguest_hvm($ho, $gho, $ram_mb, $disk_mb, NoCdromImage => 1);
+
+ my $freebsd_img = $freebsd_vm_repo . "/" . "FreeBSD-" .
$freebsd_version . "-";
+ # Use amd64 as default arch
+ $freebsd_img .= defined($r{"$gho->{Guest}_arch"}) ?
$r{"$gho->{Guest}_arch"} : 'amd64';
+ $freebsd_img .= ".qcow2.xz";
+
+ target_cmd_root($ho, "umount $gho->{Lvdev} ||:");
+
+ target_cmd_root($ho, <<END, 900);
+ xz -dkc $freebsd_img > $freebsd_qcow2
+ qemu-img convert -f qcow2 $freebsd_qcow2 -O raw $freebsd_raw
+ rm -rf $freebsd_qcow2
+ dd if=$freebsd_raw of=$gho->{Lvdev} bs=1M
+ rm -rf $freebsd_raw
+
+ kpartx -a $gho->{Lvdev}
+ mkdir -p $freebsd_mount
+ mount -t ufs -o ufstype=ufs2,rw
/dev/mapper/$gho->{Vg}-$gho->{Name}--disk3 $freebsd_mount
+
+ mkdir -p $freebsd_mount/root/.ssh
+ cat <<'ENDKEYS'
>$freebsd_mount/root/.ssh/authorized_keys
+$authkeys
+ENDKEYS
+
+ echo 'sshd_enable="YES"' >>
$freebsd_mount/etc/rc.conf
+ echo 'ifconfig_xn0="DHCP"' >>
$freebsd_mount/etc/rc.conf
+ echo 'PermitRootLogin yes' >>
$freebsd_mount/etc/ssh/sshd_config
+
+ sed -i '/^ttyu0/s/off/on/' $freebsd_mount/etc/ttys
+
+ cp $freebsd_mount/usr/share/zoneinfo/Europe/London
$freebsd_mount/etc/localtime
+
+ cat <<'ENDKEYS' >$freebsd_mount/boot/loader.conf
+boot_multicons="YES"
+boot_serial="YES"
+comconsole_speed="115200"
+console="comconsole,vidconsole"
+ENDKEYS
+
+ umount $freebsd_mount
+ rm -rf $freebsd_mount
+ kpartx -d $gho->{Lvdev}
+END
+
+}
+
+prep();
--
1.7.7.5 (Apple Git-26)
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
Roger Pau Monné
2013-Nov-21 16:09 UTC
Re: [PATCH 2/2] oss-test: add FreeBSD PVHVM installer
On 21/11/13 12:48, Roger Pau Monne wrote:> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com> > Cc: Ian Jackson <Ian.Jackson@eu.citrix.com> > Cc: Ian Campbell <ian.campbell@citrix.com> > --- > Images have to be placed in $freebsd_vm_repo, currently it expects to > find: > > ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/10.0-BETA3/i386/20131103/FreeBSD-10.0-BETA3-i386-20131103-r257580.qcow2.xz > as > FreeBSD-10.0-BETA3-i386.qcow2.xz > and > ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/VM-IMAGES/10.0-BETA3/amd64/20131103/FreeBSD-10.0-BETA3-amd64-20131103-r257580.qcow2.xz > as > FreeBSD-10.0-BETA3-amd64.qcow2.xz > --- > ts-freebsd-install | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 109 insertions(+), 0 deletions(-) > create mode 100644 ts-freebsd-install > > diff --git a/ts-freebsd-install b/ts-freebsd-install > new file mode 100644 > index 0000000..4e32b6c > --- /dev/null > +++ b/ts-freebsd-install > @@ -0,0 +1,109 @@ > +#!/usr/bin/perl -w > +# This is part of "osstest", an automated testing framework for Xen. > +# Copyright (C) 2009-2013 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 Osstest::TestSupport; > + > +tsreadconfig(); > + > +our ($whhost,$gn) = @ARGV; > +$whhost ||= 'host'; > +$gn ||= 'freebsd'; > + > +our $ho= selecthost($whhost); > + > +our $ram_mb= 1024; > +our $disk_mb= 20480; > + > +our $guesthost= "$gn.guest.osstest"; > +our $gho; > + > +our $xl= toolstack()->{Command};The line above is not needed at all, I've just used it for testing, could you remove it when committing Ian? Thanks. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Roger Pau Monné writes ("Re: [PATCH 2/2] oss-test: add FreeBSD PVHVM
installer"):> On 21/11/13 12:48, Roger Pau Monne wrote:
> > +our $xl= toolstack()->{Command};
>
> The line above is not needed at all, I''ve just used it for
testing,
> could you remove it when committing Ian?
Willdo, thanks.
Ian.
Ian Jackson
2013-Nov-21 18:45 UTC
Re: [PATCH 1/2] oss-test: add UFS rw support to pvops kernel
Roger Pau Monne writes ("[PATCH 1/2] oss-test: add UFS rw support to pvops
kernel"):> This is needed in order to mount and modify the FreeBSD VM images.
Thanks. I have pushed this one right away to osstest staging
("pretest") in the hope that it will do a build for me and safe the
effort of doing so myself :-).
I have a work-in-progress fixup and integration of your FreeBSD test.
Ian.