Description: Use the Debian-packaged MicroPython firmware by default
 During repacking of the upstream source, we remove the 2 embedded copies of
 the upstream-provided MicroPython runtime. Here we ensure that the MicroPython
 firmware provided in package firmware-microbit-micropython{,-dl} is used by
 default.
Author: Nick Morrott <knowledgejunkie@gmail.com>
Forwarded: not-needed
Last-Update: 2018-12-19
---
--- a/uflash.py
+++ b/uflash.py
@@ -28,6 +28,9 @@
 except ImportError:  # pragma: no cover
     can_minify = False
 
+# The default Debian runtime is provided in firmware-microbit-micropython{,-dl}
+DEFAULT_RUNTIME_PATH = "/usr/share/firmware-microbit-micropython/firmware.hex"
+
 #: The magic start address in flash memory for a Python script.
 _SCRIPT_ADDR = 0x3e000
 
@@ -319,11 +322,15 @@
     elif python_script:
         python_hex = hexlify(python_script, minify)
 
-    runtime = _RUNTIME
+    runtime = ''
     # Load the hex for the runtime.
     if path_to_runtime:
         with open(path_to_runtime) as runtime_file:
             runtime = runtime_file.read()
+    else:
+        with open(DEFAULT_RUNTIME_PATH) as runtime_file:
+            runtime = runtime_file.read()
+
     # Generate the resulting hex file.
     micropython_hex = embed_hex(runtime, python_hex)
     # Find the micro:bit.
