mirror of https://git.48k.eu/ogclient
live: partprobe breaks with mounted partitions
partprobe requires that all disk partitions are unmounted. partprobe needs to be called to report the OS that the partition table has changed, otherwise ogclient reports incorrect partition information. iterate over the partition list and mount cache after partprobe is called.master
parent
170d7e1be9
commit
f42e2ba201
|
@ -346,7 +346,6 @@ class OgLiveOperations:
|
|||
cxt.add_partition(pa)
|
||||
|
||||
cxt.write_disklabel()
|
||||
subprocess.run(['partprobe', f'/dev/{diskname}'])
|
||||
|
||||
for part in partlist:
|
||||
if part["filesystem"] == 'EMPTY':
|
||||
|
@ -358,10 +357,20 @@ class OgLiveOperations:
|
|||
partition = int(part["partition"])
|
||||
if fs == 'cache':
|
||||
mkfs('ext4', int(disk), partition, label='CACHE')
|
||||
init_cache()
|
||||
else:
|
||||
mkfs(fs, int(disk), partition)
|
||||
|
||||
ret = subprocess.run(['partprobe', f'/dev/{diskname}'])
|
||||
logging.info(f'partprobe /dev/{diskname} reports {ret.returncode}')
|
||||
|
||||
for part in partlist:
|
||||
if part["filesystem"] == 'EMPTY':
|
||||
continue
|
||||
|
||||
fs = part["filesystem"].lower()
|
||||
if fs == 'cache':
|
||||
init_cache()
|
||||
|
||||
logging.info('Partition setup command OK')
|
||||
result = self.refresh(ogRest)
|
||||
|
||||
|
|
Loading…
Reference in New Issue