Add device tree binary image support

This is required for correct emulation of ARM devices
This commit is contained in:
Gerben Meijer 2016-03-14 16:00:23 +01:00
parent 98f2eaed5e
commit dc1a8d421f
4 changed files with 21 additions and 0 deletions

View File

@ -49,6 +49,7 @@ module VagrantPlugins
@cmd_line = config.cmd_line
@emulator_path = config.emulator_path
@initrd = config.initrd
@dtb = config.dtb
@graphics_type = config.graphics_type
@graphics_autoport = config.graphics_autoport
@graphics_port = config.graphics_port

View File

@ -202,6 +202,20 @@ module VagrantPlugins
video.attributes['vram'] = config.video_vram
end
# dtb
if config.dtb
dtb = REXML::XPath.first(xml_descr,'/domain/os/dtb')
if dtb.nil?
dtb = REXML::Element.new('dtb', REXML::XPath.first(xml_descr,'/domain/os'))
dtb.text = config.dtb
else
if dtb.text != config.dtb
descr_changed = true
dtb.text = config.dtb
end
end
end
# Apply
if descr_changed
begin

View File

@ -73,6 +73,7 @@ module VagrantPlugins
attr_accessor :kernel
attr_accessor :cmd_line
attr_accessor :initrd
attr_accessor :dtb
attr_accessor :emulator_path
attr_accessor :graphics_type
attr_accessor :graphics_autoport
@ -148,6 +149,7 @@ module VagrantPlugins
@volume_cache = UNSET_VALUE
@kernel = UNSET_VALUE
@initrd = UNSET_VALUE
@dtb = UNSET_VALUE
@cmd_line = UNSET_VALUE
@emulator_path = UNSET_VALUE
@graphics_type = UNSET_VALUE
@ -433,6 +435,7 @@ module VagrantPlugins
@kernel = nil if @kernel == UNSET_VALUE
@cmd_line = '' if @cmd_line == UNSET_VALUE
@initrd = '' if @initrd == UNSET_VALUE
@dtb = nil if @dtb == UNSET_VALUE
@graphics_type = 'vnc' if @graphics_type == UNSET_VALUE
@graphics_autoport = 'yes' if @graphics_port == UNSET_VALUE
@graphics_autoport = 'no' if @graphics_port != UNSET_VALUE

View File

@ -42,6 +42,9 @@
<kernel><%= @kernel %></kernel>
<initrd><%= @initrd %></initrd>
<cmdline><%= @cmd_line %></cmdline>
<% if @dtb %>
<dtb><%= @dtb %></dtb>
<% end %>
</os>
<features>
<acpi/>