refs #1594 more comments and whitespace shuffling
parent
000ea29e70
commit
2a0737f2c5
|
@ -68,6 +68,7 @@ def ogCreatePartitions (disk, parts):
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, PTTYPE)
|
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_PARTITION, PTTYPE)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
# Se calcula el ultimo sector del disco (total de sectores usables)
|
||||||
SECTORS = ogGetLastSector (disk)
|
SECTORS = ogGetLastSector (disk)
|
||||||
|
|
||||||
# Se recalcula el nº de sectores del disco si existe partición de caché.
|
# Se recalcula el nº de sectores del disco si existe partición de caché.
|
||||||
|
@ -77,7 +78,6 @@ def ogCreatePartitions (disk, parts):
|
||||||
cache_disk, cache_part = CACHEPART.split()
|
cache_disk, cache_part = CACHEPART.split()
|
||||||
if ND == cache_disk:
|
if ND == cache_disk:
|
||||||
CACHESIZE = int (CacheLib.ogGetCacheSize()) * 2
|
CACHESIZE = int (CacheLib.ogGetCacheSize()) * 2
|
||||||
|
|
||||||
# Sector de inicio (la partición 1 empieza en el sector 63).
|
# Sector de inicio (la partición 1 empieza en el sector 63).
|
||||||
IODISCO = ogDiskToDev (disk)
|
IODISCO = ogDiskToDev (disk)
|
||||||
IOSIZE = 0
|
IOSIZE = 0
|
||||||
|
@ -101,12 +101,8 @@ def ogCreatePartitions (disk, parts):
|
||||||
|
|
||||||
PART = 1
|
PART = 1
|
||||||
|
|
||||||
# Fichero temporal de entrada para "sfdisk"
|
|
||||||
sfdisk_input = 'unit: sectors\n\n'
|
sfdisk_input = 'unit: sectors\n\n'
|
||||||
|
|
||||||
NVME_PREFIX = 'p' if 'nvme' in DISK else ''
|
NVME_PREFIX = 'p' if 'nvme' in DISK else ''
|
||||||
|
|
||||||
# Generar fichero de entrada para "sfdisk" con las particiones.
|
|
||||||
for p in parts:
|
for p in parts:
|
||||||
# Conservar los datos de la partición de caché.
|
# Conservar los datos de la partición de caché.
|
||||||
if f'{ND} {PART}' == CACHEPART and CACHESIZE:
|
if f'{ND} {PART}' == CACHEPART and CACHESIZE:
|
||||||
|
@ -134,7 +130,7 @@ def ogCreatePartitions (disk, parts):
|
||||||
if PART > 4:
|
if PART > 4:
|
||||||
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, '')
|
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_FORMAT, '')
|
||||||
return None
|
return None
|
||||||
# El inicio de la primera partición logica es el de la extendida más 4x512
|
# El inicio de la primera partición logica es el de la extendida más 4x512
|
||||||
EXTSTART = START+2048
|
EXTSTART = START+2048
|
||||||
EXTSIZE = SIZE-2048
|
EXTSIZE = SIZE-2048
|
||||||
# Incluir particiones lógicas dentro de la partición extendida.
|
# Incluir particiones lógicas dentro de la partición extendida.
|
||||||
|
|
Loading…
Reference in New Issue