mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 17:06:58 +02:00
Merge pull request #201 from philips/remove-cros-lsb-release-tool
chore(coreos/scripts): remove cros_set_lsb_release
This commit is contained in:
commit
7f554271b0
@ -1,77 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Copyright (c) 2011 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.
|
|
||||||
|
|
||||||
# Script to set /etc/lsb-release on the root file system. This script is run by
|
|
||||||
# build_image inside chroot.
|
|
||||||
|
|
||||||
readonly COMMON_SH=/usr/lib/crosutils/common.sh
|
|
||||||
if [ ! -r "${COMMON_SH}" ]; then
|
|
||||||
echo "ERROR: Run inside chroot."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
. "${COMMON_SH}"
|
|
||||||
|
|
||||||
# Flags
|
|
||||||
DEFINE_string board "" "The board to build an image for."
|
|
||||||
DEFINE_string root "" "The root file system to write /etc/lsb-release to."
|
|
||||||
|
|
||||||
# Parse command line
|
|
||||||
FLAGS "$@" || exit 1
|
|
||||||
eval set -- "${FLAGS_ARGV}"
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
ROOT_FS_DIR="$FLAGS_root"
|
|
||||||
[ -n "$ROOT_FS_DIR" ] || die "--root is required."
|
|
||||||
[ -d "$ROOT_FS_DIR" ] || die "Root FS does not exist? ($ROOT_FS_DIR)"
|
|
||||||
[ -n "${COREOS_VERSION_STRING}" ] || die "chromeos_version.sh isn't sourced."
|
|
||||||
|
|
||||||
COREOS_VERSION_NAME="CoreOS"
|
|
||||||
COREOS_VERSION_AUSERVER=\
|
|
||||||
${COREOS_VERSION_AUSERVER:-"http://$(hostname --fqdn):8080/update"}
|
|
||||||
COREOS_VERSION_DEVSERVER=\
|
|
||||||
${COREOS_VERSION_DEVSERVER:-"http://$(hostname --fqdn):8080"}
|
|
||||||
|
|
||||||
# Official builds must set COREOS_OFFICIAL=1.
|
|
||||||
if [ ${COREOS_OFFICIAL:-0} = 1 ]; then
|
|
||||||
# Official builds (i.e., buildbot)
|
|
||||||
COREOS_VERSION_TRACK="dev-channel"
|
|
||||||
COREOS_VERSION_NAME="CoreOS"
|
|
||||||
COREOS_VERSION_DESCRIPTION="${COREOS_VERSION_STRING} (Official Build) \
|
|
||||||
${COREOS_VERSION_TRACK} $FLAGS_board test"
|
|
||||||
COREOS_VERSION_AUSERVER="https://api.core-os.net/v1/update/"
|
|
||||||
COREOS_VERSION_DEVSERVER=""
|
|
||||||
elif [ "$USER" = "chrome-bot" ]; then
|
|
||||||
# Continuous builder
|
|
||||||
COREOS_VERSION_TRACK="buildbot-build"
|
|
||||||
COREOS_VERSION_DESCRIPTION="${COREOS_VERSION_STRING} (Continuous Build \
|
|
||||||
- Builder: ${BUILDBOT_BUILD:-"N/A"}) $FLAGS_board"
|
|
||||||
else
|
|
||||||
# Developer hand-builds
|
|
||||||
COREOS_VERSION_TRACK=${COREOS_VERSION_TRACK:-"developer-build"}
|
|
||||||
COREOS_VERSION_DESCRIPTION="${COREOS_VERSION_STRING} (Developer Build \
|
|
||||||
- $USER) ${COREOS_VERSION_TRACK} $FLAGS_board"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set version numbers:
|
|
||||||
# COREOS_RELEASE_BOARD is the target board identifier.
|
|
||||||
# COREOS_RELEASE_DESCRIPTION is the version displayed by Chrome; see
|
|
||||||
# chrome/browser/chromeos/chromeos_version_loader.cc.
|
|
||||||
# COREOS_RELEASE_NAME is a human readable name for the build.
|
|
||||||
# COREOS_RELEASE_TRACK and COREOS_RELEASE_VERSION are used by the software
|
|
||||||
# update service.
|
|
||||||
# TODO(skrul): Remove GOOGLE_RELEASE once Chromium is updated to look at
|
|
||||||
# COREOS_RELEASE_VERSION for UserAgent data.
|
|
||||||
sudo_append "${ROOT_FS_DIR}/etc/lsb-release" <<EOF
|
|
||||||
COREOS_RELEASE_BOARD=$FLAGS_board
|
|
||||||
COREOS_RELEASE_DESCRIPTION=$COREOS_VERSION_DESCRIPTION
|
|
||||||
COREOS_RELEASE_NAME=$COREOS_VERSION_NAME
|
|
||||||
COREOS_RELEASE_TRACK=$COREOS_VERSION_TRACK
|
|
||||||
COREOS_RELEASE_VERSION=$COREOS_VERSION_STRING
|
|
||||||
COREOS_AUSERVER=$COREOS_VERSION_AUSERVER
|
|
||||||
COREOS_DEVSERVER=$COREOS_VERSION_DEVSERVER
|
|
||||||
EOF
|
|
Loading…
Reference in New Issue
Block a user