Vagrant: Supply pkg information to the guest.

The vagrant proxy plugin doesn't appear to support FreeBSD or pkg in the
same way that it supports linux distros and their associated package
managers. This change supplies the needed proxy configuration to get
around this issue.

Change-Id: I7dfbd963c5fd01d598c1456c5d8139be81777440
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/426422
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Seth Howell 2018-09-21 17:34:11 -07:00 committed by Jim Harris
parent e80b3d5f13
commit 0ee7ebcc70
2 changed files with 13 additions and 0 deletions

View File

@ -30,6 +30,12 @@ Vagrant.configure(2) do |config|
when "freebsd11" when "freebsd11"
#See: https://app.vagrantup.com/generic/boxes/freebsd11 #See: https://app.vagrantup.com/generic/boxes/freebsd11
config.vm.box = "generic/freebsd11" config.vm.box = "generic/freebsd11"
if File.file?(File.expand_path("~/vagrant_pkg.conf"))
config.vm.provision "file", source: "~/vagrant_pkg.conf", destination: "pkg.conf"
config.vm.provision "shell", inline: "sudo mv pkg.conf /usr/local/etc/pkg.conf"
config.vm.provision "shell", inline: "sudo chown root:wheel /usr/local/etc/pkg.conf"
config.vm.provision "shell", inline: "sudo chmod 644 /usr/local/etc/pkg.conf"
end
else else
"Invalid argument #{distro}" "Invalid argument #{distro}"
abort("Invalid argument!") abort("Invalid argument!")

View File

@ -181,6 +181,13 @@ if [ ${DRY_RUN} != 1 ]; then
else else
vagrant plugin install vagrant-proxyconf vagrant plugin install vagrant-proxyconf
fi fi
if echo "$SPDK_VAGRANT_DISTRO" | grep -q freebsd; then
cat >~/vagrant_pkg.conf <<EOF
pkg_env: {
http_proxy: ${http_proxy}
}
EOF
fi
fi fi
vagrant up $provider vagrant up $provider
echo "" echo ""