-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
machine: u-boot: Add a hacky workaround for the crc32 command #112
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #112 +/- ##
==========================================
+ Coverage 62.27% 62.40% +0.12%
==========================================
Files 53 53
Lines 3746 3756 +10
==========================================
+ Hits 2333 2344 +11
+ Misses 1413 1412 -1 ☔ View full report in Codecov by Sentry. |
Hey @Adnan-Elhammoudi, I've been thinking about #111 for a bit. I came up with this hacky "solution" to make things a bit easier. Could you give this a test, to see whether it works as well as the workaround suggested in the issue? I.e. drop the workaround you added and rerun with the bare crc32 command. tbot should print a warning about it, but make it work correctly on its own. |
b82ff91
to
a432b1a
Compare
Hey @Rahix, it works as a charm, with the bare crc32 command:
but it does not drop any warning! |
Hm, that's unexpected! Are you really sure there is no |
oh, I was on another board my bad!
but if you notice the printenv command doesn't get the value correctly! |
Hm, that's not looking right... :(
If your U-Boot prompt is
This looks very wrong... I assume this didn't happen before the fix? Maybe, just to be sure, you can run once again, but from tbot commit 910eeb7? That version should fail at In any case, it seems tbot/tbot/machine/board/uboot.py Line 351 in 910eeb7
does not get the output it expects and thus cuts it apart in the wrong location... There seems to be an additional leading character, which pushes the slicing to the left such that it includes the |
a432b1a
to
fe78bfa
Compare
So while trying to reproduce your behavior (so far I wasn't able to), I did find another inconsistency in this patch. I've fixed it now, maybe retry with the latest version of this branch to see whether this has an effect on your problem? |
it reproduces the same behavior with this commit [910eeb7(https://github.com/Rahix/tbot/commit/910eeb7a323c45da01c5b7309340d6a6f943c087)
I was using this snippet as a workaround:
no effect with this branch either tbot 0.10.7.dev13+gfe78bfa! |
Huh, okay... This is certainly not the intended behavior. Can you open an issue about the broken |
opened a new issue ticket #113 (comment) |
This makes conditional prompt overrides more ergonomic to implement: The following is now possible: override = None if moon == "waning": override = "bash#!$ " with ch.with_prompt(override): ch.do_things() Signed-off-by: Rahix <rahix@rahix.de>
The `crc32` command in U-Boot unfortunately prints the character sequence `=> ` as part of its output. This character sequence is an often used U-Boot prompt, which means tbot's prompt-searching code gets confused by `crc32` output. Unfortunately, there is no real solution to this. At least none that works universally. So to at least ease the pain a bit for people running into this, attempt automatically applying a workaround for this specific situation. Signed-off-by: Rahix <rahix@rahix.de>
Signed-off-by: Rahix <rahix@rahix.de>
fe78bfa
to
4bb67cf
Compare
Going to merge this now under the assumption that it is working well enough. If regressions are caused by this, please speak up! |
The
crc32
command in U-Boot unfortunately prints the character sequence=>
as part of its output. This character sequence is an often used U-Boot prompt, which means tbot's prompt-searching code gets confused bycrc32
output.Unfortunately, there is no real solution to this. At least none that works universally. So to at least ease the pain a bit for people running into this, attempt automatically applying a workaround for this specific situation.
Closes #111.