summaryrefslogtreecommitdiffstats
path: root/src/utils/postinstall.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/postinstall.py')
-rw-r--r--src/utils/postinstall.py101
1 files changed, 47 insertions, 54 deletions
diff --git a/src/utils/postinstall.py b/src/utils/postinstall.py
index 6d6e60e..7e21e67 100644
--- a/src/utils/postinstall.py
+++ b/src/utils/postinstall.py
@@ -99,85 +99,78 @@ def configure_os_custom(disk, partition):
cmd_configure = f"{command_path} {disk} {partition}"
- try:
- proc = subprocess.run(shlex.split(cmd_configure),
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- check=True)
- out = proc.stdout
- except OSError as e:
- raise OgError(f'Error processing configureOsCustom: {e}') from e
+ proc = subprocess.run(shlex.split(cmd_configure),
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def windows_register_c_drive(disk, partition):
cmd_configure = f"ogWindowsRegisterPartition {disk} {partition} C {disk} {partition}"
- try:
- proc = subprocess.run(cmd_configure,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- shell=True,
- check=True)
- except OSError as e:
- raise OgError(f'Error processing ogWindowsRegisterPartition: {e}') from e
+ proc = subprocess.run(cmd_configure,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ shell=True,
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def configure_mbr_boot_sector(disk, partition):
cmd_configure = f"ogFixBootSector {disk} {partition}"
- try:
- proc = subprocess.run(cmd_configure,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- shell=True,
- check=True)
- except OSError as e:
- raise OgError(f'Error processing ogFixBootSector: {e}') from e
+ proc = subprocess.run(cmd_configure,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ shell=True,
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def configure_grub_in_mbr(disk, partition):
cmd_configure = f"ogGrubInstallMbr {disk} {partition} TRUE"
- try:
- proc = subprocess.run(cmd_configure,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- shell=True,
- check=True)
- except OSError as e:
- raise OgError(f'Error processing ogGrubInstallMbr: {e}') from e
+ proc = subprocess.run(cmd_configure,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ shell=True,
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def configure_fstab(disk, partition):
cmd_configure = f"ogConfigureFstab {disk} {partition}"
- try:
- proc = subprocess.run(cmd_configure,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- shell=True,
- check=True)
- except OSError as e:
- raise OgError(f'Error processing ogConfigureFstab: {e}') from e
+ proc = subprocess.run(cmd_configure,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ shell=True,
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def install_grub(disk, partition):
cmd_configure = f"ogGrubInstallPartition {disk} {partition}"
- try:
- proc = subprocess.run(cmd_configure,
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL,
- encoding='utf-8',
- shell=True,
- check=True)
- except OSError as e:
- raise OgError(f'Error processing ogGrubInstallPartition: {e}') from e
+ proc = subprocess.run(cmd_configure,
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL,
+ encoding='utf-8',
+ shell=True,
+ check=True)
+ if proc.returncode != 0:
+ logging.warning(f'{cmd_configure} returned non-zero exit status {proc.returncode}')
def configure_os_linux(disk, partition):