| # Copyright (c) 2012 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 "Chromium OS debug daemon" |
| author "chromium-os-dev@chromium.org" |
| |
| start on started ui |
| stop on stopping ui or starting halt or starting reboot |
| respawn |
| |
| pre-start script |
| TRACING=/sys/kernel/debug/tracing |
| # NB: check for tracing dir in case the kernel config changes |
| if [ -d "${TRACING}" ]; then |
| # enable debugfs-access write access for systrace helper |
| for file in buffer_size_kb set_event trace trace_clock trace_marker \ |
| tracing_on; do |
| chgrp debugfs-access ${TRACING}/${file} && chmod g+w ${TRACING}/${file} |
| done |
| fi |
| # NB: only on exynos5 |
| MALI_HWC_ENABLE=/sys/class/misc/mali0/device/hwc_enable |
| if [ -f "${MALI_HWC_ENABLE}" ]; then |
| chgrp debugd ${MALI_HWC_ENABLE} && chmod g+w ${MALI_HWC_ENABLE} |
| fi |
| # NB: copy logs of stateful (re)creation / powerwash |
| cp -aP --remove-destination \ |
| /mnt/stateful_partition/unencrypted/clobber.log \ |
| /mnt/stateful_partition/unencrypted/clobber-state.log \ |
| /mnt/stateful_partition/unencrypted/preserve/powerwash_count \ |
| /var/log/ || true |
| end script |
| |
| exec /sbin/debugd |
| |