2020-03-04 10:35:06 +01:00
|
|
|
#!/usr/bin/env bash
|
2013-04-30 18:01:47 +02:00
|
|
|
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
|
|
|
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
|
|
|
|
2019-03-07 17:18:31 +01:00
|
|
|
COMMAND="$1"
|
|
|
|
KERNEL_VERSION="$2"
|
2019-03-08 15:37:35 +01:00
|
|
|
ENTRY_DIR_ABS="$3"
|
2019-03-07 17:18:31 +01:00
|
|
|
KERNEL_IMAGE="$4"
|
|
|
|
INITRD_OPTIONS_START="5"
|
2013-04-30 18:01:47 +02:00
|
|
|
|
2019-03-07 17:18:31 +01:00
|
|
|
[[ $KERNEL_VERSION ]] || exit 1
|
|
|
|
|
|
|
|
case "$COMMAND" in
|
2017-04-21 20:03:17 +02:00
|
|
|
add)
|
2019-03-07 17:18:31 +01:00
|
|
|
[[ -d "/lib/modules/${KERNEL_VERSION}/kernel" ]] || exit 0
|
2019-03-07 20:49:30 +01:00
|
|
|
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
|
|
|
|
echo "Running depmod -a ${KERNEL_VERSION}"
|
2019-03-07 17:18:31 +01:00
|
|
|
exec depmod -a "${KERNEL_VERSION}"
|
2017-04-21 20:03:17 +02:00
|
|
|
;;
|
|
|
|
remove)
|
2019-03-07 20:49:30 +01:00
|
|
|
[ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
|
|
|
|
echo "Removing /lib/modules/${KERNEL_VERSION}/modules.dep and associated files"
|
2019-03-07 17:18:31 +01:00
|
|
|
exec rm -f /lib/modules/"${KERNEL_VERSION}"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
|
2017-04-21 20:03:17 +02:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 0
|
|
|
|
esac
|