diff --git a/src/modules/fstab/main.py b/src/modules/fstab/main.py index 1aea5523e..abbd3d524 100644 --- a/src/modules/fstab/main.py +++ b/src/modules/fstab/main.py @@ -306,6 +306,16 @@ def run(): conf = libcalamares.job.configuration partitions = global_storage.value("partitions") root_mount_point = global_storage.value("rootMountPoint") + + if not partitions: + libcalamares.utils.warning("partitions is empty, {!s}".format(partitions)) + return (_("Configuration Error"), + _("No partitions are defined for
{!s}
to use." ).format("fstab")) + if not root_mount_point: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("fstab")) + mount_options = conf["mountOptions"] ssd_extra_mount_options = conf.get("ssdExtraMountOptions", {}) crypttab_options = conf.get("crypttabOptions", "luks") diff --git a/src/modules/initcpio/main.py b/src/modules/initcpio/main.py index 20d841de5..796f68721 100644 --- a/src/modules/initcpio/main.py +++ b/src/modules/initcpio/main.py @@ -32,18 +32,19 @@ _ = gettext.translation("calamares-python", def pretty_name(): return _("Creating initramfs with mkinitcpio.") - -def run_mkinitcpio(): - """ Runs mkinitcpio with given kernel profile """ - kernel = libcalamares.job.configuration['kernel'] - check_target_env_call(['mkinitcpio', '-p', kernel]) - - def run(): """ Calls routine to create kernel initramfs image. :return: """ - run_mkinitcpio() + from subprocess import CalledProcessError + + kernel = libcalamares.job.configuration['kernel'] + try: + check_target_env_call(['mkinitcpio', '-p', kernel]) + except CalledProcessError as e: + libcalamares.utils.warning(str(e)) + return ( _( "Process Failed" ), + _( "Process
mkinitcpio
failed with error code {!s}. The command was
{!s}
." ).format( e.returncode, e.cmd ) ) return None diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index 2207816d9..166cccf44 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -181,6 +181,16 @@ def run(): """ partitions = libcalamares.globalstorage.value("partitions") root_mount_point = libcalamares.globalstorage.value("rootMountPoint") + + if not partitions: + libcalamares.utils.warning("partitions is empty, {!s}".format(partitions)) + return (_("Configuration Error"), + _("No partitions are defined for
{!s}
to use." ).format("initcpiocfg")) + if not root_mount_point: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("initcpiocfg")) + modify_mkinitcpio_conf(partitions, root_mount_point) return None diff --git a/src/modules/initramfscfg/main.py b/src/modules/initramfscfg/main.py index b62e4e5f7..52d512567 100644 --- a/src/modules/initramfscfg/main.py +++ b/src/modules/initramfscfg/main.py @@ -88,6 +88,16 @@ def run(): """ partitions = libcalamares.globalstorage.value("partitions") root_mount_point = libcalamares.globalstorage.value("rootMountPoint") + + if not partitions: + libcalamares.utils.warning("partitions is empty, {!s}".format(partitions)) + return (_("Configuration Error"), + _("No partitions are defined for
{!s}
to use." ).format("initramfscfg")) + if not root_mount_point: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("initramfscfg")) + copy_initramfs_hooks(partitions, root_mount_point) return None diff --git a/src/modules/localecfg/main.py b/src/modules/localecfg/main.py index 09e700409..9e50fb448 100644 --- a/src/modules/localecfg/main.py +++ b/src/modules/localecfg/main.py @@ -138,6 +138,12 @@ def run(): } install_path = libcalamares.globalstorage.value("rootMountPoint") + + if install_path is None: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(install_path)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("localecfg")) + target_locale_gen = "{!s}/etc/locale.gen".format(install_path) target_locale_gen_bak = target_locale_gen + ".bak" target_locale_conf_path = "{!s}/etc/locale.conf".format(install_path) diff --git a/src/modules/luksbootkeyfile/main.py b/src/modules/luksbootkeyfile/main.py index 0c025ca31..fb0146cf8 100644 --- a/src/modules/luksbootkeyfile/main.py +++ b/src/modules/luksbootkeyfile/main.py @@ -46,6 +46,11 @@ def run(): partitions = libcalamares.globalstorage.value("partitions") + if not partitions: + libcalamares.utils.warning("partitions is empty, {!s}".format(partitions)) + return (_("Configuration Error"), + _("No partitions are defined for
{!s}
to use." ).format("luksbootkey")) + luks_root_device = "" luks_root_passphrase = "" diff --git a/src/modules/luksopenswaphookcfg/main.py b/src/modules/luksopenswaphookcfg/main.py index e32fbbbfd..a30ae999b 100644 --- a/src/modules/luksopenswaphookcfg/main.py +++ b/src/modules/luksopenswaphookcfg/main.py @@ -90,6 +90,15 @@ def run(): openswap_conf_path = libcalamares.job.configuration["configFilePath"] partitions = libcalamares.globalstorage.value("partitions") + if not partitions: + libcalamares.utils.warning("partitions is empty, {!s}".format(partitions)) + return (_("Configuration Error"), + _("No partitions are defined for
{!s}
to use." ).format("luksopenswaphookcfg")) + if not root_mount_point: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("luksopenswaphookcfg")) + openswap_conf_path = openswap_conf_path.lstrip('/') return write_openswap_conf(partitions, root_mount_point, openswap_conf_path) diff --git a/src/modules/machineid/main.py b/src/modules/machineid/main.py index 092fc7196..cde47cfd9 100644 --- a/src/modules/machineid/main.py +++ b/src/modules/machineid/main.py @@ -43,6 +43,12 @@ def run(): :return: """ root_mount_point = libcalamares.globalstorage.value("rootMountPoint") + + if root_mount_point is None: + libcalamares.utils.warning("rootMountPoint is empty, {!s}".format(root_mount_point)) + return (_("Configuration Error"), + _("No root mount point is given for
{!s}
to use." ).format("machineid")) + enable_systemd = libcalamares.job.configuration["systemd"] enable_dbus = libcalamares.job.configuration["dbus"] enable_symlink = libcalamares.job.configuration["symlink"]