blob: 85c824be93f26dac3ef8f215d9c677540924ae78 [file] [log] [blame]
# Copyright 2020 The ChromiumOS Authors
# 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
# On modems which support modemfwd, do not trigger rmtfs-early. modemfwd will start rmtfs.
status modemfwd || /sbin/initctl emit --no-wait rmtfs-early
fi
end script