From e33607f03524dd70016db064ae4d9c808998cab7 Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Thu, 11 Sep 2025 15:01:34 +0200 Subject: [PATCH] refs #2774 run sshd earlier in oglive --- CHANGELOG.md | 26 ++++++++++++++------------ ogclient/etc/preinit.py | 3 ++- ogclient/lib/python3/BootLib.py | 2 +- ogclient/lib/python3/InitLib.py | 9 +++++---- ogclient/scripts/configureOs | 2 +- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23c3afe..73f0b9b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,56 +5,58 @@ 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.5.0] - 2025-09-11 + +### Changed + +- Run sshd earlier in oglive + ## [1.4.7] - 2025-09-10 -## Change +### Changed - Oggit branch fix - ## [1.4.6] - 2025-09-10 -## Change +### Changed - Oggit branch tracking - ## [1.4.5] - 2025-09-09 -## Change +### Changed - Oggit fast restore - ## [1.4.4] - 2025-09-09 -## Change +### Changed - Oggit Windows EFI boot fixes v2 - ## [1.4.3] - 2025-09-09 -## Change +## #Changed - Oggit Windows EFI boot fixes ## [1.4.2] - 2025-09-09 -## Change +### Changed - Oggit EFI boot fixes ## [1.4.1] - 2025-09-05 -## Change +### Changed - Oggit branch creation fixes - Oggit checked out repo integrity checking ## [1.4.0] - 2025-08-28 -## Changed +### Changed - Oggit branch creation support - Oggit parameter refactoring diff --git a/ogclient/etc/preinit.py b/ogclient/etc/preinit.py index f94d614..ca0e422 100755 --- a/ogclient/etc/preinit.py +++ b/ogclient/etc/preinit.py @@ -12,7 +12,7 @@ for l in libs: sys.path.insert (0, l) import subprocess import ogGlobals -from InitLib import loadenviron, write_profile, clean_esp, fileslinks, loadmodules, metadevs, mountrepo, poweroff, filebeat, stunnel, dbus, otherservices, runhttplog +from InitLib import loadenviron, write_profile, sshd, clean_esp, fileslinks, loadmodules, metadevs, mountrepo, poweroff, filebeat, stunnel, dbus, otherservices, runhttplog IPV4ADDR = os.environ.get ('IPV4ADDR', '') OG_IP = os.environ.get ('OG_IP', '') @@ -23,6 +23,7 @@ write_profile() # Funciones de inicio. clean_esp() fileslinks() +sshd() loadmodules() metadevs() mountrepo() diff --git a/ogclient/lib/python3/BootLib.py b/ogclient/lib/python3/BootLib.py index 9608fa4..5699d23 100644 --- a/ogclient/lib/python3/BootLib.py +++ b/ogclient/lib/python3/BootLib.py @@ -206,7 +206,7 @@ def ogBoot (disk, par, nvramperm=False, params=''): subprocess.run (['dd', 'if=/dev/zero', f'of={mntdir}/ogboot.me', 'bs=1024', 'count=3']) subprocess.run (['dd', 'if=/dev/zero', f'of={mntdir}/ogboot.firstboot', 'bs=1024', 'count=3']) subprocess.run (['dd', 'if=/dev/zero', f'of={mntdir}/ogboot.secondboot', 'bs=1024', 'count=3']) - v = RegistryLib.ogGetRegistryValue (mntdir, 'SOFTWARE', r'\Microsoft\Windows\CurrentVersion\Run\ogcleannboot') + v = RegistryLib.ogGetRegistryValue (mntdir, 'SOFTWARE', r'\Microsoft\Windows\CurrentVersion\Run\ogcleanboot') if not v: RegistryLib.ogAddRegistryValue (mntdir, 'SOFTWARE', r'\Microsoft\Windows\CurrentVersion\Run\ogcleanboot') RegistryLib.ogSetRegistryValue (mntdir, 'SOFTWARE', r'\Microsoft\Windows\CurrentVersion\Run\ogcleanboot', r'cmd /c del c:\ogboot.*') diff --git a/ogclient/lib/python3/InitLib.py b/ogclient/lib/python3/InitLib.py index fe5e916..90c718e 100644 --- a/ogclient/lib/python3/InitLib.py +++ b/ogclient/lib/python3/InitLib.py @@ -126,6 +126,9 @@ def fileslinks(): for f in glob.glob ('/scripts/ssl/*'): shutil.copy2 (f, '/root/.ssh/') +def sshd(): + subprocess.run (['/etc/init.d/ssh', 'start'], capture_output=True, text=True) + def loadmodules(): print (ogGlobals.lang.MSG_LOADMODULES) @@ -294,7 +297,7 @@ def dbus(): subprocess.Popen (['dbus-monitor', '--system'], stdout=dbus_mon_fd, stderr=subprocess.STDOUT) def otherservices(): - DEVICE = os.environ.get ('DEVICE', '') + DEVICE = os.environ.get ('DEVICE', '') if ogIsEfiActive(): subprocess.run (['mount', '-t', 'efivarfs', 'none', '/sys/firmware/efi/efivars']) @@ -309,14 +312,12 @@ def otherservices(): if not PASS: PASS = 'og' subprocess.run (['passwd', 'root'], input=f'{PASS}\n{PASS}\n', stderr=subprocess.DEVNULL, text=True) - subprocess.run (['/etc/init.d/ssh', 'start'], capture_output=True, text=True) - #setterm -blank 0 -powersave off -powerdown 0 < /dev/console > /dev/console 2>&1 ## apagado de monitor subprocess.run (['ethtool', '-s', DEVICE, 'wol', 'g'], stderr=subprocess.DEVNULL) ## Activado WOL en la interfaz usada en arranque PXE. def runhttplog(): ## si estos accesos a os.environ fallan, es porque loadenviron() no se ejecutó - OPENGNSYS = os.environ['OPENGNSYS'] + OPENGNSYS = os.environ['OPENGNSYS'] try: shutil.copy2 ('/etc/lighttpd/lighttpd.conf', '/etc/lighttpd/lighttpd.conf.back') diff --git a/ogclient/scripts/configureOs b/ogclient/scripts/configureOs index aa5bcc4..674ace9 100755 --- a/ogclient/scripts/configureOs +++ b/ogclient/scripts/configureOs @@ -5,7 +5,7 @@ #@brief Script para realizar la configuracion del sistema operativo restaurado. #@param 1 disco #@param 2 particion -#@param 2 nombre imagen +#@param 3 nombre imagen #@return #@TODO comprobar que el tipo de particion corresponde con el sistema de archivos. #@exception OG_ERR_FORMAT # 1 formato incorrecto. -- 2.40.1