heads icon indicating copy to clipboard operation
heads copied to clipboard

whiptail: no more whiptail reseting console on call (--clear)

Open tlaurion opened this issue 3 years ago • 1 comments
trafficstars

So we have console logs to troubleshoot errors and catch them correctly


@JonathonHall-Purism linked to separate discussion.

This is useful to call scripts (eg. gui-init) from recovery shell so that scripts can be ctrl-c to see console output.

Any error should be corrected in caller scripts anyway and provide at least a warning (warn) to console.

tlaurion avatar Aug 26 '22 18:08 tlaurion

https://github.com/osresearch/heads/commit/74157de59acd32e3228ed30569a5215b1037fe35 adds the last two whiptail calls that missed my past sed call.

Will test in next batch of test, combining and rebasing on master all other PRs needing merging and report in PRs individually

tlaurion avatar Aug 31 '22 17:08 tlaurion

Further improvements of #1243: having user see errors is good. Not wiping them is better.

tlaurion avatar Nov 15 '22 16:11 tlaurion

Agree, this is great. A while back I had to send out a few custom builds just to capture some error output, this is much better. Did a few quick tests in qemu-fbwhiptail-tpm1-hotp.

JonathonHall-Purism avatar Nov 15 '22 16:11 JonathonHall-Purism

Rebased.

tlaurion avatar Nov 15 '22 20:11 tlaurion

@JonathonHall-Purism Merge? I think this will bring some corner case errors from the community we might want to join force fixing, but at least a quick video capture+screenshot extracted from it should now capture it all and help us understand what is happening quicker.

Don't hesitate proposing better approach that 2 seconds sleep on die and 1 second on warn. Alternative thought on my side was prompting user, but that is way too invasive. We could go on having a trace log under /tmp at some point as well, and an option from menu to copy logs to USB drive?

tlaurion avatar Nov 15 '22 20:11 tlaurion

I thought about pausing/prompting on die too, but I agree I think there is too much chance for false positives to go all the way there in one change. IMO let's go with the 2 seconds, get some field experience with that, and if there are no indications of false positives then consider prompting.

"Copy logs" is a good idea too, but I think this improvement already reaches the point of diminishing returns. With this change we can just ask to hit Ctrl+C and take a picture of the screen, that's a pretty low barrier to get some output. "Copy logs" would be good too but we'd probably get most of the relevant output just from this.

I did something crude once to add a "show log" to TPM reset errors that displayed the log with a pager: https://source.puri.sm/firmware/pureboot/-/compare/Release-21...support-4574?from_project_id=217 This would really need a centralized log though to be useful in general.

I say ship it! :ship:

JonathonHall-Purism avatar Nov 15 '22 20:11 JonathonHall-Purism

With this change we can just ask to hit Ctrl+C and take a picture of the screen, that's a pretty low barrier to get some output.

Unfortunately there is no such thing as Ctrl-C'ing gui-init unless you go to recovery shell then back to gui-init from there, which of course will break HOTP/TOTP/Disk unlock key "unsealed" from TPM.

So as of master, user really needs to film and extract pictures since there is no output|tee output redirection into something useful to troubleshoot anything.

But I agree not wiping console output is useful in between whiptail prompts.

Reviewing change one last time to make sure my sed didn't break anything and merging.

tlaurion avatar Nov 16 '22 01:11 tlaurion

Testing this as part of https://github.com/osresearch/heads/pull/1234#issuecomment-1317318212

Really useful! Now possible to go to recovery shell to see errors and warnings which are now still on the console.

Merging!

tlaurion avatar Nov 16 '22 17:11 tlaurion