]> git.proxmox.com Git - systemd.git/blob - src/kernel-install/50-depmod.install
New upstream version 242
[systemd.git] / src / kernel-install / 50-depmod.install
1 #!/bin/bash
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4
5 COMMAND="$1"
6 KERNEL_VERSION="$2"
7 ENTRY_DIR_ABS="$3"
8 KERNEL_IMAGE="$4"
9 INITRD_OPTIONS_START="5"
10
11 [[ $KERNEL_VERSION ]] || exit 1
12
13 case "$COMMAND" in
14 add)
15 [[ -d "/lib/modules/${KERNEL_VERSION}/kernel" ]] || exit 0
16 [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
17 echo "Running depmod -a ${KERNEL_VERSION}"
18 exec depmod -a "${KERNEL_VERSION}"
19 ;;
20 remove)
21 [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
22 echo "Removing /lib/modules/${KERNEL_VERSION}/modules.dep and associated files"
23 exec rm -f /lib/modules/"${KERNEL_VERSION}"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
24 ;;
25 *)
26 exit 0
27 esac