Skip to content

Commit

Permalink
fixes #1620 - Basic support for Archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
GregSutcliffe authored and ohadlevy committed May 15, 2012
1 parent ad7ccf6 commit ba71c56
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
22 changes: 22 additions & 0 deletions app/models/archlinux.rb
@@ -0,0 +1,22 @@
class Archlinux < Operatingsystem

PXEFILES = {:kernel => "linux", :initrd => "initrd"}

# Override the class representation, as this breaks many rails helpers
def class
Operatingsystem
end

def pxe_type
"aix" # Fairly pointless as we have to set up NBD separately for now
end

def pxedir
"boot/$arch/loader"
end

def url_for_boot(file)
pxedir + "/" + PXEFILES[file]
end

end
5 changes: 4 additions & 1 deletion app/models/facts_importer.rb
Expand Up @@ -15,7 +15,10 @@ def operatingsystem
facts[:lsbdistrelease] || facts[:operatingsystemrelease]
end

if orel.present?
if os_name == "Archlinux"
# Archlinux is rolling release, so it has no release. We use 1.0 always
Operatingsystem.find_or_create_by_name_and_major_and_minor os_name, "1", "0"
elsif orel.present?
major, minor = orel.split(".")
minor ||= ""
Operatingsystem.find_or_create_by_name_and_major_and_minor os_name, major, minor
Expand Down
6 changes: 3 additions & 3 deletions app/models/operatingsystem.rb
Expand Up @@ -41,9 +41,9 @@ class Operatingsystem < ActiveRecord::Base
FAMILIES = { 'Debian' => %r{Debian|Ubuntu}i,
'Redhat' => %r{RedHat|Centos|Fedora|Scientific|SLC}i,
'Suse' => %r{OpenSuSE}i,
'Solaris' => %r{Solaris}i,
'Windows' => %r{Windows}i }

'Windows' => %r{Windows}i,
'Archlinux' => %r{Archlinux}i,
'Solaris' => %r{Solaris}i }

class Jail < Safemode::Jail
allow :name, :media_url, :major, :minor, :family, :to_s, :epel, :==, :release_name, :kernel, :initrd, :pxe_type
Expand Down
Binary file added public/images/Archlinux.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba71c56

Please sign in to comment.