#!/usr/bin/bash # # Rebuild the speaker-amplifier module for each new kernel. # # snd-soc-wsa881x is not in any Fedora package (see c630-wsa881x), so it lives # in /lib/modules//extra and has to be rebuilt whenever a kernel is # installed. Without this the speakers go silent the first time you run # `dnf upgrade`, and nothing in the logs connects the two events. # # This runs at 96, after 95-c630-devicetree, because it must not come between # 90-loaderentry.install — which rewrites the BLS entry — and the hook that # puts the devicetree line back. # # It always exits 0. kernel-install stops at the first plugin that fails, and # this machine has already been bitten once by that: a full /boot made # 50-dracut.install fail, which meant 95-c630-devicetree never ran, which left # a boot entry with neither an initrd nor a devicetree. Silent speakers are # worth a warning; they are not worth an unbootable machine. set -u COMMAND="${1:?}" KERNEL_VERSION="${2:?}" [ "$COMMAND" = "add" ] || exit 0 if ! command -v c630-wsa881x >/dev/null; then exit 0 fi if ! c630-wsa881x "$KERNEL_VERSION"; then echo "96-c630-wsa881x: could not build snd-soc-wsa881x for ${KERNEL_VERSION};" \ "the built-in speakers will be silent on that kernel until you run" \ "'sudo c630-wsa881x ${KERNEL_VERSION}'" >&2 fi exit 0