From 185e49e8514ab4b80024fa21e9986bc6866725bc Mon Sep 17 00:00:00 2001 From: ponce Date: Tue, 9 Sep 2014 08:44:32 +0200 Subject: [PATCH] Add Slackware to OS choices --- virtinst/osdict.py | 1 + virtinst/urlfetcher.py | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/virtinst/osdict.py b/virtinst/osdict.py index 4277578..3bd3b58 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py @@ -48,6 +48,7 @@ _aliases = { "rhel5" : "rhel5.0", "rhel6" : "rhel6.0", "rhel7" : "rhel7.0", + "slackware" : "slackware14.1", "ubuntuhardy" : "ubuntu8.04", "ubuntuintrepid" : "ubuntu8.10", "ubuntujaunty" : "ubuntu9.04", diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py index 0c1b5cd..5dedde5 100644 --- a/virtinst/urlfetcher.py +++ b/virtinst/urlfetcher.py @@ -1022,6 +1022,43 @@ class ALTLinuxDistro(Distro): return False +class SlackwareDistro(Distro): + # slackware doesn't have installable URLs, so this is just for a + # mounted ISO + name = "Slackware" + urldistro = "slackware" + os_variant = "linux" + + _boot_iso_paths = [] + _xen_kernel_paths = [] + + def __init__(self, *args, **kwargs): + Distro.__init__(self, *args, **kwargs) + if re.match(r'i[4-9]86', self.arch): + self.arch = 'i486' + self.kname = 'hugesmp.s' + else: + self.arch = 'x86_64' + self.kname = 'huge.s' + + self._hvm_kernel_paths = [("kernels/%s/bzImage" % self.kname, + "isolinux/initrd.img")] + + def isValidStore(self): + # Don't support any paravirt installs + if self.type is not None and self.type != "hvm": + return False + + # Slackware website / media appear to have a Slackware-HOWTO + # file in top level which we can use as our 'magic' + # check for validity + if not self.fetcher.hasFile("Slackware-HOWTO"): + return False + + logging.debug("Regex didn't match, not a %s distro", self.name) + return False + + # Build list of all *Distro classes def _build_distro_list(): allstores = [] -- 2.1.0