From 6d01140927b1ed6b9ed216099fa33406f649e22d Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Tue, 2 Apr 2024 13:23:18 +0900 Subject: [PATCH 1/2] app-emulation/actool,acbuild: Remove actool and acbuild Both actool and acbuild upstream are deprecated and probably not in use anymore. Remove actool from the image and acbuild from the SDK. --- .../2024-04-02-remove-actool-and-acbuild.md | 1 + .../acbuild/acbuild-0.4.0.ebuild | 1 - .../app-emulation/acbuild/acbuild-9999.ebuild | 49 ------------------- .../app-emulation/actool/actool-0.8.11.ebuild | 1 - .../app-emulation/actool/actool-9999.ebuild | 33 ------------- .../app-emulation/actool/metadata.xml | 4 -- .../coreos-base/coreos/coreos-0.0.1.ebuild | 1 - .../sdk-depends/sdk-depends-0.0.1.ebuild | 2 - 8 files changed, 1 insertion(+), 91 deletions(-) create mode 100644 changelog/changes/2024-04-02-remove-actool-and-acbuild.md delete mode 120000 sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-0.4.0.ebuild delete mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-9999.ebuild delete mode 120000 sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-0.8.11.ebuild delete mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-9999.ebuild delete mode 100644 sdk_container/src/third_party/coreos-overlay/app-emulation/actool/metadata.xml diff --git a/changelog/changes/2024-04-02-remove-actool-and-acbuild.md b/changelog/changes/2024-04-02-remove-actool-and-acbuild.md new file mode 100644 index 00000000000..07e619e542b --- /dev/null +++ b/changelog/changes/2024-04-02-remove-actool-and-acbuild.md @@ -0,0 +1 @@ +- Removed `actool` from the image and `acbuild` from the SDK as these tools are deprecated and not used ([scripts#1817](https://github.com/flatcar/scripts/pull/1817)) diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-0.4.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-0.4.0.ebuild deleted file mode 120000 index 64278d411fe..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-0.4.0.ebuild +++ /dev/null @@ -1 +0,0 @@ -acbuild-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-9999.ebuild deleted file mode 100644 index ca430b3f2b9..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/acbuild/acbuild-9999.ebuild +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2015 CoreOS, Inc. -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -CROS_WORKON_PROJECT="appc/acbuild" -CROS_WORKON_REPO="https://github.com" -CROS_WORKON_LOCALNAME="appc-acbuild" -COREOS_GO_PACKAGE="github.com/appc/acbuild" -COREOS_GO_GO111MODULE="off" -inherit coreos-go toolchain-funcs cros-workon - -if [[ "${PV}" == 9999 ]]; then - KEYWORDS="~amd64 ~arm64" -else - CROS_WORKON_COMMIT="2d120a832bd4c3601ca307bf7dd1612a12b55d29" # v0.4.0 - KEYWORDS="amd64 arm64" -fi - -DESCRIPTION="A build tool for ACIs" -HOMEPAGE="https://github.com/appc/acbuild" -SRC_URI="" - -LICENSE="Apache-2.0" -SLOT="0" -IUSE="" - -RDEPEND="sys-apps/kmod - app-crypt/gnupg - sys-apps/systemd" - -src_compile(){ - if [[ "${PV}" == 9999 ]]; then - # set semver - local v - v=$(git describe --long --dirty) || die - v=${v#v} - v=${v/-/+} - GO_LDFLAGS="-X ${COREOS_GO_PACKAGE}/lib.Version=${v}" - else - GO_LDFLAGS="-X ${COREOS_GO_PACKAGE}/lib.Version=${PV}" - fi - - go_build "${COREOS_GO_PACKAGE}/acbuild" -} - -src_install(){ - dobin "${WORKDIR}/gopath/bin/acbuild" -} - diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-0.8.11.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-0.8.11.ebuild deleted file mode 120000 index 394b35eae1a..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-0.8.11.ebuild +++ /dev/null @@ -1 +0,0 @@ -actool-9999.ebuild \ No newline at end of file diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-9999.ebuild deleted file mode 100644 index 03ed2192cd7..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/actool-9999.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2015 CoreOS, Inc. -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 -CROS_WORKON_PROJECT="appc/spec" -CROS_WORKON_REPO="https://github.com" -CROS_WORKON_LOCALNAME="appc-spec" -COREOS_GO_PACKAGE="github.com/appc/spec" -COREOS_GO_GO111MODULE="off" -inherit coreos-go cros-workon - -if [[ "${PV}" == 9999 ]]; then - KEYWORDS="~amd64 ~arm64" -else - CROS_WORKON_COMMIT="cbe99b7160b1397bf89f9c8bb1418f69c9424049" # v0.8.11 - KEYWORDS="amd64 arm64" -fi - -DESCRIPTION="App Container builder and validator" -HOMEPAGE="https://github.com/appc/spec" -SRC_URI="" - -LICENSE="Apache-2.0" -SLOT="0" -IUSE="" - -src_compile() { - go_build "${COREOS_GO_PACKAGE}/actool" -} - -src_install() { - dobin "${WORKDIR}/gopath/bin/actool" -} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/metadata.xml deleted file mode 100644 index 097975e3adc..00000000000 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/actool/metadata.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild index a91885d5546..9a7bb239af7 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild @@ -106,7 +106,6 @@ RDEPEND="${RDEPEND} app-crypt/go-tspi app-crypt/tpmpolicy app-editors/vim - app-emulation/actool app-containers/cri-tools app-misc/ca-certificates app-misc/jq diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-devel/sdk-depends/sdk-depends-0.0.1.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-devel/sdk-depends/sdk-depends-0.0.1.ebuild index 717429e8071..3fa37ea36a3 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-devel/sdk-depends/sdk-depends-0.0.1.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-devel/sdk-depends/sdk-depends-0.0.1.ebuild @@ -19,8 +19,6 @@ DEPEND=" app-arch/pbzip2 app-crypt/efitools app-crypt/sbsigntools - app-emulation/acbuild - app-emulation/actool app-emulation/open-vmdk app-eselect/eselect-python app-misc/jq From 1513f3a966f51ece804dede1da74785dabd6e75a Mon Sep 17 00:00:00 2001 From: Kai Lueke Date: Wed, 3 Apr 2024 13:02:22 +0900 Subject: [PATCH 2/2] Remove ACI image building bits The ACI OEM container image was used with rkt for GCE. For long time this has been migrated to systemd-nspawn and now systemd-sysext. Remove the unused build library code. --- build_library/oem_aci_util.sh | 124 --------------------------------- build_library/vm_image_util.sh | 30 -------- build_oem_aci | 78 --------------------- image_to_vm.sh | 1 - 4 files changed, 233 deletions(-) delete mode 100644 build_library/oem_aci_util.sh delete mode 100755 build_oem_aci diff --git a/build_library/oem_aci_util.sh b/build_library/oem_aci_util.sh deleted file mode 100644 index 4f9fd3b3432..00000000000 --- a/build_library/oem_aci_util.sh +++ /dev/null @@ -1,124 +0,0 @@ -# Copyright (c) 2016 The CoreOS Authors. All rights reserved. -# 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 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 -# being written into place for the ACI. Optionally, a shell script can also be -# included at files/manglefs.sh to be run after all packages are installed. It -# is intended to be used to make modifications to the file system layout and -# program paths that some included agent software might expect. - -# Copied from create_prod_image() -create_oem_aci_image() { - local image_name="$1" - local disk_layout="$2" - local update_group="$3" - local base_pkg="${4?No base package was specified}" - - info "Building OEM ACI staging image ${image_name}" - local root_fs_dir="${BUILD_DIR}/rootfs" - local image_contents="${image_name%.bin}_contents.txt" - local image_packages="${image_name%.bin}_packages.txt" - local image_licenses="${image_name%.bin}_licenses.json" - - start_image \ - "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}" - - # Install minimal GCC (libs only) and then everything else - set_image_profile oem-aci - extract_prod_gcc "${root_fs_dir}" - emerge_to_image "${root_fs_dir}" "${base_pkg}" - run_ldconfig "${root_fs_dir}" - write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}" - write_licenses "${root_fs_dir}" "${BUILD_DIR}/${image_licenses}" - insert_licenses "${BUILD_DIR}/${image_licenses}" "${root_fs_dir}" - - # clean-ups of things we do not need - sudo rm ${root_fs_dir}/etc/csh.env - sudo rm -rf ${root_fs_dir}/etc/env.d - sudo rm -rf ${root_fs_dir}/var/db/pkg - - sudo mv ${root_fs_dir}/etc/profile.env \ - ${root_fs_dir}/usr/share/baselayout/profile.env - - # Move the ld.so configs into /usr so they can be symlinked from / - sudo mv ${root_fs_dir}/etc/ld.so.conf ${root_fs_dir}/usr/lib - sudo mv ${root_fs_dir}/etc/ld.so.conf.d ${root_fs_dir}/usr/lib - - sudo ln --symbolic ../usr/lib/ld.so.conf ${root_fs_dir}/etc/ld.so.conf - - # Add a tmpfiles rule that symlink ld.so.conf from /usr into / - sudo tee "${root_fs_dir}/usr/lib/tmpfiles.d/baselayout-ldso.conf" \ - > /dev/null </dev/null) - local staging_image="coreos_oem_${oem}_aci_stage.bin" - - [ -n "${ebuild}" ] || die_notrace "No ebuild exists for OEM \"${oem}\"" - grep -Fqs '(meta package)' "${ebuild}" || - die_notrace "The \"${base_pkg}\" ebuild is not a meta package" - - # Build a staging image for this OEM. - create_oem_aci_image "${staging_image}" container stable "${base_pkg}" - - # Remount the staging image to brutalize the rootfs for broken services. - "${BUILD_LIBRARY_DIR}/disk_util" --disk_layout=container \ - mount "${BUILD_DIR}/${staging_image}" "${aciroot}/rootfs" - trap "cleanup_mounts '${aciroot}/rootfs' && delete_prompt" EXIT - [ -r "${ebuild%/*}/files/manglefs.sh" ] && - sudo sh -c "cd '${aciroot}/rootfs' && . '${ebuild%/*}/files/manglefs.sh'" - - # Substitute variables into the OEM manifest to produce the final version. - oem_aci_write_manifest \ - "${ebuild%/*}/files/manifest.in" \ - "${aciroot}/manifest" \ - "coreos.com/oem-${oem}" - - # Write a tar ACI file containing the manifest and mounted rootfs contents. - sudo tar -C "${aciroot}" -czf "${BUILD_DIR}/flatcar-oem-${oem}.aci" \ - manifest rootfs - - # Unmount the staging image, and delete it to save space. - cleanup_mounts "${aciroot}/rootfs" - trap - EXIT - rm -f "${BUILD_DIR}/${staging_image}" -} diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 8e8010cdf67..fd796c987ef 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -507,36 +507,6 @@ install_oem_package() { sudo rm -rf "${oem_tmp}" } -# Write the OEM ACI file into the OEM partition. -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}/flatcar-oem-${oem_aci}.aci" - local binpkgflags=(--nogetbinpkg) - - [ -n "${oem_aci}" ] || return 0 - - [ "${FLAGS_getbinpkg}" = "${FLAGS_TRUE}" ] && - binpkgflags=(--getbinpkg --getbinpkgver="${FLAGS_getbinpkgver}") - - # Build an OEM ACI if necessary, supplying build environment flags. - [ -e "${aci_path}" ] && - info "ACI ${aci_path} exists; reusing it" || - "${SCRIPT_ROOT}/build_oem_aci" \ - --board="${BOARD}" \ - --build_dir="${aci_dir}" \ - "${binpkgflags[@]}" \ - "${oem_aci}" - - info "Installing ${oem_aci} OEM ACI" - sudo install -Dpm 0644 \ - "${aci_path}" \ - "${VM_TMP_ROOT}/oem/flatcar-oem-${oem_aci}.aci" || - die "Could not install ${oem_aci} OEM ACI" - # Remove aci_dir if building ACI and installing it succeeded - rm -rf "${aci_dir}" -} - # Write the OEM sysext file into the OEM partition. install_oem_sysext() { local oem_sysext=$(_get_vm_opt OEM_SYSEXT) diff --git a/build_oem_aci b/build_oem_aci deleted file mode 100755 index d2fbe19a46c..00000000000 --- a/build_oem_aci +++ /dev/null @@ -1,78 +0,0 @@ -#!/bin/bash - -# Copyright (c) 2016 The CoreOS Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# This is a wrapper around the oem_aci_util.sh functions to set up the -# necessary environment, similar to the build_image script. - -SCRIPT_ROOT=$(dirname $(readlink -f "$0")) -. "${SCRIPT_ROOT}/common.sh" || exit 1 - -# Script must run inside the chroot -assert_inside_chroot - -assert_not_root_user - -# Developer-visible flags. -DEFINE_string board "${DEFAULT_BOARD}" \ - "The board to build an image for." -DEFINE_string build_dir "" \ - "Directory in which to place image result directories (named by version)" -DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \ - "Download binary packages from remote repository." -DEFINE_string getbinpkgver "" \ - "Use binary packages from a specific version." - -FLAGS_HELP="USAGE: build_oem_aci [flags] [oem name]. -This script is used to build a CoreOS OEM ACI. - -Examples: - -build_oem_aci --board=amd64-usr --build_dir= gce -... -" -show_help_if_requested "$@" - -# The following options are advanced options, only available to those willing -# to read the source code. They are not shown in help output, since they are -# not needed for the typical developer workflow. -DEFINE_integer build_attempt 1 \ - "The build attempt for this image build." -DEFINE_string group "oem-aci" \ - "The update group (not used for actual updates here)" -DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ - "Directory in which to place image result directories (named by version)" -DEFINE_string version "" \ - "Overrides version number in name to this version." - -# Parse command line. -FLAGS "$@" || exit 1 -[ -z "${FLAGS_ARGV}" ] && echo 'No OEM given' && exit 0 -eval set -- "${FLAGS_ARGV}" - -# Only now can we die on error. shflags functions leak non-zero error codes, -# so will die prematurely if 'switch_to_strict_mode' is specified before now. -switch_to_strict_mode - -# If downloading packages is enabled ensure the board is configured properly. -if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then - "${SRC_ROOT}/scripts/setup_board" --board="${FLAGS_board}" \ - --getbinpkgver="${FLAGS_getbinpkgver}" --regen_configs_only -fi - -# N.B. Ordering matters for some of the libraries below, because -# some of the files contain initialization used by later files. -. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1 -. "${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}/test_image_content.sh" || exit 1 -. "${BUILD_LIBRARY_DIR}/oem_aci_util.sh" || exit 1 - -BUILD_DIR=${FLAGS_build_dir:-$BUILD_DIR} - -for oem -do oem_aci_create "${oem}" -done diff --git a/image_to_vm.sh b/image_to_vm.sh index 2a6c1447661..d496fe8ecb0 100755 --- a/image_to_vm.sh +++ b/image_to_vm.sh @@ -117,7 +117,6 @@ setup_disk_image "${FLAGS_disk_layout}" # Optionally install any OEM packages install_oem_package -install_oem_aci install_oem_sysext run_fs_hook