POSIX compatible shells should provide `sh`

Idea proposal 💡

Checks

NOTE: The below check boxes must be checked before the accompanying idea will be considered.

  • I have checked that the idea is not directly tied to a specific project For example: "Show label icons in the package overview web page" must be a feature request in the ArchWeb repository
  • I have carefully checked this idea is not already covered by any open or closed ideas.
  • I understand that I hold no copyright claims and that this idea can be adapted and used by Arch Linux in any arbitrary shape or form.

Summary

Have all POSIX compatible shells provide 2 packages:

  • <shell> that provides the shell itself
  • <shell>-sh that provides a symlink at /usr/bin/sh to the shell (with a dep on <shell>)

Motivation

Currently the only package providing sh is bash (possibly some AUR packages as well) and that is shipped in the same packages as the shell itself. Which makes it somewhat redundant to have a provides sh, as any other shell that provides it would cause the uninstallation of bash (to my understanding at least) and considering how much relies on bash specifically, this is likely unwanted. Manually overriding /usr/bin/sh would cause an update to override it again, while /usr/local/bin/sh is never used in scripts.

The original case where I had the motiviation for this is building an image with mkosi and I was looking for ways to minimize the size of the initrd by using dash. Ignoring that systemd currently requires bash (does it actually?), this would most likely have been the first hurdle to actually doing this.

While this mostly is about bash, I wanted to bring it up here as it would have a bit wider of an effect on not just POSIX shells but also dependencies of sh.

Specification

The plan would be to first split out the sh symlink from bash to a separate bash-sh package, from then any of the other POSIX shells could start to provide sh by having a split package that packages only the symlink (and I guess any auxilary files that it specifically needs for when running as sh).

To actually make good use of this it would also probably be need to check packages that depend on bash if they can actually be changed to depend on sh instead. The same would also need to be done for packages that depend on sh, to make sure they don't actually require bash.