Skip to content

90-loaderentry-fallback.install contains bashisms

Running reinstall-kernels command I get the following errors:

/usr/lib/kernel/install.d/90-loaderentry-fallback.install: 32: [[: not found
/usr/lib/kernel/install.d/90-loaderentry-fallback.install: 65: [[: not found

Turns out 90-loaderentry-fallback.install execution shell specified as !/bin/sh, but the script itself contains commands which are bashisms (i.e. specific only for bash). These are the double square brackets on the line 32 and 65:

[[ -f /etc/kernel-install-for-dracut.conf ]] && source /etc/kernel-install-for-dracut.conf
[[ ${NO_DRACUT_FALLBACK} == "true" ]] && exit 0

There are two possible solutions to solve this problem:

  1. Change the script's execution shell to !/bin/bash
  2. Rewrite these commands to be compatible with other shells

Here is also the output of the command

checkbashisms /usr/lib/kernel/install.d/90-loaderentry-fallback.install
possible bashism in /usr/lib/kernel/install.d/90-loaderentry-fallback.install line 32 (should be '.', not 'source'):
[[ -f /etc/kernel-install-for-dracut.conf ]] && source /etc/kernel-install-for-dracut.conf
possible bashism in /usr/lib/kernel/install.d/90-loaderentry-fallback.install line 32 (alternative test command ([[ foo ]] should be [ foo ])):
[[ -f /etc/kernel-install-for-dracut.conf ]] && source /etc/kernel-install-for-dracut.conf
possible bashism in /usr/lib/kernel/install.d/90-loaderentry-fallback.install line 65 (alternative test command ([[ foo ]] should be [ foo ])):
[[ ${NO_DRACUT_FALLBACK} == "true" ]] && exit 0
possible bashism in /usr/lib/kernel/install.d/90-loaderentry-fallback.install line 65 (should be 'b = a'):
[[ ${NO_DRACUT_FALLBACK} == "true" ]] && exit 0

My system is EndeavourOS (based on Arch Linux) with systemd-boot and dracut (default installation).
And steps to reproduce this problem:

  • Set default shell to dash (you can install dashbinsh from AUR on Arch Linux)
  • Run reinstall-kernels
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information