Merge pull request #189 from philips/new-update-files

fix(build_library): create /usr/share/coreos files
This commit is contained in:
Greg Kroah-Hartman 2014-03-13 02:50:52 +00:00
commit 9b300e6240

View File

@ -12,7 +12,7 @@ SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
PRODUCTION_DEFAULT=
if [[ "${COREOS_OFFICIAL:-0}" -eq 1 ]]; then
PRODUCTION_DEFAULT="dev-channel"
PRODUCTION_DEFAULT="alpha"
fi
# Flags
@ -33,11 +33,18 @@ ROOT_FS_DIR="$FLAGS_root"
COREOS_VERSION_NAME="CoreOS"
if [[ -n "${FLAGS_production_track}" ]]; then
if [[ "${$FLAGS_board}" == "amd64-usr" ]]; then
FLAGS_production_track="alpha"
fi
COREOS_VERSION_TRACK="${FLAGS_production_track}"
COREOS_VERSION_DESCRIPTION="${COREOS_VERSION_STRING} (Official Build) \
${COREOS_VERSION_TRACK} $FLAGS_board test"
if [[ "${FLAGS_production_track}" != "sdk" ]]; then
if [[ "${$FLAGS_board}" == "amd64-usr" ]]; then
COREOS_VERSION_AUSERVER="https://public.roller.core-os.net/v1/update/"
else
COREOS_VERSION_AUSERVER="https://api.core-os.net/v1/update/"
fi
else
COREOS_VERSION_AUSERVER=""
fi
@ -51,6 +58,7 @@ else
: ${COREOS_VERSION_DEVSERVER:="http://$(hostname --fqdn):8080"}
fi
# TODO(marineam): come up with a way to support continous integration builds,
# this would provide all the bells and whistles for 'master' branch images.
#elif [ "$USER" = "chrome-bot" ]; then
@ -100,3 +108,14 @@ PRETTY_NAME="$COREOS_VERSION_NAME $COREOS_VERSION_DESCRIPTION"
ANSI_COLOR="1;32"
HOME_URL="http://www.coreos.com/"
EOF
# Create the defaults for the coreos configuration files in the usr directory
sudo mkdir -p "${ROOT_FS_DIR}/usr/share/coreos"
sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/release" <<EOF
COREOS_RELEASE_VERSION=$COREOS_VERSION_STRING
EOF
sudo_clobber "${ROOT_FS_DIR}/usr/share/coreos/update.conf" <<EOF
SERVER=$COREOS_VERSION_AUSERVER
GROUP=$COREOS_VERSION_TRACK
EOF