Files
scoutfs/scripts/50-scoutfs-kernel-install.sh
2026-03-27 17:03:52 -05:00

39 lines
861 B
Bash

#!/bin/bash
#
# ScoutFS kernel-install plugin for RHEL 8/9 and systemd-based systems
#
# Installed to: /usr/lib/kernel/install.d/50-scoutfs.install
#
# On RHEL 8/9, kernel packages use kernel-install(8) instead of the
# Debian-style /etc/kernel/postinst.d/ hooks. This plugin bridges
# to the scoutfs-kernel-hook script.
#
# Called by kernel-install with: COMMAND KERNEL_VERSION BOOT_DIR_OR_ENTRY
#
COMMAND="${1:-}"
KVER="${2:-}"
if [ -z "$KVER" ]; then
exit 0
fi
HOOK_SCRIPT="/etc/kernel/postinst.d/scoutfs"
case "$COMMAND" in
add)
if [ -x "$HOOK_SCRIPT" ]; then
"$HOOK_SCRIPT" "$KVER" || true
fi
;;
remove)
REMOVE_HOOK="/etc/kernel/postrm.d/scoutfs"
if [ -x "$REMOVE_HOOK" ]; then
"$REMOVE_HOOK" "$KVER" || true
fi
;;
esac
# Never block kernel operations
exit 0