| OLD | NEW |
| 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Trousers daemon, which talks to the TPM (or the TPM emulator). | 5 # Trousers daemon, which talks to the TPM (or the TPM emulator). |
| 6 # Started directly from tpm-probe. | 6 # Started directly from tpm-probe. |
| 7 | 7 |
| 8 # Note, this line is modified by chromeos-factoryinstall.ebuild | 8 # Note, this line is modified by chromeos-factoryinstall.ebuild |
| 9 # Please do not change without also changing this reference. | 9 # Please do not change without also changing this reference. |
| 10 stop on starting halt or starting reboot | 10 stop on starting halt or starting reboot |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 elif [ "$owned" -eq "1" ]; then | 42 elif [ "$owned" -eq "1" ]; then |
| 43 # Already owned. | 43 # Already owned. |
| 44 # Check if trousers' system.data is size zero. If so, then the TPM has | 44 # Check if trousers' system.data is size zero. If so, then the TPM has |
| 45 # been owned already and we need to copy over an empty system.data to be | 45 # been owned already and we need to copy over an empty system.data to be |
| 46 # able to use it in trousers. | 46 # able to use it in trousers. |
| 47 if [ ! -f /var/lib/tpm/system.data ] || \ | 47 if [ ! -f /var/lib/tpm/system.data ] || \ |
| 48 [ ! -s /var/lib/tpm/system.data ]; then | 48 [ ! -s /var/lib/tpm/system.data ]; then |
| 49 if [ ! -e /var/lib/tpm ]; then | 49 if [ ! -e /var/lib/tpm ]; then |
| 50 mkdir -m 0700 -p /var/lib/tpm | 50 mkdir -m 0700 -p /var/lib/tpm |
| 51 fi | 51 fi |
| 52 current_mask=$(umask) | |
| 53 umask 0177 | 52 umask 0177 |
| 54 cp --no-preserve=mode /etc/trousers/system.data.auth \ | 53 cp --no-preserve=mode /etc/trousers/system.data.auth \ |
| 55 /var/lib/tpm/system.data | 54 /var/lib/tpm/system.data |
| 56 umask 0133 | 55 umask 0133 |
| 57 touch /var/lib/.tpm_owned | 56 touch /var/lib/.tpm_owned |
| 58 umask $(current_mask) | |
| 59 fi | 57 fi |
| 60 fi | 58 fi |
| 61 fi | 59 fi |
| 62 end script | 60 end script |
| 63 | 61 |
| 64 exec /usr/sbin/tcsd | 62 exec /usr/sbin/tcsd |
| OLD | NEW |