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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 # The set of required packages before apt can take over. | 167 # The set of required packages before apt can take over. |
168 PACKAGES="debconf libacl1 libattr1 libc6 libgcc1 libselinux1" | 168 PACKAGES="debconf libacl1 libattr1 libc6 libgcc1 libselinux1" |
169 | 169 |
170 # Set of packages that we need to install early so that other packages | 170 # Set of packages that we need to install early so that other packages |
171 # maintainer scripts can still basically run. | 171 # maintainer scripts can still basically run. |
172 # | 172 # |
173 # login - So that groupadd will work | 173 # login - So that groupadd will work |
174 # base-passwd/passwd - So that chmod and useradd/groupadd will work | 174 # base-passwd/passwd - So that chmod and useradd/groupadd will work |
175 # bash - So that scripts can run | 175 # bash - So that scripts can run |
176 # libpam-runtim/libuuid1 - Not exactly sure why | 176 # libpam-runtim/libuuid1 - Not exactly sure why |
177 EXTRA_PACKAGES="base-files base-passwd bash libpam-runtime libuuid1 login pass
wd" | 177 # sysv-rc - So that we can overwrite invoke-rc.d, update-rc.d |
| 178 EXTRA_PACKAGES="base-files base-passwd bash libpam-runtime libuuid1 login pass
wd sysv-rc" |
178 | 179 |
179 # Prep the rootfs to work with dpgk and apt | 180 # Prep the rootfs to work with dpgk and apt |
180 sudo mkdir -p "${ROOT_FS_DIR}/var/lib/dpkg/info" | 181 sudo mkdir -p "${ROOT_FS_DIR}/var/lib/dpkg/info" |
181 sudo touch "${ROOT_FS_DIR}/var/lib/dpkg/available" \ | 182 sudo touch "${ROOT_FS_DIR}/var/lib/dpkg/available" \ |
182 "${ROOT_FS_DIR}/var/lib/dpkg/diversions" \ | 183 "${ROOT_FS_DIR}/var/lib/dpkg/diversions" \ |
183 "${ROOT_FS_DIR}/var/lib/dpkg/status" | 184 "${ROOT_FS_DIR}/var/lib/dpkg/status" |
184 sudo mkdir -p "${ROOT_FS_DIR}/var/lib/apt/lists/partial" \ | 185 sudo mkdir -p "${ROOT_FS_DIR}/var/lib/apt/lists/partial" \ |
185 "${ROOT_FS_DIR}/var/lib/dpkg/updates" | 186 "${ROOT_FS_DIR}/var/lib/dpkg/updates" |
186 | 187 |
187 # Download the initial packages into the apt cache if necessary. | 188 # Download the initial packages into the apt cache if necessary. |
(...skipping 20 matching lines...) Expand all Loading... |
208 # to install additional critical packages. If there are any of these, we | 209 # to install additional critical packages. If there are any of these, we |
209 # disable the maintainer scripts so they install ok. | 210 # disable the maintainer scripts so they install ok. |
210 TMP_FORCE_NO_SCRIPTS="-o=Dir::Bin::dpkg=${SCRIPTS_DIR}/dpkg_no_scripts.sh" | 211 TMP_FORCE_NO_SCRIPTS="-o=Dir::Bin::dpkg=${SCRIPTS_DIR}/dpkg_no_scripts.sh" |
211 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ | 212 sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ |
212 apt-get $TMP_FORCE_NO_SCRIPTS --force-yes --fix-broken install | 213 apt-get $TMP_FORCE_NO_SCRIPTS --force-yes --fix-broken install |
213 | 214 |
214 # ----- MAINTAINER SCRIPT FIXUPS ----- | 215 # ----- MAINTAINER SCRIPT FIXUPS ----- |
215 | 216 |
216 # TODO: Remove when we stop having maintainer scripts altogether. | 217 # TODO: Remove when we stop having maintainer scripts altogether. |
217 sudo cp -a /dev/* "${ROOT_FS_DIR}/dev" | 218 sudo cp -a /dev/* "${ROOT_FS_DIR}/dev" |
| 219 sudo cp -a /etc/resolv.conf "${ROOT_FS_DIR}/etc/resolv.conf" |
| 220 sudo ln -sf /bin/true "${ROOT_FS_DIR}/usr/sbin/invoke-rc.d" |
| 221 sudo ln -sf /bin/true "${ROOT_FS_DIR}/usr/sbin/update-rc.d" |
| 222 |
| 223 # base-files |
| 224 # TODO: Careful audit of the postinst; this isn't all that is there. |
| 225 sudo cp -a "${ROOT_FS_DIR}/usr/share/base-files/networks" \ |
| 226 "${ROOT_FS_DIR}/usr/share/base-files/nsswitch.conf" \ |
| 227 "${ROOT_FS_DIR}/usr/share/base-files/profile" \ |
| 228 "${ROOT_FS_DIR}/etc/" |
218 | 229 |
219 # base-passwd | 230 # base-passwd |
220 sudo cp "${ROOT_FS_DIR}/usr/share/base-passwd/passwd.master" \ | 231 sudo cp "${ROOT_FS_DIR}/usr/share/base-passwd/passwd.master" \ |
221 "${ROOT_FS_DIR}/etc/passwd" | 232 "${ROOT_FS_DIR}/etc/passwd" |
222 sudo cp "${ROOT_FS_DIR}/usr/share/base-passwd/group.master" \ | 233 sudo cp "${ROOT_FS_DIR}/usr/share/base-passwd/group.master" \ |
223 "${ROOT_FS_DIR}/etc/group" | 234 "${ROOT_FS_DIR}/etc/group" |
224 | 235 |
225 # libpam-runtime | 236 # libpam-runtime |
226 # The postinst script calls pam-auth-update, which is a perl script that | 237 # The postinst script calls pam-auth-update, which is a perl script that |
227 # expects to run within the targetfs. Until we fix this, we just copy | 238 # expects to run within the targetfs. Until we fix this, we just copy |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" | 286 apt-get --force-yes install "linux-image-${KERNEL_VERSION}" |
276 | 287 |
277 # List all packages installed so far, since these are what the local | 288 # List all packages installed so far, since these are what the local |
278 # repository needs to contain. | 289 # repository needs to contain. |
279 # TODO: Replace with list_installed_packages.sh when it is fixed up. | 290 # TODO: Replace with list_installed_packages.sh when it is fixed up. |
280 dpkg --root="${ROOT_FS_DIR}" -l > \ | 291 dpkg --root="${ROOT_FS_DIR}" -l > \ |
281 "${OUTPUT_DIR}/package_list_installed.txt" | 292 "${OUTPUT_DIR}/package_list_installed.txt" |
282 | 293 |
283 cleanup_rootfs_mounts | 294 cleanup_rootfs_mounts |
284 trap - EXIT | 295 trap - EXIT |
OLD | NEW |