mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
fix(build_image): Only use 'alpha' group in official builds.
This commit is contained in:
parent
4a0e4de834
commit
add4519021
21
build_image
21
build_image
@ -17,6 +17,11 @@ restart_in_chroot_if_needed "$@"
|
||||
|
||||
assert_not_root_user
|
||||
|
||||
DEFAULT_GROUP=developer
|
||||
if [[ ${COREOS_OFFICIAL:-0} -eq 1 ]]; then
|
||||
DEFAULT_GROUP=alpha
|
||||
fi
|
||||
|
||||
# Developer-visible flags.
|
||||
DEFINE_string board "${DEFAULT_BOARD}" \
|
||||
"The board to build an image for."
|
||||
@ -28,8 +33,8 @@ DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
||||
"Directory in which to place image result directories (named by version)"
|
||||
DEFINE_string disk_layout "base" \
|
||||
"The disk layout type to use for this image."
|
||||
DEFINE_string prod_group "" \
|
||||
"The update group for production images."
|
||||
DEFINE_string group "${DEFAULT_GROUP}" \
|
||||
"The update group."
|
||||
|
||||
# include upload options
|
||||
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
|
||||
@ -129,16 +134,13 @@ mkdir -p "${BUILD_DIR}"
|
||||
DISK_LAYOUT_SUFFIX=$(portageq-$BOARD envvar COREOS_DISK_LAYOUT_SUFFIX)
|
||||
DISK_LAYOUT="${FLAGS_disk_layout:-base}${DISK_LAYOUT_SUFFIX}"
|
||||
|
||||
if [[ -z "${FLAGS_prod_group}" ]]; then
|
||||
if [[ "$BOARD" == "amd64-generic" ]]; then
|
||||
FLAGS_prod_group="dev-channel"
|
||||
else
|
||||
FLAGS_prod_group="alpha"
|
||||
fi
|
||||
# Temporary hack until generic images are completely deleted
|
||||
if [[ "${FLAGS_group}" == "alpha" && "$BOARD" == "amd64-generic" ]]; then
|
||||
FLAGS_group="dev-channel"
|
||||
fi
|
||||
|
||||
# Create the base image.
|
||||
create_base_image ${PRISTINE_IMAGE_NAME} ${DISK_LAYOUT}
|
||||
create_base_image "${PRISTINE_IMAGE_NAME}" "${DISK_LAYOUT}" "${FLAGS_group}"
|
||||
if should_build_image ${PRISTINE_IMAGE_NAME}; then
|
||||
upload_image "${BUILD_DIR}/${PRISTINE_IMAGE_NAME}"
|
||||
fi
|
||||
@ -164,7 +166,6 @@ if should_build_image ${COREOS_PRODUCTION_IMAGE_NAME}; then
|
||||
copy_image ${CHROMEOS_BASE_IMAGE_NAME} ${COREOS_PRODUCTION_IMAGE_NAME}
|
||||
|
||||
setup_prod_image ${COREOS_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} \
|
||||
"${FLAGS_prod_group}" \
|
||||
${SRC_ROOT}/third_party/coreos-overlay/coreos-base/coreos-au-key/files/update-payload-key.pub.pem
|
||||
|
||||
upload_image "${BUILD_DIR}/${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
|
@ -5,6 +5,7 @@
|
||||
create_base_image() {
|
||||
local image_name=$1
|
||||
local disk_layout=$2
|
||||
local update_group="$3"
|
||||
|
||||
local disk_img="${BUILD_DIR}/${image_name}"
|
||||
local root_fs_dir="${BUILD_DIR}/rootfs"
|
||||
@ -52,6 +53,7 @@ create_base_image() {
|
||||
# Set /etc/lsb-release on the image.
|
||||
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
|
||||
--root="${root_fs_dir}" \
|
||||
--group="${update_group}" \
|
||||
--board="${BOARD}"
|
||||
|
||||
local boot_dir="/boot"
|
||||
|
@ -84,7 +84,6 @@ install_dev_packages() {
|
||||
sudo mkdir -p "${root_fs_dir}/etc/coreos"
|
||||
sudo_clobber "${root_fs_dir}/etc/coreos/update.conf" <<EOF
|
||||
SERVER=${auserver}
|
||||
GROUP=developer-build
|
||||
|
||||
# For gmerge
|
||||
DEVSERVER=${devserver}
|
||||
|
@ -6,8 +6,7 @@
|
||||
setup_prod_image() {
|
||||
local image_name="$1"
|
||||
local disk_layout="$2"
|
||||
local update_group="$3"
|
||||
local au_key="$4"
|
||||
local au_key="$3"
|
||||
|
||||
info "Configuring production image ${image_name}"
|
||||
local root_fs_dir="${BUILD_DIR}/rootfs"
|
||||
@ -20,12 +19,6 @@ setup_prod_image() {
|
||||
mount "${BUILD_DIR}/${image_name}" "${root_fs_dir}"
|
||||
trap "cleanup_mounts '${root_fs_dir}' && delete_prompt" EXIT
|
||||
|
||||
# Replace /etc/lsb-release on the image.
|
||||
"${BUILD_LIBRARY_DIR}/set_lsb_release" \
|
||||
--group="${update_group}" \
|
||||
--root="${root_fs_dir}" \
|
||||
--board="${BOARD}"
|
||||
|
||||
# Install an auto update key on the root before sealing it off
|
||||
local key_location=${root_fs_dir}"/usr/share/update_engine/"
|
||||
sudo mkdir -p "${key_location}"
|
||||
|
@ -10,11 +10,6 @@
|
||||
SCRIPT_ROOT=$(readlink -f $(dirname "$0")/..)
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
|
||||
PRODUCTION_DEFAULT=
|
||||
if [[ "${COREOS_OFFICIAL:-0}" -eq 1 ]]; then
|
||||
PRODUCTION_DEFAULT="alpha"
|
||||
fi
|
||||
|
||||
# Flags
|
||||
DEFINE_string board "" "The board to build an image for."
|
||||
DEFINE_string root "" "The root file system to write /etc/lsb-release to."
|
||||
|
Loading…
x
Reference in New Issue
Block a user