Project

General

Profile

« Previous | Next » 

Revision 7e0a5873

Added by Jim Perrin about 12 years ago

  • ID 7e0a58734bdeaa64ee737b487e11f657181a4e29

fixes #1254 - initial support to pxeboot windows

View differences:

app/models/operatingsystem.rb
FAMILIES = { 'Debian' => %r{Debian|Ubuntu}i,
'Redhat' => %r{RedHat|Centos|Fedora|Scientific|SLC}i,
'Suse' => %r{OpenSuSE}i,
'Solaris' => %r{Solaris}i }
'Solaris' => %r{Solaris}i,
'Windows' => %r{Windows}i }
class Jail < Safemode::Jail
app/models/windows.rb
class Windows < Operatingsystem
PXEFILES = {:kernel => "startrom.0", :initrd => "boot.sdi"}
def class
Operatingsystem
end
def pxe_type
"waik"
end
def pxedir
"images"
end
def url_for_boot(file)
pxedir + "/" + PXEFILES[file]
end
end
app/views/unattended/autowaik.xml.erb
#There will be content here later on
there will be content here later on
app/views/unattended/pxe_autowaik.erb
default winPE
label winPE
kernel /Boot/startrom.0
db/migrate/20120127141602_add_windows_templates.rb
class AddWindowsTemplates < ActiveRecord::Migration
def self.up
TemplateKind.all.each do |kind|
case kind.name
when /provision/
ConfigTemplate.create(
:name => "Waik Default",
:template_kind_id => kind.id,
:operatingsystem_ids => Windows.all.map(&:id),
:template => File.read("#{RAILS_ROOT}/app/views/unattended/autowaik.xml.erb"))
when /pxelinux/i
ConfigTemplate.create(
:name => "Waik default PXELinux",
:template_kind_id => kind.id,
:operatingsystem_ids => Windows.all.map(&:id),
:template => File.read("#{RAILS_ROOT}/app/views/unattended/pxe_autowaik.erb"))
end
end
os = Operatingsystem.find_all_by_type "Windows" || Operatingsystem.where("name LIKE ?", "windows")
disk = Ptable.create :name => "Windows Entire SCSI Disk", :layout =>" <partitioning config:type=\"list\">\n <drive>\n <device>/stuff</device> \n <use>all</use>\n </drive>\n </partitioning>"
disk.operatingsystems = os
disk = Ptable.create :name => "Windows Entire Virtual Disk", :layout =>" <partitioning config:type=\"list\">\n <drive>\n <device>/data</device> \n <use>all</use>\n </drive>\n </partitioning>"
disk.operatingsystems = os
Medium.reset_column_information
medium = Medium.create :name => "Windows mirror", :path => "http://example.com/"
medium.operatingsystems = os
rescue Exception => e
# something bad happened, but we don't want to break the migration process
Rails.logger.warn "Failed to migrate #{e}"
return true
end
def self.down
end
end

Also available in: Unified diff