diff options
author | Martin Sivak <msivak@redhat.com> | 2008-04-08 18:00:09 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2008-04-08 18:00:09 +0200 |
commit | 9963162c7aff4dfdc50368bbf1e74363184ef1d9 (patch) | |
tree | 26e8e85247aafd1a99ad008ca1de139902cc6951 /plugins | |
parent | 6d99aacbba2f1237740a6aa5449f835db7725545 (diff) | |
download | firstaidkit-9963162c7aff4dfdc50368bbf1e74363184ef1d9.tar.gz firstaidkit-9963162c7aff4dfdc50368bbf1e74363184ef1d9.tar.xz firstaidkit-9963162c7aff4dfdc50368bbf1e74363184ef1d9.zip |
GRUB plugin: Get linux partitions too
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/plugin_grub.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/plugin_grub.py b/plugins/plugin_grub.py index e428cef..532604a 100644 --- a/plugins/plugin_grub.py +++ b/plugins/plugin_grub.py @@ -39,6 +39,7 @@ class Sample1Plugin(Plugin): self._partitions = [] #partitions in the system self._drives = [] #drives in the system self._bootable = [] #partitions with boot flag + self._linux = [] #Linux type partitions (0x83 Linux) self._grub_dir = [] #directories with stage1, menu.lst and other needed files self._grub = [] #devices with possible grub instalation self._grub_map = {} #mapping from linux device names to grub device names @@ -75,6 +76,13 @@ class Sample1Plugin(Plugin): if data[1]=="*": #boot flag self._reporting.info(origin = self, level = PLUGIN, message = "Bootable partition found: %s" % (data[0][5:],)) self._bootable.append(data[0][5:]) #strip the "/dev/" beginning + if data[6]=="Linux": + self._linux.append(data[0][5:]) + self._reporting.debug(origin = self, level = PLUGIN, message = "Linux partition found: %s" % (data[0][5:],)) + else: + if data[5]=="Linux": + self._linux.append(data[0][5:]) + self._reporting.debug(origin = self, level = PLUGIN, message = "Linux partition found: %s" % (data[0][5:],)) #Find grub directories @@ -106,8 +114,10 @@ class Sample1Plugin(Plugin): self._reporting.info(origin = self, level = PLUGIN, message = "Installed Grub probably found at %s" % (bootsectors[k],)) self._grub.append(bootsectors[k]) + #if there is the grub configuration dir and the grub appears installed into MBR or bootable partition, then we are probably OK if len(self._grub_dir)>0 and len(self._grub)>0 and len(set(self._grub).intersection(set(self._bootable+self._drives)))>0: self._result=ReturnSuccess + self._dependencies.provide("boot-grub") else: self._result=ReturnFailure |