| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 ;; | 250 ;; |
| 251 esac | 251 esac |
| 252 done | 252 done |
| 253 } | 253 } |
| 254 | 254 |
| 255 # Install packages from the given package-lists | 255 # Install packages from the given package-lists |
| 256 PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g') | 256 PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g') |
| 257 PKG_LIST_ARCH="$FLAGS_arch" | 257 PKG_LIST_ARCH="$FLAGS_arch" |
| 258 if [ "$PKG_LIST_ARCH" = "x86" ]; then | 258 if [ "$PKG_LIST_ARCH" = "x86" ]; then |
| 259 PKG_LIST_ARCH="i386" | 259 PKG_LIST_ARCH="i386" |
| 260 FORCE_NO_SCRIPTS="" |
| 261 else |
| 262 # For armel we forcefully disable all maintainer scripts. |
| 263 # TODO: Remove this when everything is whitelisted for all build variants. |
| 264 FORCE_NO_SCRIPTS="-o=DPkg::options::=--nodpkg_fallback" |
| 260 fi | 265 fi |
| 261 for p in $PACKAGE_LISTS; do | 266 for p in $PACKAGE_LISTS; do |
| 262 COMPONENTS=$(filter_pkgs "$p" "$PKG_LIST_ARCH") | 267 COMPONENTS=$(filter_pkgs "$p" "$PKG_LIST_ARCH") |
| 263 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ | 268 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ |
| 264 ARCH="$FLAGS_arch" apt-get --force-yes install $COMPONENTS | 269 ARCH="$FLAGS_arch" \ |
| 270 apt-get $FORCE_NO_SCRIPTS --force-yes install $COMPONENTS |
| 265 done | 271 done |
| 266 | 272 |
| 267 # Create kernel installation configuration to suppress warnings, | 273 # Create kernel installation configuration to suppress warnings, |
| 268 # install the kernel in /boot, and manage symlinks. | 274 # install the kernel in /boot, and manage symlinks. |
| 269 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/kernel-img.conf" | 275 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/kernel-img.conf" |
| 270 link_in_boot = yes | 276 link_in_boot = yes |
| 271 do_symlinks = yes | 277 do_symlinks = yes |
| 272 minimal_swap = yes | 278 minimal_swap = yes |
| 273 clobber_modules = yes | 279 clobber_modules = yes |
| 274 warn_reboot = no | 280 warn_reboot = no |
| 275 do_bootloader = no | 281 do_bootloader = no |
| 276 do_initrd = yes | 282 do_initrd = yes |
| 277 warn_initrd = no | 283 warn_initrd = no |
| 278 EOF | 284 EOF |
| 279 | 285 |
| 280 # Install the kernel. | 286 # Install the kernel. |
| 281 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive ARCH="$FLAGS_arch"\ | 287 # TODO: Support for armel kernels. |
| 282 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" | 288 if [ "$FLAGS_arch" = "x86" ]; then |
| 289 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive ARCH="$FLAGS_arch
"\ |
| 290 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" |
| 291 fi |
| 292 |
| 293 # Install optionally present rootfs static data. This can be used to blast |
| 294 # custom firmware, kernel modules, etc. onto the image. |
| 295 # TODO: Remove this hack at some point. |
| 296 LOCAL_ASSETS="${FLAGS_build_root}/${FLAGS_arch}/local_assets" |
| 297 OPTIONAL_ROOTFS_DATA="${LOCAL_ASSETS}/rootfs_data.tgz" |
| 298 if [ -f "${OPTIONAL_ROOTFS_DATA}" ]; then |
| 299 sudo tar -zxvf "${OPTIONAL_ROOTFS_DATA}" -C "${ROOT_FS_DIR}" |
| 300 fi |
| 283 | 301 |
| 284 # List all packages installed so far, since these are what the local | 302 # List all packages installed so far, since these are what the local |
| 285 # repository needs to contain. | 303 # repository needs to contain. |
| 286 # TODO: Replace with list_installed_packages.sh when it is fixed up. | 304 # TODO: Replace with list_installed_packages.sh when it is fixed up. |
| 287 dpkg --root="${ROOT_FS_DIR}" -l > \ | 305 dpkg --root="${ROOT_FS_DIR}" -l > \ |
| 288 "${OUTPUT_DIR}/package_list_installed.txt" | 306 "${OUTPUT_DIR}/package_list_installed.txt" |
| 289 | 307 |
| 290 cleanup_rootfs_mounts | 308 cleanup_rootfs_mounts |
| 291 trap - EXIT | 309 trap - EXIT |
| OLD | NEW |