Browse Source

an EFI partition may be on any disk

master
hama 5 years ago
parent
commit
de64fa6aff
4 changed files with 20 additions and 16 deletions
  1. 1
    0
      .gitignore
  2. 6
    0
      debian/changelog
  3. 9
    10
      isource/diskinfopage.py
  4. 4
    6
      isource/mountpointpage.py

+ 1
- 0
.gitignore View File

@@ -48,4 +48,5 @@ backend/D
.coverage
backend/sdc_partinfo.pl
util/
fll-installer


+ 6
- 0
debian/changelog View File

@@ -1,3 +1,9 @@
sidu-installer (2016.01.9.3) unstable; urgency=medium

* an EFI partition may be on any disk

-- J. Hamatoma <hama@siduction.net> Sat, 09 Jan 2016 12:41:17 +0100

sidu-installer (2016.01.9.2) unstable; urgency=medium

* Careless mistakes: pyhton errors in diskinfopage

+ 9
- 10
isource/diskinfopage.py View File

@@ -144,20 +144,19 @@ class DiskInfoPage(Page):
if now - ftime > 30:
self.buildInfoFile()

def efiPartOfRoot(self, bootDev):
'''Returns the EFI boot partition of the disk or None
def efiPartition(self):
'''Returns the first EFI boot partition of all detected disks
@param bootDev the partition for the root filesystem, e.g. sda1
@return True: System is able too boot with EFI
@return None: No EFI partition found or not booted using EFI<br>
otherwise: the first EFI partition
'''
rc = None
if self._isEfi and self.hasGPT(bootDev):
prefix = self.getDiskOfPartition(bootDev)
if self._isEfi:
for dev in self._partitions:
if dev.startswith(prefix):
part = self._partitions[dev]
if part._partType == "EF00":
rc = dev
break
part = self._partitions[dev]
if part._partType == "EF00":
rc = dev
break
return rc
def reload(self):

+ 4
- 6
isource/mountpointpage.py View File

@@ -12,7 +12,6 @@ class MountpointPage(Page):
Handles the page allowing changing the partitions.
'''


def __init__(self, session):
'''
Constructor.
@@ -123,13 +122,12 @@ class MountpointPage(Page):
self._session.getConfig("mountpoint.txt_button_text"))
return body
def efiPartOfRoot(self):
def efiPartition(self):
'''Returns the EFI partition of the root partition.
@return None: not available or not a EFI system<br>
the EFI partition, e.g. "sda1"
'''
rootDev = self._globalPage.getField("root")
rc = self._diskInfo.efiPartOfRoot(rootDev)
rc = self._diskInfo.efiPartition()
return rc
def changeContent(self, body):
@@ -139,7 +137,7 @@ class MountpointPage(Page):
'''
body = self.handleSelectors(body)
body = self.fillStaticSelected("mountonboot", body)
if self.efiPartOfRoot() != None:
if self.efiPartition() != None:
value = self._session.getConfig("mountpoint.opts_mountonboot")
texts = value[1:].split(value[:1])
values = ["yes", "no"]
@@ -220,7 +218,7 @@ class MountpointPage(Page):
self.storeAsGlobal("mountonboot", "mountonboot")
value = ""
if self.getField("efi_boot") == "yes":
value = self.efiPartOfRoot()
value = self.efiPartition()
self._session.log("efi_boot: " + value)
self._globalPage.putField("efi_boot", value)
pageResult = self._session.redirect(

Loading…
Cancel
Save