Skip to content
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

Add DEBUG statements in code and fix "sh: argument expected" #1317

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

tlaurion
Copy link
Collaborator

@tlaurion tlaurion commented Feb 18, 2023

As noted under #1316, it is sometimes difficult to isolate source of errors/diagnose problems.

This PR introduces:


In current debugging state, we can see that reported #1316 can be isolated under:
2023-02-18-125731

@tlaurion tlaurion marked this pull request as draft February 18, 2023 18:03
@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 18, 2023

A little bit clearer. Also permits newcomers to simply export CONFIG_DEBUG in board configs to see trace of function calls
2023-02-18-144240

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 18, 2023

In current state:

2023-02-18-153403

So prior of main gui-init loop

@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 18, 2023

2023-02-18-155206

While 5d30c2b fd6daeb 5fbbbbc#diff-9A66E05586B37D4779EE1EB88802E759
is the actual fix.

@JonathonHall-Purism let me know what you want to do with that introduced bug! ( I think those 2 commits bundled under this PR is fine, but if you disagree, I can split debug and fix in different PR. Just thought it was nice to show here how a bug like this can be debugged in the future by adding more DEBUG statements in code to be ran on qemu and/or enabled on user computer by injecting config.user overlay through menu options and/or minimal debug functionality from recovery shell by typing CONFIG_DEBUG_CONSOLE=y to not persist on reboot. )

@tlaurion tlaurion marked this pull request as ready for review February 18, 2023 21:19
@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 18, 2023

Tested:

  • With and without export CONFIG_DEBUG_CONSOLE
  • Needs Librem testing (bug showed when $CONFIG_AUTO_BOOT_TIMEOUT not exposed) (@JonathonHall-Purism )

@tlaurion tlaurion changed the title WiP : add DEBUG statements in code and fix "sh: argument expected" Add DEBUG statements in code and fix "sh: argument expected" Feb 18, 2023
@tlaurion tlaurion mentioned this pull request Feb 18, 2023
49 tasks
@tlaurion tlaurion force-pushed the fix-sh_argument_expected branch 2 times, most recently from f59f347 to c894870 Compare February 19, 2023 02:34
…NFIG_DEBUG_OUTPUT is exported in board config

-qemu-coreboot-*whiptail-tpm1(-hotp) boards have 'export CONFIG_DEBUG_OUTPUT=y' by default now
tlaurion added a commit to tlaurion/heads that referenced this pull request Feb 19, 2023
…, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.

Includes linuxboot#1317, linuxboot#1121, linuxboot#1312, linuxboot#1305 for test on daily driver
tlaurion added a commit to tlaurion/heads that referenced this pull request Feb 19, 2023
…ix-sh_argument_expected-yubikey-oem-factory-reset_dasharo-flashrom

Daily driver test fo x230-hotp-maximized on coreboot 4.19, with debug, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.
    Includes linuxboot#1317, linuxboot#1121, linuxboot#1312, linuxboot#1305, linuxboot#1251 for test on daily driver
tlaurion referenced this pull request in tlaurion/heads Feb 19, 2023
…ix-sh_argument_expected-yubikey-oem-factory-reset_dasharo-flashrom

Daily driver test fo x230-hotp-maximized on coreboot 4.19, with debug, yubikey test regression for oem-factory-reset, optimized for space (03-O2->Os) and fix for sh: argument expected, with local CONFIG_DEBUG_OUTPUT enabled and fused in ROM.
    Includes osresearch#1317, osresearch#1121, osresearch#1312, osresearch#1305, osresearch#1251 for test on daily driver
@tlaurion
Copy link
Collaborator Author

Using x230-hotp-maximized from CircleCI builds as of now. Nothing to report as of now as regression.

- Add TRACE function tracing output under etc/functions, depending on CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT enabled in board configs
- Replace current DEBUG to TRACE calls in code, reserving DEBUG calls for more verbose debugging later on (output of variables etc)
- add 'export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=y' in qemu-coreboot(fb)whiptail-tpm1(-hotp) boards to see it in action
@tlaurion
Copy link
Collaborator Author

tlaurion commented Feb 20, 2023

Latest commit gives following output when 'export CONFIG_ENABLE_FUNCTION_TRACING_OUTPUT=y' enabled under board config

(OP edited)

2023-02-20-114415

@JonathonHall-Purism ready for merging?

@JonathonHall-Purism
Copy link
Collaborator

This looks great, thanks let's merge 👍

@tlaurion tlaurion merged commit 8b479b0 into linuxboot:master Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sh: argument expected
2 participants