refs #1744 automatically figure PTT out
parent
21770526e5
commit
9108f4f1fe
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,5 +1,16 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- getConfiguration.py now collects the firmware type
|
||||||
|
|
||||||
## [0.1.1] - 2025-03-19
|
## [0.1.1] - 2025-03-19
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -9,6 +9,7 @@ import SystemLib
|
||||||
import CacheLib
|
import CacheLib
|
||||||
import FileSystemLib
|
import FileSystemLib
|
||||||
import DiskLib
|
import DiskLib
|
||||||
|
import InventoryLib
|
||||||
|
|
||||||
#Load engine configurator from engine.cfg file.
|
#Load engine configurator from engine.cfg file.
|
||||||
#Carga el configurador del engine desde el fichero engine.cfg
|
#Carga el configurador del engine desde el fichero engine.cfg
|
||||||
|
@ -61,22 +62,20 @@ sparam = tbprm[1] # Partitioning and formatting parameters
|
||||||
# Toma valores de disco y caché, separados por "*".
|
# Toma valores de disco y caché, separados por "*".
|
||||||
# Los valores están en las variables $dis: disco, $che: existe cache (1, 0), $tch: Tamaño de la cache.
|
# Los valores están en las variables $dis: disco, $che: existe cache (1, 0), $tch: Tamaño de la cache.
|
||||||
tbprm = pparam.split ('*')
|
tbprm = pparam.split ('*')
|
||||||
dis = ptt = tch = None
|
dis = tch = None
|
||||||
for item in tbprm:
|
for item in tbprm:
|
||||||
if '=' not in item: continue
|
if '=' not in item: continue
|
||||||
|
|
||||||
k, v = item.split ('=', 1)
|
k, v = item.split ('=', 1)
|
||||||
if k not in ['dis', 'tch', 'ptt']: ## 'ptt' added, unused 'che' removed
|
if k not in ['dis', 'tch']:
|
||||||
print (f'ignoring unknown disk parameter ({k})')
|
print (f'ignoring unknown disk parameter ({k})')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if 'dis' == k: dis = int (v)
|
if 'dis' == k: dis = int (v)
|
||||||
elif 'ptt' == k: ptt = v
|
|
||||||
elif 'tch' == k: tch = v
|
elif 'tch' == k: tch = v
|
||||||
|
|
||||||
# Error si no se define el parámetro de disco (dis).
|
# Error si no se define el parámetro de disco (dis).
|
||||||
if dis is None: sys.exit (ogGlobals.OG_ERR_FORMAT)
|
if dis is None: sys.exit (ogGlobals.OG_ERR_FORMAT)
|
||||||
if ptt is None: ptt = 'MSDOS'
|
|
||||||
if tch is None: tch = '0'
|
if tch is None: tch = '0'
|
||||||
|
|
||||||
# Toma valores de distribución de particiones, separados por "%".
|
# Toma valores de distribución de particiones, separados por "%".
|
||||||
|
@ -138,11 +137,10 @@ CacheLib.ogUnmountCache()
|
||||||
|
|
||||||
# Elimina la tabla de particiones
|
# Elimina la tabla de particiones
|
||||||
cur_ptt = DiskLib.ogGetPartitionTableType (dis)
|
cur_ptt = DiskLib.ogGetPartitionTableType (dis)
|
||||||
|
ptt = 'GPT' if InventoryLib.ogIsEfiActive() else 'MSDOS'
|
||||||
if not cur_ptt or ptt != cur_ptt:
|
if not cur_ptt or ptt != cur_ptt:
|
||||||
DiskLib.ogDeletePartitionTable (dis)
|
DiskLib.ogDeletePartitionTable (dis)
|
||||||
SystemLib.ogExecAndLog ('command', DiskLib.ogUpdatePartitionTable)
|
SystemLib.ogExecAndLog ('command', DiskLib.ogUpdatePartitionTable)
|
||||||
|
|
||||||
# Crea tabla de particiones MSDOS (NOTA: adaptar para tablas GPT).
|
|
||||||
DiskLib.ogCreatePartitionTable (dis, ptt)
|
DiskLib.ogCreatePartitionTable (dis, ptt)
|
||||||
|
|
||||||
# Inicia la cache.
|
# Inicia la cache.
|
||||||
|
|
Loading…
Reference in New Issue