Adrian revised this gist . Go to revision
1 file changed, 1 deletion
gistfile1.txt
@@ -49,6 +49,5 @@ ln -s "$BASEDIR"/mnt/vendor/etc/sensors/sns_reg_config "$HEXAGONFSDIR"/sensors/s | |||
49 | 49 | # Since that is device-specific, let's check if we have a directory for this device. | |
50 | 50 | if [ -d "$SOCINFODIR"/"$DEVICE" ] | |
51 | 51 | then | |
52 | - | set -ex | |
53 | 52 | ln -s "$SOCINFODIR"/"$DEVICE" "$HEXAGONFSDIR"/socinfo | |
54 | 53 | fi |
Adrian revised this gist . Go to revision
1 file changed, 54 insertions
gistfile1.txt(file created)
@@ -0,0 +1,54 @@ | |||
1 | + | #!/bin/sh | |
2 | + | # SPDX-License-Identifier: MIT | |
3 | + | ||
4 | + | # | |
5 | + | # This script is responsible for loading firmware blobs for the HexagonFS | |
6 | + | # on qcom devices. It assumes to be run after msm-firmware-loader. | |
7 | + | # | |
8 | + | ||
9 | + | # Base directory that msm-firmware-loader uses. | |
10 | + | BASEDIR="/lib/firmware/msm-firmware-loader" | |
11 | + | ||
12 | + | # HexagonFS base directory. | |
13 | + | HEXAGONFSDIR="/usr/share/qcom" | |
14 | + | ||
15 | + | # socinfo file base directory. | |
16 | + | SOCINFODIR="/usr/share/hexagonfs-firmware-loader" | |
17 | + | ||
18 | + | # Preparations: | |
19 | + | ||
20 | + | mount -o mode=755,nodev,noexec,nosuid,uid=fastrpc,gid=fastrpc -t tmpfs none "$HEXAGONFSDIR" | |
21 | + | ||
22 | + | mkdir "$HEXAGONFSDIR/sensors" | |
23 | + | ||
24 | + | # Get the device codename (in the form of vendor-device) from the compatible | |
25 | + | # in the devicetree. | |
26 | + | DEVICE=$(tr '\0,' '\n-' < /sys/firmware/devicetree/base/compatible | head -n1) | |
27 | + | ||
28 | + | # Symlink the files and directories from msm-firmware-loader mounts: | |
29 | + | ||
30 | + | ln -s "$BASEDIR"/mnt/vendor/etc/acdbdata "$HEXAGONFSDIR"/acdb | |
31 | + | ||
32 | + | # Some devices have a dsp partition, others have /vendor/dsp. | |
33 | + | # The ones with dsp partition have a mount point for it at /vendor/dsp, but | |
34 | + | # we don't mount it there, so we need to fall back to /vendor/dsp. | |
35 | + | if [ -d "$BASEDIR"/mnt/dsp ] | |
36 | + | then | |
37 | + | ln -s "$BASEDIR"/mnt/dsp "$HEXAGONFSDIR"/dsp | |
38 | + | else | |
39 | + | ln -s "$BASEDIR"/mnt/vendor/dsp "$HEXAGONFSDIR"/dsp | |
40 | + | fi | |
41 | + | ||
42 | + | ln -s "$BASEDIR"/mnt/vendor/etc/sensors/config "$HEXAGONFSDIR"/sensors/config | |
43 | + | ||
44 | + | ln -s "$BASEDIR"/mnt/persist/sensors/registry/registry "$HEXAGONFSDIR"/sensors/registry | |
45 | + | ||
46 | + | ln -s "$BASEDIR"/mnt/vendor/etc/sensors/sns_reg_config "$HEXAGONFSDIR"/sensors/sns_reg.conf | |
47 | + | ||
48 | + | # Some devices (hey, Xiaomi!) require a bunch of files from /sys/devices/soc0. | |
49 | + | # Since that is device-specific, let's check if we have a directory for this device. | |
50 | + | if [ -d "$SOCINFODIR"/"$DEVICE" ] | |
51 | + | then | |
52 | + | set -ex | |
53 | + | ln -s "$SOCINFODIR"/"$DEVICE" "$HEXAGONFSDIR"/socinfo | |
54 | + | fi |