From e3a86c6dfceb8ad6d9b94110118cd762b6e62043 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 23 Aug 2017 10:45:04 -0400 Subject: [PATCH] initcpiocfg: accept (but warn) for missing config file in the host --- src/modules/initcpiocfg/main.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index eb29d7def..ca9455d20 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -65,8 +65,12 @@ def write_mkinitcpio_lines(hooks, modules, files, root_mount_point): :param files: :param root_mount_point: """ - with open("/etc/mkinitcpio.conf", "r") as mkinitcpio_file: - mklins = [x.strip() for x in mkinitcpio_file.readlines()] + try: + with open("/etc/mkinitcpio.conf", "r") as mkinitcpio_file: + mklins = [x.strip() for x in mkinitcpio_file.readlines()] + except FileNotFoundError: + libcalamares.utils.debug("Could not open host file /etc/mkinitcpio.conf") + mklins = [] for i in range(len(mklins)): if mklins[i].startswith("HOOKS"):