Merge pull request 'refs #2858 improve detection of BCD files for the menu entries' (#127) from winloader-menu-entry into main
Reviewed-on: #127pull/128/head opengnsys-3.1.0
commit
8daaefffd1
|
@ -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/),
|
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).
|
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
|
## [1.7.1] - 2025-10-02
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -462,15 +462,14 @@ def ogGetOsVersion(disk, part):
|
||||||
# Para cargador Windows: buscar versión en fichero BCD (basado en os-prober).
|
# Para cargador Windows: buscar versión en fichero BCD (basado en os-prober).
|
||||||
if not version:
|
if not version:
|
||||||
type = 'WinLoader'
|
type = 'WinLoader'
|
||||||
file = FileLib.ogGetPath (file=f'{mntdir}/boot/bcd')
|
find_out = subprocess.run (['find', mntdir, '-type', 'f'], capture_output=True, text=True).stdout
|
||||||
if not file:
|
bcd_files = list (filter (lambda x: 'Boot/BCD' in x, find_out.splitlines()))
|
||||||
file = FileLib.ogGetPath (file=f'{mntdir}/EFI/Microsoft/boot/bcd')
|
if bcd_files:
|
||||||
if file:
|
|
||||||
for distrib in 'Windows Recovery', 'Windows Boot':
|
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 = re.sub (r'(.)', '\\1.', distrib)
|
||||||
distrib_utf16_regex = bytes (distrib_utf16_regex, 'ascii')
|
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):
|
if re.search (distrib_utf16_regex, contents):
|
||||||
version = f'{distrib} loader'
|
version = f'{distrib} loader'
|
||||||
# Para macOS: detectar kernel y completar con fichero plist de información del sistema.
|
# Para macOS: detectar kernel y completar con fichero plist de información del sistema.
|
||||||
|
|
Loading…
Reference in New Issue