blob: 8e616b0115074049a46acfa266079d45040cea9c [file] [log] [blame]
# Copyright (c) 2013 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 "Tear down swap (zram) experiment (field trial)"
author "chromium-os-dev@chromium.org"
# Run before Chrome, so Chrome can start the experiment in this boot cycle.
# Note that we do almost nothing after the first run.
start on starting ui
pre-start script
# SWAP_ENABLE_FILE indicates that swap is to be used and contains the swap
# size. If the file was created by the experiment, rather than manually via
# crosh, then SWAP_FIELD_TRIAL_FORCED also exists, to restore the original
# condition when we stop the experiment. SWAP_FIELD_TRIAL_ENROLLED is
# created when the experiment has been set up.
SWAP_ENABLE_FILE=/home/chronos/.swap_enabled
SWAP_FIELD_TRIAL_ENROLLED=/home/chronos/.swap_exp_enrolled
SWAP_FIELD_TRIAL_FORCED=/home/chronos/.swap_exp_forced
# If not enrolled into trial (or already unenrolled), nothing to do.
if [ ! -f $SWAP_FIELD_TRIAL_ENROLLED ]; then
exit 0
fi
# If forced into trial, clean up.
if [ -f $SWAP_FIELD_TRIAL_FORCED ]; then
rm -f $SWAP_ENABLE_FILE
rm -f $SWAP_FIELD_TRIAL_FORCED
fi
rm -f $SWAP_FIELD_TRIAL_ENROLLED
end script