-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathenable-ov5645.sh
More file actions
executable file
·32 lines (26 loc) · 941 Bytes
/
enable-ov5645.sh
File metadata and controls
executable file
·32 lines (26 loc) · 941 Bytes
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
#!/bin/bash
BOOTIMG=${1:-/dev/disk/by-partlabel/boot}
DT_ROOT=`dirname $0`/../..
DBOOTIMG=`which dbootimg`
DBOOTIMG=${DBOOTIMG:-${DT_ROOT}/tools/dbootimg/dbootimg}
DTBTOOL=`which dtbtool`
DTBTOOL=${DTBTOOL:-${DT_ROOT}/tools/dtbtool/dtbtool}
# Check DTB already has camera subsystem node present
${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camss@1b00000 -p > /dev/null
if [ "$?" -ne 0 ]; then
echo "Failed to enable ov5645, no camss node, upgrade your bootimg."
exit 1
fi
# Check rear camera node is already defined
${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -n camera_rear@3b -p > /dev/null
if [ "$?" -ne 0 ]; then
echo "Failed to enable ov5645, no rear camera node, upgrade your bootimg."
return -1
fi
${DBOOTIMG} ${BOOTIMG} -x dtb | ${DTBTOOL} -m `dirname $0`/overlays/db410c-ov5645.dtbo | ${DBOOTIMG} ${BOOTIMG} -u dtb
if [ "$?" -ne 0 ]; then
echo "Failed to update DTB"
exit 1
fi
echo "ov5645 enabled, please reboot"
sync