From ba43d5dab1ba653303ca4ff2fd6da34c47eee30e Mon Sep 17 00:00:00 2001 From: Jason Pell Date: Thu, 9 Jan 2025 13:56:30 +1100 Subject: [PATCH] verify that no one is attempting to flash cartographer directly on creality os or other build root based environments --- scripts/firmware.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/firmware.py b/scripts/firmware.py index 6f365f2..a102b09 100755 --- a/scripts/firmware.py +++ b/scripts/firmware.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import os +import os.path import re import subprocess import argparse @@ -2445,6 +2446,15 @@ def install(self) -> None: choices=[e.value for e in FlashMethod], # Use FlashMethod values type=lambda s: FlashMethod(s.upper()), # Convert string to FlashMethod enum ) + + if os.path.isfile('/etc/os-release'): + with open('/etc/os-release') as f: + release_info = f.read() + if 'ID=buildroot' in release_info: + print("\nFlashing is not currently supported on Build Root OS such as Creality OS. Exiting...") + print("Please follow this https://github.com/pellcorp/creality/wiki/Flashing-Carto-Firmware-on-Ubuntu") + exit(1) + try: args = parser.parse_args(namespace=FirmwareNamespace()) Utils.configure_logging()