From 40c3b3dd04dbc15b67ed20f10ed46d1738438da6 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 10 Aug 2017 16:04:02 -0400 Subject: [PATCH] Modules: initramfscfg copy files from own install-dir FIXES #770 --- src/modules/initramfscfg/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/initramfscfg/main.py b/src/modules/initramfscfg/main.py index 3f77ccd6d..d935328d6 100644 --- a/src/modules/initramfscfg/main.py +++ b/src/modules/initramfscfg/main.py @@ -8,6 +8,7 @@ # Copyright 2016, David McKinney # Copyright 2016, Kevin Kofler # Copyright 2017, Alf Gaida +# Copyright 2017, Adriaan de Groot # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -48,14 +49,19 @@ def copy_initramfs_hooks(partitions, root_mount_point): if encrypt_hook: target = "{!s}/usr/share/initramfs-tools/hooks/encrypt_hook".format( root_mount_point) + + # Find where this module is installed + _filename = inspect.getframeinfo(inspect.currentframe()).filename + _path = os.path.dirname(os.path.abspath(_filename)) + if unencrypted_separate_boot: shutil.copy2( - "/usr/lib/calamares/modules/initramfscfg/encrypt_hook_nokey", + os.path.join(_path, "encrypt_hook_nokey"), target ) else: shutil.copy2( - "/usr/lib/calamares/modules/initramfscfg/encrypt_hook", + os.path.join(_path, "encrypt_hook"), target ) os.chmod(target, 0o755)