Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: src/platform/init/chromeos_startup

Issue 1784006: Changes to image_to_live to copy stateful partition over (Closed) Base URL: ssh://git@chromiumos-git//chromeos
Patch Set: Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/scripts/image_to_live.sh » ('j') | src/scripts/image_to_live.sh » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 # Check if the stateful partition has requested self-destruction 44 # Check if the stateful partition has requested self-destruction
45 # This is used for the factory install process 45 # This is used for the factory install process
46 RESET_FILE="/mnt/stateful_partition/factory_install_reset" 46 RESET_FILE="/mnt/stateful_partition/factory_install_reset"
47 if [ -f "$RESET_FILE" ]; then 47 if [ -f "$RESET_FILE" ]; then
48 if [ $(stat -c%u "$RESET_FILE") -eq 0 ]; then 48 if [ $(stat -c%u "$RESET_FILE") -eq 0 ]; then
49 echo "Erasing stateful partition..." 49 echo "Erasing stateful partition..."
50 exec /sbin/clobber-state 50 exec /sbin/clobber-state
51 fi 51 fi
52 fi 52 fi
53 53
54 # Check if we have an update to stateful pending. This is used for dev_mode.
55 VAR_NEW="/mnt/stateful_partition/var_new"
56 DEVELOPER_NEW="/mnt/stateful_partition/dev_image_new"
57 STATEFUL_UPDATE="/mnt/stateful_partition/.update_available"
58 if [ -f "$STATEFUL_UPDATE" ] ; then
59 sudo rm -rf /mnt/stateful_partition/dev_image
60 sudo rm -rf /mnt/stateful_partition/var
61 sudo mv "$DEVELOPER_NEW" /mnt/stateful_partition/dev_image
62 sudo mv "$VAR_NEW" /mnt/stateful_partition/var
63 sudo rm $STATEFUL_UPDATE
64 fi
65
54 # Make sure stateful partition has some basic directories 66 # Make sure stateful partition has some basic directories
55 mkdir -p -m 0755 /mnt/stateful_partition/home 67 mkdir -p -m 0755 /mnt/stateful_partition/home
56 mkdir -p -m 0755 /mnt/stateful_partition/etc 68 mkdir -p -m 0755 /mnt/stateful_partition/etc
57 mkdir -p -m 0755 /mnt/stateful_partition/var/cache 69 mkdir -p -m 0755 /mnt/stateful_partition/var/cache
58 mkdir -p -m 0755 /mnt/stateful_partition/var/empty 70 mkdir -p -m 0755 /mnt/stateful_partition/var/empty
59 mkdir -p -m 0755 /mnt/stateful_partition/var/lib 71 mkdir -p -m 0755 /mnt/stateful_partition/var/lib
60 mkdir -p -m 0755 /mnt/stateful_partition/var/lock 72 mkdir -p -m 0755 /mnt/stateful_partition/var/lock
61 mkdir -p -m 0755 /mnt/stateful_partition/var/log 73 mkdir -p -m 0755 /mnt/stateful_partition/var/log
62 mkdir -p -m 0755 /mnt/stateful_partition/var/tmp 74 mkdir -p -m 0755 /mnt/stateful_partition/var/tmp
63 mkdir -p -m 0755 /mnt/stateful_partition/var/run 75 mkdir -p -m 0755 /mnt/stateful_partition/var/run
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") & 109 (test -f "$SALT" || head -c 16 /dev/urandom > "$SALT") &
98 110
99 # Write out uptime and disk stats pre/post startup 111 # Write out uptime and disk stats pre/post startup
100 cat /proc/uptime > /tmp/uptime-post-startup 112 cat /proc/uptime > /tmp/uptime-post-startup
101 ! cat /sys/block/sda/stat > /tmp/disk-post-startup 113 ! cat /sys/block/sda/stat > /tmp/disk-post-startup
102 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup 114 echo "$PRE_UPTIME_STAT" > /tmp/uptime-pre-startup
103 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup 115 echo "$PRE_DISK_STAT" > /tmp/disk-pre-startup
104 116
105 # Always return success to avoid killing init 117 # Always return success to avoid killing init
106 exit 0 118 exit 0
OLDNEW
« no previous file with comments | « no previous file | src/scripts/image_to_live.sh » ('j') | src/scripts/image_to_live.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698