Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,4 @@ cython_debug/
#.idea/

*.DS_Store
OCK_Files
OCK_FilesSysReport/
66 changes: 52 additions & 14 deletions OpCore-Simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,31 +46,69 @@ def select_hardware_report(self):
print("")
print("E. Export hardware report (Recommended)")
print("")
elif os.name == "posix" and self.hardware_sniffer == "linux_internal":
print("\033[93mNote:\033[0m")
print("- Linux hardware detection will gather system information using built-in tools.")
print("- Some features may require sudo access (ACPI tables, memory details).")
print("")
print("E. Export hardware report (Recommended)")
print("")
print("Q. Quit")
print("")

user_input = self.u.request_input("Drag and drop your hardware report here (.JSON){}: ".format(" or type \"E\" to export" if self.hardware_sniffer else ""))
if user_input.lower() == "q":
self.u.exit_program()
if self.hardware_sniffer and user_input.lower() == "e":
output = self.r.run({
"args":[self.hardware_sniffer, "-e"]
})

if output[-1] != 0:
if self.hardware_sniffer == "linux_internal":
# Use built-in Linux hardware detection
from Scripts import linux_hardware_detector
detector = linux_hardware_detector.LinuxHardwareDetector()
print("")
print("Could not export the hardware report. Please export it manually using Hardware Sniffer.")
print("Gathering hardware information from Linux system...")
print("")
self.u.request_input()
return

try:
report_path = detector.export_report()
acpitables_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "SysReport", "ACPI")

report_data = self.u.read_file(report_path)
self.ac.read_acpi_tables(acpitables_dir)

print("")
print("Hardware report exported successfully!")
print("")
self.u.request_input("Press Enter to continue...")

return report_path, report_data
except Exception as e:
print("")
print(f"Error exporting hardware report: {e}")
print("You may need to run with sudo for full hardware detection.")
print("")
self.u.request_input()
continue
else:
report_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "SysReport", "Report.json")
acpitables_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "SysReport", "ACPI")

report_data = self.u.read_file(report_path)
self.ac.read_acpi_tables(acpitables_dir)
# Windows hardware sniffer
output = self.r.run({
"args":[self.hardware_sniffer, "-e"]
})

return report_path, report_data
if output[-1] != 0:
print("")
print("Could not export the hardware report. Please export it manually using Hardware Sniffer.")
print("")
self.u.request_input()
return
else:
report_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "SysReport", "Report.json")
acpitables_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "SysReport", "ACPI")

report_data = self.u.read_file(report_path)
self.ac.read_acpi_tables(acpitables_dir)

return report_path, report_data

path = self.u.normalize_path(user_input)
data = self.u.read_file(path)
Expand Down
30 changes: 30 additions & 0 deletions OpCore-Simplify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# OpCore Simplify for Linux
# This script runs the OpCore Simplify tool on Linux systems

# Get the directory where the script is located
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"

# Change to the script directory
cd "$SCRIPT_DIR"

# Check if Python 3 is installed
if ! command -v python3 &> /dev/null; then
echo "Python 3 is not installed. Please install Python 3 to run OpCore Simplify."
exit 1
fi

# Check if running with sudo for full hardware detection
if [ "$EUID" -ne 0 ]; then
echo "Note: Running without sudo. Some hardware information may be limited."
echo "For complete hardware detection (ACPI tables, memory details), run with: sudo $0"
echo ""
read -p "Press Enter to continue or Ctrl+C to exit..."
fi

# Run the main Python script
python3 OpCore-Simplify.py

# Exit with the same code as the Python script
exit $?
5 changes: 4 additions & 1 deletion Scripts/gathering_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,10 @@ def get_kernel_patches(self, patches_name, patches_url):
return []

def gather_hardware_sniffer(self):
if os_name != "Windows":
if os_name == "Linux":
# For Linux, we use built-in hardware detection
return "linux_internal"
elif os_name != "Windows":
return

self.utils.head("Gathering Files")
Expand Down
Loading