foreman/app/models/operatingsystems/windows.rb @ 9a9ec5b1
7e0a5873 | Jim Perrin | class Windows < Operatingsystem
|
|
85e62544 | Dmitry Kireev | PXEFILES = {:kernel => "wimboot", :initrd => "bootmgr", :bcd => "bcd", :bootsdi => "boot.sdi", :bootwim => "boot.wim"}
|
|
7e0a5873 | Jim Perrin | ||
9a9ec5b1 | Daniel Lobato | class << self
|
|
delegate :model_name, :to => :superclass
|
|||
end
|
|||
7e0a5873 | Jim Perrin | def pxe_type
|
|
"waik"
|
|||
end
|
|||
85e62544 | Dmitry Kireev | def pxe_prefix(arch)
|
|
"boot/windows-#{arch}/".gsub(" ","-")
|
|||
7e0a5873 | Jim Perrin | end
|
|
85e62544 | Dmitry Kireev | def bootfile arch, type
|
|
pxe_prefix(arch) + eval("#{self.family}::PXEFILES[:#{type}]")
|
|||
end
|
|||
def boot_files_uri(medium, architecture, host = nil)
|
|||
raise ::Foreman::Exception.new(N_("invalid medium for %s"), to_s) unless media.include?(medium)
|
|||
pxe_dir = ""
|
|||
PXEFILES.values.collect do |img|
|
|||
if img =~ /boot.sdi/i || img =~ /bcd/i
|
|||
pxe_dir = "boot"
|
|||
elsif img =~ /boot.wim/i
|
|||
pxe_dir = "sources"
|
|||
else
|
|||
pxe_dir = ""
|
|||
end
|
|||
URI.parse("#{medium_vars_to_uri(medium.path, architecture.name, self)}/#{pxe_dir}/#{img}").normalize
|
|||
end
|
|||
7e0a5873 | Jim Perrin | end
|
|
48a65101 | Greg Sutcliffe | def display_family
|
|
"Windows"
|
|||
end
|
|||
end
|