From f41fd0907f5ae0073bd06e7b2b681dff66dede73 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Tue, 26 Aug 2025 15:03:17 -0400 Subject: [PATCH] Create .baremetal file on internal system. Hide install to disk if already installed. --- home/stormux/Documents/change_log.md | 1 + usr/local/bin/game_launcher.py | 4 ++-- usr/local/bin/install_to_disk.sh | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/home/stormux/Documents/change_log.md b/home/stormux/Documents/change_log.md index 7b007a1..2d02254 100644 --- a/home/stormux/Documents/change_log.md +++ b/home/stormux/Documents/change_log.md @@ -5,6 +5,7 @@ Dates are given for the image. All items listed are available for the listed ima ## September 1, 2025 +- Create ~/.baremetal file on installed to disk systems. Allows hiding install to disk option and easily tell if system was booted from usb or internal disk - Major review and fixes to help files. Added getting started and upload server help files - Updated xlibre stack. Required almost total reinstall because of some package naming issues in the AUR - Made booting from USB image with image also installed to internal hard drive much more reliable diff --git a/usr/local/bin/game_launcher.py b/usr/local/bin/game_launcher.py index 3e67a8d..952cfdf 100755 --- a/usr/local/bin/game_launcher.py +++ b/usr/local/bin/game_launcher.py @@ -1083,8 +1083,8 @@ if __name__ == "__main__": # Add system section menu.add_section("System") - # Add installer only on x86_64 - if platform.machine() == "x86_64": + # Add installer only on x86_64 and if not already installed (no .baremetal file) + if platform.machine() == "x86_64" and not os.path.exists("/home/stormux/.baremetal"): 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") diff --git a/usr/local/bin/install_to_disk.sh b/usr/local/bin/install_to_disk.sh index 4684172..1a429e6 100755 --- a/usr/local/bin/install_to_disk.sh +++ b/usr/local/bin/install_to_disk.sh @@ -355,6 +355,13 @@ if sudo mount "$TARGET_ROOT_PART" "$TEMP_MOUNT" 2>/dev/null; then # Remove any USB-specific markers sudo rm -f "$TEMP_MOUNT/home/stormux/.firstboot" 2>/dev/null || true + # Create .baremetal marker file to indicate installed system + echo "Creating baremetal system marker..." + sudo touch "$TEMP_MOUNT/home/stormux/.baremetal" + sudo chown stormux:stormux "$TEMP_MOUNT/home/stormux/.baremetal" 2>/dev/null || true + # Set immutable attribute to prevent accidental deletion + sudo chattr +i "$TEMP_MOUNT/home/stormux/.baremetal" 2>/dev/null || echo "Warning: Could not set immutable attribute on .baremetal" + # Update /etc/fstab with new UUIDs if [[ ${#uuid_mappings[@]} -gt 0 ]]; then update_fstab_uuids "$TEMP_MOUNT" "${uuid_mappings[@]}"