| # Copyright 2020 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "Check if rmtfs is available early" |
| author "dianders@chromium.org" |
| |
| start on started startup |
| task |
| oom score -100 # Short task at startup; don't oom kill |
| |
| # If the /dev/qcom_rmtfs_mem1 and the remoteproc state exist already then the |
| # modem is builtin to the kernel. Make sure access permissions are right |
| # and emit the signal that rmtfs doesn't need to wait for udev to run. |
| # |
| # NOTE: these two files match what's in rmtfs.conf |
| script |
| if [ -e /dev/qcom_rmtfs_mem1 ] && \ |
| [ -e /sys/bus/platform/drivers/qcom-q6v5-mss/[0-9]*/remoteproc/remoteproc*/state ]; then |
| chmod 0660 /dev/qcom_rmtfs_mem1; |
| chgrp rmtfs /dev/qcom_rmtfs_mem1 |
| /sbin/initctl emit --no-wait rmtfs-early |
| fi |
| end script |