From 80b72e93189a7c9d7f9d5fbd6a6ab7babe28133e Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Sun, 21 Jul 2013 22:56:58 -0700 Subject: [PATCH 1/2] chore(*): remove obsolete stuff - mod_for_factory says it is obsolete - coreos doesn't sign ssds - download_latest is just wrong for us --- bin/cros_download_latest_image | 95 ------------------- bin/cros_sign_to_ssd | 92 ------------------ mod_for_factory_scripts/100rebaseClient | 19 ---- mod_for_factory_scripts/300modifyDescription | 9 -- mod_for_factory_scripts/400configAutotest | 20 ---- .../README.this_directory_is_obsolete | 3 - mod_for_factory_scripts/factory_setup.sh | 15 --- 7 files changed, 253 deletions(-) delete mode 100755 bin/cros_download_latest_image delete mode 100755 bin/cros_sign_to_ssd delete mode 100755 mod_for_factory_scripts/100rebaseClient delete mode 100755 mod_for_factory_scripts/300modifyDescription delete mode 100644 mod_for_factory_scripts/400configAutotest delete mode 100644 mod_for_factory_scripts/README.this_directory_is_obsolete delete mode 100755 mod_for_factory_scripts/factory_setup.sh diff --git a/bin/cros_download_latest_image b/bin/cros_download_latest_image deleted file mode 100755 index 650e41f4aa..0000000000 --- a/bin/cros_download_latest_image +++ /dev/null @@ -1,95 +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. - -# Downloads the latest buildbot image and prints the path to it. -# This script only works if you have access to buildbot images. - -# --- 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 --- - -DEFINE_string board "$DEFAULT_BOARD" \ - "The name of the board to check for images." -DEFINE_boolean incremental "$FLAGS_FALSE" "Download incremental build" -DEFINE_boolean enable_rootfs_verification "${FLAGS_TRUE}" \ - "Enable rootfs verification for the downloaded image." - -# Parse command line flags. -FLAGS "$@" || exit 1 -eval set -- "$FLAGS_ARGV" - -# Check on the board that they are trying to set up. -if [ -z "$FLAGS_board" ] ; then - die_notrace "Error: --board required." -fi - -BUCKET="chromeos-image-archive" -if [ $FLAGS_board = x86-generic ]; then - if [ "$FLAGS_incremental" -eq "$FLAGS_TRUE" ]; then - PATH_PREFIX="x86-generic-pre-flight-queue" - else - PATH_PREFIX="x86-generic-full" - fi -else - PATH_PREFIX="${FLAGS_board}-release" -fi - -URL_PREFIX="gs://$BUCKET/$PATH_PREFIX" -LATEST_BUILD=$(gsutil cat $URL_PREFIX/LATEST) -IMAGES_DIR="$DEFAULT_BUILD_ROOT/images/$FLAGS_board" -LATEST_IMAGE_DIR="$IMAGES_DIR/$LATEST_BUILD" -if [ ! -e $LATEST_IMAGE_DIR/chromiumos_base_image.bin ]; then - mkdir -p $LATEST_IMAGE_DIR - gsutil cp "$URL_PREFIX/$LATEST_BUILD/image.zip" \ - "$LATEST_IMAGE_DIR/image.zip" || die "Could not download image.zip" - ( cd $LATEST_IMAGE_DIR && unzip -qo image.zip ) \ - || die "Could not unzip image.zip" -fi - -IMAGE_NAME=chromiumos_qemu_image.bin -IMAGE_FILE="${LATEST_IMAGE_DIR}"/"${IMAGE_NAME}" -ESP_DIR="${LATEST_IMAGE_DIR}/esp" - -cleanup() { - "$SCRIPTS_DIR/mount_gpt_image.sh" -u -e "${ESP_DIR}" -} - -# This might seem a bit strange, but rootfs verification is already on with the -# image, the only reason we've named this flag 'enable_rootfs_verfication' -# versus 'disable_xyz' is to stay constant with the -# 'noenable_rootfs_verification' flag used in build image to disable it. -if [ "${FLAGS_enable_rootfs_verification}" -eq "${FLAGS_FALSE}" ] ; then - trap cleanup INT TERM EXIT - # We only need to touch the ESP part - "$SCRIPTS_DIR/mount_gpt_image.sh" -i chromiumos_qemu_image.bin \ - -f "${LATEST_IMAGE_DIR}" -e "${ESP_DIR}" - - # Change the default to boot from the usb instead of vusb, usb is set - # to boot from /dev/sda - sudo sed -i -e 's/vusb/usb/g' "${ESP_DIR}/syslinux/default.cfg" - - sync; sync -fi - -echo $LATEST_IMAGE_DIR -exit 0 diff --git a/bin/cros_sign_to_ssd b/bin/cros_sign_to_ssd deleted file mode 100755 index 2b3a9c4416..0000000000 --- a/bin/cros_sign_to_ssd +++ /dev/null @@ -1,92 +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. - -# Script to resign the kernel partition generated in the output of build_image -# with SSD keys. - -# --- 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 --- - -# Need to be inside the chroot to load chromeos-common.sh -assert_inside_chroot - -# Load functions and constants for chromeos-install -. /usr/lib/installer/chromeos-common.sh || exit 1 - -locate_gpt - -DEFINE_string from "chromiumos_image.bin" \ - "Input file name of Chrome OS image to re-sign." - -# Parse command line -FLAGS "$@" || exit 1 -eval set -- "${FLAGS_ARGV}" - -failure() { - echo "SIGNING HAD FAILED" - exit 1 -} - -# Abort on error -switch_to_strict_mode - -trap "failure" EXIT - -if [ -z "${FLAGS_from}" ] || [ ! -f "${FLAGS_from}" ] ; then - echo "Error: invalid flag --from" - exit 1 -fi - -# Example commandline is as follows: -# ./sign_official_build.sh \ -# ssd \ -# /.../build/images/x86-mario/0.8.68.2/chromiumos_test_image.bin \ -# ../../tests/devkeys/ \ -# /.../build/images/x86-mario/0.8.68.2/chromiumos_test_ssd_image.bin - -VBOOT_DIR="${SRC_ROOT}/platform/vboot_reference" -if [ ! -d "${VBOOT_DIR}" ]; then - die_notrace "VBOOT DIR NOT FOUND at \'${VBOOT_DIR}\' .." -fi - -TMP_IMAGE=$(mktemp) -VBOOT_KEYS="${VBOOT_DIR}/tests/devkeys" -if [ ! -d "${VBOOT_KEYS}" ]; then - die_notrace "VBOOT KEYS NOT FOUND at \'${VBOOT_KEYS}\' .." -fi - -VBOOT_SIGN="${VBOOT_DIR}/scripts/image_signing/sign_official_build.sh" -if [ ! -x "${VBOOT_SIGN}" ]; then - die_notrace \ - "VBOOT TOOL sign_official_build.sh NOT FOUND at \'${VBOOT_SIGN}\' .." -fi - -cp "${FLAGS_from}" "${TMP_IMAGE}" - -${VBOOT_SIGN} ssd "${TMP_IMAGE}" "${VBOOT_KEYS}" "${FLAGS_from}" - -rm "${TMP_IMAGE}" - -set +e -trap - EXIT diff --git a/mod_for_factory_scripts/100rebaseClient b/mod_for_factory_scripts/100rebaseClient deleted file mode 100755 index 3f9a029a8a..0000000000 --- a/mod_for_factory_scripts/100rebaseClient +++ /dev/null @@ -1,19 +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. - -die() { - echo "ERROR: $*" - exit 1 -} - -echo "Rebasing autotest/client folder for factory." -base_dir="${ROOT_FS_DIR}/usr/local/autotest" - -[ -d "${base_dir}/client" ] || die "Missing client in root: ${base_dir}" -rm -rf ${base_dir}/packages || die "Failed to wipe packages directory." -mv "${base_dir}/client/"* "${base_dir}" || die "Failed moving client folder." -rmdir "${base_dir}/client" || die "Failed removing client folder." -ln -s . "${base_dir}/client" || die "Failed creating symlink." diff --git a/mod_for_factory_scripts/300modifyDescription b/mod_for_factory_scripts/300modifyDescription deleted file mode 100755 index 5196142dee..0000000000 --- a/mod_for_factory_scripts/300modifyDescription +++ /dev/null @@ -1,9 +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. - -echo "Modifying Release Description for Factory." -FILE="${ROOT_FS_DIR}/etc/lsb-release" -sed -i 's/Test/Factory/' "${FILE}" diff --git a/mod_for_factory_scripts/400configAutotest b/mod_for_factory_scripts/400configAutotest deleted file mode 100644 index 74261a5512..0000000000 --- a/mod_for_factory_scripts/400configAutotest +++ /dev/null @@ -1,20 +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. - -echo "Configure autotest setting." - -GLOBAL_CONFIG="${ROOT_FS_DIR}/usr/local/autotest/global_config.ini" - -if [ -f "${GLOBAL_CONFIG}" ]; then - echo -e "File ${GLOBAL_CONFIG} already exists." - exit 1 -fi - -cat >"${GLOBAL_CONFIG}" < Date: Sun, 21 Jul 2013 23:20:50 -0700 Subject: [PATCH 2/2] chore(*): use coreos_ everywhere --- bin/cros_image_to_target.py | 4 ++-- bin/cros_make_image_bootable | 4 ++-- bin/cros_resign_image.sh | 2 +- build_image | 2 +- build_library/disk_layout_util.sh | 2 +- common.sh | 8 ++++---- core_upload_update | 2 +- lib/cros_vm_constants.sh | 4 ++-- mount_gpt_image.sh | 6 +++--- sdk_lib/make_chroot.sh | 4 ++-- update_chroot | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/bin/cros_image_to_target.py b/bin/cros_image_to_target.py index 3d9af64a30..5792dbbe4f 100755 --- a/bin/cros_image_to_target.py +++ b/bin/cros_image_to_target.py @@ -35,8 +35,8 @@ from dev import autoupdate_lib # This is the default filename within the image directory to load updates from -DEFAULT_IMAGE_NAME = 'chromiumos_image.bin' -DEFAULT_IMAGE_NAME_TEST = 'chromiumos_test_image.bin' +DEFAULT_IMAGE_NAME = 'coreos_image.bin' +DEFAULT_IMAGE_NAME_TEST = 'coreos_test_image.bin' # The filenames we provide to clients to pull updates UPDATE_FILENAME = 'update.gz' diff --git a/bin/cros_make_image_bootable b/bin/cros_make_image_bootable index d8500d1a6e..196055cd81 100755 --- a/bin/cros_make_image_bootable +++ b/bin/cros_make_image_bootable @@ -79,8 +79,8 @@ DEFINE_string image_type "base" \ "Type of image we're building for (base/factory_install)." DEFINE_string output_dir "/tmp" \ "Directory to place output in." -DEFINE_string image "chromiumos_base.img" \ - "Full path to the chromiumos image to make bootable." +DEFINE_string image "coreos_base.img" \ + "Full path to the coreos image to make bootable." DEFINE_string arch "x86" \ "Architecture to make bootable for: arm, x86, or amd64" DEFINE_boolean cleanup_dirs ${FLAGS_TRUE} \ diff --git a/bin/cros_resign_image.sh b/bin/cros_resign_image.sh index 8f957894df..b58c000d55 100755 --- a/bin/cros_resign_image.sh +++ b/bin/cros_resign_image.sh @@ -36,7 +36,7 @@ assert_inside_chroot locate_gpt -DEFINE_string from "chromiumos_image.bin" \ +DEFINE_string from "coreos_image.bin" \ "Input file name of Chrome OS image to re-sign." DEFINE_string datakey "" \ "Private Kernel Data Key (.vbprivk) to use for re-signing." diff --git a/build_image b/build_image index f76e0791b5..1f7432d917 100755 --- a/build_image +++ b/build_image @@ -5,7 +5,7 @@ # found in the LICENSE file. # Script to build a bootable keyfob-based chromeos system image from within -# a chromiumos setup. This assumes that all needed packages have been built into +# a coreos setup. This assumes that all needed packages have been built into # the given target's root with binary packages turned on. This script will # build the Chrome OS image using only pre-built binary packages. diff --git a/build_library/disk_layout_util.sh b/build_library/disk_layout_util.sh index d19d1c0a5d..1e60196463 100644 --- a/build_library/disk_layout_util.sh +++ b/build_library/disk_layout_util.sh @@ -153,7 +153,7 @@ emit_gpt_scripts() { TARGET=\${1:-} if [[ -z \${TARGET} ]]; then echo "Usage: \$0 " 1>&2 - echo "Example: \$0 chromiumos_image.bin" 1>&2 + echo "Example: \$0 coreos_image.bin" 1>&2 exit 1 fi set -x diff --git a/common.sh b/common.sh index 1a6230b2cd..b3b400e330 100644 --- a/common.sh +++ b/common.sh @@ -399,11 +399,11 @@ DEFAULT_FAST=${FLAGS_TRUE} BUILD_DIR= # Standard filenames -CHROMEOS_BASE_IMAGE_NAME="chromiumos_base_image.bin" -CHROMEOS_IMAGE_NAME="chromiumos_image.bin" -CHROMEOS_DEVELOPER_IMAGE_NAME="chromiumos_image.bin" +CHROMEOS_BASE_IMAGE_NAME="coreos_base_image.bin" +CHROMEOS_IMAGE_NAME="coreos_image.bin" +CHROMEOS_DEVELOPER_IMAGE_NAME="coreos_image.bin" CHROMEOS_RECOVERY_IMAGE_NAME="recovery_image.bin" -CHROMEOS_TEST_IMAGE_NAME="chromiumos_test_image.bin" +CHROMEOS_TEST_IMAGE_NAME="coreos_test_image.bin" COREOS_BASE_IMAGE_NAME=${CHROMEOS_BASE_IMAGE_NAME} COREOS_IMAGE_NAME=${CHROMEOS_IMAGE_NAME} diff --git a/core_upload_update b/core_upload_update index 47d24c2dad..dcddc4b326 100755 --- a/core_upload_update +++ b/core_upload_update @@ -32,7 +32,7 @@ Setting everything up for use\n 1) Run 'gsutil config' and use project id coreos.com:core-update-storage\n 2) Ensure core-admin is installed, it is a recent addition\n -NOTE: Use the chromiumos_image.bin not a qemu/xen/etc image for generating the +NOTE: Use the coreos_image.bin not a qemu/xen/etc image for generating the update. " diff --git a/lib/cros_vm_constants.sh b/lib/cros_vm_constants.sh index 4a4bdb26a5..a0fb7ba4b1 100644 --- a/lib/cros_vm_constants.sh +++ b/lib/cros_vm_constants.sh @@ -7,9 +7,9 @@ # Default values for creating VM's. DEFAULT_MEM="1024" DEFAULT_VMDK="ide.vmdk" -DEFAULT_VMX="chromiumos.vmx" +DEFAULT_VMX="coreos.vmx" DEFAULT_VBOX_DISK="os.vdi" -DEFAULT_QEMU_IMAGE="chromiumos_qemu_image.bin" +DEFAULT_QEMU_IMAGE="coreos_qemu_image.bin" # Minimum sizes for full size vm images -- needed for update. MIN_VDISK_SIZE_FULL=9216 diff --git a/mount_gpt_image.sh b/mount_gpt_image.sh index 3b932ce99e..f3f9a897ba 100755 --- a/mount_gpt_image.sh +++ b/mount_gpt_image.sh @@ -32,7 +32,7 @@ DEFINE_boolean unmount $FLAGS_FALSE \ "Unmount previously mounted dir." u DEFINE_string from "/dev/sdc" \ "Directory, image, or device with image on it" f -DEFINE_string image "chromiumos_image.bin"\ +DEFINE_string image "coreos_image.bin"\ "Name of the bin file if a directory is specified in the from flag" i DEFINE_string "rootfs_mountpt" "/tmp/m" "Mount point for rootfs" "r" DEFINE_string "stateful_mountpt" "/tmp/s" \ @@ -56,7 +56,7 @@ fi # Check for conflicting args. # If --from is a block device, --image can't also be specified. if [ -b "${FLAGS_from}" ]; then - if [ "${FLAGS_image}" != "chromiumos_image.bin" ]; then + if [ "${FLAGS_image}" != "coreos_image.bin" ]; then die_notrace "-i ${FLAGS_image} can't be used with block device ${FLAGS_from}" fi fi @@ -64,7 +64,7 @@ fi # Allow --from /foo/file.bin if [ -f "${FLAGS_from}" ]; then # If --from is specified as a file, --image cannot be also specified. - if [ "${FLAGS_image}" != "chromiumos_image.bin" ]; then + if [ "${FLAGS_image}" != "coreos_image.bin" ]; then die_notrace "-i ${FLAGS_image} can't be used with --from file ${FLAGS_from}" fi pathname=$(dirname "${FLAGS_from}") diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 80088b9d67..4632d5184c 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -237,7 +237,7 @@ init_setup () { # Add chromite/bin and depot_tools into the path globally; note that the # chromite wrapper itself might also be found in depot_tools. # We rely on 'env-update' getting called below. - target="${FLAGS_chroot}/etc/env.d/99chromiumos" + target="${FLAGS_chroot}/etc/env.d/99coreos" cat < "${target}" PATH=${CHROOT_TRUNK_DIR}/chromite/bin:${DEPOT_TOOLS_DIR} CROS_WORKON_SRCROOT="${CHROOT_TRUNK_DIR}" @@ -265,7 +265,7 @@ EOF target="${FLAGS_chroot}/etc/profile.d" mkdir -p "${target}" - cat << EOF > "${target}/chromiumos-niceties.sh" + cat << EOF > "${target}/coreos-niceties.sh" # Niceties for interactive logins. (cr) denotes this is a chroot, the # __git_branch_ps1 prints current git branch in ./ . The $r behavior is to # make sure we don't reset the previous $? value which later formats in diff --git a/update_chroot b/update_chroot index c6c69160eb..4ebe716ee6 100755 --- a/update_chroot +++ b/update_chroot @@ -70,7 +70,7 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then fi # Only update toolchain when binpkgs are available. Toolchain rollout - # process only takes place when the chromiumos sdk builder finishes + # process only takes place when the coreos sdk builder finishes # a successful build. EMERGE_FLAGS+=" --useoldpkg-atoms=sys-devel/binutils" EMERGE_FLAGS+=" --useoldpkg-atoms=sys-devel/gcc"