Skip to content

Instantly share code, notes, and snippets.

@nbuchwitz
Last active March 31, 2022 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbuchwitz/ed177e23777ce4ab81fd338ca4a95ef0 to your computer and use it in GitHub Desktop.
Save nbuchwitz/ed177e23777ce4ab81fd338ca4a95ef0 to your computer and use it in GitHub Desktop.
--- /usr/bin/pictory_configcheck 2022-01-24 11:13:06.000000000 +0100
+++ /usr/bin/pictory_configcheck 2022-03-31 15:47:10.288976466 +0200
@@ -92,9 +92,11 @@
changed = False
logger.info(f"Checking device '{device['id']}' ...")
+ io_sort = lambda e: current_offset(e)
+
offset_calculated = 0
for io_type in ["inp", "out", "mem"]:
- for idx_m, memory in device[io_type].items():
+ for memory in sorted(device[io_type].values(), key=io_sort):
offset = current_offset(memory)
if offset > offset_calculated:
@nbuchwitz
Copy link
Author

First download the patch to your RevPi:

wget https://gist.githubusercontent.com/nbuchwitz/ed177e23777ce4ab81fd338ca4a95ef0/raw/f5bfe871c35083f5188ee284e4bd320e1866d258/001-patch-pictory_configcheck.patch

Then apply the patch:

sudo patch /usr/bin/pictory_configcheck < 001-patch-pictory_configcheck.patch

The output should look like this:

patching file /usr/bin/pictory_configcheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment