OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 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 customize the root file system after packages have been installed. | 7 # Script to customize the root file system after packages have been installed. |
8 # | 8 # |
9 # NOTE: This is currently a dumping ground for for a bunch of hacks, some of | 9 # NOTE: This is currently a dumping ground for for a bunch of hacks, some of |
10 # which are to work around the fact that we are trying not to modify the base | 10 # which are to work around the fact that we are trying not to modify the base |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 # Flags | 22 # Flags |
23 DEFINE_string target "x86" \ | 23 DEFINE_string target "x86" \ |
24 "The target architecture to build for. One of { x86, arm }." | 24 "The target architecture to build for. One of { x86, arm }." |
25 DEFINE_string board "" \ | 25 DEFINE_string board "" \ |
26 "The board to build an image for." | 26 "The board to build an image for." |
27 DEFINE_string root "" \ | 27 DEFINE_string root "" \ |
28 "The root file system to customize." | 28 "The root file system to customize." |
29 DEFINE_boolean withdev $FLAGS_TRUE \ | 29 DEFINE_boolean withdev $FLAGS_TRUE \ |
30 "Include useful developer friendly utilities in the image." | 30 "Include useful developer friendly utilities in the image." |
31 DEFINE_string factory_server "" \ | |
32 "Build a factory install image pointing to given server." | |
33 | 31 |
34 # Parse command line | 32 # Parse command line |
35 FLAGS "$@" || exit 1 | 33 FLAGS "$@" || exit 1 |
36 eval set -- "${FLAGS_ARGV}" | 34 eval set -- "${FLAGS_ARGV}" |
37 | 35 |
38 # Die on any errors. | 36 # Die on any errors. |
39 set -e | 37 set -e |
40 | 38 |
41 . "${SCRIPTS_DIR}/chromeos_version.sh" | 39 . "${SCRIPTS_DIR}/chromeos_version.sh" |
42 | 40 |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 # where CHROMEOS_REVISION is set | 262 # where CHROMEOS_REVISION is set |
265 if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then | 263 if [ ${CHROMEOS_OFFICIAL:-0} = 1 ]; then |
266 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Buil
d ${CHROMEOS_REVISION:?})" | 264 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Buil
d ${CHROMEOS_REVISION:?})" |
267 elif [ "$USER" = "chrome-bot" ] | 265 elif [ "$USER" = "chrome-bot" ] |
268 then | 266 then |
269 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Continuous Bu
ild ${CHROMEOS_REVISION:?} - Builder: ${BUILDBOT_BUILD:-"N/A"})" | 267 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Continuous Bu
ild ${CHROMEOS_REVISION:?} - Builder: ${BUILDBOT_BUILD:-"N/A"})" |
270 else | 268 else |
271 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Bui
ld ${CHROMEOS_REVISION:?} - $(date) - $USER)" | 269 export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Bui
ld ${CHROMEOS_REVISION:?} - $(date) - $USER)" |
272 fi | 270 fi |
273 | 271 |
274 if [ -n "$FLAGS_factory_server" ]; then | |
275 CHROMEOS_VERSION_AUSERVER="$FLAGS_factory_server" | |
276 CHROMEOS_VERSION_DEVSERVER="" | |
277 fi | |
278 | |
279 # Set google-specific version numbers: | 272 # Set google-specific version numbers: |
280 # CHROMEOS_RELEASE_BOARD is the target board identifier. | 273 # CHROMEOS_RELEASE_BOARD is the target board identifier. |
281 # CHROMEOS_RELEASE_CODENAME is the codename of the release. | 274 # CHROMEOS_RELEASE_CODENAME is the codename of the release. |
282 # CHROMEOS_RELEASE_DESCRIPTION is the version displayed by Chrome; see | 275 # CHROMEOS_RELEASE_DESCRIPTION is the version displayed by Chrome; see |
283 # chrome/browser/chromeos/chromeos_version_loader.cc. | 276 # chrome/browser/chromeos/chromeos_version_loader.cc. |
284 # CHROMEOS_RELEASE_NAME is a human readable name for the build. | 277 # CHROMEOS_RELEASE_NAME is a human readable name for the build. |
285 # CHROMEOS_RELEASE_TRACK and CHROMEOS_RELEASE_VERSION are used by the software | 278 # CHROMEOS_RELEASE_TRACK and CHROMEOS_RELEASE_VERSION are used by the software |
286 # update service. | 279 # update service. |
287 # TODO(skrul): Remove GOOGLE_RELEASE once Chromium is updated to look at | 280 # TODO(skrul): Remove GOOGLE_RELEASE once Chromium is updated to look at |
288 # CHROMEOS_RELEASE_VERSION for UserAgent data. | 281 # CHROMEOS_RELEASE_VERSION for UserAgent data. |
289 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/lsb-release" | 282 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/lsb-release" |
290 CHROMEOS_RELEASE_BOARD=$FLAGS_board | 283 CHROMEOS_RELEASE_BOARD=$FLAGS_board |
291 CHROMEOS_RELEASE_CODENAME=$CHROMEOS_VERSION_CODENAME | 284 CHROMEOS_RELEASE_CODENAME=$CHROMEOS_VERSION_CODENAME |
292 CHROMEOS_RELEASE_DESCRIPTION=$CHROMEOS_VERSION_DESCRIPTION | 285 CHROMEOS_RELEASE_DESCRIPTION=$CHROMEOS_VERSION_DESCRIPTION |
293 CHROMEOS_RELEASE_NAME=$CHROMEOS_VERSION_NAME | 286 CHROMEOS_RELEASE_NAME=$CHROMEOS_VERSION_NAME |
294 CHROMEOS_RELEASE_TRACK=$CHROMEOS_VERSION_TRACK | 287 CHROMEOS_RELEASE_TRACK=$CHROMEOS_VERSION_TRACK |
295 CHROMEOS_RELEASE_VERSION=$CHROMEOS_VERSION_STRING | 288 CHROMEOS_RELEASE_VERSION=$CHROMEOS_VERSION_STRING |
296 GOOGLE_RELEASE=$CHROMEOS_VERSION_STRING | 289 GOOGLE_RELEASE=$CHROMEOS_VERSION_STRING |
297 CHROMEOS_AUSERVER=$CHROMEOS_VERSION_AUSERVER | 290 CHROMEOS_AUSERVER=$CHROMEOS_VERSION_AUSERVER |
298 CHROMEOS_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER | 291 CHROMEOS_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER |
299 EOF | 292 EOF |
300 | 293 |
301 if [ -n "$FLAGS_factory_server" ]; then | |
302 cat <<EOF | sudo dd of="${ROOT_FS_DIR}/etc/lsb-release" \ | |
303 oflag=append conv=notrunc | |
304 FACTORY_INSTALL=1 | |
305 HTTP_SERVER_OVERRIDE=true | |
306 EOF | |
307 sudo sed -i '/CHROMEOS_DEVSERVER=/d' "${ROOT_FS_DIR}/etc/lsb-release" | |
308 # Remove ui.conf startup script, which will make sure chrome doesn't | |
309 # run, since it tries to update on startup | |
310 sudo rm -f "${ROOT_FS_DIR}/etc/init/ui.conf" | |
311 # Set network to start up another way | |
312 sudo sed -i 's/login-prompt-ready/stopping startup/' \ | |
313 "${ROOT_FS_DIR}/etc/init/dump-boot-stats.conf" | |
314 fi | |
315 | |
316 # We need to replace /etc/pulse/client.conf and /etc/pulse/default.pa with our | 294 # We need to replace /etc/pulse/client.conf and /etc/pulse/default.pa with our |
317 # own versions. | 295 # own versions. |
318 # | 296 # |
319 # TODO(ajwong): Find a way to override the default pulseaudio config files, | 297 # TODO(ajwong): Find a way to override the default pulseaudio config files, |
320 # ideally in an ebuild. | 298 # ideally in an ebuild. |
321 sudo mv "${ROOT_FS_DIR}/etc/pulse/client-cros.conf" \ | 299 sudo mv "${ROOT_FS_DIR}/etc/pulse/client-cros.conf" \ |
322 "${ROOT_FS_DIR}/etc/pulse/client.conf" | 300 "${ROOT_FS_DIR}/etc/pulse/client.conf" |
323 sudo mv "${ROOT_FS_DIR}/etc/pulse/default-cros.pa" \ | 301 sudo mv "${ROOT_FS_DIR}/etc/pulse/default-cros.pa" \ |
324 "${ROOT_FS_DIR}/etc/pulse/default.pa" | 302 "${ROOT_FS_DIR}/etc/pulse/default.pa" |
325 | 303 |
(...skipping 12 matching lines...) Expand all Loading... |
338 QEMU="qemu-i386" | 316 QEMU="qemu-i386" |
339 ;; | 317 ;; |
340 *) | 318 *) |
341 error "Unable to determine ARCH from toolchain: $CHOST" | 319 error "Unable to determine ARCH from toolchain: $CHOST" |
342 exit 1 | 320 exit 1 |
343 esac | 321 esac |
344 cp "/usr/bin/${QEMU}" "${ROOT_FS_DIR}/tmp" | 322 cp "/usr/bin/${QEMU}" "${ROOT_FS_DIR}/tmp" |
345 sudo mkdir -p "${ROOT_FS_DIR}/usr/share/fontconfig" | 323 sudo mkdir -p "${ROOT_FS_DIR}/usr/share/fontconfig" |
346 sudo chroot "${ROOT_FS_DIR}" "/tmp/${QEMU}" /usr/bin/fc-cache -f | 324 sudo chroot "${ROOT_FS_DIR}" "/tmp/${QEMU}" /usr/bin/fc-cache -f |
347 rm "${ROOT_FS_DIR}/tmp/${QEMU}" | 325 rm "${ROOT_FS_DIR}/tmp/${QEMU}" |
OLD | NEW |