Compare commits

..

13 Commits

Author SHA1 Message Date
Natalia Serrano 4c191aa730 Merge pull request 'fix-syntax-and-others' (#72) from fix-syntax-and-others into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #72
2025-06-26 13:39:31 +02:00
Natalia Serrano e3f5470fce refs #2331 fix syntax and other errors 2025-06-26 13:37:33 +02:00
Natalia Serrano 13ebbc2939 refs #2319 widen a check for None 2025-06-26 13:26:49 +02:00
Natalia Serrano 9cc67bbf1f Merge pull request 'refs #2316 prevent Configurar.py from messing with the browser' (#71) from configurar-coproc into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #71
2025-06-25 11:22:25 +02:00
Natalia Serrano 78f27b724e refs #2316 prevent Configurar.py from messing with the browser 2025-06-25 11:21:53 +02:00
Natalia Serrano b78fb6f900 Merge pull request 'refs #2314 fix bugs' (#70) from fix-bugs into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #70
2025-06-25 11:18:08 +02:00
Natalia Serrano 0f2cb4aefe refs #2314 fix bugs 2025-06-25 11:17:31 +02:00
Natalia Serrano 5541e39b5f Merge pull request 'refs #2308 do ogExecAndLog also when creating images' (#69) from ogexecandlog-createimage into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #69
2025-06-24 15:25:56 +02:00
Natalia Serrano 4f0543fe79 refs #2308 do ogExecAndLog also when creating images 2025-06-24 15:25:09 +02:00
Natalia Serrano a5eacbe203 Merge pull request '#2301 adds mount route when boot mark is created' (#67) from fix-bootMark-linux into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #67
2025-06-24 15:10:25 +02:00
Luis Gerardo Romero Garcia a34c98eb4c refs #2301 updates changelog 0.19.3 2025-06-24 15:09:21 +02:00
Luis Gerardo Romero Garcia c55a75f5ce #2301 adds mount route when boot mark is created 2025-06-24 15:08:29 +02:00
Natalia Serrano 1bf1283aff Merge pull request 'refs #2305 have ogExecAndLog do subprocess.Popen' (#68) from ogexecandlog into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #68
2025-06-24 15:04:40 +02:00
6 changed files with 45 additions and 23 deletions

View File

@ -5,6 +5,36 @@ 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).
## [0.21.1] - 2025-06-26
### Fixed
- Fixed syntax and other errors
## [0.21.0] - 2025-06-25
### Changed
- Prevent Configurar.py from messing with the browser
## [0.20.3] - 2025-06-25
### Fixed
- Fixed bugs when partitioning disks
## [0.20.2] - 2025-06-24
### Changed
- Do a couple of ogExecAndLog()s also when creating images
## [0.20.1] - 2025-06-24
### Changed
- Fix mark for ogboot on linux
## [0.20.0] - 2025-06-24
### Changed

View File

@ -47,9 +47,6 @@ prog = os.path.basename(__name__)
#param = ''.join(sys.argv[2:]).replace(' ', '').replace('\t', '')
param = sys.argv[2]
# Activa navegador para ver progreso
coproc = subprocess.Popen (['/opt/opengnsys/bin/browser', '-qws', 'http://localhost/cgi-bin/httpd-log.sh'])
# Leer los dos bloques de parámetros, separados por '!'.
tbprm = param.split ('!')
pparam = tbprm[0] # General disk parameters
@ -71,7 +68,6 @@ for item in tbprm:
# Error si no se define el parámetro de disco (dis).
if dis is None:
coproc.kill()
sys.exit (ogGlobals.OG_ERR_FORMAT)
# Toma valores de distribución de particiones, separados por "%".
@ -101,13 +97,12 @@ for item in tbprm:
elif 'ope' == k: ope = int (v)
missing_params = []
if par is None: missing_params.append ('par')
if cpt is None: missing_params.append ('cpt')
if sfi is None: missing_params.append ('sfi')
if tam is None: missing_params.append ('tam')
if par is None or 'None' == par: missing_params.append ('par')
if cpt is None or 'None' == cpt: missing_params.append ('cpt')
if sfi is None or 'None' == sfi: missing_params.append ('sfi')
if tam is None or 'None' == tam: missing_params.append ('tam')
if missing_params:
print (f'partition data ({item}) missing required parameters ({' '.join (missing_params)})')
coproc.kill()
sys.exit (1)
# Componer datos de particionado.
@ -153,15 +148,13 @@ if 'CACHE' in sparam:
rc = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGSCRIPTS}/initCache', tch])
if not rc:
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_CACHE, f'initCache failed')
coproc.kill()
sys.exit (1)
# Definir particionado.
SystemLib.ogEcho (['session', 'log'], None, f'[50] {ogGlobals.lang.MSG_HELP_ogCreatePartitions}')
SystemLib.ogEcho (['session', 'log'], None, f' ogCreatePartitions {dis} {' '.join (tbp)}')
res = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreatePartitions', dis] + tbp)
res = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreatePartitions', str(dis)] + tbp)
if not res:
coproc.kill()
SystemLib.ogRaiseError (['log', 'session'], ogGlobals.OG_ERR_GENERIC, f'ogCreatePartitions {dis} {' '.join (tbp)}')
sys.exit (1)
SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogUpdatePartitionTable'])
@ -177,9 +170,8 @@ for p in range (1, maxp+1):
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatCache'])
else:
SystemLib.ogEcho (['session', 'log'], None, f' ogFormatFs {dis} {p} {tbf[p]}')
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatFs', dis, str(p), tbf[p]])
if retval:
coproc.kill()
retval = SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogFormatFs', str(dis), str(p), tbf[p]])
if not retval:
SystemLib.ogRaiseError (['session', 'log'], ogGlobals.OG_ERR_GENERIC, f'ogFormatFs {dis} {p} {tbf[p]}')
sys.exit (1)
# Registro de fin de ejecución
@ -190,5 +182,4 @@ SystemLib.ogEcho (['session', 'log'], None, f'{ogGlobals.lang.MSG_INTERFACE_END}
# Retorno
#___________________________________________________________________
coproc.kill()
sys.exit (0)

View File

@ -263,7 +263,7 @@ def ogFormatFs (disk, par, fs=None, label=None):
errcode = ogGlobals.OG_ERR_PARTITION
ogUnlock (disk, par)
return errcode
return not errcode ## reverse to indicate success
#/**

View File

@ -81,7 +81,7 @@ if 'Windows' == ostype:
elif 'Linux' == ostype:
# Marca para arranque.
boot_mark_file = f'/Part-{int(disk):02d}-{int(par):02d}'
boot_mark_file = f'{mntdir}/Part-{int(disk):02d}-{int(par):02d}'
try:
open (boot_mark_file, 'w').close()
except Exception as e:

View File

@ -140,7 +140,7 @@ def main (disk, par, repo, imgname):
# Evaluar variable de engine.cfg para reducir el sistema de archivos en la creacion
if ogGlobals.IMGREDUCE:
SystemLib.ogEcho (['log', 'session'], None, f'[30] {ogGlobals.lang.MSG_HELP_ogReduceFs}')
FileSystemLib.ogReduceFs (disk, par)
SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogReduceFs', disk, par])
newsizefs = FileSystemLib.ogGetFsSize (disk, par)
timeaux = time.time() - time1
SystemLib.ogEcho (['log', 'session'], None, f' {ogGlobals.lang.MSG_SCRIPTS_TIME_PARTIAL} ( {newsizefs} KB ) : {int (timeaux/60)}m {int (timeaux%60)}s')
@ -157,7 +157,7 @@ def main (disk, par, repo, imgname):
with open (ogGlobals.OGLOGCOMMAND, 'w') as fd: fd.write ('')
time2 = time.time()
SystemLib.ogEcho (['log', 'session'], None, f'[40] {ogGlobals.lang.MSG_HELP_ogCreateImage} : ogCreateImage {disk} {par} {repo} {imgname} {ogGlobals.IMGPROG} {ogGlobals.IMGCOMP}')
if not ImageLib.ogCreateImage (disk, par, repo, f'/{imgname}', ogGlobals.IMGPROG, ogGlobals.IMGCOMP):
if not SystemLib.ogExecAndLog ('command', [f'{ogGlobals.OGPYFUNCS}/ogCreateImage', disk, par, repo, f'/{imgname}', ogGlobals.IMGPROG, ogGlobals.IMGCOMP]):
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_IMAGE, 'ogCreateImage')
sys.exit (1)
resumecreateimage = subprocess.run (['grep', 'Total Time:', ogGlobals.OGLOGCOMMAND], capture_output=True, text=True).stdout

View File

@ -143,7 +143,7 @@ if sizerequired >= cachesizefree:
SystemLib.ogRaiseError ('session', ogGlobals.OG_ERR_CACHESIZE, 'CACHE')
sys.exit (1)
# Comprobamos que imagen cache igual a la del repo. Si sincronizada no podemos comprobar.
# Comprobamos que imagen cache igual a la del repo. Si sincronizada no podemos comprobar.
rc = ProtocolLib.ogUpdateCacheIsNecesary (repositorio, path, protocolo)
# si rc=True: actualizamos; si rc=False: no actualizamos (exit 0); si rc=None: exit error
if rc == True: pass ## es necesario actualizar
@ -156,9 +156,10 @@ CacheLib.ogMountCache()
imgdir = FileLib.ogGetParentPath ('CACHE', f'/{path}')
if not imgdir:
SystemLib.ogEcho (['log', 'session'], None, f'[5] {ogGlobals.lang.MSG_HELP_ogMakeDir} "{path} {os.path.dirname (path)}".')
FileLib.ogMakeDir ('CACHE', os.path.dirname (f'/{path}'))
imgdir = ogGetParentPath ('CACHE', f'/{path}')
FileLib.ogMakeDir (container='CACHE', file=os.path.dirname (f'/{path}'))
imgdir = FileLib.ogGetParentPath ('CACHE', f'/{path}')
if not imgdir:
SystemLib.ogRaiseError ('session', ogGlobals.OG_ERR_IMAGE, 'no directory for images')
sys.exit (1)
t0 = time.time()