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 install packages into the target root file system. | 7 # Script to install packages into the target root file system. |
8 # | 8 # |
9 # NOTE: This script should be called by build_image.sh. Do not run this | 9 # NOTE: This script should be called by build_image.sh. Do not run this |
10 # on your own unless you know what you are doing. | 10 # on your own unless you know what you are doing. |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 # Set up mounts for working within the rootfs. We copy some basic | 208 # Set up mounts for working within the rootfs. We copy some basic |
209 # network information from the host so that maintainer scripts can | 209 # network information from the host so that maintainer scripts can |
210 # access the network as needed. | 210 # access the network as needed. |
211 # TODO: All of this rootfs mount stuff can be removed as soon as we stop | 211 # TODO: All of this rootfs mount stuff can be removed as soon as we stop |
212 # running the maintainer scripts on install. | 212 # running the maintainer scripts on install. |
213 sudo mount -t proc proc "${ROOT_FS_DIR}/proc" | 213 sudo mount -t proc proc "${ROOT_FS_DIR}/proc" |
214 sudo cp /etc/hosts "${ROOT_FS_DIR}/etc" | 214 sudo cp /etc/hosts "${ROOT_FS_DIR}/etc" |
215 trap cleanup_rootfs_mounts EXIT | 215 trap cleanup_rootfs_mounts EXIT |
216 | 216 |
217 # Install prod packages | 217 # Install prod packages |
218 COMPONENTS=`cat $FLAGS_package_list | grep -v ' *#' | grep -v '^ *$' | sed '/$/{
N;s/\n/ /;}'` | 218 COMPONENTS=`cat $FLAGS_package_list | sed -e 's/#.*//' | grep -v '^ *$' | sed '/
$/{N;s/\n/ /;}'` |
219 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ | 219 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ |
220 apt-get --force-yes install $COMPONENTS | 220 apt-get --force-yes install $COMPONENTS |
221 | 221 |
222 # Create kernel installation configuration to suppress warnings, | 222 # Create kernel installation configuration to suppress warnings, |
223 # install the kernel in /boot, and manage symlinks. | 223 # install the kernel in /boot, and manage symlinks. |
224 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/kernel-img.conf" | 224 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/kernel-img.conf" |
225 link_in_boot = yes | 225 link_in_boot = yes |
226 do_symlinks = yes | 226 do_symlinks = yes |
227 minimal_swap = yes | 227 minimal_swap = yes |
228 clobber_modules = yes | 228 clobber_modules = yes |
229 warn_reboot = no | 229 warn_reboot = no |
230 do_bootloader = no | 230 do_bootloader = no |
231 do_initrd = yes | 231 do_initrd = yes |
232 warn_initrd = no | 232 warn_initrd = no |
233 EOF | 233 EOF |
234 | 234 |
235 # Install the kernel. | 235 # Install the kernel. |
236 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ | 236 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ |
237 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" | 237 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" |
238 | 238 |
239 # List all packages installed so far, since these are what the local | 239 # List all packages installed so far, since these are what the local |
240 # repository needs to contain. | 240 # repository needs to contain. |
241 # TODO: Replace with list_installed_packages.sh when it is fixed up. | 241 # TODO: Replace with list_installed_packages.sh when it is fixed up. |
242 dpkg --root="${ROOT_FS_DIR}" -l > \ | 242 dpkg --root="${ROOT_FS_DIR}" -l > \ |
243 "${OUTPUT_DIR}/package_list_installed.txt" | 243 "${OUTPUT_DIR}/package_list_installed.txt" |
244 | 244 |
245 cleanup_rootfs_mounts | 245 cleanup_rootfs_mounts |
246 trap - EXIT | 246 trap - EXIT |
OLD | NEW |