From ba71c565baefbb183367e79dc1138c8258b457cb Mon Sep 17 00:00:00 2001 From: Greg Sutcliffe Date: Mon, 14 May 2012 22:16:31 +0100 Subject: [PATCH] fixes #1620 - Basic support for Archlinux --- app/models/archlinux.rb | 22 ++++++++++++++++++++++ app/models/facts_importer.rb | 5 ++++- app/models/operatingsystem.rb | 6 +++--- public/images/Archlinux.png | Bin 0 -> 1122 bytes 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 app/models/archlinux.rb create mode 100644 public/images/Archlinux.png diff --git a/app/models/archlinux.rb b/app/models/archlinux.rb new file mode 100644 index 00000000000..b15a9e3b922 --- /dev/null +++ b/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 diff --git a/app/models/facts_importer.rb b/app/models/facts_importer.rb index bc396859fea..bc63ad57c8b 100644 --- a/app/models/facts_importer.rb +++ b/app/models/facts_importer.rb @@ -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 diff --git a/app/models/operatingsystem.rb b/app/models/operatingsystem.rb index bc95662487e..4341f709378 100644 --- a/app/models/operatingsystem.rb +++ b/app/models/operatingsystem.rb @@ -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 diff --git a/public/images/Archlinux.png b/public/images/Archlinux.png new file mode 100644 index 0000000000000000000000000000000000000000..dc7c0e5cba00e9cef1921e3abab7c780a1bc2326 GIT binary patch literal 1122 zcmV-o1fBbdP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXQ3 z3?Mo-`2Ms200ZJlL_t(Y$E}u0Y}Hj1#(&@a|KGo*OagtSU>KC4u|Zlu>X1;~h{Ob( zf?=ZwF%YGF7)^|c3w5J0Ce{vshLB*wWE^lvbOGu@NYH?#&!#PtCLk6{rBDLCzP@*l zi`NDev@LKJcXQ7<-#OoR?f`?Z!iHu5#@8k*W^76>0J#67W^TI0>zckS+1R{$C^2rZ zjzta0slx8Pl=kx;+;OD*rUOK>C9%MbHSCtIp5DcSjnhC5CF@)0kuPxAHzq2*8DsOq z!$l+9UD<4SVfV7>H`c+S=S#_#N}^DeF$XaxyfHJK2^I~Md_aJEK5PLXFH$0MA_|;E zfg_#u$oyM3q(Q~jB>R?^Qn9(E2>MNSqvS<2hAhd(~N9ANRM$F5(41zTG8 zNv`cuum2#FedS@CH!N#t;)vLkx}3N7;mzcMQL$jp$UH416aKaR z@u`ES=%LTr%7$5Z5P=z-OJ(UwWk_W_-XL@$3Prpiq&PoXxb@N7c3mq^_+J3S6mE2g zKQ5;2cz2p~#*k27Mb^KZywI!Sf=mNYGN1;<4F>^OwBzuSj*GqX_n*3GN6+>slQjZ| z1m`5W1VX||3WRm0GBc;W-@F&3FpL@*OZ%hE z3`r-_q21Z_T>1HHcVGs<7%O}xAH@U3!t)>oc0vo+&t z4vd^OW%54(rq>;z{nh!9$v$Z?_e$PmhB@{C%siA&%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