Fixed pep8 whining in module initramfscfg

added myself to copyright
This commit is contained in:
Alf Gaida 2017-06-02 23:34:14 +02:00
parent 65b5d67a08
commit 9e9e1e6550

View File

@ -7,6 +7,7 @@
# Copyright 2015, Philip Müller <philm@manjaro.org> # Copyright 2015, Philip Müller <philm@manjaro.org>
# Copyright 2016, David McKinney <mckinney@subgraph.com> # Copyright 2016, David McKinney <mckinney@subgraph.com>
# Copyright 2016, Kevin Kofler <kevin.kofler@chello.at> # Copyright 2016, Kevin Kofler <kevin.kofler@chello.at>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -25,8 +26,10 @@ import libcalamares
import os import os
import shutil import shutil
def copy_initramfs_hooks(partitions, root_mount_point): def copy_initramfs_hooks(partitions, root_mount_point):
""" Copies initramfs hooks so they are picked up by update-initramfs """
Copies initramfs hooks so they are picked up by update-initramfs
:param partitions: :param partitions:
:param root_mount_point: :param root_mount_point:
@ -38,18 +41,31 @@ def copy_initramfs_hooks(partitions, root_mount_point):
if partition["mountPoint"] == "/" and "luksMapperName" in partition: if partition["mountPoint"] == "/" and "luksMapperName" in partition:
encrypt_hook = True encrypt_hook = True
if partition["mountPoint"] == "/boot" and "luksMapperName" not in partition: if (partition["mountPoint"] == "/boot"
and "luksMapperName" not in partition):
unencrypted_separate_boot = True unencrypted_separate_boot = True
if encrypt_hook: if encrypt_hook:
if unencrypted_separate_boot: if unencrypted_separate_boot:
shutil.copy2("/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey", "{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(root_mount_point)) shutil.copy2(
"/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey",
"{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(
root_mount_point)
)
else: else:
shutil.copy2("/usr/lib/calamares/modules/initramfscfg/encrypt_hook", "{!s}/usr/share/initramfs-tools/hooks/".format(root_mount_point)) shutil.copy2(
os.chmod("{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(root_mount_point), 0o755) "/usr/lib/calamares/modules/initramfscfg/encrypt_hook",
"{!s}/usr/share/initramfs-tools/hooks/".format(
root_mount_point)
)
os.chmod("{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(
root_mount_point), 0o755
)
def run(): def run():
""" Calls routine with given parameters to configure initramfs """
Calls routine with given parameters to configure initramfs
:return: :return:
""" """