Merge pull request 'refs #2171 copy grub.cfg' (#51) from cp-grub-cfg 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: #51
pull/52/head 0.13.9
Natalia Serrano 2025-06-04 14:00:25 +02:00
commit 4df8caa203
2 changed files with 11 additions and 1 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.13.9] - 2025-06-04
### Fixed
- Copy grub.cfg so that grub finds the config upon boot
## [0.13.8] - 2025-06-03
### Fixed

View File

@ -112,7 +112,7 @@ def ogBoot (disk, par, nvramperm=False, params=''):
bootloader = 'shimx64.efi'
# Obtener parcición EFI.
esp = DiskLib.ogGetEsp()
#efidisk, efipart = esp.split()
efidisk, efipart = esp.split()
# TODO: Comprobamos que existe la BOOTLABEL, si no buscamos por sistema operativo
if '' == FileLib.ogGetPath (src=esp, file=f'EFI/{bootlabel}'):
osversion = InventoryLib.ogGetOsVersion (disk, par)
@ -126,6 +126,10 @@ def ogBoot (disk, par, nvramperm=False, params=''):
SystemLib.ogRaiseError ([], ogGlobals.OG_ERR_NOTFOUND, f'{esp} Boot loader')
return None
esp_dev = DiskLib.ogDiskToDev (efidisk, efipart)
esp_mntdir = esp_dev.replace ('dev', 'mnt')
shutil.copy2 (f'{esp_mntdir}/EFI/{bootlabel}/Boot/grub.cfg', f'{esp_mntdir}/boot/grub/grub.cfg')
# Crear orden de arranque (con unos valores por defecto).
UEFILib.ogNvramAddEntry (bootlabel, f'/EFI/{bootlabel}/Boot/{bootloader}', nvramperm)
# Marcar próximo arranque y reiniciar.