From e3bb01f5f1727d3384c2826336ed06c5c82246d4 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Thu, 22 Feb 2024 11:03:13 +0100 Subject: live: improve logging with setup command Improve logging when setting up partition, provide more hints on progress. Fail in case partition layout is not supported. --- src/live/ogOperations.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index c97975a..b72f7df 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -332,9 +332,14 @@ class OgLiveOperations: cxt.create_disklabel('dos') elif table_type == 'GPT': cxt.create_disklabel('gpt') + else: + logging.info(f'Unsupported partition layout: {table_type}, only MSDOS and GPT are supported') + raise ValueError(f'Unsupported partition scheme {table_type}, only MSDOS and GPT are supported') + + logging.info(f'Setting up partition layout to {table_type}') for part in partlist: - logging.debug(f'Adding partition: {part}') + logging.info(f'Creating partition {part["partition"]} with {part["code"]} of {int(part["size"])//1024} Mbytes') if part["code"] == 'EMPTY': continue if ogRest.terminated: @@ -358,8 +363,11 @@ class OgLiveOperations: for part in partlist: if part["filesystem"] == 'EMPTY': continue - partition = int(part["partition"]) + fs = part["filesystem"].lower() + logging.info(f'Formatting partition {part["partition"]} with filesystem {part["filesystem"]}') + + partition = int(part["partition"]) if fs == 'cache': mkfs('ext4', int(disk), partition, label='CACHE') init_cache() -- cgit v1.2.3-18-g5258