mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-29 02:15:36 -04:00
Python Better Docstrings
This commit is contained in:
parent
b8b41bdfdd
commit
113d9db7cb
15 changed files with 295 additions and 11 deletions
|
@ -32,6 +32,11 @@ from libcalamares.utils import check_chroot_call
|
|||
|
||||
|
||||
def get_uuid():
|
||||
"""
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
|
||||
print("Root mount point: \"{!s}\"".format(root_mount_point))
|
||||
partitions = libcalamares.globalstorage.value("partitions")
|
||||
|
@ -44,6 +49,11 @@ def get_uuid():
|
|||
|
||||
|
||||
def get_bootloader_entry_name():
|
||||
"""
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
if "bootloaderEntryName" in libcalamares.job.configuration:
|
||||
return libcalamares.job.configuration["bootloaderEntryName"]
|
||||
else:
|
||||
|
@ -52,6 +62,11 @@ def get_bootloader_entry_name():
|
|||
|
||||
|
||||
def get_kernel_line(kernel_type):
|
||||
"""
|
||||
|
||||
:param kernel_type:
|
||||
:return:
|
||||
"""
|
||||
if kernel_type == "fallback":
|
||||
if "fallbackKernelLine" in libcalamares.job.configuration:
|
||||
return libcalamares.job.configuration["fallbackKernelLine"]
|
||||
|
@ -65,6 +80,12 @@ def get_kernel_line(kernel_type):
|
|||
|
||||
|
||||
def create_conf(uuid, conf_path, kernel_line):
|
||||
"""
|
||||
|
||||
:param uuid:
|
||||
:param conf_path:
|
||||
:param kernel_line:
|
||||
"""
|
||||
distribution = get_bootloader_entry_name()
|
||||
kernel = libcalamares.job.configuration["kernel"]
|
||||
img = libcalamares.job.configuration["img"]
|
||||
|
@ -91,6 +112,10 @@ def create_conf(uuid, conf_path, kernel_line):
|
|||
|
||||
|
||||
def create_loader(loader_path):
|
||||
"""
|
||||
|
||||
:param loader_path:
|
||||
"""
|
||||
distribution = get_bootloader_entry_name()
|
||||
timeout = libcalamares.job.configuration["timeout"]
|
||||
file_name_sanitizer = str.maketrans(" /", "_-")
|
||||
|
@ -107,6 +132,10 @@ def create_loader(loader_path):
|
|||
|
||||
|
||||
def install_gummiboot(efi_directory):
|
||||
"""
|
||||
|
||||
:param efi_directory:
|
||||
"""
|
||||
print("Bootloader: gummiboot")
|
||||
install_path = libcalamares.globalstorage.value("rootMountPoint")
|
||||
install_efi_directory = install_path + efi_directory
|
||||
|
@ -134,6 +163,11 @@ def install_gummiboot(efi_directory):
|
|||
|
||||
|
||||
def install_grub(efi_directory, fw_type):
|
||||
"""
|
||||
|
||||
:param efi_directory:
|
||||
:param fw_type:
|
||||
"""
|
||||
if fw_type == "efi":
|
||||
print("Bootloader: grub (efi)")
|
||||
efi_directory_firmware = efi_directory + "/EFI"
|
||||
|
@ -166,6 +200,11 @@ def install_grub(efi_directory, fw_type):
|
|||
|
||||
|
||||
def prepare_bootloader(fw_type):
|
||||
"""
|
||||
|
||||
:param fw_type:
|
||||
:return:
|
||||
"""
|
||||
efi_boot_loader = libcalamares.job.configuration["efiBootLoader"]
|
||||
efi_directory = libcalamares.globalstorage.value("efiSystemPartition")
|
||||
if fw_type == "efi":
|
||||
|
@ -194,6 +233,11 @@ def prepare_bootloader(fw_type):
|
|||
|
||||
|
||||
def run():
|
||||
"""
|
||||
|
||||
|
||||
:return:
|
||||
"""
|
||||
fw_type = libcalamares.globalstorage.value("firmwareType")
|
||||
prepare_bootloader(fw_type)
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue