Adds a local Autoupdate server and a mechanism for adding developer packages.

I've been getting frustrated by juggling usb sticks to constantly update my netbook so I wrote a simple
server that can run in a developer's source tree and serve updates to a netbook. I also added an upstart
task that will download a script from the dev server and run it. I use this to install sshfs, gdb, and vim.

Here's a quick heads up about what has changed. 

1. /etc/lsb-release

I added two new fields to the release file. One is the URL that should be pinged for updates. The other is the URL that can be used to download a developer setup script. 

2. chromeos_version.sh

The functionality for the release build is unchanged, however, developer builds now have a monotonically increasing version number. 

3. software-update.conf

Autoupdate is disabled when the DEV_SERVER field in /etc/lsb-release is initialized. This field won't be set on the build server, but will be set everywhere else. 

4. ping_omaha.sh

The omaha server is now configured by /etc/lsb-release

Review URL: http://chromereview.prom.corp.google.com/1175098

git-svn-id: svn://chrome-svn/chromeos/trunk@92 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
rtc@google.com 2009-10-26 22:36:21 +00:00
parent 66c440d687
commit d26178fa7e
4 changed files with 80 additions and 20 deletions

View File

@ -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."

View File

@ -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/^/ /'

View File

@ -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 <<EOF > /etc/acpi/events/lidbtn
event=button[ /]lid
action=/etc/acpi/lid.sh
EOF
cat <<'EOF' > /etc/acpi/lid.sh
#!/bin/sh
# On lid close:

17
get_latest_image.sh Executable file
View File

@ -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