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

Make shell script output depend on log-level #85

Closed
1 of 2 tasks
0xricksanchez opened this issue Sep 1, 2022 · 0 comments
Closed
1 of 2 tasks

Make shell script output depend on log-level #85

0xricksanchez opened this issue Sep 1, 2022 · 0 comments

Comments

@0xricksanchez
Copy link
Owner

0xricksanchez commented Sep 1, 2022

There are two obvious ways to do so:

  • Depending on the log level do a sed to (un-)set the -x flag in both rootfs.sh and debugger.sh. However, this requires rebuilding the containers for the changes to take effect. Additionally, we should implement a 'watcher' that only rebuilds the containers upon changes.
  • Modify the entry point of both mentioned containers above and prepend a set -x. This does not require rebuilding and should work the same. However, this only seem to work for immediate commands, not a shell script, which is executed in another subshell itself... We would need to inherit the set options like so set -eu(x); . ./entrypoint.sh (argv). Doing that as an entrypoint in a container seems to not work out of the box... We probably need something like docker run .... <container> /bin/bash -c 'set -eu(x); source <entrypoint.sh>
@0xricksanchez 0xricksanchez changed the title Make shell script / kernel build output depend on log-level Make shell script output depend on log-level Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant