Browse Source

U)efi support

* partinfo.pl: partition type in ptype, "booted from EFI" test
* combobox "UEFI boot"
* global field "efi_boot"
* configuration item "EFI_BOOT"
master
hama 5 years ago
parent
commit
f5f2923ee6

+ 3
- 0
backend/partinfo.pl View File

@@ -108,6 +108,8 @@ sub Main{
foreach $dev (@sorted){
&Out("$dev\t$s_blkids{$dev}");
}
# isefi.mrk is for emulation (debugging)
&Out("!IsEfi=" . (-e "/sys/firmware/efi/efivars" || -e "/etc/sidu-base/isefi.mrk" ? "t" : "f"));
&Out("!phDisk=" . JoinPhysicalDiskInfo());
&Out("!labels=;" . join(";", @s_labels));
my $val = "!VG=";
@@ -783,6 +785,7 @@ sub MergeDevs{
} else {
my $size = "\t$1" if $val =~ /(size:\d+)/;
my $ptype = "\t$1" if $val =~ /(id:\w+)/;
my $ptype = "\t$1" if $val =~ /(ptype:\w+)/;
my $info2 = "\t$1" if $val =~ /(pinfo:[^\t]+)/;
$s_blkids{$dev} = "$info$size$ptype$info2";
}

+ 2
- 0
config/sidu-installer_de.conf View File

@@ -131,6 +131,8 @@ mountpoint.txt_button_text=Freitext
mountpoint.txt_desc_mount_on_boot=
mountpoint.txt_device=Gerät
mountpoint.txt_disk=Festplatte
mountpoint.txt_efi_boot=(U)EFI boot
mountpoint.txt_efi_impossible=Nicht möglich
mountpoint.txt_fs=D.sys
mountpoint.txt_info=Zusatzinformation
mountpoint.txt_intro=<xml><b>Zusätzliche Partitionen</b> werden durch <b>Einbinden</b> ("mounten") verfügbar gemacht. Dabei wird ein <b>Einhängepunkt</b> ("Mountpoint") zu dieser Partition festgelegt. Dieser liegt normalerweise im Wurzeldateisystem ("root filesystem").

+ 2
- 0
config/sidu-installer_en.conf View File

@@ -131,6 +131,8 @@ mountpoint.txt_button_del=Remove
mountpoint.txt_desc_mount_on_boot=
mountpoint.txt_device=Device
mountpoint.txt_disk=Harddisk
mountpoint.txt_efi_boot=(U)EFI boot
mountpoint.txt_efi_impossible=Impossible
mountpoint.txt_filesys=File System
mountpoint.txt_fs=FSys
mountpoint.txt_info=Additional Info

BIN
data/config.db View File


+ 10
- 0
debian/changelog View File

@@ -1,3 +1,13 @@
sidu-installer (2016.01.08) unstable; urgency=medium

(U)efi support
* partinfo.pl: partition type in ptype, "booted from EFI" test
* combobox "UEFI boot"
* global field "efi_boot"
* configuration item "EFI_BOOT"

-- J. Hamatoma <hama@siduction.net> Sat, 09 Jan 2016 02:29:10 +0100

sidu-installer (2016.01.06.2) unstable; urgency=medium

* missed: GlobalPage.free_sw_only

+ 20
- 1
isource/diskinfopage.py View File

@@ -122,6 +122,7 @@ class DiskInfoPage(Page):
self._freePV = []
self._volumeGroupList = []
self._volumeGroups = {}
self._isEfi = False
# flavour, arch, version
self._osInfo = ("nox", "32", "13.2");
self._filePartInfo = session.getConfigWithoutLanguage(
@@ -143,6 +144,22 @@ class DiskInfoPage(Page):
if now - ftime > 30:
self.buildInfoFile()

def efiPartOfRoot(self, bootDev):
'''Returns the EFI boot partition of the disk or None
@param bootDev the partition for the root filesystem, e.g. sda1
@return True: System is able too boot with EFI
'''
rc = None
if self._isEfi and self.hasGPT(bootDev):
prefix = self.getDiskOfPartition(bootDev)
for dev in self._partitions:
if dev.startswith(prefix):
part = self._partitions[dev]
if part._partType == "EF00":
rc = dev
break
return rc
def reload(self):
'''The partition info will be requested again.
'''
@@ -231,6 +248,8 @@ class DiskInfoPage(Page):
pass
elif line.startswith("!GPT="):
self._gptDisks = line[5:]
elif line.startswith("!IsEfi="):
self._isEfi = line[7:] == 't'
elif line.startswith("!labels="):
self._labels = self.autoSplit(line[8:])
elif line.startswith("!VG="):
@@ -400,7 +419,7 @@ class DiskInfoPage(Page):
False: otherwise
'''
disk = self._disks[self.getDiskOfPartition(partition)]
rc = disk._attr.find("gpt") >= 0
rc = disk._attr.find("gpt") >= 0 or disk._class.find("gpt") >= 0
return rc

def buildPartOfTable(self, info, what, ixRow = None):

+ 1
- 0
isource/globalpage.py View File

@@ -50,4 +50,5 @@ class GlobalPage(GlobalBasePage):
self.addField(".pages")
# F or T
self.addField("free_sw_only", "F", None, "b")
self.addField("efi_boot")

+ 26
- 2
isource/mountpointpage.py View File

@@ -43,6 +43,7 @@ class MountpointPage(Page):
self.addField("add_mount")
self.addField("add_mount2")
self.addField("mountonboot")
self.addField("efi_boot")
self.addField("mounts")
self.addField("partinfo")
# fields used by diskinfopage:
@@ -122,6 +123,15 @@ class MountpointPage(Page):
self._session.getConfig("mountpoint.txt_button_text"))
return body
def efiPartOfRoot(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)
return rc
def changeContent(self, body):
'''Changes the template in a customized way.
@param body: the HTML code of the page
@@ -129,6 +139,17 @@ class MountpointPage(Page):
'''
body = self.handleSelectors(body)
body = self.fillStaticSelected("mountonboot", body)
if self.efiPartOfRoot() != None:
value = self._session.getConfig("mountpoint.opts_mountonboot")
texts = value[1:].split(value[:1])
values = ["yes", "no"]
disabled = ""
else:
texts = [self._session.getConfig("mountpoint.txt_efi_impossible")]
values = None
disabled = "disabled"
body = self.fillDynamicSelected('efi_boot', texts, values, body)
body = body.replace("{{efi_boot_disabled}}", disabled)
devs = self._diskInfo.getMountPartitions(self._mountRows)[0]
body = self.fillDynamicSelected("add_dev", devs, None, body)
self._mounts = ""
@@ -162,8 +183,6 @@ class MountpointPage(Page):
points += ";" + dev + ":" + point
self._globalPage.putField("mountpoint.list", points)
self.initMounts()
def handleButton(self, button):
'''Do the actions after a button has been pushed.
@@ -199,6 +218,11 @@ class MountpointPage(Page):
"mountpoint.handleButton")
elif button == "button_next":
self.storeAsGlobal("mountonboot", "mountonboot")
value = ""
if self.getField("efi_boot") == "yes":
value = self.efiPartOfRoot()
self._session.log("efi_boot: " + value)
self._globalPage.putField("efi_boot", value)
pageResult = self._session.redirect(
self.neighbourOf(self._name, False),
"mountpoint.handleButton")

+ 4
- 0
isource/runpage.py View File

@@ -236,6 +236,10 @@ class RunPage(Page):
lines.append("# Possible are: grub")
lines.append("# Default value is: grub")
lines.append("BOOT_LOADER='{:s}'".format(value))
lines.append("# Use (U)EFI for boot process")
lines.append("# Possible: '' or <efi_device>, e.g. 'sdb1'")
value = self._globalPage.getField("efi_boot")
lines.append("EFI_BOOT='{:s}'".format(value))
lines.append("")

lines.append("# If set to 'yes' a boot disk will be created! (AFAIK this doesnt work anymore)")

+ 5
- 2
templates/mountpoint.snippets View File

@@ -47,8 +47,11 @@ MAIN:
{{body_mountonboot}}
</select>
</td>
<td>{{mountpoint.txt_desc_mount_on_boot}}</td>
<td>&nbsp;</td>
<td>{{mountpoint.txt_efi_boot}}</td>
<td><select name="efi_boot" size="1" {{efi_boot_disabled}}>
{{body_efi_boot}}
</select>
</td>
<td>&nbsp;</td>
</tr>
</table>

Loading…
Cancel
Save