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.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/utils/postinstall.py b/src/utils/postinstall.py
index 7e21e67..94a7e4b 100644
--- a/src/utils/postinstall.py
+++ b/src/utils/postinstall.py
@@ -18,6 +18,7 @@ from src.utils.disk import *
from src.utils.winreg import *
from src.utils.fs import *
from src.utils.uefi import *
+from src.utils.fstab import *
from socket import gethostname
CONFIGUREOS_LEGACY_ENABLED = False
@@ -148,16 +149,17 @@ def configure_grub_in_mbr(disk, partition):
def configure_fstab(disk, partition):
- cmd_configure = f"ogConfigureFstab {disk} {partition}"
+ logging.info(f'Configuring /etc/fstab')
+ device = get_partition_device(disk, partition)
+ mountpoint = device.replace('dev', 'mnt')
- 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}')
+ if not mount_mkdir(device, mountpoint):
+ raise OgError(f'Unable to mount {device} into {mountpoint}')
+
+ try:
+ update_fstab(disk, partition, mountpoint)
+ finally:
+ umount(mountpoint)
def install_grub(disk, partition):