[virt-tools-list] [PATCH] Add Slackware to OS choices
Cole Robinson
crobinso at redhat.com
Thu Sep 11 20:22:28 UTC 2014
On 09/11/2014 12:37 PM, ponce wrote:
> From: Matteo Bernardini <ponce at slackbuilds.org>
>
> Signed-off-by: Matteo Bernardini <ponce at slackbuilds.org>
> Reviewed-by: Robby Workman <rworkman at slackware.com>
Thanks for your patch!
> ---
> virtinst/osdict.py | 6 ++++--
> virtinst/urlfetcher.py | 37 +++++++++++++++++++++++++++++++++++++
> 2 files changed, 41 insertions(+), 2 deletions(-)
>
> diff --git a/virtinst/osdict.py b/virtinst/osdict.py
> index 4277578..e70445f 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",
This dictionary is only for legacy back compatibility, we shouldn't be adding
to it in this case.
> @@ -444,8 +445,9 @@ class _OsVariantOsInfo(_OSVariant):
> # We should fix this in a new libosinfo version, and then drop
> # this hack
> if name in ["rhel7.0", "rhel7.1", "fedora19", "fedora20", "fedora21",
> - "debian6", "debian7", "ubuntu13.04", "ubuntu13.10", "ubuntu14.04",
> - "ubuntu14.10", "win8", "win8.1", "win2k12", "win2k12r2"]:
> + "debian6", "debian7", "slackware14.1", "ubuntu13.04", "ubuntu13.10",
> + "ubuntu14.04", "ubuntu14.10", "win8", "win8.1", "win2k12",
> + "win2k12r2"]:
> return True
> return False
>
This is also a temporary stop gap until end-of-life info is added to all the
libosinfo entries, so we can depend on it.
Since you are adding slackware bits to libosinfo in another patch, just add an
end-of-life date there and virt-manager will do the right thing.
> 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
> +
> +
Great! Can you give me an example public URL so I can test? Also, please
extend the patch to document an example URL in man/virt-install.pod with the
other examples.
Thanks,
Cole
More information about the virt-tools-list
mailing list