diff --git a/build_image.sh b/build_image.sh index 363d45cfa9..251a159240 100755 --- a/build_image.sh +++ b/build_image.sh @@ -32,6 +32,8 @@ DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ DEFINE_boolean use_ubuntu_kernel $FLAGS_FALSE \ "Use the Ubuntu kernel (rather than our own)?" DEFINE_boolean replace $FLAGS_FALSE "Overwrite existing output, if any." +DEFINE_boolean increment $FLAGS_FALSE \ + "Picks the latest build and increments the minor version by one." DEFINE_string mirror "$DEFAULT_IMG_MIRROR" "Repository mirror to use." DEFINE_string suite "$DEFAULT_IMG_SUITE" "Repository suite to base image on." diff --git a/chromeos_version.sh b/chromeos_version.sh index 8a3e91ae4f..70c26912ef 100755 --- a/chromeos_version.sh +++ b/chromeos_version.sh @@ -12,30 +12,56 @@ # Version numbering scheme is much like Chrome's, with the addition of # double-incrementing branch number so trunk is always odd. -# Major/minor versions. -# Primarily for product marketing. -export CHROMEOS_VERSION_MAJOR=0 -export CHROMEOS_VERSION_MINOR=3 +# Sets up a version number for release builds. +function export_release_version { + # Major/minor versions. + # Primarily for product marketing. + export CHROMEOS_VERSION_MAJOR=0 + export CHROMEOS_VERSION_MINOR=3 -# Branch number. -# Increment by 1 in a new release branch. -# Increment by 2 in trunk after making a release branch. -# Does not reset on a major/minor change (always increases). -# (Trunk is always odd; branches are always even). -export CHROMEOS_VERSION_BRANCH=19 + # Branch number. + # Increment by 1 in a new release branch. + # Increment by 2 in trunk after making a release branch. + # Does not reset on a major/minor change (always increases). + # (Trunk is always odd; branches are always even). + export CHROMEOS_VERSION_BRANCH=19 -# Patch number. -# Increment by 1 each release on a branch. -# Reset to 0 when increasing branch number. -export CHROMEOS_VERSION_PATCH=0 + # Patch number. + # Increment by 1 each release on a branch. + # Reset to 0 when increasing branch number. + export CHROMEOS_VERSION_PATCH=0 -# Codename of this version -export CHROMEOS_VERSION_CODENAME="Indy" + # Codename of this version. + export CHROMEOS_VERSION_CODENAME="Indy" -# Version string +} + +# Sets up a version for developer builds. +function export_developer_version { + # Use an arbitrarily high number to indicate that this is a dev build. + export CHROMEOS_VERSION_MAJOR=999 + + # Use the SVN revision number of the tree here. + # TODO(rtc): Figure out how to do this. + export CHROMEOS_VERSION_MINOR=999 + + # Use the day of year and two digit year. + export CHROMEOS_VERSION_BRANCH=$(date +"%j%y") + + export CHROMEOS_VERSION_PATCH=$(date +"%H%M%S") + + # Sets the codename to the user who built the image. This + # will help us figure out who did the build if a different + # person is debugging the system. + export CHROMEOS_VERSION_CODENAME="$USER" + +} +function export_version_string { +# Version string. Not indentied to appease bash. export CHROMEOS_VERSION_STRING=\ "${CHROMEOS_VERSION_MAJOR}.${CHROMEOS_VERSION_MINOR}"\ ".${CHROMEOS_VERSION_BRANCH}.${CHROMEOS_VERSION_PATCH}" +} # Official builds must set # CHROMEOS_OFFICIAL=1 @@ -44,17 +70,29 @@ export CHROMEOS_VERSION_STRING=\ if [ ${CHROMEOS_OFFICIAL:-0} -eq 1 ] then # Official builds (i.e., buildbot) + export_release_version + export_version_string export CHROMEOS_VERSION_NAME="Chrome OS" export CHROMEOS_VERSION_TRACK="dev-channel" # CHROMEOS_REVISION must be set in the environment for official builds export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Official Build ${CHROMEOS_REVISION:?})" + export CHROMEOS_VERSION_AUSERVER="https://tools.google.com/service/update2" + export CHROMEOS_VERSION_DEVSERVER="" else # Continuous builds and developer hand-builds + export_developer_version + export_version_string export CHROMEOS_VERSION_NAME="Chromium OS" export CHROMEOS_VERSION_TRACK="developer-build" - export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build - $(date))" + export CHROMEOS_VERSION_DESCRIPTION="${CHROMEOS_VERSION_STRING} (Developer Build - $(date)-$USER)" + HOSTNAME=$(hostname) + export CHROMEOS_VERSION_AUSERVER="http://$HOSTNAME:8080/update" + export CHROMEOS_VERSION_DEVSERVER="http://$HOSTNAME:8080/static/devkit" fi -# Print version info + + +# Print version info. echo "ChromeOS version information:" set | grep "CHROMEOS_VERSION" | sed 's/^/ /' + diff --git a/customize_rootfs.sh b/customize_rootfs.sh index 73e37239d2..ca5b72c037 100755 --- a/customize_rootfs.sh +++ b/customize_rootfs.sh @@ -53,6 +53,8 @@ CHROMEOS_RELEASE_NAME=$CHROMEOS_VERSION_NAME CHROMEOS_RELEASE_TRACK=$CHROMEOS_VERSION_TRACK CHROMEOS_RELEASE_VERSION=$CHROMEOS_VERSION_STRING GOOGLE_RELEASE=$CHROMEOS_VERSION_STRING +CHROMEOS_AUSERVER=$CHROMEOS_VERSION_AUSERVER +CHROMEOS_DEVSERVER=$CHROMEOS_VERSION_DEVSERVER EOF # Set the default X11 cursor theme to inherit our cursors. @@ -168,7 +170,7 @@ $STATEFUL_PARTITION /mnt/stateful_partition |" "$INSTALL_ROOT"/etc/fstab EOF chmod 0755 /usr/sbin/chromeos-postinst -ln -s /usr/sbin/chromeos-postinst /postinst +ln -s ./usr/sbin/chromeos-postinst /postinst # make a mountpoint for stateful partition @@ -255,6 +257,7 @@ cat < /etc/acpi/events/lidbtn event=button[ /]lid action=/etc/acpi/lid.sh EOF + cat <<'EOF' > /etc/acpi/lid.sh #!/bin/sh # On lid close: diff --git a/get_latest_image.sh b/get_latest_image.sh new file mode 100755 index 0000000000..52598fad09 --- /dev/null +++ b/get_latest_image.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Copyright (c) 2009 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Prints the path to the most recently built image to stdout. + +# Load common constants. This should be the first executable line. +# The path to common.sh should be relative to your script's location. +. "$(dirname "$0")/common.sh" + +IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images" +# Default to the most recent image +DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`" + +echo $DEFAULT_FROM