From 7f6aa5d50f035feb751f655ffa70b18dd68f5650 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 20 Sep 2013 21:24:33 -0400 Subject: [PATCH 1/3] fix(coreos-base/coreos): Switch awk implementation to gawk. Space saving by using mawk is not significant and a number of things depend on gawk so save us the trouble and just switch. --- .../{coreos-base-0-r67.ebuild => coreos-base-0-r68.ebuild} | 0 .../coreos-base/coreos-base/coreos-base-0.ebuild | 4 ---- .../{coreos-0.0.1-r208.ebuild => coreos-0.0.1-r209.ebuild} | 0 .../coreos-overlay/coreos-base/coreos/coreos-0.0.1.ebuild | 2 +- 4 files changed, 1 insertion(+), 5 deletions(-) rename sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/{coreos-base-0-r67.ebuild => coreos-base-0-r68.ebuild} (100%) rename sdk_container/src/third_party/coreos-overlay/coreos-base/coreos/{coreos-0.0.1-r208.ebuild => coreos-0.0.1-r209.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0-r67.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0-r68.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0-r67.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0-r68.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0.ebuild index 33500ea930..2994609718 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-base/coreos-base-0.ebuild @@ -27,7 +27,6 @@ DEPEND="sys-apps/baselayout ! Date: Fri, 20 Sep 2013 21:28:38 -0400 Subject: [PATCH 2/3] fix(coreos-base/coreos-dev): Add gentoolkit (includes equery) I keep wanting this tool, so here it is! Add explicit dependency on portage just to be clear that it is in the dev image, not the base image. --- ...{coreos-dev-0.1.0-r65.ebuild => coreos-dev-0.1.0-r66.ebuild} | 0 .../coreos-base/coreos-dev/coreos-dev-0.1.0.ebuild | 2 ++ 2 files changed, 2 insertions(+) rename sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/{coreos-dev-0.1.0-r65.ebuild => coreos-dev-0.1.0-r66.ebuild} (100%) diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0-r65.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0-r66.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0-r65.ebuild rename to sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0-r66.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0.ebuild index 4424042449..f7d71a6a36 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/coreos-dev/coreos-dev-0.1.0.ebuild @@ -39,6 +39,7 @@ RDEPEND="${RDEPEND} dev-libs/nss app-editors/vim app-misc/evtest + app-portage/gentoolkit app-shells/bash coreos-base/gmerge dev-lang/python @@ -60,6 +61,7 @@ RDEPEND="${RDEPEND} sys-apps/i2c-tools sys-apps/kbd sys-apps/less + sys-apps/portage sys-apps/smartmontools sys-apps/usbutils sys-apps/which From 34d9d2f1c2fff173b5a55fd89dd13238af702333 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Fri, 20 Sep 2013 20:28:26 -0400 Subject: [PATCH 3/3] remove(coreos-base/dev-install): Remove oddball portage configuration. Now that dev images install packages into root instead of /usr/local we can move to configuring portage in those images in a more standard way. We also don't support turning a prod image directly into a dev image so this sort of stuff doesn't belong in the base system anyway. --- .../coreos-base/coreos/coreos-0.0.1.ebuild | 1 - .../dev-install/dev-install-0.0.1-r459.ebuild | 139 ------------------ .../dev-install/dev-install-9999.ebuild | 136 ----------------- .../coreos-base/dev-install/files/filter.py | 35 ----- 4 files changed, 311 deletions(-) delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-0.0.1-r459.ebuild delete mode 100644 sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-9999.ebuild delete mode 100755 sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/files/filter.py 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 362ab2d025..f4f9f62fa9 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 @@ -107,7 +107,6 @@ RDEPEND="${RDEPEND} coreos-base/vboot_reference coreos-base/update_engine coreos-base/coreos-installer - coreos-base/dev-install coreos-base/coreos-init net-misc/dhcpcd net-firewall/iptables diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-0.0.1-r459.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-0.0.1-r459.ebuild deleted file mode 100644 index 017dc1246e..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-0.0.1-r459.ebuild +++ /dev/null @@ -1,139 +0,0 @@ -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -# This ebuild file installs the developer installer package. It: -# + Copies dev_install. -# + Copies some config files for emerge: make.defaults and make.conf. -# + Generates a list of packages installed (in base images). -# dev_install downloads and bootstraps emerge in base images without -# modifying the root filesystem. - -EAPI="4" -CROS_WORKON_COMMIT="597ca1198129fab4b870618c74ae4d51b6b85e4a" -CROS_WORKON_TREE="ae6f2543c17e05c66b249852d15090e66a96c45f" -CROS_WORKON_PROJECT="chromiumos/platform/dev-util" -CROS_WORKON_LOCALNAME="dev" -CROS_WORKON_OUTOFTREE_BUILD="1" - -inherit cros-workon cros-board multiprocessing - -DESCRIPTION="Chromium OS Developer Packages installer" -HOMEPAGE="http://www.chromium.org/chromium-os" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="amd64 arm x86" -IUSE="cros-debug" - -DEPEND="app-arch/tar - sys-apps/coreutils - sys-apps/grep - dev-util/strace - sys-apps/portage - sys-apps/sed" -# TODO(arkaitzr): remove dependency on tar if it's gonna be removed from the -# base image. Also modify dev_install. -RDEPEND="app-arch/tar - net-misc/curl - sys-apps/coreutils" - -src_prepare() { - SRCDIR="${S}/dev-install" - mkdir -p "$(cros-workon_get_build_dir)" -} - -src_compile() { - cd "$(cros-workon_get_build_dir)" - - local useflags pkg pkgs BOARD=$(get_current_board_with_variant) - - # We need to pass down cros-debug automatically because this is often - # times toggled at the ./build_packages level. This is a hack of sorts, - # but covers the most common case. - useflags="${USE}" - use cros-debug || useflags+=" -cros-debug" - - pkgs=( - # Generate a list of packages that go into the base image. These - # packages will be assumed to be installed by emerge in the target. - coreos - - # Get the list of the packages needed to bootstrap emerge. - portage - - # Get the list of dev and test packages. - coreos-dev - coreos-test - ) - einfo "Ignore warnings below related to LD_PRELOAD/libsandbox.so" - multijob_init - for pkg in ${pkgs[@]} ; do - # The ebuild env will modify certain variables in ways that we - # do not care for. For example, PORTDIR_OVERLAY is modified to - # only point to the current tree which screws up the search of - # the board-specific overlays. - ( - multijob_child_init - env -i PATH="${PATH}" PORTAGE_USERNAME="${PORTAGE_USERNAME}" USE="${useflags}" \ - emerge-${BOARD} \ - --pretend --quiet --emptytree --ignore-default-opts \ - --root-deps=rdeps ${pkg} | \ - egrep -o ' [[:alnum:]-]+/[^[:space:]/]+\b' | \ - tr -d ' ' | \ - sort > ${pkg}.packages - _pipestatus=${PIPESTATUS[*]} - [[ ${_pipestatus// } -eq 0 ]] || die "\`emerge-${BOARD} ${pkg}\` failed" - ) & - multijob_post_fork - done - multijob_finish - # No virtual packages in package.provided. We store packages for - # package.provided in file coreos-base.packages as package.provided is a - # directory. - grep -v "virtual/" coreos.packages > coreos-base.packages - - python "${FILESDIR}"/filter.py || die - - # Add the board specific binhost repository. - sed -e "s|BOARD|${BOARD}|g" "${SRCDIR}/repository.conf" > repository.conf - - # Add dhcp to the list of packages installed since its installation will not - # complete (can not add dhcp group since /etc is not writeable). Bootstrap it - # instead. - grep "net-misc/dhcp-" coreos-dev.packages >> coreos-base.packages - grep "net-misc/dhcp-" coreos-dev.packages >> bootstrap.packages -} - -src_install() { - local build_dir=$(cros-workon_get_build_dir) - - cd "${SRCDIR}" - dobin dev_install - - insinto /usr/share/${PN}/portage - doins "${build_dir}"/{bootstrap.packages,repository.conf} - - insinto /usr/share/${PN}/portage/make.profile - doins "${build_dir}"/package.installable make.{conf,defaults} - - insinto /usr/share/${PN}/portage/make.profile/package.provided - doins "${build_dir}"/coreos-base.packages - - insinto /etc/env.d - doins 99devinstall -} - -pkg_preinst() { - if [[ $(cros_target) == "target_image" ]]; then - # We don't want to install these files into the normal /build/ - # dir because we need different settings at build time vs what - # we want at runtime in release images. Thus, install the files - # into /usr/share but symlink them into /etc for the images. - local f srcdir="/usr/share/${PN}" - pushd "${ED}/${srcdir}" >/dev/null - for f in $(find -type f -printf '%P '); do - dosym "${srcdir}/${f}" "/etc/${f}" - done - popd >/dev/null - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-9999.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-9999.ebuild deleted file mode 100644 index 6cb1294072..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/dev-install-9999.ebuild +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. -# Distributed under the terms of the GNU General Public License v2 - -# This ebuild file installs the developer installer package. It: -# + Copies dev_install. -# + Copies some config files for emerge: make.defaults and make.conf. -# + Generates a list of packages installed (in base images). -# dev_install downloads and bootstraps emerge in base images without -# modifying the root filesystem. - -EAPI="4" -CROS_WORKON_PROJECT="chromiumos/platform/dev-util" -CROS_WORKON_LOCALNAME="dev" -CROS_WORKON_OUTOFTREE_BUILD="1" - -inherit cros-workon cros-board multiprocessing - -DESCRIPTION="Chromium OS Developer Packages installer" -HOMEPAGE="http://www.chromium.org/chromium-os" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~arm ~x86" -IUSE="cros-debug" - -DEPEND="app-arch/tar - sys-apps/coreutils - sys-apps/grep - sys-apps/portage - sys-apps/sed" -# TODO(arkaitzr): remove dependency on tar if it's gonna be removed from the -# base image. Also modify dev_install. -RDEPEND="app-arch/tar - net-misc/curl - sys-apps/coreutils" - -src_prepare() { - SRCDIR="${S}/dev-install" - mkdir -p "$(cros-workon_get_build_dir)" -} - -src_compile() { - cd "$(cros-workon_get_build_dir)" - - local useflags pkg pkgs BOARD=$(get_current_board_with_variant) - - # We need to pass down cros-debug automatically because this is often - # times toggled at the ./build_packages level. This is a hack of sorts, - # but covers the most common case. - useflags="${USE}" - use cros-debug || useflags+=" -cros-debug" - - pkgs=( - # Generate a list of packages that go into the base image. These - # packages will be assumed to be installed by emerge in the target. - coreos - - # Get the list of the packages needed to bootstrap emerge. - portage - - # Get the list of dev and test packages. - coreos-dev - coreos-test - ) - einfo "Ignore warnings below related to LD_PRELOAD/libsandbox.so" - multijob_init - for pkg in ${pkgs[@]} ; do - # The ebuild env will modify certain variables in ways that we - # do not care for. For example, PORTDIR_OVERLAY is modified to - # only point to the current tree which screws up the search of - # the board-specific overlays. - ( - multijob_child_init - env -i PATH="${PATH}" PORTAGE_USERNAME="${PORTAGE_USERNAME}" USE="${useflags}" \ - emerge-${BOARD} \ - --pretend --quiet --emptytree --ignore-default-opts \ - --root-deps=rdeps ${pkg} | \ - egrep -o ' [[:alnum:]-]+/[^[:space:]/]+\b' | \ - tr -d ' ' | \ - sort > ${pkg}.packages - _pipestatus=${PIPESTATUS[*]} - [[ ${_pipestatus// } -eq 0 ]] || die "\`emerge-${BOARD} ${pkg}\` failed" - ) & - multijob_post_fork - done - multijob_finish - # No virtual packages in package.provided. We store packages for - # package.provided in file chromeos-base.packages as package.provided is a - # directory. - grep -v "virtual/" coreos.packages > coreos-base.packages - - python "${FILESDIR}"/filter.py || die - - # Add the board specific binhost repository. - sed -e "s|BOARD|${BOARD}|g" "${SRCDIR}/repository.conf" > repository.conf - - # Add dhcp to the list of packages installed since its installation will not - # complete (can not add dhcp group since /etc is not writeable). Bootstrap it - # instead. - grep "net-misc/dhcp-" coreos-dev.packages >> coreos-base.packages - grep "net-misc/dhcp-" coreos-dev.packages >> bootstrap.packages -} - -src_install() { - local build_dir=$(cros-workon_get_build_dir) - - cd "${SRCDIR}" - dobin dev_install - - insinto /usr/share/${PN}/portage - doins "${build_dir}"/{bootstrap.packages,repository.conf} - - insinto /usr/share/${PN}/portage/make.profile - doins "${build_dir}"/package.installable make.{conf,defaults} - - insinto /usr/share/${PN}/portage/make.profile/package.provided - doins "${build_dir}"/coreos-base.packages - - insinto /etc/env.d - doins 99devinstall -} - -pkg_preinst() { - if [[ $(cros_target) == "target_image" ]]; then - # We don't want to install these files into the normal /build/ - # dir because we need different settings at build time vs what - # we want at runtime in release images. Thus, install the files - # into /usr/share but symlink them into /etc for the images. - local f srcdir="/usr/share/${PN}" - pushd "${ED}/${srcdir}" >/dev/null - for f in $(find -type f -printf '%P '); do - dosym "${srcdir}/${f}" "/etc/${f}" - done - popd >/dev/null - fi -} diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/files/filter.py b/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/files/filter.py deleted file mode 100755 index df3a20bdb1..0000000000 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/dev-install/files/filter.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/python -# 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. - -# Filter out all the packages that are already in coreos. -cros_pkgs = set(open('coreos.packages', 'r').readlines()) -port_pkgs = set(open('portage.packages', 'r').readlines()) - -boot_pkgs = port_pkgs - cros_pkgs -f = open('bootstrap.packages', 'w') -f.write(''.join(boot_pkgs)) -f.close() - -# After bootstrapping the package will be assumed -# to be installed by emerge. -prov_pkgs = [x for x in boot_pkgs if not x.startswith('virtual/')] -f = open('coreos-base.packages', 'a') -f.write(''.join(prov_pkgs)) -f.close() - -# Make a list of the packages that can be installed. Those packages -# are in coreos-dev or coreos-test and not coreos. -dev_pkgs = set(open('coreos-dev.packages', 'r').readlines()) -test_pkgs = set(open('coreos-test.packages', 'r').readlines()) -inst_pkgs = (dev_pkgs | test_pkgs) - cros_pkgs - -# We have to keep virtuals because portage will complain if we list -# them in package.provided, but it still needs to install a binpkg -# for the new style virtuals. -inst_pkgs = inst_pkgs | set([x for x in cros_pkgs if x.startswith('virtual/')]) - -f = open('package.installable', 'w') -f.write(''.join(inst_pkgs)) -f.close()