diff --git a/bootstrap_sdk b/bootstrap_sdk index 089141eb1c..2193b8f357 100755 --- a/bootstrap_sdk +++ b/bootstrap_sdk @@ -33,7 +33,7 @@ SCRIPT_ROOT=$(dirname $(readlink -f "$0")) . "${SCRIPT_ROOT}/common.sh" || exit 1 -TYPE="coreos-sdk" +TYPE="flatcar-sdk" . "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1 @@ -63,7 +63,7 @@ catalyst_init "$@" check_gsutil_opts if [[ "$STAGES" =~ stage4 ]]; then - info "Setting release to ${COREOS_VERSION}" + info "Setting release to ${FLATCAR_VERSION}" rm -rf "${TEMPDIR}/stage4_overlay" # need to setup the lib->lib64 symlink correctly libdir=$(get_sdk_libdir) diff --git a/build_docker_aci b/build_docker_aci index b62648608a..cdd12dd61a 100755 --- a/build_docker_aci +++ b/build_docker_aci @@ -94,7 +94,7 @@ case "${version}" in "/usr/bin/docker-containerd-shim" "/usr/bin/docker-proxy" "/usr/bin/docker-runc" - "/usr/lib/coreos/dockerd" + "/usr/lib/flatcar/dockerd" ) ebuild_aci_create "users.developer.core-os.net/skim/docker" \ "coreos_docker-${BOARD}-${version}_coreos.${aci_version}" \ diff --git a/build_image b/build_image index 640a92f2b5..327f649ae2 100755 --- a/build_image +++ b/build_image @@ -171,24 +171,24 @@ 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} + create_dev_image ${FLATCAR_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}" + extract_update "${FLATCAR_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_image "${FLATCAR_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" ${FLAGS_base_dev_pkg} fi if [[ "${PROD_IMAGE}" -eq 1 ]]; then IMAGE_BUILD_TYPE="prod" - create_prod_image ${COREOS_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group} ${FLAGS_base_pkg} + create_prod_image ${FLATCAR_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group} ${FLAGS_base_pkg} if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} ]]; then - generate_update "${COREOS_PRODUCTION_IMAGE_NAME}" ${DISK_LAYOUT} + generate_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" ${DISK_LAYOUT} elif [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then - extract_update "${COREOS_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}" + extract_update "${FLATCAR_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}" fi fi @@ -199,15 +199,15 @@ then fi # Write out a version.txt file, this will be used by image_to_vm.sh -split_ver "${COREOS_VERSION_ID}" SPLIT +split_ver "${FLATCAR_VERSION_ID}" SPLIT tee "${BUILD_DIR}/version.txt" <"${BUILD_DIR}/pcrs/kernel.config" fi @@ -596,7 +596,7 @@ EOF if [[ -n "${pcr_policy}" ]]; then ${BUILD_LIBRARY_DIR}/generate_grub_hashes.py \ - "${disk_img}" /usr/lib/grub/ "${BUILD_DIR}/pcrs" ${COREOS_VERSION} + "${disk_img}" /usr/lib/grub/ "${BUILD_DIR}/pcrs" ${FLATCAR_VERSION} info "Generating $pcr_policy" pushd "${BUILD_DIR}" >/dev/null diff --git a/build_library/catalyst.sh b/build_library/catalyst.sh index ea1fccf774..4ba1b3bf40 100644 --- a/build_library/catalyst.sh +++ b/build_library/catalyst.sh @@ -12,7 +12,7 @@ : ${TYPE:="coreos-sdk"} : ${ARCH:=$(get_sdk_arch)} : ${DEFAULT_CATALYST_ROOT:="${DEFAULT_BUILD_ROOT}/catalyst"} -: ${DEFAULT_SEED:=${COREOS_SDK_TARBALL_PATH}} +: ${DEFAULT_SEED:=${FLATCAR_SDK_TARBALL_PATH}} : ${DEFAULT_PROFILE:=$(get_sdk_profile)} # Set to something like "stage4" to restrict what to build # FORCE_STAGES= @@ -34,7 +34,7 @@ DEFINE_string coreos_overlay "${SRC_ROOT}/third_party/coreos-overlay" \ "Path to the coreos-overlay git checkout." DEFINE_string seed_tarball "${DEFAULT_SEED}" \ "Path to an existing stage tarball to start from." -DEFINE_string version "${COREOS_VERSION}" \ +DEFINE_string version "${FLATCAR_VERSION}" \ "Version to use for portage snapshot and stage tarballs." DEFINE_string profile "${DEFAULT_PROFILE}" \ "Portage profile, may be prefixed with repo:" @@ -196,7 +196,7 @@ catalyst_init() { DISTDIR="$CATALYST_ROOT/distfiles" # automatically download the current SDK if it is the seed tarball. - if [[ "$FLAGS_seed_tarball" == "${COREOS_SDK_TARBALL_PATH}" ]]; then + if [[ "$FLAGS_seed_tarball" == "${FLATCAR_SDK_TARBALL_PATH}" ]]; then sdk_download_tarball fi diff --git a/build_library/check_root b/build_library/check_root index 4a1b41af55..60adc2740b 100755 --- a/build_library/check_root +++ b/build_library/check_root @@ -116,7 +116,9 @@ IGNORE_SYMLINK = ( b"/etc/motd", # Other - b"/etc/lsb-release" # set later in the build process + b"/etc/lsb-release", # set later in the build process + b"/usr/share/coreos", # set later in the build process + b"/etc/coreos" # set later in the build process ) diff --git a/build_library/configure_bootloaders.sh b/build_library/configure_bootloaders.sh index 27b862cbec..f163074f72 100755 --- a/build_library/configure_bootloaders.sh +++ b/build_library/configure_bootloaders.sh @@ -45,11 +45,11 @@ configure_pvgrub() { sudo_clobber "${GRUB_DIR}/menu.lst.A" < "${GRUB_TEMP_DIR}/grub.cfg" fi - sudo tar cf "${ESP_DIR}/coreos/grub/grub.cfg.tar" \ + sudo tar cf "${ESP_DIR}/flatcar/grub/grub.cfg.tar" \ -C "${GRUB_TEMP_DIR}" "grub.cfg" fi @@ -176,7 +176,7 @@ sudo grub-mkimage \ --format "${FLAGS_target}" \ --directory "${GRUB_SRC}" \ --config "${ESP_DIR}/${GRUB_DIR}/load.cfg" \ - --memdisk "${ESP_DIR}/coreos/grub/grub.cfg.tar" \ + --memdisk "${ESP_DIR}/flatcar/grub/grub.cfg.tar" \ --output "${ESP_DIR}/${GRUB_DIR}/${CORE_NAME}" \ "${CORE_MODULES[@]}" diff --git a/build_library/modify_image_util.sh b/build_library/modify_image_util.sh index a81122b55e..f8ed535762 100755 --- a/build_library/modify_image_util.sh +++ b/build_library/modify_image_util.sh @@ -14,7 +14,7 @@ start_modify_image() { FLAGS_from="$(readlink -f "${FLAGS_from}")" fi - local src_image="${FLAGS_from}/${COREOS_PRODUCTION_IMAGE_NAME}" + local src_image="${FLAGS_from}/${FLATCAR_PRODUCTION_IMAGE_NAME}" if [[ ! -f "${src_image}" ]]; then die_notrace "Source image does not exist: ${src_image}" fi @@ -24,7 +24,7 @@ start_modify_image() { die_notrace "Source version info does not exist: ${FLAGS_from}/version.txt" fi source "${FLAGS_from}/version.txt" - COREOS_VERSION_STRING="${COREOS_VERSION}" + FLATCAR_VERSION_STRING="${FLATCAR_VERSION}" # Load after version.txt to set the correct output paths . "${BUILD_LIBRARY_DIR}/toolchain_util.sh" @@ -44,7 +44,7 @@ start_modify_image() { fi # Create the output directory and temporary mount points. - DST_IMAGE="${BUILD_DIR}/${COREOS_PRODUCTION_IMAGE_NAME}" + DST_IMAGE="${BUILD_DIR}/${FLATCAR_PRODUCTION_IMAGE_NAME}" ROOT_FS_DIR="${BUILD_DIR}/rootfs" mkdir -p "${ROOT_FS_DIR}" @@ -52,10 +52,10 @@ start_modify_image() { cp "${src_image}" "${DST_IMAGE}" # Copy all extra useful things, these do not need to be modified. - local update_prefix="${COREOS_PRODUCTION_IMAGE_NAME%_image.bin}_update" - local production_prefix="${COREOS_PRODUCTION_IMAGE_NAME%.bin}" - local container_prefix="${COREOS_DEVELOPER_CONTAINER_NAME%.bin}" - local pcr_data="${COREOS_PRODUCTION_IMAGE_NAME%.bin}_pcr_policy.zip" + local update_prefix="${FLATCAR_PRODUCTION_IMAGE_NAME%_image.bin}_update" + local production_prefix="${FLATCAR_PRODUCTION_IMAGE_NAME%.bin}" + local container_prefix="${FLATCAR_DEVELOPER_CONTAINER_NAME%.bin}" + local pcr_data="${FLATCAR_PRODUCTION_IMAGE_NAME%.bin}_pcr_policy.zip" EXTRA_FILES=( "version.txt" "${update_prefix}.bin" @@ -64,7 +64,7 @@ start_modify_image() { "${production_prefix}_contents.txt" "${production_prefix}_packages.txt" "${production_prefix}_kernel_config.txt" - "${COREOS_DEVELOPER_CONTAINER_NAME}" + "${FLATCAR_DEVELOPER_CONTAINER_NAME}" "${container_prefix}_contents.txt" "${container_prefix}_packages.txt" ) diff --git a/build_library/oem_aci_util.sh b/build_library/oem_aci_util.sh index f6a1bbf176..90fcd4d700 100644 --- a/build_library/oem_aci_util.sh +++ b/build_library/oem_aci_util.sh @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# Expects BOARD, BUILD_DIR, BUILD_LIBRARY_DIR, and COREOS_VERSION in env. +# Expects BOARD, BUILD_DIR, BUILD_LIBRARY_DIR, and FLATCAR_VERSION in env. # There must be a manifest template included with the ebuild at # files/manifest.in, which will have some variable values substituted before @@ -81,7 +81,7 @@ oem_aci_write_manifest() { sudo cp "${manifest_template}" "${manifest}" sudo sed "${manifest}" -i \ -e "s,@ACI_NAME@,${name}," \ - -e "s,@ACI_VERSION@,${COREOS_VERSION}," \ + -e "s,@ACI_VERSION@,${FLATCAR_VERSION}," \ -e "s,@ACI_ARCH@,${appc_arch}," } @@ -113,7 +113,7 @@ oem_aci_create() { "coreos.com/oem-${oem}" # Write a tar ACI file containing the manifest and mounted rootfs contents. - sudo tar -C "${aciroot}" -czf "${BUILD_DIR}/coreos-oem-${oem}.aci" \ + sudo tar -C "${aciroot}" -czf "${BUILD_DIR}/flatcar-oem-${oem}.aci" \ manifest rootfs # Unmount the staging image, and delete it to save space. diff --git a/build_library/release_util.sh b/build_library/release_util.sh index c48576f286..bfe92318ef 100644 --- a/build_library/release_util.sh +++ b/build_library/release_util.sh @@ -11,8 +11,8 @@ UPLOAD_DEFAULT=${FLAGS_FALSE} # Default upload root can be overridden from the environment. _user="${USER}" [[ ${USER} == "root" ]] && _user="${SUDO_USER}" -: ${COREOS_UPLOAD_ROOT:=gs://users.developer.core-os.net/${_user}} -: ${COREOS_TORCX_UPLOAD_ROOT:=${COREOS_UPLOAD_ROOT}/torcx} +: ${FLATCAR_UPLOAD_ROOT:=gs://users.developer.core-os.net/${_user}} +: ${FLATCAR_TORCX_UPLOAD_ROOT:=${FLATCAR_UPLOAD_ROOT}/torcx} unset _user IMAGE_ZIPPER="lbzip2 --compress --keep" @@ -22,7 +22,7 @@ DEFINE_boolean parallel ${FLAGS_TRUE} \ "Enable parallelism in gsutil." DEFINE_boolean upload ${UPLOAD_DEFAULT} \ "Upload all packages/images via gsutil." -DEFINE_string upload_root "${COREOS_UPLOAD_ROOT}" \ +DEFINE_string upload_root "${FLATCAR_UPLOAD_ROOT}" \ "Upload prefix, board/version/etc will be appended. Must be a gs:// URL." DEFINE_string upload_path "" \ "Full upload path, overrides --upload_root. Must be a full gs:// URL." @@ -30,7 +30,7 @@ DEFINE_string download_root "" \ "HTTP download prefix, board/version/etc will be appended." DEFINE_string download_path "" \ "HTTP download path, overrides --download_root." -DEFINE_string torcx_upload_root "${COREOS_TORCX_UPLOAD_ROOT}" \ +DEFINE_string torcx_upload_root "${FLATCAR_TORCX_UPLOAD_ROOT}" \ "Tectonic torcx package and manifest Upload prefix. Must be a gs:// URL." DEFINE_string tectonic_torcx_download_root "" \ "HTTP download prefix for tectonic torcx packages and manifests." @@ -155,7 +155,7 @@ upload_packages() { [[ -n "${BOARD}" ]] || die "board_options.sh must be sourced first" local board_packages="${1:-"${BOARD_ROOT}/packages"}" - local def_upload_path="${UPLOAD_ROOT}/boards/${BOARD}/${COREOS_VERSION}" + local def_upload_path="${UPLOAD_ROOT}/boards/${BOARD}/${FLATCAR_VERSION}" sign_and_upload_files packages ${def_upload_path} "pkgs/" \ "${board_packages}"/* } @@ -214,7 +214,7 @@ upload_image() { fi local log_msg=$(basename "$digests" .DIGESTS) - local def_upload_path="${UPLOAD_ROOT}/boards/${BOARD}/${COREOS_VERSION}" + local def_upload_path="${UPLOAD_ROOT}/boards/${BOARD}/${FLATCAR_VERSION}" sign_and_upload_files "${log_msg}" "${def_upload_path}" "" "${uploads[@]}" } @@ -233,9 +233,9 @@ download_image_url() { download_path="${FLAGS_download_path%%/}" elif [[ "${download_root}" = *release.core-os.net* ]]; then # Official release download paths don't include the boards directory - download_path="${download_root%%/}/${BOARD}/${COREOS_VERSION}" + download_path="${download_root%%/}/${BOARD}/${FLATCAR_VERSION}" else - download_path="${download_root%%/}/boards/${BOARD}/${COREOS_VERSION}" + download_path="${download_root%%/}/boards/${BOARD}/${FLATCAR_VERSION}" fi # Just in case download_root was set from UPLOAD_ROOT diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index e765b343cc..a8c5c036ff 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -143,14 +143,14 @@ get_board_binhost() { shift if [[ $# -eq 0 ]]; then - set -- "${COREOS_SDK_VERSION}" "${COREOS_VERSION_ID}" + set -- "${FLATCAR_SDK_VERSION}" "${FLATCAR_VERSION_ID}" fi for ver in "$@"; do if [[ $toolchain_only -eq 0 ]]; then - echo "${COREOS_DEV_BUILDS}/boards/${board}/${ver}/pkgs/" + echo "${FLATCAR_DEV_BUILDS}/boards/${board}/${ver}/pkgs/" fi - echo "${COREOS_DEV_BUILDS}/boards/${board}/${ver}/toolchain/" + echo "${FLATCAR_DEV_BUILDS}/boards/${board}/${ver}/toolchain/" done } @@ -172,12 +172,12 @@ get_sdk_libdir() { get_sdk_binhost() { local arch=$(get_sdk_arch) ver if [[ $# -eq 0 ]]; then - set -- "${COREOS_SDK_VERSION}" "${COREOS_VERSION_ID}" + set -- "${FLATCAR_SDK_VERSION}" "${FLATCAR_VERSION_ID}" fi for ver in "$@"; do - echo "${COREOS_DEV_BUILDS}/sdk/${arch}/${ver}/pkgs/" - echo "${COREOS_DEV_BUILDS}/sdk/${arch}/${ver}/toolchain/" + echo "${FLATCAR_DEV_BUILDS}/sdk/${arch}/${ver}/pkgs/" + echo "${FLATCAR_DEV_BUILDS}/sdk/${arch}/${ver}/toolchain/" done } diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 7fd5408124..eab411d7fe 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -355,7 +355,7 @@ set_vm_paths() { VM_TMP_DIR="${dst_dir}/${dst_name}.vmtmpdir" VM_TMP_IMG="${VM_TMP_DIR}/disk_image.bin" VM_TMP_ROOT="${VM_TMP_DIR}/rootfs" - VM_NAME="$(_src_to_dst_name "${src_name}" "")-${COREOS_VERSION}" + VM_NAME="$(_src_to_dst_name "${src_name}" "")-${FLATCAR_VERSION}" VM_README="${dst_dir}/$(_src_to_dst_name "${src_name}" ".README")" # Make VM_NAME safe for use as a hostname @@ -441,8 +441,8 @@ setup_disk_image() { sudo mount -o remount,ro "${VM_TMP_ROOT}" VM_GROUP=$(grep --no-messages --no-filename ^GROUP= \ - "${VM_TMP_ROOT}/usr/share/coreos/update.conf" \ - "${VM_TMP_ROOT}/etc/coreos/update.conf" | \ + "${VM_TMP_ROOT}/usr/share/flatcar/update.conf" \ + "${VM_TMP_ROOT}/etc/flatcar/update.conf" | \ tail -n 1 | sed -e 's/^GROUP=//') if [[ -z "${VM_GROUP}" ]]; then die "Unable to determine update group for this image." @@ -485,7 +485,7 @@ install_oem_package() { install_oem_aci() { local oem_aci=$(_get_vm_opt OEM_ACI) local aci_dir="${FLAGS_to}/oem-${oem_aci}-aci" - local aci_path="${aci_dir}/coreos-oem-${oem_aci}.aci" + local aci_path="${aci_dir}/flatcar-oem-${oem_aci}.aci" local binpkgflags=(--nogetbinpkg) [ -n "${oem_aci}" ] || return 0 @@ -505,7 +505,7 @@ install_oem_aci() { info "Installing ${oem_aci} OEM ACI" sudo install -Dpm 0644 \ "${aci_path}" \ - "${VM_TMP_ROOT}/usr/share/oem/coreos-oem-${oem_aci}.aci" || + "${VM_TMP_ROOT}/usr/share/oem/flatcar-oem-${oem_aci}.aci" || die "Could not install ${oem_aci} OEM ACI" } @@ -595,8 +595,8 @@ _write_cpio_common() { echo "/.noupdate f 444 root root echo -n" >"${VM_TMP_DIR}/extra" # Set correct group for PXE/ISO, which has no writeable /etc - echo /usr/share/coreos/update.conf f 644 root root \ - "sed -e 's/GROUP=.*$/GROUP=${VM_GROUP}/' ${base_dir}/share/coreos/update.conf" \ + echo /usr/share/flatcar/update.conf f 644 root root \ + "sed -e 's/GROUP=.*$/GROUP=${VM_GROUP}/' ${base_dir}/share/flatcar/update.conf" \ >> "${VM_TMP_DIR}/extra" # Build the squashfs, embed squashfs into a gzipped cpio @@ -616,7 +616,7 @@ _write_cpio_disk() { local grub_name="$(_dst_name "_grub.efi")" _write_cpio_common $@ # Pull the kernel and loader out of the filesystem - cp "${base_dir}"/boot/coreos/vmlinuz-a "${dst_dir}/${vmlinuz_name}" + cp "${base_dir}"/boot/flatcar/vmlinuz-a "${dst_dir}/${vmlinuz_name}" local grub_arch case $BOARD in @@ -624,7 +624,7 @@ _write_cpio_disk() { arm64-usr) grub_arch="arm64-efi" ;; esac - cp "${base_dir}/boot/coreos/grub/${grub_arch}/core.efi" "${dst_dir}/${grub_name}" + cp "${base_dir}/boot/flatcar/grub/${grub_arch}/core.efi" "${dst_dir}/${grub_name}" VM_GENERATED_FILES+=( "${dst_dir}/${vmlinuz_name}" "${dst_dir}/${grub_name}" ) } @@ -636,22 +636,22 @@ _write_iso_disk() { mkdir "${iso_target}" pushd "${iso_target}" >/dev/null - mkdir isolinux syslinux coreos - _write_cpio_common "$1" "${iso_target}/coreos/cpio.gz" - cp "${base_dir}"/boot/vmlinuz "${iso_target}/coreos/vmlinuz" + mkdir isolinux syslinux flatcar + _write_cpio_common "$1" "${iso_target}/flatcar/cpio.gz" + cp "${base_dir}"/boot/vmlinuz "${iso_target}/flatcar/vmlinuz" cp -R /usr/share/syslinux/* isolinux/ cat< isolinux/isolinux.cfg INCLUDE /syslinux/syslinux.cfg EOF cat< syslinux/syslinux.cfg -default coreos +default flatcar prompt 1 timeout 15 -label coreos +label flatcar menu default - kernel /coreos/vmlinuz - append initrd=/coreos/cpio.gz coreos.autologin + kernel /flatcar/vmlinuz + append initrd=/flatcar/cpio.gz flatcar.autologin EOF mkisofs -v -l -r -J -o $2 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table . isohybrid $2 @@ -1107,10 +1107,10 @@ EOF cat >"${json}" <>>>>>> Change names of env vars, paths, files, etc. to Flatcar + {FETCH,RESUME}COMMAND_GS="/usr/bin/gangue get \ +--json-key=/etc/portage/gangue.json $verify_key \ +"'"${URI}" "${DISTDIR}/${FILE}"' \ + "$@" +} + +script() { + enter "/mnt/host/source/src/scripts/$@" +} + +source .repo/manifests/version.txt +export FLATCAR_BUILD_ID + +# Set up GPG for signing uploads. +gpg --import "${GPG_SECRET_KEY_FILE}" + +script setup_board \ + --board="${BOARD}" \ + --getbinpkgver="${FLATCAR_VERSION}" \ + --regen_configs_only + +if [ "x${COREOS_OFFICIAL}" == x1 ] +then + script set_official --board="${BOARD}" --official +else + script set_official --board="${BOARD}" --noofficial +fi + +# Retrieve this version's torcx manifest +mkdir -p torcx/pkgs +enter gsutil cp -r \ + "${DOWNLOAD_ROOT}/torcx/manifests/${BOARD}/${FLATCAR_VERSION}/torcx_manifest.json"{,.sig} \ + /mnt/host/source/torcx/ +gpg --verify torcx/torcx_manifest.json.sig + +# Download all cas references from the manifest and verify their checksums +# TODO: technically we can skip ones that don't have a 'path' since they're not +# included in the image. +while read name digest hash +do + mkdir -p "torcx/pkgs/${BOARD}/${name}/${digest}" + enter gsutil cp -r "${TORCX_PKG_DOWNLOAD_ROOT}/pkgs/${BOARD}/${name}/${digest}" \ + "/mnt/host/source/torcx/pkgs/${BOARD}/${name}/" + downloaded_hash=$(sha512sum "torcx/pkgs/${BOARD}/${name}/${digest}/"*.torcx.tgz | awk '{print $1}') + if [[ "sha512-${downloaded_hash}" != "${hash}" ]] + then + echo "Torcx package had wrong hash: ${downloaded_hash} instead of ${hash}" + exit 1 + fi +done < <(jq -r '.value.packages[] | . as $p | .name as $n | $p.versions[] | [.casDigest, .hash] | join(" ") | [$n, .] | join(" ")' "torcx/torcx_manifest.json") + +script build_image \ + --board="${BOARD}" \ + --group="${GROUP}" \ + --getbinpkg \ + --getbinpkgver="${FLATCAR_VERSION}" \ + --sign="${SIGNING_USER}" \ + --sign_digests="${SIGNING_USER}" \ + --torcx_manifest=/mnt/host/source/torcx/torcx_manifest.json \ + --torcx_root=/mnt/host/source/torcx/ \ + --upload_root="${UPLOAD_ROOT}" \ + --upload prod container diff --git a/jenkins/packages.sh b/jenkins/packages.sh index cea5b5aee5..fefe75f121 100644 --- a/jenkins/packages.sh +++ b/jenkins/packages.sh @@ -15,7 +15,7 @@ enter() { bin/cork enter --bind-gpg-agent=false -- env \ CCACHE_DIR=/mnt/host/source/.cache/ccache \ CCACHE_MAXSIZE=5G \ - COREOS_DEV_BUILDS="${DOWNLOAD_ROOT}" \ + FLATCAR_DEV_BUILDS="${DOWNLOAD_ROOT}" \ {FETCH,RESUME}COMMAND_GS="/usr/bin/gangue get \ --json-key=/etc/portage/gangue.json $verify_key \ "'"${URI}" "${DISTDIR}/${FILE}"' \ @@ -27,7 +27,7 @@ script() { } source .repo/manifests/version.txt -export COREOS_BUILD_ID +export FLATCAR_BUILD_ID # Set up GPG for signing uploads. gpg --import "${GPG_SECRET_KEY_FILE}" @@ -37,13 +37,13 @@ enter ccache --zero-stats script setup_board \ --board="${BOARD}" \ - --getbinpkgver=${RELEASE_BASE:-"${COREOS_VERSION}" --toolchainpkgonly} \ + --getbinpkgver=${RELEASE_BASE:-"${FLATCAR_VERSION}" --toolchainpkgonly} \ --skip_chroot_upgrade \ --force script build_packages \ --board="${BOARD}" \ - --getbinpkgver=${RELEASE_BASE:-"${COREOS_VERSION}" --toolchainpkgonly} \ + --getbinpkgver=${RELEASE_BASE:-"${FLATCAR_VERSION}" --toolchainpkgonly} \ --skip_chroot_upgrade \ --skip_torcx_store \ --sign="${SIGNING_USER}" \ diff --git a/jenkins/sdk.sh b/jenkins/sdk.sh index 8437776a4e..7e9cac3276 100644 --- a/jenkins/sdk.sh +++ b/jenkins/sdk.sh @@ -5,7 +5,7 @@ enter() { } source .repo/manifests/version.txt -export COREOS_BUILD_ID +export FLATCAR_BUILD_ID # Set up GPG for signing uploads. gpg --import "${GPG_SECRET_KEY_FILE}" diff --git a/jenkins/toolchains.sh b/jenkins/toolchains.sh index e46ecf8c56..d90f2f3b7c 100644 --- a/jenkins/toolchains.sh +++ b/jenkins/toolchains.sh @@ -5,7 +5,7 @@ enter() { } source .repo/manifests/version.txt -export COREOS_BUILD_ID +export FLATCAR_BUILD_ID # Set up GPG for signing uploads. gpg --import "${GPG_SECRET_KEY_FILE}" diff --git a/jenkins/vm.sh b/jenkins/vm.sh index 2f9748dba1..1acfe58bcd 100644 --- a/jenkins/vm.sh +++ b/jenkins/vm.sh @@ -11,7 +11,7 @@ enter() { verify_key=--verify-key=/etc/portage/gangue.asc sudo ln -f "${GS_DEVEL_CREDS}" chroot/etc/portage/gangue.json bin/cork enter --bind-gpg-agent=false -- env \ - COREOS_DEV_BUILDS="${GS_DEVEL_ROOT}" \ + FLATCAR_DEV_BUILDS="${GS_DEVEL_ROOT}" \ {FETCH,RESUME}COMMAND_GS="/usr/bin/gangue get \ --json-key=/etc/portage/gangue.json $verify_key \ "'"${URI}" "${DISTDIR}/${FILE}"' \ @@ -23,7 +23,7 @@ script() { } source .repo/manifests/version.txt -export COREOS_BUILD_ID +export FLATCAR_BUILD_ID # Set up GPG for signing uploads. gpg --import "${GPG_SECRET_KEY_FILE}" @@ -32,13 +32,13 @@ gpg --import "${GPG_SECRET_KEY_FILE}" mkdir -p src tmp bin/cork download-image \ - --root="${UPLOAD_ROOT}/boards/${BOARD}/${COREOS_VERSION}" \ + --root="${UPLOAD_ROOT}/boards/${BOARD}/${FLATCAR_VERSION}" \ --json-key="${GOOGLE_APPLICATION_CREDENTIALS}" \ --cache-dir=./src \ --platform=qemu \ --verify=true $verify_key -img=src/coreos_production_image.bin +img=src/flatcar_production_image.bin [[ "${img}.bz2" -nt "${img}" ]] && enter lbunzip2 -k -f "/mnt/host/source/${img}.bz2" @@ -46,7 +46,7 @@ script image_to_vm.sh \ --board="${BOARD}" \ --format="${FORMAT}" \ --getbinpkg \ - --getbinpkgver="${COREOS_VERSION}" \ + --getbinpkgver="${FLATCAR_VERSION}" \ --from=/mnt/host/source/src \ --to=/mnt/host/source/tmp \ --sign="${SIGNING_USER}" \ diff --git a/jenkins/vm.sh.orig b/jenkins/vm.sh.orig new file mode 100644 index 0000000000..742c791e8a --- /dev/null +++ b/jenkins/vm.sh.orig @@ -0,0 +1,61 @@ +#!/bin/bash -ex + +# Clear out old images. +sudo rm -rf chroot/build tmp + +enter() { + local verify_key= + trap 'sudo rm -f chroot/etc/portage/gangue.*' RETURN + [ -s verify.asc ] && + sudo ln -f verify.asc chroot/etc/portage/gangue.asc && + verify_key=--verify-key=/etc/portage/gangue.asc + sudo ln -f "${GS_DEVEL_CREDS}" chroot/etc/portage/gangue.json +<<<<<<< HEAD + bin/cork enter --bind-gpg-agent=false -- env \ + COREOS_DEV_BUILDS="${GS_DEVEL_ROOT}" \ +======= + bin/cork enter --experimental -- env \ + FLATCAR_DEV_BUILDS="${GS_DEVEL_ROOT}" \ +>>>>>>> Change names of env vars, paths, files, etc. to Flatcar + {FETCH,RESUME}COMMAND_GS="/usr/bin/gangue get \ +--json-key=/etc/portage/gangue.json $verify_key \ +"'"${URI}" "${DISTDIR}/${FILE}"' \ + "$@" +} + +script() { + enter "/mnt/host/source/src/scripts/$@" +} + +source .repo/manifests/version.txt +export FLATCAR_BUILD_ID + +# Set up GPG for signing uploads. +gpg --import "${GPG_SECRET_KEY_FILE}" + +[ -s verify.asc ] && verify_key=--verify-key=verify.asc || verify_key= + +mkdir -p src tmp +bin/cork download-image \ + --root="${UPLOAD_ROOT}/boards/${BOARD}/${FLATCAR_VERSION}" \ + --json-key="${GOOGLE_APPLICATION_CREDENTIALS}" \ + --cache-dir=./src \ + --platform=qemu \ + --verify=true $verify_key + +img=src/flatcar_production_image.bin +[[ "${img}.bz2" -nt "${img}" ]] && +enter lbunzip2 -k -f "/mnt/host/source/${img}.bz2" + +script image_to_vm.sh \ + --board="${BOARD}" \ + --format="${FORMAT}" \ + --getbinpkg \ + --getbinpkgver="${FLATCAR_VERSION}" \ + --from=/mnt/host/source/src \ + --to=/mnt/host/source/tmp \ + --sign="${SIGNING_USER}" \ + --sign_digests="${SIGNING_USER}" \ + --download_root="${DOWNLOAD_ROOT}" \ + --upload_root="${UPLOAD_ROOT}" \ + --upload diff --git a/lib/cros_vm_constants.sh b/lib/cros_vm_constants.sh index 9012135bfc..af65a8b046 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="coreos.vmx" +DEFAULT_VMX="flatcar.vmx" DEFAULT_VBOX_DISK="os.vdi" -DEFAULT_QEMU_IMAGE="coreos_developer_qemu_image.img" +DEFAULT_QEMU_IMAGE="flatcar_developer_qemu_image.img" # Minimum sizes for full size vm images -- needed for update. MIN_VDISK_SIZE_FULL=9216 diff --git a/oem/openstack/glance_load.sh b/oem/openstack/glance_load.sh index e79b06fb69..0af21ba593 100755 --- a/oem/openstack/glance_load.sh +++ b/oem/openstack/glance_load.sh @@ -50,7 +50,7 @@ if [[ -z "${baseurl}" ]]; then fi version_url="${baseurl}/version.txt" -image_url="${baseurl}/coreos_production_openstack_image.img.bz2" +image_url="${baseurl}/flatcar_production_openstack_image.img.bz2" # use the following location as our local work space tmplocation=$(mktemp -d /var/tmp/glanceload.XXX) @@ -60,25 +60,25 @@ curl --fail -s -L -O ${version_url} . version.txt # if we already have the image don't waste time -if glance image-show "CoreOS-${release}-v${COREOS_VERSION}"; then +if glance image-show "Flatcar-${release}-v${Flatcar_VERSION}"; then echo "Image already exists." rm -rf ${tmplocation} exit fi -coreosimg="coreos_${COREOS_VERSION}_openstack_image.img" +flatcarimg="flatcar_${FLATCAR_VERSION}_openstack_image.img" # change the following line to reflect the image to be chosen, openstack # is used by default -curl --fail -s -L ${image_url} | bunzip2 > ${coreosimg} +curl --fail -s -L ${image_url} | bunzip2 > ${flatcarimg} # perform actual image creation # here we set the os_release, os_verison, os_family, and os_distro variables # for intelligent consumption of images by scripts -glance --os-image-api-version 1 image-create --name CoreOS-${release}-v${COREOS_VERSION} --progress \ - --is-public true --property os_distro=coreos --property os_family=coreos \ - --property os_version=${COREOS_VERSION} \ - --disk-format qcow2 --container-format bare --min-disk 6 --file $coreosimg +glance --os-image-api-version 1 image-create --name Flatcar-${release}-v${FLATCAR_VERSION} --progress \ + --is-public true --property os_distro=flatcar --property os_family=flatcar \ + --property os_version=${FLATCAR_VERSION} \ + --disk-format qcow2 --container-format bare --min-disk 6 --file $flatcarimg # optionally, set --property os_release=${release} in the glance image-create # command above and uncomment the two commands below to support searching by diff --git a/offline_signing/sign.sh b/offline_signing/sign.sh index ecd690a951..717ff31d8d 100755 --- a/offline_signing/sign.sh +++ b/offline_signing/sign.sh @@ -4,19 +4,19 @@ set -ex DATA_DIR="$(readlink -f "$1")" KEYS_DIR="$(readlink -f "$(dirname "$0")")" -gpg2 --verify "${DATA_DIR}/coreos_production_update.bin.bz2.sig" -gpg2 --verify "${DATA_DIR}/coreos_production_image.vmlinuz.sig" -gpg2 --verify "${DATA_DIR}/coreos_production_update.zip.sig" -bunzip2 --keep "${DATA_DIR}/coreos_production_update.bin.bz2" -unzip "${DATA_DIR}/coreos_production_update.zip" -d "${DATA_DIR}" +gpg2 --verify "${DATA_DIR}/flatcar_production_update.bin.bz2.sig" +gpg2 --verify "${DATA_DIR}/flatcar_production_image.vmlinuz.sig" +gpg2 --verify "${DATA_DIR}/flatcar_production_update.zip.sig" +bunzip2 --keep "${DATA_DIR}/flatcar_production_update.bin.bz2" +unzip "${DATA_DIR}/flatcar_production_update.zip" -d "${DATA_DIR}" export PATH="${DATA_DIR}:${PATH}" cd "${DATA_DIR}" ./core_sign_update \ - --image "${DATA_DIR}/coreos_production_update.bin" \ - --kernel "${DATA_DIR}/coreos_production_image.vmlinuz" \ - --output "${DATA_DIR}/coreos_production_update.gz" \ + --image "${DATA_DIR}/flatcar_production_update.bin" \ + --kernel "${DATA_DIR}/flatcar_production_image.vmlinuz" \ + --output "${DATA_DIR}/flatcar_production_update.gz" \ --private_keys "${KEYS_DIR}/devel.key.pem+pkcs11:object=CoreOS_Update_Signing_Key;type=private" \ --public_keys "${KEYS_DIR}/devel.pub.pem+${KEYS_DIR}/prod-2.pub.pem" \ --keys_separator "+" diff --git a/offline_signing/transfer.sh b/offline_signing/transfer.sh index b68751b13c..1593aec16a 100755 --- a/offline_signing/transfer.sh +++ b/offline_signing/transfer.sh @@ -22,12 +22,12 @@ download() { pushd "${dir}" >/dev/null gsutil -m cp \ - "${gs}/coreos_production_image.vmlinuz" \ - "${gs}/coreos_production_image.vmlinuz.sig" \ - "${gs}/coreos_production_update.bin.bz2" \ - "${gs}/coreos_production_update.bin.bz2.sig" \ - "${gs}/coreos_production_update.zip" \ - "${gs}/coreos_production_update.zip.sig" ./ + "${gs}/flatcar_production_image.vmlinuz" \ + "${gs}/flatcar_production_image.vmlinuz.sig" \ + "${gs}/flatcar_production_update.bin.bz2" \ + "${gs}/flatcar_production_update.bin.bz2.sig" \ + "${gs}/flatcar_production_update.zip" \ + "${gs}/flatcar_production_update.zip.sig" ./ # torcx manifest: try embargoed release bucket first local torcx_base="gs://builds.release.core-os.net/embargoed/devfiles/torcx/manifests/${board}/${version}" @@ -40,9 +40,9 @@ download() { "${torcx_base}/torcx_manifest.json.sig" \ ./ - gpg2 --verify "coreos_production_image.vmlinuz.sig" - gpg2 --verify "coreos_production_update.bin.bz2.sig" - gpg2 --verify "coreos_production_update.zip.sig" + gpg2 --verify "flatcar_production_image.vmlinuz.sig" + gpg2 --verify "flatcar_production_update.bin.bz2.sig" + gpg2 --verify "flatcar_production_update.zip.sig" gpg2 --verify "torcx_manifest.json.sig" popd >/dev/null @@ -54,7 +54,7 @@ upload() { local board="$3" local dir="${BASEDIR}/${board}/${version}" - local payload="${dir}/coreos_production_update.gz" + local payload="${dir}/flatcar_production_update.gz" local torcx_manifest="${dir}/torcx_manifest.json" local torcx_manifest_sig="${dir}/torcx_manifest.json.asc" local path diff --git a/sdk_lib/sdk_util.sh b/sdk_lib/sdk_util.sh index 5c60e46159..62c8066676 100644 --- a/sdk_lib/sdk_util.sh +++ b/sdk_lib/sdk_util.sh @@ -5,13 +5,13 @@ # found in the LICENSE file. # common.sh must be properly sourced before this file. -[[ -n "${COREOS_SDK_VERSION}" ]] || exit 1 +[[ -n "${FLATCAR_SDK_VERSION}" ]] || exit 1 -COREOS_SDK_ARCH="amd64" # We are unlikely to support anything else. -COREOS_SDK_TARBALL="coreos-sdk-${COREOS_SDK_ARCH}-${COREOS_SDK_VERSION}.tar.bz2" -COREOS_SDK_TARBALL_CACHE="${REPO_CACHE_DIR}/sdks" -COREOS_SDK_TARBALL_PATH="${COREOS_SDK_TARBALL_CACHE}/${COREOS_SDK_TARBALL}" -COREOS_SDK_URL="${COREOS_DEV_BUILDS}/sdk/${COREOS_SDK_ARCH}/${COREOS_SDK_VERSION}/${COREOS_SDK_TARBALL}" +FLATCAR_SDK_ARCH="amd64" # We are unlikely to support anything else. +FLATCAR_SDK_TARBALL="flatcar-sdk-${FLATCAR_SDK_ARCH}-${FLATCAR_SDK_VERSION}.tar.bz2" +FLATCAR_SDK_TARBALL_CACHE="${REPO_CACHE_DIR}/sdks" +FLATCAR_SDK_TARBALL_PATH="${FLATCAR_SDK_TARBALL_CACHE}/${FLATCAR_SDK_TARBALL}" +FLATCAR_SDK_URL="${FLATCAR_DEV_BUILDS}/sdk/${FLATCAR_SDK_ARCH}/${FLATCAR_SDK_VERSION}/${FLATCAR_SDK_TARBALL}" # Download the current SDK tarball (if required) and verify digests/sig sdk_download_tarball() { @@ -19,13 +19,13 @@ sdk_download_tarball() { return 0 fi - info "Downloading ${COREOS_SDK_TARBALL}" - info "URL: ${COREOS_SDK_URL}" + info "Downloading ${FLATCAR_SDK_TARBALL}" + info "URL: ${FLATCAR_SDK_URL}" local suffix for suffix in "" ".DIGESTS"; do # TODO(marineam): download .asc wget --tries=3 --timeout=30 --continue \ - -O "${COREOS_SDK_TARBALL_PATH}${suffix}" \ - "${COREOS_SDK_URL}${suffix}" \ + -O "${FLATCAR_SDK_TARBALL_PATH}${suffix}" \ + "${FLATCAR_SDK_URL}${suffix}" \ || die_notrace "SDK download failed!" done @@ -34,21 +34,21 @@ sdk_download_tarball() { } sdk_verify_digests() { - if [[ ! -f "${COREOS_SDK_TARBALL_PATH}" || \ - ! -f "${COREOS_SDK_TARBALL_PATH}.DIGESTS" ]]; then + if [[ ! -f "${FLATCAR_SDK_TARBALL_PATH}" || \ + ! -f "${FLATCAR_SDK_TARBALL_PATH}.DIGESTS" ]]; then return 1 fi # TODO(marineam): Add gpg signature verification too. - verify_digests "${COREOS_SDK_TARBALL_PATH}" || return 1 + verify_digests "${FLATCAR_SDK_TARBALL_PATH}" || return 1 } sdk_clean_cache() { - pushd "${COREOS_SDK_TARBALL_CACHE}" >/dev/null + pushd "${FLATCAR_SDK_TARBALL_CACHE}" >/dev/null local filename for filename in *; do - if [[ "${filename}" == "${COREOS_SDK_TARBALL}"* ]]; then + if [[ "${filename}" == "${FLATCAR_SDK_TARBALL}"* ]]; then continue fi info "Cleaning up ${filename}" diff --git a/setup_board b/setup_board index ec6129a8fe..1ca62f369f 100755 --- a/setup_board +++ b/setup_board @@ -120,9 +120,9 @@ EOF generate_binhost_list() { local t [[ "${FLAGS_toolchainpkgonly}" -eq "${FLAGS_TRUE}" ]] && t="-t" - FLAGS_getbinpkgver="${FLAGS_getbinpkgver/current/${COREOS_VERSION_ID}}" - FLAGS_getbinpkgver="${FLAGS_getbinpkgver/latest/${COREOS_VERSION_ID}}" - FLAGS_getbinpkgver="${FLAGS_getbinpkgver/sdk/${COREOS_SDK_VERSION}}" + FLAGS_getbinpkgver="${FLAGS_getbinpkgver/current/${FLATCAR_VERSION_ID}}" + FLAGS_getbinpkgver="${FLAGS_getbinpkgver/latest/${FLATCAR_VERSION_ID}}" + FLAGS_getbinpkgver="${FLAGS_getbinpkgver/sdk/${FLATCAR_SDK_VERSION}}" get_board_binhost $t "${BOARD}" ${FLAGS_getbinpkgver} } diff --git a/tag_release b/tag_release index 8ad71342d3..f97ee53aac 100755 --- a/tag_release +++ b/tag_release @@ -28,7 +28,7 @@ DEFAULT_MINOR=0 DEFAULT_BRANCH=${FLAGS_FALSE} DEFAULT_BRANCH_PROJECTS= -CURRENT_VERSION=( ${COREOS_VERSION_ID//./ } ) +CURRENT_VERSION=( ${FLATCAR_VERSION_ID//./ } ) # Detect if we are on a branch or still tracking master. DEFAULT_MANIFEST=$(readlink "${REPO_MANIFESTS_DIR}/default.xml") \ @@ -48,8 +48,8 @@ fi DEFINE_integer major ${DEFAULT_MAJOR} "Branch major version (aka 'build')" DEFINE_integer minor ${DEFAULT_MINOR} "Branch revision or minor version" DEFINE_integer patch 0 "Branch patch id, normally 0" -DEFINE_string sdk_version "${COREOS_VERSION_ID}" \ - "SDK version to use, or 'keep'. (current: ${COREOS_SDK_VERSION})" +DEFINE_string sdk_version "${FLATCAR_VERSION_ID}" \ + "SDK version to use, or 'keep'. (current: ${FLATCAR_SDK_VERSION})" DEFINE_boolean branch ${DEFAULT_BRANCH} "Release branch, diverge from master" DEFINE_string branch_projects "${DEFAULT_BRANCH_PROJECTS}" \ "Branch the named projects (with a 'coreos/' prefix) in the manifest." @@ -82,7 +82,7 @@ TAG_NAME="v${BRANCH_VERSION}" if [[ "${FLAGS_sdk_version}" == keep || "${FLAGS_sdk_version}" == current ]] then - FLAGS_sdk_version="${COREOS_SDK_VERSION}" + FLAGS_sdk_version="${FLATCAR_SDK_VERSION}" fi if [[ "${FLAGS_sdk_version}" == "${BRANCH_VERSION}" ]]; then @@ -92,9 +92,9 @@ if [[ "${FLAGS_sdk_version}" == "${BRANCH_VERSION}" ]]; then fi # Verify that the specified SDK version exists -COREOS_SDK_VERSION="${FLAGS_sdk_version}" +FLATCAR_SDK_VERSION="${FLAGS_sdk_version}" . "${SCRIPT_ROOT}/sdk_lib/sdk_util.sh" -if ! curl --head --fail --silent "${COREOS_SDK_URL}" > /dev/null ; then +if ! curl --head --fail --silent "${FLATCAR_SDK_URL}" > /dev/null ; then die_notrace "SDK version does not exist." \ "Try --sdk_version keep to use the existing SDK." fi @@ -140,10 +140,10 @@ if [[ ${FLAGS_branch} -eq ${FLAGS_TRUE} ]]; then fi tee version.txt <