Merge ~kchsieh/ipu6-camera-hal/+git/packaging:main into ~oem-solutions-engineers/ipu6-camera-hal/+git/packaging:main

Proposed by Kai-Chuan Hsieh
Status: Merged
Approved by: Shih-Yuan Lee
Approved revision: d49809d082be6c7c24ba362a2c090c437f1257a3
Merged at revision: 1c986a792f98cc46d4bed218d306a3ac291d9052
Proposed branch: ~kchsieh/ipu6-camera-hal/+git/packaging:main
Merge into: ~oem-solutions-engineers/ipu6-camera-hal/+git/packaging:main
Diff against target: 60 lines (+54/-0)
1 file modified
debian/libcamhal-ipu6ep-common.preinst (+54/-0)
Reviewer Review Type Date Requested Status
Shih-Yuan Lee Approve
Review via email: mp+454096@code.launchpad.net

Commit message

debian: Add libcamhal-ipu6ep-common script to remove contents

Description of the change

Files under etc should be removed from filesystem and dpkg-divert, since the package will be obsoleted.

To post a comment you must log in.
Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/libcamhal-ipu6ep-common.preinst b/debian/libcamhal-ipu6ep-common.preinst
0new file mode 1006440new file mode 100644
index 0000000..4fd6af1
--- /dev/null
+++ b/debian/libcamhal-ipu6ep-common.preinst
@@ -0,0 +1,54 @@
1#!/bin/bash
2# preinst script for libcamhal-ipu6ep-common
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9# * <new-preinst> `install'
10# * <new-preinst> `install' <old-version>
11# * <new-preinst> `upgrade' <old-version>
12# * <old-preinst> `abort-upgrade' <new-version>
13# for details, see https://www.debian.org/doc/debian-policy/ or
14# the debian-policy package
15
16
17case "$1" in
18 install|upgrade)
19 CPU_MODALIAS_PATH="/sys/devices/system/cpu/modalias"
20 CPU_MODALIAS=$(cat "${CPU_MODALIAS_PATH}")
21 CPU_FAMILY="${CPU_MODALIAS:23:4}"
22 if [ "${CPU_FAMILY}" != "0006" ]; then
23 echo "The cpu family is not supported"
24 exit 0
25 fi
26 CPU_MODEL="${CPU_MODALIAS:30:4}"
27 case "$CPU_MODEL" in
28 ('008C' | '008D' | '009A' | '00BA' | '00AA') # TGL + ADL + RPL + MTL
29 if [ -e /etc/modprobe.d/v4l2-relayd.conf ]; then
30 rm /etc/modprobe.d/v4l2-relayd.conf
31 dpkg-divert --rename --remove /etc/modprobe.d/v4l2-relayd.conf
32 fi
33 if [ -e /lib/udev/rules.d/72-intel-mipi-ipu6-camera.rules ]; then
34 rm /lib/udev/rules.d/72-intel-mipi-ipu6-camera.rules
35 dpkg-divert --rename --remove /lib/udev/rules.d/72-intel-mipi-ipu6-camera.rules
36 fi
37 if [ -e /etc/v4l2-relayd ]; then
38 rm /etc/v4l2-relayd
39 dpkg-divert --rename --remove /etc/v4l2-relayd
40 fi
41 ;;
42 *) # default
43 echo "The platform is not supported"
44 ;;
45 esac
46 ;;
47esac
48
49# dh_installdeb will replace this with shell code automatically
50# generated by other debhelper scripts.
51
52#DEBHELPER#
53
54exit 0

Subscribers

People subscribed via source and target branches