From 80125623027283c9a9d94a98bea442b1f0c11206 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Wed, 13 Mar 2024 12:18:35 +0100 Subject: utils: implement BIOS boot for windows Create ogboot.me and ogboot.secondboot as empty files and ogboot.firstboot with the value "iniciado" in the root of the BIOS Windows system partition. The files must contain data for GRUB to be able to write content, therefore these are created containing 3072 null bytes. The Windows boot process is handled by the "pxe" profile. There the files ogboot.me, ogboot.firstboot and ogboot.secondboot are used as a state machine to chose between booting Windows and ogLive. The first Windows boot happens if ogboot.me and ogboot.firstboot are identical, then "iniciado" is written in ogboot.firstboot. We skip this stage as we create ogboot.firstboot with 'iniciado'. The second Windows boot occurs if ogboot.me and ogboot.secondboot are boot identical, then "iniciado" is written in ogboot.secondboot. After the Windows boot ogLive is booted. --- src/live/ogOperations.py | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/live') diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index 339c58c..acb1a0e 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -36,8 +36,6 @@ from src.utils.boot import * from src.utils.sw_inventory import get_package_set from src.utils.hw_inventory import get_hardware_inventory, legacy_list_hardware_inventory -from src.ogClient import ogClient -from src.utils.probe import OSFamily, get_os_family OG_SHELL = '/bin/bash' OG_CACHE_PATH = '/opt/opengnsys/cache/opt/opengnsys/images' @@ -267,30 +265,6 @@ class OgLiveOperations: disk = request.getDisk() partition = request.getPartition() - device = get_partition_device(int(disk), int(partition)) - mountpoint = device.replace('dev', 'mnt') - - if not mount_mkdir(device, mountpoint): - raise RuntimeError(f'Cannot probe OS family. Unable to mount {device} at {esp_mountpoint}.') - is_legacy = not is_uefi_supported(disk) and get_os_family(mountpoint) == OSFamily.WINDOWS - umount(mountpoint) - - if is_legacy: - cmd = f'{ogClient.OG_PATH}interfaceAdm/IniciarSesion {disk} {partition}' - - try: - ogRest.proc = subprocess.Popen([cmd], - stdout=subprocess.PIPE, - shell=True, - executable=OG_SHELL) - (output, error) = ogRest.proc.communicate() - except: - logging.exception('Exception when running session subprocess') - raise ValueError('Error: Incorrect command value') - - logging.info('Starting OS at disk %s partition %s', disk, partition) - return output.decode('utf-8') - boot_os_at(int(disk), int(partition)) self.reboot() -- cgit v1.2.3-18-g5258