Compare commits

...

8 Commits
1.6.1 ... main

Author SHA1 Message Date
Natalia Serrano 8daaefffd1 Merge pull request 'refs #2858 improve detection of BCD files for the menu entries' (#127) from winloader-menu-entry into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #127
2025-10-02 14:26:03 +02:00
Natalia Serrano ae48530b95 refs #2858 improve detection of BCD files for the menu entries 2025-10-02 14:23:15 +02:00
Natalia Serrano ab552d571d Merge pull request 'refs #2856 allow to create images in regular ogLive (not ogLiveAdmin)' (#126) from crearimagen-oglive-no-admin into main
ogclient/pipeline/head There was a failure building this commit Details
ogclient/pipeline/tag There was a failure building this commit Details
Reviewed-on: #126
2025-10-02 10:26:56 +02:00
Natalia Serrano 9a0a3c2223 refs #2856 allow to create images in regular ogLive (not ogLiveAdmin) 2025-10-02 10:25:41 +02:00
Natalia Serrano 458c18a8d8 Merge pull request 'refs #2850 add cgi error page' (#125) from browser-err into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #125
2025-09-29 15:36:20 +02:00
Natalia Serrano de5d4bc04b refs #2850 add cgi error page 2025-09-29 15:35:46 +02:00
Natalia Serrano bcf69b6bfe Merge pull request 'refs #2848 log less stuff' (#124) from log-less-stuff into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details
Reviewed-on: #124
2025-09-26 10:51:04 +02:00
Natalia Serrano 616885376d refs #2848 log less stuff 2025-09-26 10:50:43 +02:00
7 changed files with 66 additions and 18 deletions

View File

@ -5,6 +5,30 @@ 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).
## [1.7.2] - 2025-10-02
### Fixed
- Improve detection of BCD files for the menu entries
## [1.7.1] - 2025-10-02
### Fixed
- Allow to create images in regular ogLive (not ogLiveAdmin)
## [1.7.0] - 2025-09-29
### Added
- Add CGI error page
## [1.6.2] - 2025-09-26
### Fixed
- Have gitlib log less stuff, to prevent the execution from getting stuck
## [1.6.1] - 2025-09-25
### Fixed

View File

@ -73,7 +73,7 @@ if 'REPO' == repo or ogCheckIpAddress (repo):
sys.exit (1)
# Si el destino es REPO y el cliente no está en modo "admin"; activar repositorio para escritura,
if 'REPO' == repo and 'admin' != env_boot:
if 'admin' != env_boot:
retval = subprocess.run ([f'{dirname}/CambiarAcceso', 'admin']).returncode
if retval:
sys.exit (retval)

View File

@ -0,0 +1,12 @@
#!/bin/bash
echo "Content-type: text/html"
echo ""
echo "<html><head><title>OpenGnsys Client $(/opt/opengnsys/functions/ogGetIpAddress)</title>"
echo " <meta charset='utf-8'>"
echo "</head><body>"
echo "<h1>Ocurrió un error durante el arranque del agente</h1>"
echo "<p>Consulte el log del agente para más información</p>"
echo "</body></html>"

View File

@ -14,4 +14,4 @@ echo "<IFRAME SRC='cache.sh' WIDTH=590 HEIGHT=90><A HREF="cache.sh">link</a>
echo "<IFRAME SRC='LogSession.sh' WIDTH=850 HEIGHT=230> <A HREF="LogSession.sh">link</A> </IFRAME>"
echo "<IFRAME SRC='LogCommand.sh' WIDTH=850 HEIGHT=280> <A HREF="LogCommand.sh">link</A> </IFRAME>"
echo "</body>
echo "</body></html>"

View File

@ -10,5 +10,4 @@ echo "<html><head><title>OpenGnsys Client</title></head><body>"
$(wget http://172.17.9.205/opengnsys/varios/menubrowser.php -O /tmp/menu.tmp)
echo "$(cat /tmp/menu.tmp)"
echo "</body>
echo "</body></html>"

View File

@ -427,14 +427,22 @@ class OpengnsysGitLibrary:
if result.returncode == 0:
self.logger.debug("Completed, return code %i", result.returncode)
self.logger.debug("STDOUT: %s", result.stdout)
self.logger.debug("STDERR: %s", result.stderr)
#self.logger.debug("STDOUT: %s", result.stdout)
#self.logger.debug("STDERR: %s", result.stderr)
else:
# An error return code can be returned for reasons like missing files, so we deal this
# as non-fatal.
self.logger.error("Completed, return code %i", result.returncode)
self.logger.error("STDOUT: %s", result.stdout)
#self.logger.error("STDOUT: %s", result.stdout)
fd = open ('/tmp/ntfssecaudit.stdout', 'wb')
fd.write (result.stdout)
fd.close()
self.logger.error("STDERR: %s", result.stderr)
fd = open ('/tmp/ntfssecaudit.stderr', 'wb')
fd.write (result.stderr)
fd.close()
self.fs.temp_remount(mountdata)
@ -504,6 +512,9 @@ class OpengnsysGitLibrary:
boot_device = self.fs.find_boot_device()
boot_mount = self.fs.find_mountpoint(boot_device)
if boot_mount is None:
self.logger.warning(f"Not installing EFI files--boot_mount is None")
return
self.logger.info(f"Installing EFI files in {boot_mount}")
meta_dir = os.path.join(root_directory, ".opengnsys-metadata")
@ -535,6 +546,9 @@ class OpengnsysGitLibrary:
def _efi_copy(self, root_directory, system_specific = False, config_name = None):
meta_dir = os.path.join(root_directory, ".opengnsys-metadata")
boot_device = self.fs.find_boot_device()
if boot_device is None:
self.logger.warning("Not copying EFI--boot_device is None")
return
boot_mount = self.fs.find_mountpoint(boot_device)
efi_files_dir = ""
@ -620,7 +634,7 @@ class OpengnsysGitLibrary:
self.logger.debug(f"Archive: {metadata}")
for entry in metadata:
self.logger.debug(entry)
#self.logger.debug(entry)
if entry.pathname in wanted_files:
self.logger.debug(f"Extracting {entry}")
data = bytearray()
@ -1112,7 +1126,7 @@ class OpengnsysGitLibrary:
with open(os.path.join(meta_dir, "empty_directories.jsonl"), "r", encoding='utf-8') as empties_file:
for line in empties_file:
if line.isspace():
self.logger.debug("Empty line, skipping")
#self.logger.debug("Empty line, skipping")
continue
empties_data = json.loads(line)
@ -1124,12 +1138,12 @@ class OpengnsysGitLibrary:
empty_dir_keep = os.path.join(path, empty_dir, ".opengnsys-keep")
self.logger.debug(f"Empty directory: {empty_dir}")
#self.logger.debug(f"Empty directory: {empty_dir}")
full_empty_dir = os.path.join(path, empty_dir)
Path(full_empty_dir).mkdir(parents=True, exist_ok=True)
if os.path.exists(empty_dir_keep):
self.logger.debug(f"Deleting: {empty_dir_keep}")
#self.logger.debug(f"Deleting: {empty_dir_keep}")
os.unlink(empty_dir_keep)
if not destructive_only:
@ -1840,7 +1854,7 @@ if __name__ == '__main__':
logger.setLevel(logging.DEBUG)
streamLog = logging.StreamHandler()
streamLog.setLevel(logging.INFO)
streamLog.setLevel(logging.WARNING)
if not os.path.exists(opengnsys_log_dir):
os.mkdir(opengnsys_log_dir)

View File

@ -462,15 +462,14 @@ def ogGetOsVersion(disk, part):
# Para cargador Windows: buscar versión en fichero BCD (basado en os-prober).
if not version:
type = 'WinLoader'
file = FileLib.ogGetPath (file=f'{mntdir}/boot/bcd')
if not file:
file = FileLib.ogGetPath (file=f'{mntdir}/EFI/Microsoft/boot/bcd')
if file:
find_out = subprocess.run (['find', mntdir, '-type', 'f'], capture_output=True, text=True).stdout
bcd_files = list (filter (lambda x: 'Boot/BCD' in x, find_out.splitlines()))
if bcd_files:
for distrib in 'Windows Recovery', 'Windows Boot':
with open (file, 'rb') as fd:
contents = fd.read()
distrib_utf16_regex = re.sub (r'(.)', '\\1.', distrib)
distrib_utf16_regex = bytes (distrib_utf16_regex, 'ascii')
with open (bcd_files[0], 'rb') as fd:
contents = fd.read()
if re.search (distrib_utf16_regex, contents):
version = f'{distrib} loader'
# Para macOS: detectar kernel y completar con fichero plist de información del sistema.