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

DO NOT MERGE: Shellcheck script files in initrd #872

Closed
wants to merge 64 commits into from

Conversation

Thrilleratplay
Copy link
Contributor

@Thrilleratplay Thrilleratplay commented Oct 26, 2020

This is an alternative approach to #862.

Instead of rewriting all BASH syntax to be POSIX, add busybox config to set CONFIG_BASH_IS_ASH=y which I believe statically links /bin/ash to /bin/bash. This combined with the existing CONFIG_ASH_BASH_COMPAT setting should allow shellcheck to the check the scripts under /initrd as closer to how they already exists and with few large changes.

While labeling these scripts as #!/bin/bash may be misleading, all scripts are read-only within the ROM and will still need to be tested before being committed in the official repo. The only problem I can foresee would be if users who try to execute BASH scripts from external media that may execute bash scripts with incompatible syntax, although, I think this is currently a possibility.

Exceptions added for:

  • SC1091 - Generally added under .shellcheckrc
  • SC2094 - initrd/init.sh
  • SC2154 - initrd/sbin/config-dhcp.sh

@osresearch @tlaurion @MrChromebox One of three possible paths:

  • I can complete this PR using BASH syntax
  • I can complete WIP: Shellcheck script files in initrd #862 using POSIX syntax with a few exceptions.
  • I can complete this PR using BASH syntax and during the long term goal of cleaning up these scripts, migrate to POSIX during this process.

@tlaurion
Copy link
Collaborator

@Thrilleratplay what is your preferate approach between #862 and here? Seems lik here wins to me.

@Thrilleratplay
Copy link
Contributor Author

Thrilleratplay commented Oct 28, 2020

@tlaurion I would probably vote for this version, fake BASH. It will likely be easier to verify the changes and run spellcheck against.

Again, this could only be a temporary solution with an long term goal of rewriting everything in POSIX.

@tlaurion
Copy link
Collaborator

tlaurion commented Nov 1, 2020

@Thrilleratplay : can you make circleCi follow your github so that automatic builds are made at each commit? This PR seems mature enough to test builds for regressions

@Thrilleratplay
Copy link
Contributor Author

@tlaurion I will try. Currently I am still testing and running into issues.

@Thrilleratplay Thrilleratplay changed the title WIP: alternative Shellcheck script files in initrd DO NOT MERGE: Shellcheck script files in initrd Nov 2, 2020
@tlaurion
Copy link
Collaborator

This is not going to work. #862 approach is preferred.

@tlaurion tlaurion closed this Jul 29, 2022
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.

2 participants