| OLD | NEW |
| 1 #!/bin/sh | 1 #!/bin/sh |
| 2 | 2 |
| 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 # Default to Pacific timezone if we don't have one set | 64 # Default to Pacific timezone if we don't have one set |
| 65 ! ln -s /usr/share/zoneinfo/US/Pacific /mnt/stateful_partition/etc/localtime \ | 65 ! ln -s /usr/share/zoneinfo/US/Pacific /mnt/stateful_partition/etc/localtime \ |
| 66 > /dev/null 2>&1 | 66 > /dev/null 2>&1 |
| 67 | 67 |
| 68 # Mount some /var directories and /home | 68 # Mount some /var directories and /home |
| 69 mount -n --bind /mnt/stateful_partition/var/cache /var/cache | 69 mount -n --bind /mnt/stateful_partition/var/cache /var/cache |
| 70 mount -n --bind /mnt/stateful_partition/var/log /var/log | 70 mount -n --bind /mnt/stateful_partition/var/log /var/log |
| 71 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid vartmp /var/tmp | 71 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid vartmp /var/tmp |
| 72 mount -n --bind /mnt/stateful_partition/home /home | 72 mount -n --bind /mnt/stateful_partition/home /home |
| 73 | 73 |
| 74 # Mount stateful partition for dev packages |
| 75 # TODO(sosa@chromium.org) - Use kernel flag |
| 76 if [ -f /root/.dev_mode ] ; then |
| 77 mount -n --bind /mnt/stateful_partition/dev_image /usr/local |
| 78 fi |
| 79 |
| 74 mount -n -t tmpfs -omode=0755,nosuid varrun /var/run | 80 mount -n -t tmpfs -omode=0755,nosuid varrun /var/run |
| 75 touch /var/run/.ramfs # TODO: Is this needed? | 81 touch /var/run/.ramfs # TODO: Is this needed? |
| 76 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid varlock /var/lock | 82 mount -n -t tmpfs -omode=1777,nodev,noexec,nosuid varlock /var/lock |
| 77 touch /var/lock/.ramfs # TODO: Is this needed? | 83 touch /var/lock/.ramfs # TODO: Is this needed? |
| 78 mount -n -t tmpfs media /media | 84 mount -n -t tmpfs media /media |
| 79 | 85 |
| 80 # Some things freak out if no hostname is set. | 86 # Some things freak out if no hostname is set. |
| 81 hostname localhost | 87 hostname localhost |
| 82 | 88 |
| 83 # create salt for user data dir crypto | 89 # create salt for user data dir crypto |
| 84 mkdir -p /home/.shadow | 90 mkdir -p /home/.shadow |
| 85 SALT=/home/.shadow/salt | 91 SALT=/home/.shadow/salt |
| 86 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") & | 92 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") & |
| 87 | 93 |
| 88 # Write out uptime and disk stats pre/post startup | 94 # Write out uptime and disk stats pre/post startup |
| 89 cat /proc/uptime > /tmp/uptime-post-startup | 95 cat /proc/uptime > /tmp/uptime-post-startup |
| 90 ! cat /sys/block/sda/stat > /tmp/disk-post-startup | 96 ! cat /sys/block/sda/stat > /tmp/disk-post-startup |
| 91 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup | 97 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup |
| 92 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup | 98 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup |
| 93 | 99 |
| 94 # Always return success to avoid killing init | 100 # Always return success to avoid killing init |
| 95 exit 0 | 101 exit 0 |
| OLD | NEW |