76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/vmit/bootstrap.rb', line 76
def execute_autoinstall(args)
auto_install_args = {}
kickstart = Vmit::Kickstart.new
case media
when Vmit::VFS::URI
kickstart.install = location
when Vmit::VFS::ISO
kickstart.install = :cdrom
auto_install_args.merge!(:cdrom => location.to_s)
else raise ArgumentError.new("Unsupported autoinstallation: #{location}")
end
Dir.mktmpdir do |floppy_dir|
qemu_args = {:floppy => floppy_dir,
:append => "ks=floppy repo=#{kickstart.install}",
:reboot => false}
qemu_args.merge!(auto_install_args)
qemu_args.merge!(args) do |key, oldv, newv|
case key
when :append then [oldv, newv].flatten
else newv
end
end
File.write(File.join(floppy_dir, 'ks.cfg'), kickstart.to_ks_script)
Vmit.logger.info "Kickstart: 1st stage."
vm.run(qemu_args)
end
end
|