File: kernel_prerm.d_dkms

package info (click to toggle)
dkms 2.2.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,084 kB
  • ctags: 61
  • sloc: sh: 3,542; makefile: 195; perl: 76; python: 62
file content (20 lines) | stat: -rwxr-xr-x 630 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# We're passed the version of the kernel being installed
inst_kern=$1

if [ -x /usr/sbin/dkms ]; then
while read line; do
   name=`echo "$line" | awk '{print $1}' | sed 's/,$//'`
   vers=`echo "$line" | awk '{print $2}' | sed 's/,$//'`
   arch=`echo "$line" | awk '{print $4}' | sed 's/:$//'`
   echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
   dkms remove -m $name -v $vers -k $inst_kern -a $arch
done < <(dkms status -k $inst_kern 2>/dev/null | grep ": installed")
fi

rmdir --ignore-fail-on-non-empty \
	"/lib/modules/$inst_kern/updates/dkms" \
	"/lib/modules/$inst_kern/updates" 2>/dev/null

exit 0