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

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

Issue 500014: Modify customize_rootfs.sh to run outside of the target rootfs and to use (Closed)
Patch Set: Created 11 years 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/customize_rootfs.sh » ('j') | 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 build a bootable keyfob-based chromeos system image. 7 # Script to build a bootable keyfob-based chromeos system image.
8 # It uses debootstrap (see https://wiki.ubuntu.com/DebootstrapChroot) to 8 # It uses debootstrap (see https://wiki.ubuntu.com/DebootstrapChroot) to
9 # create a base file system. It then cusotmizes the file system and adds 9 # create a base file system. It then cusotmizes the file system and adds
10 # Ubuntu and chromeos specific packages. Finally, it creates a bootable USB 10 # Ubuntu and chromeos specific packages. Finally, it creates a bootable USB
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 # Set up bind mount for trunk, so we can get to package repository 177 # Set up bind mount for trunk, so we can get to package repository
178 # TODO: also use this instead of SETUP_DIR for other things below? 178 # TODO: also use this instead of SETUP_DIR for other things below?
179 sudo mkdir -p "$ROOT_FS_DIR/trunk" 179 sudo mkdir -p "$ROOT_FS_DIR/trunk"
180 sudo mount --bind "$GCLIENT_ROOT" "$ROOT_FS_DIR/trunk" 180 sudo mount --bind "$GCLIENT_ROOT" "$ROOT_FS_DIR/trunk"
181 181
182 # Create setup directory and copy over scripts, config files, and locally 182 # Create setup directory and copy over scripts, config files, and locally
183 # built packages. 183 # built packages.
184 mkdir -p "$SETUP_DIR" 184 mkdir -p "$SETUP_DIR"
185 mkdir -p "${SETUP_DIR}/local_packages" 185 mkdir -p "${SETUP_DIR}/local_packages"
186 cp "${SCRIPTS_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}" "$SETUP_DIR" 186 cp "${SCRIPTS_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}" "$SETUP_DIR"
187 cp "${SCRIPTS_DIR}/${ROOTFS_CUSTOMIZE_SCRIPT}" "$SETUP_DIR"
188 cp -r "$ROOTFS_STATIC_DATA" "$SETUP_DIR" 187 cp -r "$ROOTFS_STATIC_DATA" "$SETUP_DIR"
189 cp "$FLAGS_pkglist" "${SETUP_DIR}/package-list-prod.txt" 188 cp "$FLAGS_pkglist" "${SETUP_DIR}/package-list-prod.txt"
190 cp "${FLAGS_build_root}/x86/local_packages"/* "${SETUP_DIR}/local_packages" 189 cp "${FLAGS_build_root}/x86/local_packages"/* "${SETUP_DIR}/local_packages"
191 190
192 if [ -n "$FLAGS_pkglist2" ] 191 if [ -n "$FLAGS_pkglist2" ]
193 then 192 then
194 cp "$FLAGS_pkglist2" "${SETUP_DIR}/package-list-2.txt" 193 cp "$FLAGS_pkglist2" "${SETUP_DIR}/package-list-2.txt"
195 fi 194 fi
196 195
197 # Set up repository for local packages to install in the rootfs via apt-get. 196 # Set up repository for local packages to install in the rootfs via apt-get.
(...skipping 19 matching lines...) Expand all
217 SUITE2="$FLAGS_suite2" 216 SUITE2="$FLAGS_suite2"
218 EOF 217 EOF
219 # ...and all CHROMEOS_ vars 218 # ...and all CHROMEOS_ vars
220 set | egrep "^CHROMEOS_|^BUILDBOT_" >> $CUST_OPTS 219 set | egrep "^CHROMEOS_|^BUILDBOT_" >> $CUST_OPTS
221 220
222 # Run the package install script 221 # Run the package install script
223 sudo chroot "$ROOT_FS_DIR" \ 222 sudo chroot "$ROOT_FS_DIR" \
224 "${ROOTFS_SETUP_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}" 223 "${ROOTFS_SETUP_DIR}/${ROOTFS_PACKAGE_INSTALL_SCRIPT}"
225 224
226 # Run the script to customize the resulting root file system. 225 # Run the script to customize the resulting root file system.
227 sudo chroot "$ROOT_FS_DIR" "${ROOTFS_SETUP_DIR}/${ROOTFS_CUSTOMIZE_SCRIPT}" 226 "${SCRIPTS_DIR}/${ROOTFS_CUSTOMIZE_SCRIPT}" --root="${ROOT_FS_DIR}"
228 227
229 # No longer need the setup directory in the rootfs. 228 # No longer need the setup directory in the rootfs.
230 rm -rf "$SETUP_DIR" 229 rm -rf "$SETUP_DIR"
231 230
232 # Move package lists from the image into the output dir 231 # Move package lists from the image into the output dir
233 sudo mv "$ROOT_FS_DIR"/etc/package_list_*.txt "$OUTPUT_DIR" 232 sudo mv "$ROOT_FS_DIR"/etc/package_list_*.txt "$OUTPUT_DIR"
234 233
235 # Unmount mounts within the rootfs so it is ready to be imaged. 234 # Unmount mounts within the rootfs so it is ready to be imaged.
236 cleanup_rootfs_mounts 235 cleanup_rootfs_mounts
237 236
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 EOF 275 EOF
277 276
278 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}" 277 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}"
279 echo "Done. Image created in ${OUTPUT_DIR}" 278 echo "Done. Image created in ${OUTPUT_DIR}"
280 echo "To copy to USB keyfob, outside the chroot, do something like:" 279 echo "To copy to USB keyfob, outside the chroot, do something like:"
281 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" 280 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb"
282 echo "To convert to VMWare image, outside the chroot, do something like:" 281 echo "To convert to VMWare image, outside the chroot, do something like:"
283 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" 282 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}"
284 283
285 trap - EXIT 284 trap - EXIT
OLDNEW
« no previous file with comments | « no previous file | src/scripts/customize_rootfs.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698