ArchR DTB Overlay Generator, offline edition
============================================

Same generator as https://arch-r.io/overlay-generator/, as a terminal script.
Use this when the website cannot finish loading: the page needs an 8 MB
WebAssembly runtime, this needs about 100 KB and no network at all.

REQUIREMENT
  Python 3.5 or newer.
    Linux/macOS: already installed on almost every system. Check with
                 python3 --version
    Windows:     install from https://www.python.org/downloads/ and tick
                 "Add python.exe to PATH" during setup. Check with
                 python --version

  Nothing else. Do not run pip: the fdt library this needs is already in
  this folder.

USAGE
  Open a terminal in this folder, then:

  Linux / macOS
    python3 archr_dtbo.py rk3326-r36s-linux.dtb SDORIG -o mipi-panel.dtbo

  Windows
    python archr_dtbo.py rk3326-r36s-linux.dtb SDORIG -o mipi-panel.dtbo

  The generate.sh and generate.bat wrappers do the same thing and can be
  used instead. On Linux and macOS the wrapper may need its executable bit
  back if your unzip tool dropped it: chmod +x generate.sh

  The first argument is the DTB from your console's original firmware. The
  second is the option string for your console. The -o argument is where the
  overlay is written; without it the overlay goes to standard output.

CONSOLE OPTION STRINGS
  SDORIG        R36S Original
  SDCLONE       R36S Clone
  SDORIG-NAm    R36S Soysauce

  Append extra flags with a dash, exactly as the website builds them, for
  example SDCLONE-LSi for inverted panel lines. If you are unsure, open the
  website's generator on any working connection, choose your options, and
  copy the option string it shows.

WHAT TO DO WITH THE RESULT
  Copy the generated file to the ARCHR partition of your card, into the
  overlays folder, and name it exactly mipi-panel.dtbo:

    <ARCHR partition>/overlays/mipi-panel.dtbo

  That is the path extlinux.conf already points at (FDTOVERLAYS
  /overlays/mipi-panel.dtbo), so there is nothing else to configure. The
  folder already exists on a freshly flashed card and has a README.txt in it.
  On the running console the same file is /flash/overlays/mipi-panel.dtbo.

  The name matters. An overlay left as mipi-panel-something.dtbo, or dropped
  anywhere else, is simply not loaded, and the console boots with a blank
  screen exactly as before.

TROUBLESHOOTING
  "python: command not found" / "'python' is not recognized"
      Python is not installed or not on PATH. See REQUIREMENT above. On some
      Linux systems the command is python3, not python.

  "ModuleNotFoundError: No module named 'fdt'"
      You moved archr_dtbo.py out of this folder. Keep the script, the fdt
      folder and archr-bases together.

  "anti-gap: base not available"
      The archr-bases folder is missing or was moved. Keep it next to the
      script. The overlay is still produced, but without the mirror pass that
      fills in board details from the matching ArchR base.

CONTENTS
  archr_dtbo.py    the generator (identical to the one the website runs)
  archr-bases/     ArchR base device trees the generator mirrors from
  fdt/             device tree library, pure Python, BSD licensed
  generate.sh      convenience wrapper for Linux and macOS
  generate.bat     convenience wrapper for Windows
