foreman/app/models/operatingsystems/debian.rb @ 95a66717
2c83f744 | Paul Kelly | class Debian < Operatingsystem
|
|
6352d882 | Jochen Schalanda | ||
PXEFILES = {:kernel => "linux", :initrd => "initrd.gz"}
|
|||
2c83f744 | Paul Kelly | def preseed_server host
|
|
db59a916 | Jochen Schalanda | medium_uri(host).select(:host, :port).compact.join(':')
|
|
2c83f744 | Paul Kelly | end
|
|
def preseed_path host
|
|||
db59a916 | Jochen Schalanda | medium_uri(host).select(:path, :query).compact.join('?')
|
|
2c83f744 | Paul Kelly | end
|
|
db59a916 | Jochen Schalanda | def boot_files_uri(medium, architecture)
|
|
eed31c34 | Ohad Levy | raise ::Foreman::Exception.new(N_("invalid medium for %s"), to_s) unless media.include?(medium)
|
|
raise ::Foreman::Exception.new(N_("invalid architecture for %s"), to_s) unless architectures.include?(architecture)
|
|||
6352d882 | Jochen Schalanda | ||
# Debian stores x86_64 arch is amd64
|
|||
arch = architecture.to_s.gsub("x86_64","amd64")
|
|||
pxe_dir = "dists/#{release_name}/main/installer-#{arch}/current/images/netboot/#{guess_os}-installer/#{arch}"
|
|||
PXEFILES.values.collect do |img|
|
|||
db59a916 | Jochen Schalanda | URI.parse("#{medium_vars_to_uri(medium.path, architecture.name, self)}/#{pxe_dir}/#{img}").normalize
|
|
6352d882 | Jochen Schalanda | end
|
|
end
|
|||
def pxe_type
|
|||
cab0d8c6 | Ohad Levy | "preseed"
|
|
6352d882 | Jochen Schalanda | end
|
|
a6db0470 | Paul Kelly | # Does this OS family use release_name in its naming scheme
|
|
def use_release_name?
|
|||
true
|
|||
end
|
|||
48a65101 | Greg Sutcliffe | def display_family
|
|
"Debian"
|
|||
end
|
|||
c2c32409 | Greg Sutcliffe | def self.shorten_description description
|
|
return "" if description.blank?
|
|||
s=description
|
|||
s.gsub!('GNU/Linux','')
|
|||
s.gsub!(/\(.+?\)/,'')
|
|||
s.squeeze! " "
|
|||
s.strip!
|
|||
s.blank? ? description : s
|
|||
end
|
|||
6352d882 | Jochen Schalanda | private
|
|
# tries to guess if this an ubuntu or a debian os
|
|||
def guess_os
|
|||
name =~ /ubuntu/i ? "ubuntu" : "debian"
|
|||
end
|
|||
95a66717 | Marek Hulan | def self.model_name
|
|
superclass.model_name
|
|||
end
|
|||
3b828aad | Ohad Levy | end
|