summarylogtreecommitdiffstats
path: root/phc-intel-dkms.install
blob: 8f55c40c36bd125a57722815a697e48bb68396f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pre_upgrade() {
  if (( "$(vercmp $2 0.3.2.12.19-2)" < 0 )); then
    cd usr/lib/modules/
    for i in *; do
      if [ -f "$i/extramodules/phc-intel.ko" ]; then
        rm -f "$i/extramodules/phc-intel.ko"
        [ -d "$i/kernel" ] && depmod "$i"
      elif [ -f "$i/phc-intel.ko" ]; then
        rm -f "$i/phc-intel.ko"
        rmdir -p --ignore-fail-on-non-empty "$i"
      elif [ -f "$i/extra/phc-intel.ko" ]; then
        rm -f "$i/extra/phc-intel.ko"
        rmdir -p --ignore-fail-on-non-empty "$i/extra"
        [ -d "$i/kernel" ] && depmod "$i"
      fi
    done
  fi
}

post_upgrade() {
  if (( "$(vercmp $2 0.3.2.12.19-2)" < 0 )); then
    rm -rf usr/src/phc-intel/
    echo '===> The kernel module gets automatically built by DKMS now.'
  fi
}