summaryrefslogtreecommitdiffstats
path: root/src/utils/probe.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-11 12:15:09 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-22 16:47:38 +0200
commit373c1b2a724a3855f93d9cc4b48d0c33310a482c (patch)
tree70d6fb6eeed3eabb62d10458a5826b282c0d8d8a /src/utils/probe.py
parent2fcdf896061fd3dfdde9ea42c58a76dd3f42f3fa (diff)
grub: replace legacy grub install scripts
Translate old legacy grub scripts into grub.py Implement ogGrubInstallMbr as install_main_grub() and ogGrubInstallPartition as install_linux_grub(). Add grub configuration file generator through the classes GrubConfig and MenuEntry. Ensure EFI tree structure compatibility with legacy code. The structure of the created folders in the ESP is non-standard, efi binaries are usually located in the folder below the EFI/ directory. Structure used by ogClient: EFI/ ├── grub/ │ └── Boot/ │ ├── BOOTX64.CSV │ ├── grub.cfg │ ├── mmx64.efi │ ├── shimx64.efi │ ├── BOOTX64.EFI │ ├── grubx64.efi │ └── ogloader.efi ... The function _mangle_efi_folder handles the folder structure after grub-install to comply with the location expected by ogLive. install_linux_grub() installs a grub local to each Linux install to enable chainloading, each grub is located in EFI/Part-xx-yy/ in UEFI. The local linux BIOS grub in legacy scripts is unreliable, grub-install reports a failure during the install process. install_main_grub() installs a global grub in EFI/grub/ to show a grub menu when the pxe boot fails. The global grub contains entries to every installed os. No global grub is installed for BIOS systems, a Boot partition would be required to store the grub configuration.
Diffstat (limited to 'src/utils/probe.py')
-rw-r--r--src/utils/probe.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils/probe.py b/src/utils/probe.py
index e53f08f..92ccf7c 100644
--- a/src/utils/probe.py
+++ b/src/utils/probe.py
@@ -10,6 +10,7 @@ import os
import subprocess
import platform
import logging
+import sys
from enum import Enum
from subprocess import PIPE
@@ -76,6 +77,10 @@ def getwindowsversion(winreghives):
return 'Microsoft Windows'
+def interpreter_is64bit():
+ return sys.maxsize > 2**32
+
+
def windows_is64bit(winreghives):
"""
Check for 64 bit Windows by means of retrieving the value of