[PATCH 2/2] bbremote: decode bytes output of getenv and md on command line

Ahmad Fatoum a.fatoum at pengutronix.de
Wed Dec 11 23:19:28 PST 2024


That way the output of

  scripts/bbremote  --port /dev/ttyUSB10  md /dev/zero 0 4

is 00000000 instead of b'00000000'.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 scripts/remote/main.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/remote/main.py b/scripts/remote/main.py
index 020a78c3fcb0..4bc855616ae3 100644
--- a/scripts/remote/main.py
+++ b/scripts/remote/main.py
@@ -71,7 +71,7 @@ def handle_getenv(args):
     if not value:
         res = 1
     else:
-        print(value)
+        print(value.decode())
         res = 0
     ctrl.close()
     return res
@@ -81,7 +81,7 @@ def handle_md(args):
     ctrl = get_controller(args)
     (res,data) = ctrl.md(args.path, args.address, args.size)
     if res == 0:
-        print(binascii.hexlify(data))
+        print(binascii.hexlify(data).decode())
     ctrl.close()
     return res
 
-- 
2.39.5




More information about the barebox mailing list