mirror of https://git.48k.eu/ogclient
parent
fe40f9c5d6
commit
71b3211d3d
|
@ -10,6 +10,7 @@ import subprocess
|
|||
import shutil
|
||||
import logging
|
||||
import hivex
|
||||
import shlex
|
||||
from src.log import OgError
|
||||
from src.utils.bcd import update_bcd
|
||||
from src.utils.probe import *
|
||||
|
@ -90,19 +91,19 @@ def set_linux_hostname(disk, partition, name):
|
|||
|
||||
|
||||
def configure_os_custom(disk, partition):
|
||||
if not shutil.which('configureOsCustom'):
|
||||
command_path = shutil.which('configureOsCustom')
|
||||
if not command_path:
|
||||
raise OgError('configureOsCustom not found')
|
||||
|
||||
logging.info(f'Found configureOsCustom script, invoking it...')
|
||||
|
||||
cmd_configure = f"configureOsCustom {disk} {partition}"
|
||||
cmd_configure = f"{command_path} {disk} {partition}"
|
||||
|
||||
try:
|
||||
proc = subprocess.run(cmd_configure,
|
||||
proc = subprocess.run(shlex.split(cmd_configure),
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL,
|
||||
encoding='utf-8',
|
||||
shell=True,
|
||||
check=True)
|
||||
out = proc.stdout
|
||||
except OSError as e:
|
||||
|
|
Loading…
Reference in New Issue