Merge pull request 'refs #2367 fix winboot/kexec' (#78) from fix-winboot into main
ogclient/pipeline/head This commit looks good Details
ogclient/pipeline/tag This commit looks good Details

Reviewed-on: #78
pull/79/head 0.22.5
Natalia Serrano 2025-07-02 09:59:48 +02:00
commit 0476bff36a
2 changed files with 10 additions and 4 deletions

View File

@ -5,6 +5,12 @@ 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.22.5] - 2025-07-02
### Fixed
- Fixed booting windows using winboot/kexec
## [0.22.4] - 2025-07-01
### Changed

View File

@ -189,12 +189,12 @@ def ogBoot (disk, par, nvramperm=False, params=''):
winboot = os.environ.get ('winboot', '')
if 'kexec' == winboot:
# Modo de arranque en caliente (con kexec).
for f in glob.glob (f'{ogGlobals.OGLIB}/grub4dos/*'):
shutil.copy2 (f, mntdir)
cp_cmd = f'cp {ogGlobals.OGLIB}/grub4dos/* {mntdir}'
subprocess.run (cp_cmd, shell=True)
disk0 = int(disk)-1
par0 = int(par)-1
subprocess.run (['kexec', '-l', f'{mntdir}/grub.exe', '--append=--config-file=root (hd{disk0},{par0}); chainloader (hd{disk0},{par0})/{loader}; tpm --init'])
subprocess.Popen (['kexec', '-e'])
subprocess.run (['kexec', '--load', f'{mntdir}/grub.exe', '--append=--config-file=root (hd{disk0},{par0}); chainloader (hd{disk0},{par0})/{loader}; tpm --init'])
subprocess.Popen (['kexec', '--exec'])
else:
# Modo de arranque por reinicio (con reboot).
subprocess.run (['dd', 'if=/dev/zero', f'of={mntdir}/ogboot.me', 'bs=1024', 'count=3'])