summarylogtreecommitdiffstats
path: root/decklink.install
blob: f7cf4932ad8bf9e2aa235c6c2639bfda59532806 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
## arg 1:  the new package version
pre_install() {
  true
}

## arg 1:  the new package version
post_install() {
  ldconfig

  cd /usr/src/blackmagic-${1%%-*}*
  make
  install -D -m 0644 blackmagic.ko "/lib/modules/$(uname -r)/kernel/drivers"
  make clean

  cd /usr/src/blackmagic-io-${1%%-*}*
  make
  install -D -m 0644 blackmagic-io.ko "/lib/modules/$(uname -r)/kernel/drivers"
  install -D -m 0644 snd_blackmagic-io.ko "/lib/modules/$(uname -r)/kernel/drivers"

  echo ">>> Updating module dependencies. Please wait..."
  depmod -a

  echo ">>> Loading modules..."
  modprobe blackmagic
  modprobe blackmagic-io
  modprobe snd_blackmagic-io

  update-desktop-database -q
}

## arg 1:  the new package version
## arg 2:  the old package version
pre_upgrade() {
  lsmod | grep blackmagic && modprobe -r blackmagic || true
  rm -f "/lib/modules/*/kernel/drivers/blackmagic.ko"
}

## arg 1:  the new package version
## arg 2:  the old package version
post_upgrade() {
  post_install $1
}

## arg 1:  the old package version
pre_remove() {
  lsmod | grep blackmagic && modprobe -r blackmagic || true
}

## arg 1:  the old package version
post_remove() {
  rm -f "/lib/modules/*/kernel/drivers/blackmagic.ko"
}

# vim:set ts=2 sw=2 et: