#!/bin/sh

# Copyright (c) 2009 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.

trap '' USR1 TTOU TTIN

# Disables all the Ctrl-Alt-Fn shortcuts for switching between virtual terminals
# if we're in verified boot mode. Otherwise, disables only Fn (n>=3) keys.
MAXVT=0
if crossystem "cros_debug?1" ||
    grep -q '^chronos:[^*]' /etc/shadow; then
  # developer end-user
  MAXVT=2
fi

# The '-noreset' works around an apparent bug in the X server that
# makes us fail to boot sometimes; see http://crosbug.com/7578.
exec nice -n -20 /usr/bin/X \
    -noreset -maxvt $MAXVT -nolisten tcp vt01 -auth $1 2> /dev/null

#!/bin/sh

# Copyright (c) 2009 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.

trap '' USR1 TTOU TTIN

# Disables all the Ctrl-Alt-Fn shortcuts for switching between virtual terminals
# if we're in verified boot mode. Otherwise, disables only Fn (n>=3) keys.
MAXVT=0
# If you are editing this if-condition, please also update
# platform/init/hotkey-access.conf.
if crossystem "cros_debug?1" ||
    grep -q '^chronos:[^*]' /etc/shadow; then
  # developer end-user
  MAXVT=2
fi

# The '-noreset' works around an apparent bug in the X server that
# makes us fail to boot sometimes; see http://crosbug.com/7578.
exec nice -n -20 /usr/bin/X \
    -noreset -maxvt $MAXVT -nolisten tcp vt01 -auth $1 2> /dev/null

Add the comment about use of the duplicated logic.
Add the comment about use of the duplicated logic.

BUG=chromium:153961, chromium-os:35606
TEST=none

Change-Id: Id35aa5cb9c98cc1e4c7e782fb64a1005a286ca1d
Reviewed-on: https://gerrit.chromium.org/gerrit/37815
Reviewed-by: Seigo Nonaka <d44217c39a626f090b6c94af1c8fe1f1c45e1807@chromium.org>
Commit-Ready: Yoshiki IGUCHI <34a0efba52c941b84ff35efd1693cf46bd9ad2c4@chromium.org>
Tested-by: Yoshiki IGUCHI <34a0efba52c941b84ff35efd1693cf46bd9ad2c4@chromium.org>
