Skip to content

rpipmic: remove bashisms and use POSIX sh - #235

Merged
popcornmix merged 1 commit into
raspberrypi:masterfrom
macmpi:rpimic-sh
Nov 20, 2026
Merged

popcornmix merged 1 commit into
raspberrypi:masterfrom
macmpi:rpimic-sh

Conversation

@macmpi

@macmpi macmpi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@popcornmix

Copy link
Copy Markdown
Contributor

Thanks. The port works: I ran it under dash and bash --posix with a fake device tree and vcgencmd (reset bits set, EVT bits set, pmicrd failing) and the output and exit status match the bash version. On a Pi 5 (where /bin/sh is dash) it gives the same output as the bash version.

A few small things:

  • local (in report_bits) is not POSIX, though dash, busybox and bash all accept it. None of those variable names clash with the rest of the script, so it could simply be dropped.
  • The whole file is re-indented from spaces to tabs, which makes the diff much harder to read than the actual change. raspinfo and rpi-manufacture-info (the other #!/bin/sh scripts here) use 4 spaces, so I'd keep the spaces.
  • The comment and # shellcheck disable=SC2046 above the od loop could go: the word splitting there is plainly intended.

@timg236

timg236 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

The normal naming convention would be rpi-pmic ... to late to change?

@macmpi

macmpi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@popcornmix thanks for feedback: I hope I have addressed your comments fully in last revision.
Let me know.
Do I have to take care of the naming side too?

@popcornmix
popcornmix merged commit 2753ee4 into raspberrypi:master Nov 20, 2026
@popcornmix

Copy link
Copy Markdown
Contributor

Thanks for PR.

Do I have to take care of the naming side too?

I can handle that.

@macmpi

macmpi commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

thanks.

@macmpi
macmpi deleted the rpimic-sh branch November 20, 2026 17:56
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.

3 participants