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

Subscribers

People subscribed via source and target branches