mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-05 04:06:33 +02:00
chore(*): remove obsolete stuff
- mod_for_factory says it is obsolete - coreos doesn't sign ssds - download_latest is just wrong for us
This commit is contained in:
parent
5f6d02b7db
commit
80b72e9318
@ -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
|
||||
@ -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
|
||||
@ -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."
|
||||
@ -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}"
|
||||
@ -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}" <<EOF
|
||||
[CLIENT]
|
||||
drop_caches: False
|
||||
drop_caches_between_iterations: False
|
||||
EOF
|
||||
@ -1,3 +0,0 @@
|
||||
Please do not add new files to this directory. Instead, use:
|
||||
|
||||
src/third_party/chromiumos-overlay/chromeos-base/factorytest-init/factorytest-init-9999.ebuild
|
||||
@ -1,15 +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 image for factory test..."
|
||||
set -e
|
||||
|
||||
SCRIPT_BASE="${GCLIENT_ROOT}/src/scripts/mod_for_factory_scripts/"
|
||||
for SCRIPT in "${SCRIPT_BASE}"[0-9][0-9][0-9]*[!$~]
|
||||
do
|
||||
echo "Apply $(basename "${SCRIPT}")..."
|
||||
bash -e "${SCRIPT}"
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user