diff --git a/CHANGELOG.md b/CHANGELOG.md index 59595cc..d155172 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/ogclient/lib/python3/BootLib.py b/ogclient/lib/python3/BootLib.py index 3fecd90..4d43078 100644 --- a/ogclient/lib/python3/BootLib.py +++ b/ogclient/lib/python3/BootLib.py @@ -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.