mirror of https://git.48k.eu/ogclient
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.master
parent
26ca4c7950
commit
e3bb01f5f1
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue