OLD | NEW |
1 #!/bin/sh | 1 #!/bin/sh |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 HAS_INITRAMFS=0 | 7 HAS_INITRAMFS=0 |
8 if [ -d /dev/.initramfs ] | 8 if [ -d /dev/.initramfs ] |
9 then | 9 then |
10 # The initrd will have mounted /sys, /proc, and /dev for us. | 10 # The initrd will have mounted /sys, /proc, and /dev for us. |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 mkdir -p -m 0755 /mnt/stateful_partition/etc | 56 mkdir -p -m 0755 /mnt/stateful_partition/etc |
57 mkdir -p -m 0755 /mnt/stateful_partition/var/cache | 57 mkdir -p -m 0755 /mnt/stateful_partition/var/cache |
58 mkdir -p -m 0755 /mnt/stateful_partition/var/empty | 58 mkdir -p -m 0755 /mnt/stateful_partition/var/empty |
59 mkdir -p -m 0755 /mnt/stateful_partition/var/lib | 59 mkdir -p -m 0755 /mnt/stateful_partition/var/lib |
60 mkdir -p -m 0755 /mnt/stateful_partition/var/lock | 60 mkdir -p -m 0755 /mnt/stateful_partition/var/lock |
61 mkdir -p -m 0755 /mnt/stateful_partition/var/log | 61 mkdir -p -m 0755 /mnt/stateful_partition/var/log |
62 mkdir -p -m 0755 /mnt/stateful_partition/var/tmp | 62 mkdir -p -m 0755 /mnt/stateful_partition/var/tmp |
63 mkdir -p -m 0755 /mnt/stateful_partition/var/run | 63 mkdir -p -m 0755 /mnt/stateful_partition/var/run |
64 chmod 0755 /mnt/stateful_partition/var | 64 chmod 0755 /mnt/stateful_partition/var |
65 | 65 |
| 66 # Directory for ChromeOS metrics collection |
| 67 mkdir -p -m 0755 /mnt/stateful_partition/var/log/metrics |
| 68 chown chronos:chronos /mnt/stateful_partition/var/log/metrics |
| 69 |
66 # Default to Pacific timezone if we don't have one set | 70 # Default to Pacific timezone if we don't have one set |
67 ! ln -s /usr/share/zoneinfo/US/Pacific /mnt/stateful_partition/etc/localtime \ | 71 ! ln -s /usr/share/zoneinfo/US/Pacific /mnt/stateful_partition/etc/localtime \ |
68 > /dev/null 2>&1 | 72 > /dev/null 2>&1 |
69 | 73 |
70 # Mount some /var directories and /home | 74 # Mount some /var directories and /home |
71 mount -n --bind /mnt/stateful_partition/var /var | 75 mount -n --bind /mnt/stateful_partition/var /var |
72 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid vartmp /var/tmp | 76 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid vartmp /var/tmp |
73 mount -n --bind /mnt/stateful_partition/home /home | 77 mount -n --bind /mnt/stateful_partition/home /home |
74 | 78 |
75 # Mount stateful partition for dev packages | 79 # Mount stateful partition for dev packages |
(...skipping 17 matching lines...) Expand all Loading... |
93 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") & | 97 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") & |
94 | 98 |
95 # Write out uptime and disk stats pre/post startup | 99 # Write out uptime and disk stats pre/post startup |
96 cat /proc/uptime > /tmp/uptime-post-startup | 100 cat /proc/uptime > /tmp/uptime-post-startup |
97 ! cat /sys/block/sda/stat > /tmp/disk-post-startup | 101 ! cat /sys/block/sda/stat > /tmp/disk-post-startup |
98 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup | 102 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup |
99 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup | 103 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup |
100 | 104 |
101 # Always return success to avoid killing init | 105 # Always return success to avoid killing init |
102 exit 0 | 106 exit 0 |
OLD | NEW |