Files
Arch-R/projects
Douglas Teles cceafdaca0 pacman: rewrite /usr/sbin/bash shebangs to /usr/bin/bash
Upstream pacman ships pacman-key, makepkg, vercmp and friends as bash
scripts whose shebang is built against the configured sbindir (/usr/sbin
on Arch). Arch ships /usr/sbin as a symlink to /usr/bin via the usrmerge
package, so the shebang resolves fine. ArchR (LibreELEC heritage)
does NOT merge sbin: /usr/sbin is a real directory and bash lives at
/usr/bin/bash only. Result on a fresh boot:

  archr:~ # pacman-key --init
  -sh: /usr/bin/pacman-key: /usr/sbin/bash: bad interpreter: No such
  file or directory

which also makes the pacman-init.service silently miss the keyring
populate step.

Post-install pass that rewrites every "#!/usr/sbin/bash" first line
to "#!/usr/bin/bash" anywhere under ${INSTALL}/usr fixes the lot in
one shot. The pkg.tar.zst we ship in the repo will need the same
treatment, but that's handled at build time too because gen-pacman-repo
packages whatever install_pkg holds.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-24 01:51:41 -03:00
..