refs #2414 improve some error messages, create a windows logical partition rather than an empty one
parent
73721d70f7
commit
8029d469a7
|
@ -156,6 +156,7 @@ def ogCreatePartitions (disk, parts):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Comprobar tamaño numérico y convertir en sectores
|
# Comprobar tamaño numérico y convertir en sectores
|
||||||
|
ORIG_SIZE = SIZE ## para reportar en un error
|
||||||
if 512 == IOSIZE: SIZE *= 2
|
if 512 == IOSIZE: SIZE *= 2
|
||||||
else: SIZE = (SIZE+3)//4 ## sumamos 3 para que la división entera "redondee al alza"
|
else: SIZE = (SIZE+3)//4 ## sumamos 3 para que la división entera "redondee al alza"
|
||||||
|
|
||||||
|
@ -195,7 +196,7 @@ def ogCreatePartitions (disk, parts):
|
||||||
pass ## sin problema, la partición 5 es simplemente una más
|
pass ## sin problema, la partición 5 es simplemente una más
|
||||||
else:
|
else:
|
||||||
if not EXTSTART:
|
if not EXTSTART:
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'PART==5 and not EXTSTART')
|
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, 'la partición 5 es lógica pero no hay ninguna EXTENDED definida antes')
|
||||||
return None
|
return None
|
||||||
START = EXTSTART
|
START = EXTSTART
|
||||||
SECTORS = EXTSTART+EXTSIZE
|
SECTORS = EXTSTART+EXTSIZE
|
||||||
|
@ -212,7 +213,7 @@ def ogCreatePartitions (disk, parts):
|
||||||
|
|
||||||
# Error si se supera el nº total de sectores.
|
# Error si se supera el nº total de sectores.
|
||||||
if START > SECTORS:
|
if START > SECTORS:
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'{START//2} > {SECTORS//2}')
|
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, f'partición "{TYPE}:{ORIG_SIZE}" no cabe')
|
||||||
return None
|
return None
|
||||||
PART += 1
|
PART += 1
|
||||||
|
|
||||||
|
@ -226,7 +227,8 @@ def ogCreatePartitions (disk, parts):
|
||||||
|
|
||||||
# Si se define partición extendida sin lógicas, crear particion 5 vacía.
|
# Si se define partición extendida sin lógicas, crear particion 5 vacía.
|
||||||
if 5 == PART and EXTSTART:
|
if 5 == PART and EXTSTART:
|
||||||
sfdisk_input += f'{DISK}5 : start={EXTSTART}, SIZE={EXTSIZE}, type=0\n'
|
ID = ogTypeToId ('WINDOWS', PTTYPE)
|
||||||
|
sfdisk_input += f'{DISK}5 : start={EXTSTART}, SIZE={EXTSIZE}, type={ID}\n'
|
||||||
|
|
||||||
# Desmontar los sistemas de archivos del disco antes de realizar las operaciones.
|
# Desmontar los sistemas de archivos del disco antes de realizar las operaciones.
|
||||||
FileSystemLib.ogUnmountAll (ND)
|
FileSystemLib.ogUnmountAll (ND)
|
||||||
|
|
Loading…
Reference in New Issue