diff options
author | Joel Andres Granados <jgranado@redhat.com> | 2008-10-17 14:06:28 +0200 |
---|---|---|
committer | Joel Andres Granados <jgranado@redhat.com> | 2008-10-17 14:06:28 +0200 |
commit | dbcee1c4cd88aaacbe5df03072980498b6f7b858 (patch) | |
tree | 68509131fa09eba073e3c54548d71a79d4c2de6f /plugins/grub/grubUtils.py | |
parent | e9d5eeabf4357dc564f816a39c0b704562214908 (diff) | |
download | firstaidkit-dbcee1c4cd88aaacbe5df03072980498b6f7b858.tar.gz firstaidkit-dbcee1c4cd88aaacbe5df03072980498b6f7b858.tar.xz firstaidkit-dbcee1c4cd88aaacbe5df03072980498b6f7b858.zip |
Add the "search for other bootloaders" euristic.
When looking for the place to install GRUB we need to search for
the drives/partitions that dont have other bootloaders in the
first 512 bytes. This will be done by means of functions that
specifically look for boot loaders. ATM there is only one
function that will allow an installation allways. In the futre
we hope to have user defined funcitons for specific bootloaders.
Diffstat (limited to 'plugins/grub/grubUtils.py')
-rw-r--r-- | plugins/grub/grubUtils.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/grub/grubUtils.py b/plugins/grub/grubUtils.py index 6a5578f..54a5083 100644 --- a/plugins/grub/grubUtils.py +++ b/plugins/grub/grubUtils.py @@ -233,6 +233,31 @@ def part_unmount(part, opts=None): else: return True + +# +# There will be the possitility of installing the grub in all partitions +# that dont have a boot loader (This will hopefully be default behavior). +# For this purpose we must test to see if there are boot loaders in the +# device. +# +# The idea here is to have people scream about firstaidkit messing their +# other bootloaders up and creating new tests as needed. +# +# FIXME:If this function gets too big, might want to make another file. +def other_bootloader_present(dev): + # Will allways say that no bootloader is present. + def none_grub(dev): + return False + + # We will have the list of all the tests in the tests variable. + tests = {none_grub} + + for test in tests: + if test(dev): + return True + + return False + # The Strings contained in the grub stage one: stage1strings = ["GRUB", "Geom", "Hard", "Disk", "Read", "Error"] |