OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 DEFINE_integer build_attempt 1 \ | 26 DEFINE_integer build_attempt 1 \ |
27 "The build attempt for this image build." | 27 "The build attempt for this image build." |
28 DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ | 28 DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ |
29 "Directory in which to place image result directories (named by version)" | 29 "Directory in which to place image result directories (named by version)" |
30 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ | 30 DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ |
31 "Root of build output" | 31 "Root of build output" |
32 DEFINE_boolean replace $FLAGS_FALSE "Overwrite existing output, if any." | 32 DEFINE_boolean replace $FLAGS_FALSE "Overwrite existing output, if any." |
33 DEFINE_boolean increment $FLAGS_FALSE \ | 33 DEFINE_boolean increment $FLAGS_FALSE \ |
34 "Picks the latest build and increments the minor version by one." | 34 "Picks the latest build and increments the minor version by one." |
35 | 35 |
| 36 DEFINE_string arch "x86" \ |
| 37 "The target architecture to build for. One of { x86, armel }." |
36 DEFINE_string mirror "$DEFAULT_IMG_MIRROR" "Repository mirror to use." | 38 DEFINE_string mirror "$DEFAULT_IMG_MIRROR" "Repository mirror to use." |
37 DEFINE_string suite "$DEFAULT_IMG_SUITE" "Repository suite to base image on." | 39 DEFINE_string suite "$DEFAULT_IMG_SUITE" "Repository suite to base image on." |
| 40 DEFINE_string mirror2 "" "Additional repository mirror to use (URL only)." |
| 41 DEFINE_string suite2 "" "Repository suite for additional mirror." |
38 DEFINE_string pkglist "$DEFAULT_PKGLIST" \ | 42 DEFINE_string pkglist "$DEFAULT_PKGLIST" \ |
39 "Name of file listing packages to install from repository." | 43 "Name of file listing packages to install from repository." |
40 DEFINE_boolean with_dev_pkgs $FLAGS_TRUE \ | 44 DEFINE_boolean with_dev_pkgs $FLAGS_TRUE \ |
41 "Include additional developer-friendly packages in the image." | 45 "Include additional developer-friendly packages in the image." |
42 | 46 |
43 # Parse command line | 47 # Parse command line |
44 FLAGS "$@" || exit 1 | 48 FLAGS "$@" || exit 1 |
45 eval set -- "${FLAGS_ARGV}" | 49 eval set -- "${FLAGS_ARGV}" |
46 | 50 |
47 # Die on any errors. | 51 # Die on any errors. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 # -- Install packages and customize root file system. -- | 125 # -- Install packages and customize root file system. -- |
122 PKGLIST="$FLAGS_pkglist" | 126 PKGLIST="$FLAGS_pkglist" |
123 if [ $FLAGS_with_dev_pkgs -eq $FLAGS_TRUE ]; then | 127 if [ $FLAGS_with_dev_pkgs -eq $FLAGS_TRUE ]; then |
124 PKGLIST="$PKGLIST,${SRC_ROOT}/package_repo/package-list-debug.txt" | 128 PKGLIST="$PKGLIST,${SRC_ROOT}/package_repo/package-list-debug.txt" |
125 fi | 129 fi |
126 "${SCRIPTS_DIR}/install_packages.sh" \ | 130 "${SCRIPTS_DIR}/install_packages.sh" \ |
127 --build_root="${FLAGS_build_root}" \ | 131 --build_root="${FLAGS_build_root}" \ |
128 --root="$ROOT_FS_DIR" \ | 132 --root="$ROOT_FS_DIR" \ |
129 --output_dir="${OUTPUT_DIR}" \ | 133 --output_dir="${OUTPUT_DIR}" \ |
130 --package_list="$PKGLIST" \ | 134 --package_list="$PKGLIST" \ |
| 135 --arch="$FLAGS_arch" \ |
131 --mirror="$FLAGS_mirror" \ | 136 --mirror="$FLAGS_mirror" \ |
132 --suite="$FLAGS_suite" | 137 --suite="$FLAGS_suite" \ |
| 138 --mirror2="$FLAGS_mirror2" \ |
| 139 --suite2="$FLAGS_suite2" |
133 | 140 |
134 "${SCRIPTS_DIR}/customize_rootfs.sh" --root="${ROOT_FS_DIR}" | 141 "${SCRIPTS_DIR}/customize_rootfs.sh" --root="${ROOT_FS_DIR}" |
135 | 142 |
136 # -- Turn root file system into bootable image -- | 143 # -- Turn root file system into bootable image -- |
137 | 144 |
138 # Setup extlinux configuration. | 145 # Setup extlinux configuration. |
139 # TODO: For some reason the /dev/disk/by-uuid is not being generated by udev | 146 # TODO: For some reason the /dev/disk/by-uuid is not being generated by udev |
140 # in the initramfs. When we figure that out, switch to root=UUID=$UUID. | 147 # in the initramfs. When we figure that out, switch to root=UUID=$UUID. |
141 cat <<EOF | sudo dd of="$ROOT_FS_DIR"/boot/extlinux.conf | 148 cat <<EOF | sudo dd of="$ROOT_FS_DIR"/boot/extlinux.conf |
142 DEFAULT chromeos-usb | 149 DEFAULT chromeos-usb |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 EOF | 181 EOF |
175 | 182 |
176 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}" | 183 OUTSIDE_OUTPUT_DIR="${EXTERNAL_TRUNK_PATH}/src/build/images/${IMAGE_SUBDIR}" |
177 echo "Done. Image created in ${OUTPUT_DIR}" | 184 echo "Done. Image created in ${OUTPUT_DIR}" |
178 echo "To copy to USB keyfob, outside the chroot, do something like:" | 185 echo "To copy to USB keyfob, outside the chroot, do something like:" |
179 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" | 186 echo " ./image_to_usb.sh --from=${OUTSIDE_OUTPUT_DIR} --to=/dev/sdb" |
180 echo "To convert to VMWare image, outside the chroot, do something like:" | 187 echo "To convert to VMWare image, outside the chroot, do something like:" |
181 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" | 188 echo " ./image_to_vmware.sh --from=${OUTSIDE_OUTPUT_DIR}" |
182 | 189 |
183 trap - EXIT | 190 trap - EXIT |
OLD | NEW |