Removed running from usb check for install to disk option.
This commit is contained in:
@@ -925,44 +925,8 @@ if __name__ == "__main__":
|
|||||||
# Add system section
|
# Add system section
|
||||||
menu.add_section("System")
|
menu.add_section("System")
|
||||||
|
|
||||||
# Add installer only on x86_64 and when running from USB
|
# Add installer only on x86_64
|
||||||
import platform
|
if platform.machine() == "x86_64":
|
||||||
import subprocess
|
|
||||||
import re
|
|
||||||
|
|
||||||
def is_running_from_usb():
|
|
||||||
try:
|
|
||||||
# Get the root device
|
|
||||||
result = subprocess.run(['findmnt', '-n', '-o', 'SOURCE', '/'],
|
|
||||||
capture_output=True, text=True)
|
|
||||||
if result.returncode != 0:
|
|
||||||
return False
|
|
||||||
|
|
||||||
root_device = result.stdout.strip()
|
|
||||||
|
|
||||||
# Extract device name without partition number
|
|
||||||
device_match = re.match(r'^(/dev/(?:sd[a-z]|nvme[0-9]n[0-9]|mmcblk[0-9]))', root_device)
|
|
||||||
if not device_match:
|
|
||||||
return False
|
|
||||||
|
|
||||||
device_name = device_match.group(1)
|
|
||||||
|
|
||||||
# Check if device is removable (USB/SD card)
|
|
||||||
try:
|
|
||||||
with open(f'/sys/block/{device_name.split("/")[-1]}/removable', 'r') as f:
|
|
||||||
removable = f.read().strip()
|
|
||||||
return removable == '1'
|
|
||||||
except:
|
|
||||||
# Fallback: check for STORMUX label (live USB indicator)
|
|
||||||
result = subprocess.run(['lsblk', '-no', 'NAME,LABEL'],
|
|
||||||
capture_output=True, text=True)
|
|
||||||
if result.returncode == 0:
|
|
||||||
return 'STORMUX' in result.stdout.upper()
|
|
||||||
return False
|
|
||||||
except:
|
|
||||||
return False
|
|
||||||
|
|
||||||
if platform.machine() == "x86_64" and is_running_from_usb():
|
|
||||||
menu.add_item("System", "Install System to Hard Drive", "GAME='Install to Disk' /home/stormux/.clirc")
|
menu.add_item("System", "Install System to Hard Drive", "GAME='Install to Disk' /home/stormux/.clirc")
|
||||||
|
|
||||||
menu.add_item("System", "Internet Configuration", "GAME=\"Network Configuration\" /home/stormux/.clirc")
|
menu.add_item("System", "Internet Configuration", "GAME=\"Network Configuration\" /home/stormux/.clirc")
|
||||||
|
|||||||
Reference in New Issue
Block a user