Skip to content
Snippets Groups Projects
Commit e0f40f44 authored by Thomas Bellman's avatar Thomas Bellman
Browse files

Add internal class for guessing what bootloader is used.

This is intended as an internal helper for other definitions or
classes.
parent 3d4c184e
No related branches found
No related tags found
No related merge requests found
# Copyright © 2017 Thomas Bellman, Linköping, Sweden
# Licensed under the GNU LGPL v3+; see the README file for more information.
/*
* Try to guess what bootloader is in use, based on the OS.
* Sets the $bootloader variable to the guess.
* The heuristics used are not very good...
* This is intended as an internal helper class, not for end users.
*/
class bootloader::guess
{
if ($::operatingsystem == 'Fedora' and
versioncmp($::operatingsystemrelease, '18') >= 0)
{
$bootloader = 'grub2'
}
elsif ($::operatingsystem == 'Fedora' and
versioncmp($::operatingsystemrelease, '15') < 0)
{
$bootloader = 'grub0'
}
elsif ($::osfamily == 'RedHat' and
versioncmp($::operatingsystemrelease, '7') >= 0)
{
$bootloader = 'grub2'
}
elsif ($::osfamily == 'RedHat' and
versioncmp($::operatingsystemrelease, '7') < 0)
{
$bootloader = 'grub0'
}
else
{
fail("Cannot guess what bootloader is in use.")
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment