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

od: Avoid subshell in rcS and rcK #104

Draft
wants to merge 1 commit into
base: opendingux
Choose a base branch
from

Conversation

glebm
Copy link

@glebm glebm commented Dec 16, 2022

We previously used ( ... ) subprocess for each init script to prevent the exit command from exiting rcS/K.

Instead, define the EXIT=return in rcS/K and use ${EXIT:-exit} in the scripts instead of the exit command.

${EXIT:-exit} will expand to exit if $EXIT is not set, allowing these scripts to be called directly as well.

This only applies to system scripts. We still use subshells in S99localscripts.sh to avoid breaking any user scripts.

NEEDS TESTING

We previously used `( ... )` subprocess for each init script
to prevent the `exit` command from exiting `rcS/K`.

Instead, define the `EXIT=return` in `rcS/K` and use `${EXIT:-exit}`
in the scripts instead of the `exit` command.

`${EXIT:-exit}` will expand to `exit` if `$EXIT` is not set,
allowing these scripts to be called directly as well.

This only applies to system scripts. We still use subshells
in `S99localscripts.sh` to avoid breaking any user scripts.

Signed-off-by: Gleb Mazovetskiy <[email protected]>
@glebm glebm marked this pull request as draft December 16, 2022 17:00
@glebm
Copy link
Author

glebm commented Dec 17, 2022

Confirmed that this boots on rg350m and gets all the way to "Spawning getty..."

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.

1 participant