Update CHANGELOG

This commit is contained in:
Mitchell Hashimoto 2014-04-11 16:39:58 -07:00
parent d6a872f501
commit 2057d513cb
5 changed files with 18 additions and 31 deletions

View File

@ -23,8 +23,7 @@ FEATURES:
IMPROVEMENTS:
- commands/ssh-config: Works without a target in multi-machine envs [GH-2844]
- guests/freebsd: Added `config.freebsd.device` setting to set the network
device prefix, defaults to "em". [GH-2956]
- guests/freebsd: Support for virtio interfaces. [GH-3082]
- guests/openbsd: Support for virtio interfaces. [GH-3082]
PLUGIN AUTHOR CHANGES:

View File

@ -13,7 +13,19 @@ module VagrantPlugins
machine.communicate.sudo("sed -i '' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf", {:shell => "sh"})
networks.each do |network|
device = "#{machine.config.freebsd.device}#{network[:interface]}"
# Determine the interface prefix...
command = "ifconfig -a | grep -o ^[0-9a-z]*"
result = ""
ifname = ""
machine.communicate.execute(command) do |type, data|
result << data if type == :stdout
if result.split(/\n/).any?{|i| i.match(/vio*/)}
ifname = "vio#{network[:interface]}"
else
ifname = "em#{network[:interface]}"
end
end
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
:options => network)
@ -28,9 +40,9 @@ module VagrantPlugins
machine.communicate.sudo("rm /tmp/vagrant-network-entry", {:shell => "sh"})
if network[:type].to_sym == :static
machine.communicate.sudo("ifconfig #{device} inet #{network[:ip]} netmask #{network[:netmask]}", {:shell => "sh"})
machine.communicate.sudo("ifconfig #{ifname} inet #{network[:ip]} netmask #{network[:netmask]}", {:shell => "sh"})
elsif network[:type].to_sym == :dhcp
machine.communicate.sudo("dhclient #{device}", {:shell => "sh"})
machine.communicate.sudo("dhclient #{ifname}", {:shell => "sh"})
end
end
end

View File

@ -1,20 +0,0 @@
module VagrantPlugins
module GuestFreeBSD
class Config < Vagrant.plugin("2", :config)
# The device prefix for network devices created by Vagrant.
# This defaults to "em" but can be set for example to "vtnet"
# for virtio devices and so on.
#
# @return [String]
attr_accessor :device
def initialize
@device = UNSET_VALUE
end
def finalize!
@device = "em" if @device == UNSET_VALUE
end
end
end
end

View File

@ -6,11 +6,6 @@ module VagrantPlugins
name "FreeBSD guest"
description "FreeBSD guest support."
config("freebsd") do
require File.expand_path("../config", __FILE__)
Config
end
guest("freebsd") do
require File.expand_path("../guest", __FILE__)
Guest

View File

@ -18,10 +18,10 @@ module VagrantPlugins
temp.write(entry)
temp.close
# Determine the interface prefix...
command = "ifconfig -a | grep -o ^[0-9a-z]*"
result = ""
ifname = ""
machine.communicate.execute(command) do |type, data|
result << data if type == :stdout
if result.split(/\n/).any?{|i| i.match(/vio*/)}
@ -30,6 +30,7 @@ module VagrantPlugins
ifname = "em#{network[:interface]}"
end
end
machine.communicate.upload(temp.path, "/tmp/vagrant-network-entry")
machine.communicate.sudo("mv /tmp/vagrant-network-entry /etc/hostname.#{ifname}")