[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v4 04/11] osstest: add support for installing bare metal FreeBSD



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, <<END, 100);
> +            set -e
> +            chsh -s /bin/sh osstest
> +            mkdir -p /home/osstest/.ssh
> +            cat <<ENDKEYS >/home/osstest/.ssh/authorized_keys
> +$authkeys
> +ENDKEYS
> +END

Likewise.

> +    logm('OK: install completed');

That was remarkably painless, I thought it would be much worse!



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.