From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH v4 04/11] osstest: add support for installing bare metal FreeBSD Date: Thu, 19 Mar 2015 15:13:38 +0000 Message-ID: <1426778018.21742.29.camel@citrix.com> References: <1424276291-6872-1-git-send-email-roger.pau@citrix.com> <1424276291-6872-5-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YYcAh-0003IM-Eg for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 15:15:43 +0000 In-Reply-To: <1424276291-6872-5-git-send-email-roger.pau@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Roger Pau Monne Cc: xen-devel@lists.xenproject.org, Ian Jackson List-Id: xen-devel@lists.xenproject.org On Wed, 2015-02-18 at 17:18 +0100, Roger Pau Monne wrote: > - Add a list of FreeBSD ftp mirrors and iterate over them in order to > find a working one. I didn't actually see this, and in general we try and avoid dependencies on random 3rd party webservices. Can we mirror FreeBSD locally like we do with Debian? > diff --git a/production-config b/production-config > index 515bd98..fefc467 100644 > --- a/production-config > +++ b/production-config > @@ -86,6 +86,8 @@ HostProp_GenEtherPrefixBase 5a:36:0e:00 > # :00:01 guest number in job appended > # ^^ xor'd with low 8 bits of flight > > +FreeBSDVersion current I think for the final deployment we would want a specific version here. IIRC the "current" stuff used with DiVersion is vestigial and no longer used (or perhaps a standalone-mode-ism). (or perhaps there is something which that graphic from 00/11 should be telling me which I can't decipher) > +exit 0 if $ho->{SharedReady}; I suppose this is some clever way to avoid unnecessary reinstalls? > +sub get_mfsbsd() { > + > + # Figure out the path to the mfsBSD image we have to use. > + # This can either come from a previous buildjob or from > + # a pre-seeded image. > + > + if ($r{freebsd_buildjob}) { > + # We are going to use the build output from a previous job. > + return get_stashed('path_mfsbsd.img', $r{freebsd_buildjob}); > + } else { > + # We are going to use a pre-seeded version. > + return "$c{Images}/freebsd/$c{FreeBSDVersion}/$r{arch}/mfsbsd.img"; > + } > +} > + > +sub get_set($) { > + my ($set) = @_; > + > + if ($r{freebsd_buildjob}) { > + # We are going to use the build output from a previous job. > + return get_stashed("path_$set", $r{freebsd_buildjob}); > + } else { > + # We are going to use a pre-seeded version. > + return "$c{Images}/freebsd/$c{FreeBSDVersion}/$r{arch}/$set"; > + } > +} Isn't get_mfsbsd the same as get_set("mfsbsd.img") ? > + > +sub setup_sets() { > + my $webfolder = "$c{WebspaceFile}/$c{WebspaceCommon}/freebsd/$ho->{Name}"; > + > + # Link the sets to the public http folder > + rmtree($webfolder); > + mkpath($webfolder); > + foreach my $set (@sets) { > + my $set_src = abs_path(get_set($set)); > + logm("Using install set: $set_src"); > + symlink $set_src,"$webfolder/$set" or die "Unable to create symlink: $!"; This relies on the webserver and the controller having a shared NFS view of the world, which I'm not sure is always true? > + logm('Setting root shell to /bin/sh'); > + target_cmd_root($ho, 'chsh -s /bin/sh', 100); Did you not already do this and/or can't you do it while tailoring rather than after first boot? > + logm('Adding osstest user'); > + target_cmd_root($ho, 'pw useradd osstest -m', 100); > + target_cmd_root($ho, < + set -e > + chsh -s /bin/sh osstest > + mkdir -p /home/osstest/.ssh > + cat </home/osstest/.ssh/authorized_keys > +$authkeys > +ENDKEYS > +END Likewise. > + logm('OK: install completed'); That was remarkably painless, I thought it would be much worse!