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

Side by Side Diff: src/scripts/image_to_usb.sh

Issue 1017001: Add installation of stateful partition to scripts (Closed)
Patch Set: Merge changes Created 10 years, 9 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 | « src/platform/installer/chromeos-install ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
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 # Script to convert the output of build_image.sh to a usb image. 7 # Script to convert the output of build_image.sh to a usb image.
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 sudo losetup -d "${STATEFUL_LOOP_DEV}" 127 sudo losetup -d "${STATEFUL_LOOP_DEV}"
128 echo "Cleaned" 128 echo "Cleaned"
129 fi 129 fi
130 } 130 }
131 131
132 function install_autotest { 132 function install_autotest {
133 echo "Detecting autotest at ${AUTOTEST_SRC}" 133 echo "Detecting autotest at ${AUTOTEST_SRC}"
134 if [ -d ${AUTOTEST_SRC} ] 134 if [ -d ${AUTOTEST_SRC} ]
135 then 135 then
136 local stateful_loop_dev=$(sudo losetup -f) 136 local stateful_loop_dev=$(sudo losetup -f)
137 local stateful_root="${STATEFUL_DIR}/dev_image"
137 if [ -z "${stateful_loop_dev}" ] 138 if [ -z "${stateful_loop_dev}" ]
138 then 139 then
139 echo "No free loop device. Free up a loop device or reboot. exiting." 140 echo "No free loop device. Free up a loop device or reboot. exiting."
140 exit 1 141 exit 1
141 fi 142 fi
142 trap do_cleanup INT TERM EXIT 143 trap do_cleanup INT TERM EXIT
143 STATEFUL_LOOP_DEV=$stateful_loop_dev 144 STATEFUL_LOOP_DEV=$stateful_loop_dev
144 echo "Mounting ${STATEFUL_DIR} loopback" 145 echo "Mounting ${STATEFUL_DIR} loopback"
145 sudo losetup "${stateful_loop_dev}" "${STATEFUL_DIR}.image" 146 sudo losetup "${stateful_loop_dev}" "${STATEFUL_DIR}.image"
146 sudo mount "${stateful_loop_dev}" "${STATEFUL_DIR}" 147 sudo mount "${stateful_loop_dev}" "${STATEFUL_DIR}"
147 148
148 echo -ne "Install autotest into stateful partition..." 149 echo -ne "Install autotest into stateful partition..."
149 local autotest_client="/home/autotest-client" 150 local autotest_client="/home/autotest-client"
150 sudo mkdir -p "${STATEFUL_DIR}${autotest_client}" 151 sudo mkdir -p "${stateful_root}/${autotest_client}"
151 sudo cp -fpru ${AUTOTEST_SRC}/client/* \ 152 sudo cp -fpru ${AUTOTEST_SRC}/client/* \
152 "${STATEFUL_DIR}${autotest_client}" 153 » "${stateful_root}/${autotest_client}"
153 sudo chmod 755 "${STATEFUL_DIR}${autotest_client}" 154 sudo chmod 755 "${stateful_root}/${autotest_client}"
154 sudo chown -R 1000:1000 "${STATEFUL_DIR}${autotest_client}" 155 sudo chown -R 1000:1000 "${stateful_root}/${autotest_client}"
155 156
156 sudo umount ${STATEFUL_DIR} 157 sudo umount ${STATEFUL_DIR}
157 sudo losetup -d "${stateful_loop_dev}" 158 sudo losetup -d "${stateful_loop_dev}"
158 trap - INT TERM EXIT 159 trap - INT TERM EXIT
159 else 160 else
160 echo "/usr/local/autotest under ${DEFAULT_CHROOT_DIR} is not installed." 161 echo "/usr/local/autotest under ${DEFAULT_CHROOT_DIR} is not installed."
161 echo "Please call make_autotest.sh inside chroot first." 162 echo "Please call make_autotest.sh inside chroot first."
162 exit -1 163 exit -1
163 fi 164 fi
164 } 165 }
165 166
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 echo "Done. To copy to USB keyfob, outside the chroot, do something like:" 258 echo "Done. To copy to USB keyfob, outside the chroot, do something like:"
258 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M" 259 echo " sudo dd if=${FLAGS_to} of=/dev/sdb bs=4M"
259 echo "where /dev/sdb is the entire keyfob." 260 echo "where /dev/sdb is the entire keyfob."
260 if [ ${INSIDE_CHROOT} -eq 1 ] 261 if [ ${INSIDE_CHROOT} -eq 1 ]
261 then 262 then
262 echo "NOTE: Since you are currently inside the chroot, and you'll need to" 263 echo "NOTE: Since you are currently inside the chroot, and you'll need to"
263 echo "run dd outside the chroot, the path to the USB image will be" 264 echo "run dd outside the chroot, the path to the USB image will be"
264 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/usb.img)." 265 echo "different (ex: ~/chromeos/trunk/src/build/images/SOME_DIR/usb.img)."
265 fi 266 fi
266 fi 267 fi
OLDNEW
« no previous file with comments | « src/platform/installer/chromeos-install ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698