summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk/installation.py
diff options
context:
space:
mode:
Diffstat (limited to 'py_modules/lsfg_vk/installation.py')
-rw-r--r--py_modules/lsfg_vk/installation.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py
index 4329d49..4f01be1 100644
--- a/py_modules/lsfg_vk/installation.py
+++ b/py_modules/lsfg_vk/installation.py
@@ -3,6 +3,7 @@ Installation service for lsfg-vk.
"""
import os
+import platform
import shutil
import traceback
import zipfile
@@ -14,7 +15,7 @@ from typing import Dict, Any
from .base_service import BaseService
from .constants import (
LIB_FILENAME, JSON_FILENAME, ZIP_FILENAME, BIN_DIR,
- SO_EXT, JSON_EXT
+ SO_EXT, JSON_EXT, ARM_LIB_FILENAME
)
from .config_schema import ConfigurationManager
from .types import InstallationResponse, UninstallationResponse, InstallationCheckResponse
@@ -48,6 +49,13 @@ class InstallationService(BaseService):
self._extract_and_install_files(zip_path)
+ # If on ARM, overwrite the .so with the ARM version
+ if self._is_arm_architecture():
+ self.log.info("Detected ARM architecture, using ARM binary")
+ arm_so_path = plugin_dir / BIN_DIR / ARM_LIB_FILENAME
+ shutil.copy2(arm_so_path, self.lib_file)
+ self.log.info(f"Overwrote with ARM binary: {self.lib_file}")
+
self._create_config_file()
self._create_lsfg_launch_script()
@@ -64,6 +72,14 @@ class InstallationService(BaseService):
self.log.error(error_msg)
return self._error_response(InstallationResponse, str(e), message="")
+ def _is_arm_architecture(self) -> bool:
+ """Check if running on ARM architecture
+
+ Returns:
+ True if running on ARM (aarch64), False otherwise
+ """
+ return platform.machine().lower() == 'aarch64'
+
def _extract_and_install_files(self, zip_path: Path) -> None:
"""Extract zip file and install files to appropriate locations