Python-style: refactor calculating target path of hook-script
This commit is contained in:
parent
a752df2db0
commit
29d91a4fbf
@ -46,21 +46,19 @@ def copy_initramfs_hooks(partitions, root_mount_point):
|
|||||||
unencrypted_separate_boot = True
|
unencrypted_separate_boot = True
|
||||||
|
|
||||||
if encrypt_hook:
|
if encrypt_hook:
|
||||||
|
target = "{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(
|
||||||
|
root_mount_point)
|
||||||
if unencrypted_separate_boot:
|
if unencrypted_separate_boot:
|
||||||
shutil.copy2(
|
shutil.copy2(
|
||||||
"/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey",
|
"/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey",
|
||||||
"{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(
|
target
|
||||||
root_mount_point)
|
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
shutil.copy2(
|
shutil.copy2(
|
||||||
"/usr/lib/calamares/modules/initramfscfg/encrypt_hook",
|
"/usr/lib/calamares/modules/initramfscfg/encrypt_hook",
|
||||||
"{!s}/usr/share/initramfs-tools/hooks/".format(
|
target
|
||||||
root_mount_point)
|
|
||||||
)
|
|
||||||
os.chmod("{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format(
|
|
||||||
root_mount_point), 0o755
|
|
||||||
)
|
)
|
||||||
|
os.chmod(target, 0o755)
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
Loading…
Reference in New Issue
Block a user