mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 11:51:14 +02:00
Merge pull request #831 from ajeddeloh/rm-dev-image
Remove Developer Image
This commit is contained in:
commit
73d2dc45b5
@ -1 +0,0 @@
|
||||
../../platform/crostestutils/au_test_harness/cros_au_test_harness.py
|
||||
@ -1 +0,0 @@
|
||||
../../platform/crostestutils/cros_run_vm_test
|
||||
@ -1 +0,0 @@
|
||||
../../platform/crostestutils/cros_run_vm_update
|
||||
@ -1 +0,0 @@
|
||||
../../platform/dev/host/cros_start_vm
|
||||
@ -1 +0,0 @@
|
||||
../../platform/dev/host/cros_stop_vm
|
||||
@ -1,32 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright (c) 2010 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.
|
||||
#
|
||||
# Simple wrapper script to build a cros_workon package incrementally.
|
||||
# You must already be cros_workon'ing the package in question.
|
||||
|
||||
# --- BEGIN COMMON.SH BOILERPLATE ---
|
||||
# Load common CrOS utilities. Inside the chroot this file is installed in
|
||||
# /usr/lib/crosutils. Outside the chroot we find it relative to the script's
|
||||
# location.
|
||||
find_common_sh() {
|
||||
local common_paths=("$(dirname "$(readlink -f "$0")")/.." /usr/lib/crosutils)
|
||||
local path
|
||||
|
||||
SCRIPT_ROOT="${common_paths[0]}"
|
||||
for path in "${common_paths[@]}"; do
|
||||
if [ -r "${path}/common.sh" ]; then
|
||||
SCRIPT_ROOT="${path}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
find_common_sh
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
# --- END COMMON.SH BOILERPLATE ---
|
||||
|
||||
die_notrace \
|
||||
"error: Please run cros_workon_make from chroot:/usr/bin/cros_workon_make"
|
||||
63
bin/proxy-gw
63
bin/proxy-gw
@ -1,63 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2012 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.
|
||||
|
||||
# $1 = hostname, $2 = port
|
||||
#
|
||||
# Use socat to connect to the specified host and port via one of the proxies
|
||||
# defined in the environment, if the target host does not appear in the
|
||||
# no_proxy environment variable.
|
||||
|
||||
DEST_HOST="$1"
|
||||
DEST_PORT="$2"
|
||||
|
||||
# Determine whether the destination host is in the "no_proxy" list.
|
||||
use_proxy="true"
|
||||
GLOBIGNORE="*"
|
||||
for a_host in ${no_proxy//,/ } ; do
|
||||
case "${a_host}" in
|
||||
"*") # A "*" matches all hosts.
|
||||
use_proxy="false"
|
||||
break
|
||||
;;
|
||||
.*) # Items of the form ".some.fqdn" imply match-at-end.
|
||||
if [[ "${DEST_HOST}" == *"${a_host}" ]]; then
|
||||
use_proxy="false"
|
||||
break
|
||||
fi
|
||||
;;
|
||||
${DEST_HOST}) # Items of the form "some.fqdn" imply exact-match.
|
||||
use_proxy="false"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ -n "${all_proxy}" ]]; then
|
||||
PROXY="${all_proxy}"
|
||||
TYPE=SOCKS4
|
||||
PORT_ATTR=socksport
|
||||
elif [[ -n "${https_proxy}" ]]; then
|
||||
PROXY="${https_proxy}"
|
||||
TYPE=PROXY
|
||||
PORT_ATTR=proxyport
|
||||
elif [[ -n "${http_proxy}" ]]; then
|
||||
PROXY="${http_proxy}"
|
||||
TYPE=PROXY
|
||||
PORT_ATTR=proxyport
|
||||
else
|
||||
use_proxy="false"
|
||||
fi
|
||||
|
||||
if [[ "${use_proxy}" == "true" ]]; then
|
||||
PROXY="${PROXY#*://}"
|
||||
PROXY="${PROXY%%/*}"
|
||||
PROXY_HOST="${PROXY%%:*}"
|
||||
PROXY_PORT="${PROXY##*:}"
|
||||
PARMS="${PROXY_HOST}:${DEST_HOST}:${DEST_PORT},${PORT_ATTR}=${PROXY_PORT}"
|
||||
socat_args=( "${TYPE}:${PARMS}" )
|
||||
else
|
||||
socat_args=( TCP:"${DEST_HOST}":"${DEST_PORT}" )
|
||||
fi
|
||||
exec socat STDIO "${socat_args[@]}"
|
||||
25
build_image
25
build_image
@ -31,7 +31,7 @@ DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \
|
||||
DEFINE_string base_pkg "coreos-base/coreos" \
|
||||
"The base portage package to base the build off of (only applies to prod images)"
|
||||
DEFINE_string base_dev_pkg "coreos-base/coreos-dev" \
|
||||
"The base portage package to base the build off of (only applies to dev images)"
|
||||
"The base portage package to base the build off of (only applies to dev containers)"
|
||||
DEFINE_string torcx_manifest "${DEFAULT_BUILD_ROOT}/torcx/${DEFAULT_BOARD}/latest/torcx_manifest.json" \
|
||||
"The torcx manifest describing torcx packages for this image (or blank for none)"
|
||||
DEFINE_string torcx_root "${DEFAULT_BUILD_ROOT}/torcx" \
|
||||
@ -57,12 +57,11 @@ This script is used to build a CoreOS image. CoreOS comes in many
|
||||
different forms. This scripts can be used to build the following:
|
||||
|
||||
prod - Production image for CoreOS. This image is for booting.
|
||||
dev - Developer image. Like base but with additional developer packages.
|
||||
container - Developer image with single filesystem, bootable by nspawn.
|
||||
|
||||
Examples:
|
||||
|
||||
build_image --board=<board> [dev] [prod] [container] - builds developer and production images.
|
||||
build_image --board=<board> [prod] [container] - builds developer and production images.
|
||||
...
|
||||
"
|
||||
show_help_if_requested "$@"
|
||||
@ -107,18 +106,16 @@ fi
|
||||
. "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/build_image_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/prod_image_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/dev_image_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/dev_container_util.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/test_image_content.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/torcx_manifest.sh" || exit 1
|
||||
. "${BUILD_LIBRARY_DIR}/vm_image_util.sh" || exit 1
|
||||
|
||||
PROD_IMAGE=0
|
||||
DEV_IMAGE=0
|
||||
CONTAINER=0
|
||||
for arg in "$@"; do
|
||||
case "${arg}" in
|
||||
prod) PROD_IMAGE=1 ;;
|
||||
dev) DEV_IMAGE=1 ;;
|
||||
container) CONTAINER=1 ;;
|
||||
*) die_notrace "Unknown image type ${arg}" ;;
|
||||
esac
|
||||
@ -146,8 +143,6 @@ fi
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
|
||||
DISK_LAYOUT="${FLAGS_disk_layout:-base}"
|
||||
DEV_DISK_LAYOUT="${FLAGS_disk_layout:-devel}"
|
||||
|
||||
CONTAINER_LAYOUT="${FLAGS_disk_layout:-container}"
|
||||
|
||||
if [[ -n "${FLAGS_developer_data}" ]]; then
|
||||
@ -169,17 +164,9 @@ fi
|
||||
|
||||
fix_mtab
|
||||
|
||||
if [[ "${DEV_IMAGE}" -eq 1 ]]; then
|
||||
IMAGE_BUILD_TYPE="dev"
|
||||
create_dev_image ${COREOS_DEVELOPER_IMAGE_NAME} ${DEV_DISK_LAYOUT} ${FLAGS_group} ${FLAGS_base_dev_pkg}
|
||||
if [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
|
||||
extract_update "${COREOS_DEVELOPER_IMAGE_NAME}" "${DEV_DISK_LAYOUT}"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "${CONTAINER}" -eq 1 ]]; then
|
||||
IMAGE_BUILD_TYPE="container"
|
||||
create_dev_image "${COREOS_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" ${FLAGS_base_dev_pkg}
|
||||
create_dev_container "${COREOS_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" ${FLAGS_base_dev_pkg}
|
||||
fi
|
||||
|
||||
if [[ "${PROD_IMAGE}" -eq 1 ]]; then
|
||||
@ -236,10 +223,6 @@ if [[ "${PROD_IMAGE}" -eq 1 ]]; then
|
||||
echo "CoreOS Production image created as ${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
print_image_to_vm
|
||||
fi
|
||||
if [[ "${DEV_IMAGE}" -eq 1 ]]; then
|
||||
echo "Developer image created as ${COREOS_DEVELOPER_IMAGE_NAME}"
|
||||
print_image_to_vm dev
|
||||
fi
|
||||
|
||||
command_completed
|
||||
|
||||
|
||||
@ -54,38 +54,17 @@ EOF
|
||||
eselect profile set --force $(get_board_profile $BOARD)/dev
|
||||
}
|
||||
|
||||
detect_dev_url() {
|
||||
local port=":8080"
|
||||
local host=$(hostname --fqdn 2>/dev/null)
|
||||
if [[ -z "${host}" ]]; then
|
||||
host=$(ip addr show scope global | \
|
||||
awk '$1 == "inet" { sub(/[/].*/, "", $2); print $2; exit }')
|
||||
fi
|
||||
if [[ -n "${host}" ]]; then
|
||||
echo "http://${host}${port}"
|
||||
fi
|
||||
}
|
||||
|
||||
create_dev_image() {
|
||||
create_dev_container() {
|
||||
local image_name=$1
|
||||
local disk_layout=$2
|
||||
local update_group=$3
|
||||
local base_pkg="$4"
|
||||
local devserver=$(detect_dev_url)
|
||||
local auserver=""
|
||||
|
||||
if [ -z "${base_pkg}" ]; then
|
||||
echo "did not get base package!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -n "${devserver}" ]]; then
|
||||
info "Using ${devserver} for local dev server URL."
|
||||
auserver="${devserver}/update"
|
||||
else
|
||||
info "Unable do detect local dev server address."
|
||||
fi
|
||||
|
||||
info "Building developer image ${image_name}"
|
||||
local root_fs_dir="${BUILD_DIR}/rootfs"
|
||||
local image_contents="${image_name%.bin}_contents.txt"
|
||||
@ -102,14 +81,7 @@ create_dev_image() {
|
||||
write_licenses "${root_fs_dir}" "${BUILD_DIR}/${image_licenses}"
|
||||
|
||||
# Setup portage for emerge and gmerge
|
||||
configure_dev_portage "${root_fs_dir}" "${devserver}"
|
||||
|
||||
sudo_append "${root_fs_dir}/etc/coreos/update.conf" <<EOF
|
||||
SERVER=${auserver}
|
||||
|
||||
# For gmerge
|
||||
DEVSERVER=${devserver}
|
||||
EOF
|
||||
configure_dev_portage "${root_fs_dir}"
|
||||
|
||||
# Mark the image as a developer image (input to chromeos_startup).
|
||||
# TODO(arkaitzr): Remove this file when applications no longer rely on it
|
||||
@ -73,30 +73,6 @@
|
||||
"mount":"/"
|
||||
}
|
||||
},
|
||||
"devel": {
|
||||
"3":{
|
||||
"label":"USR-A",
|
||||
"uuid":"7130c94a-213a-4e5a-8e26-6cce9662f132",
|
||||
"type":"coreos-rootfs",
|
||||
"blocks":"4194304",
|
||||
"fs_blocks":"520188",
|
||||
"fs_type":"ext2",
|
||||
"mount":"/usr",
|
||||
"features": ["prioritize", "verity"]
|
||||
},
|
||||
"4":{
|
||||
"label":"USR-B",
|
||||
"uuid":"e03dd35c-7c2d-4a47-b3fe-27f15780a57c",
|
||||
"type":"coreos-rootfs",
|
||||
"blocks":"4194304",
|
||||
"fs_blocks":"520188"
|
||||
},
|
||||
"9":{
|
||||
"label":"ROOT",
|
||||
"fs_label":"ROOT",
|
||||
"blocks":"12943360"
|
||||
}
|
||||
},
|
||||
"vm":{
|
||||
"9":{
|
||||
"label":"ROOT",
|
||||
|
||||
@ -389,7 +389,6 @@ fi
|
||||
BUILD_DIR=
|
||||
|
||||
# Standard filenames
|
||||
COREOS_DEVELOPER_IMAGE_NAME="coreos_developer_image.bin"
|
||||
COREOS_DEVELOPER_CONTAINER_NAME="coreos_developer_container.bin"
|
||||
COREOS_PRODUCTION_IMAGE_NAME="coreos_production_image.bin"
|
||||
|
||||
|
||||
@ -31,13 +31,11 @@ DEFINE_string board "${DEFAULT_BOARD}" \
|
||||
DEFINE_string format "" \
|
||||
"Output format, one of: ${VALID_IMG_TYPES[*]}"
|
||||
DEFINE_string from "" \
|
||||
"Directory containing coreos_developer_image.bin or coreos_production_image.bin."
|
||||
"Directory containing coreos_production_image.bin."
|
||||
DEFINE_string disk_layout "" \
|
||||
"The disk layout type to use for this image."
|
||||
DEFINE_integer mem "${DEFAULT_MEM}" \
|
||||
"Memory size for the vm config in MBs."
|
||||
DEFINE_boolean dev_image "${FLAGS_FALSE}" \
|
||||
"Use the development image instead of the default production image."
|
||||
DEFINE_string to "" \
|
||||
"Destination folder for VM output file(s)"
|
||||
DEFINE_string oem_pkg "" \
|
||||
@ -107,14 +105,7 @@ if [ -f "${FLAGS_from}/version.txt" ]; then
|
||||
COREOS_VERSION_STRING="${COREOS_VERSION}"
|
||||
fi
|
||||
|
||||
if [ ${FLAGS_dev_image} -eq ${FLAGS_TRUE} ]; then
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_DEVELOPER_IMAGE_NAME}"
|
||||
if [[ "${FLAGS_disk_layout}" == "" ]]; then
|
||||
FLAGS_disk_layout=devel
|
||||
fi
|
||||
else
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
fi
|
||||
set_vm_paths "${FLAGS_from}" "${FLAGS_to}" "${COREOS_PRODUCTION_IMAGE_NAME}"
|
||||
|
||||
# Make sure things are cleaned up on failure
|
||||
trap vm_cleanup EXIT
|
||||
|
||||
@ -9,7 +9,6 @@ DEFAULT_MEM="1024"
|
||||
DEFAULT_VMDK="ide.vmdk"
|
||||
DEFAULT_VMX="coreos.vmx"
|
||||
DEFAULT_VBOX_DISK="os.vdi"
|
||||
DEFAULT_QEMU_IMAGE="coreos_developer_qemu_image.img"
|
||||
|
||||
# Minimum sizes for full size vm images -- needed for update.
|
||||
MIN_VDISK_SIZE_FULL=9216
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2010 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.
|
||||
|
||||
# Start the Dev Server after making sure we are running under a chroot.
|
||||
|
||||
SCRIPT_ROOT=$(dirname $(readlink -f "$0"))
|
||||
. "${SCRIPT_ROOT}/common.sh" || exit 1
|
||||
|
||||
# Script must be run inside the chroot if not in 'always serve' mode.
|
||||
if [[ "$1" != "--archive_dir" ]]; then
|
||||
assert_inside_chroot
|
||||
fi
|
||||
|
||||
# This is the location of the script now.
|
||||
exec $(dirname ${0})/../../chroot/usr/bin/start_devserver "$@"
|
||||
Loading…
x
Reference in New Issue
Block a user