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

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

Issue 414051: Split out installation of packages from customize_rootfs into a separate script. (Closed)
Patch Set: Created 11 years, 1 month 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/scripts/customize_rootfs.sh ('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
(Empty)
1 #!/bin/sh
2
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
5 # found in the LICENSE file.
6
7 # Sets up the chromium-based os from inside a chroot of the root fs.
8 # NOTE: This script should be called by build_image.sh. Do not run this
9 # on your own unless you know what you are doing.
10
11 set -e
12
13 # Read options from the config file created by build_image.sh.
14 echo "Reading options..."
15 cat "$(dirname $0)/customize_opts.sh"
16 . "$(dirname $0)/customize_opts.sh"
17
18 PACKAGE_LIST_FILE="${SETUP_DIR}/package-list-prod.txt"
19 PACKAGE_LIST_FILE2="${SETUP_DIR}/package-list-2.txt"
20 COMPONENTS=`cat $PACKAGE_LIST_FILE | grep -v ' *#' | grep -v '^ *$' | sed '/$/{N ;s/\n/ /;}'`
21
22 # Create the temporary apt source.list used to install packages.
23 cat <<EOF > /etc/apt/sources.list
24 deb file:"$SETUP_DIR" local_packages/
25 deb $SERVER $SUITE main restricted multiverse universe
26 EOF
27
28 # Install prod packages
29 apt-get update
30 apt-get --yes --force-yes install $COMPONENTS
31
32 # Create kernel installation configuration to suppress warnings,
33 # install the kernel in /boot, and manage symlinks.
34 cat <<EOF > /etc/kernel-img.conf
35 link_in_boot = yes
36 do_symlinks = yes
37 minimal_swap = yes
38 clobber_modules = yes
39 warn_reboot = no
40 do_bootloader = no
41 do_initrd = yes
42 warn_initrd = no
43 EOF
44
45 # NB: KERNEL_VERSION comes from customize_opts.sh
46 apt-get --yes --force-yes --no-install-recommends \
47 install "linux-image-${KERNEL_VERSION}"
48
49 # Setup bootchart. Due to dependencies, this adds about 180MB!
50 apt-get --yes --force-yes --no-install-recommends install bootchart
51 # TODO: Replace this with pybootchartgui, or remove it entirely.
52 apt-get --yes --force-yes --no-install-recommends install bootchart-java
53
54 # Install additional packages from a second mirror, if necessary. This must
55 # be done after all packages from the first repository are installed; after
56 # the apt-get update, apt-get and debootstrap will prefer the newest package
57 # versions (which are probably on this second mirror).
58 if [ -f "$PACKAGE_LIST_FILE2" ]
59 then
60 COMPONENTS2=`cat $PACKAGE_LIST_FILE2 | grep -v ' *#' | grep -v '^ *$' | sed '/ $/{N;s/\n/ /;}'`
61
62 echo "deb $SERVER2 $SUITE2 main restricted multiverse universe" \
63 >> /etc/apt/sources.list
64 apt-get update
65 apt-get --yes --force-yes --no-install-recommends \
66 install $COMPONENTS2
67 fi
68
69 # List all packages installed so far, since these are what the local
70 # repository needs to contain.
71 # TODO: better place to put the list. Must still exist after the chroot
72 # is dismounted, so build_image.sh can get it. That rules out /tmp and
73 # $SETUP_DIR (which is under /tmp).
74 sudo sh -c "/trunk/src/scripts/list_installed_packages.sh \
75 > /etc/package_list_installed.txt"
76
77 # Clean up other useless stuff created as part of the install process.
78 rm -f /var/cache/apt/archives/*.deb
79
80 # List all packages still installed post-pruning
81 sudo sh -c "/trunk/src/scripts/list_installed_packages.sh \
82 > /etc/package_list_pruned.txt"
OLDNEW
« no previous file with comments | « src/scripts/customize_rootfs.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698