]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/kernel-install/50-depmod.install
kernel-install: add --verbose
[thirdparty/systemd.git] / src / kernel-install / 50-depmod.install
CommitLineData
8f51399e
HH
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
7061e4ca
ZJS
5COMMAND="$1"
6KERNEL_VERSION="$2"
7BOOT_DIR_ABS="$3"
8KERNEL_IMAGE="$4"
9INITRD_OPTIONS_START="5"
8f51399e 10
7061e4ca
ZJS
11[[ $KERNEL_VERSION ]] || exit 1
12
13case "$COMMAND" in
301fb519 14 add)
7061e4ca 15 [[ -d "/lib/modules/${KERNEL_VERSION}/kernel" ]] || exit 0
7054308a
ZJS
16 [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
17 echo "Running depmod -a ${KERNEL_VERSION}"
7061e4ca 18 exec depmod -a "${KERNEL_VERSION}"
301fb519
YW
19 ;;
20 remove)
7054308a
ZJS
21 [ "$KERNEL_INSTALL_VERBOSE" -gt 0 ] && \
22 echo "Removing /lib/modules/${KERNEL_VERSION}/modules.dep and associated files"
7061e4ca 23 exec rm -f /lib/modules/"${KERNEL_VERSION}"/modules.{alias{,.bin},builtin.bin,dep{,.bin},devname,softdep,symbols{,.bin}}
301fb519
YW
24 ;;
25 *)
26 exit 0
27esac