From be63f41081a8897a9cfa78e3de085a6c076f0379 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 22 Jul 2013 12:34:06 -0400 Subject: [PATCH 1/3] fix(make.conf.user): Fix references to old make.conf.user path. We've moved all of the chroot configs from /etc to /etc/portage but setup_board was still symlinking to /etc. Fix the path so no one gets mixed up by the two copies of the same file. Remove unused script that also used to write to old location. --- enable_localaccount.sh | 26 -------------------------- setup_board | 5 ++--- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100755 enable_localaccount.sh diff --git a/enable_localaccount.sh b/enable_localaccount.sh deleted file mode 100755 index 2232551977..0000000000 --- a/enable_localaccount.sh +++ /dev/null @@ -1,26 +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. -set -e - -if [ -z $1 ]; then - echo "Usage: $0 localaccount_username [chroot_path]" - exit 1 -fi - -# Default chroot_path to its standard location -chroot_path=${2:-"../../chroot"} - -echo "Enabling local account $1@gmail.com." - -# Add CHROMEOS_LOCAL_ACCOUNT var to /etc/make.conf.user -echo "Setting CHROMEOS_LOCAL_ACCOUNT in $chroot_path/etc/make.conf.user..." -VAR_NAME=CHROMEOS_LOCAL_ACCOUNT -if grep -q ${VAR_NAME} $chroot_path/etc/make.conf.user; then - regex="s/${VAR_NAME}=.*/${VAR_NAME}=$1@gmail.com/" - sudo sed -i -e "${regex}" $chroot_path/etc/make.conf.user -else - sudo sh -c "echo ""${VAR_NAME}=$1@gmail.com"" >> \ - $chroot_path/etc/make.conf.user" -fi diff --git a/setup_board b/setup_board index 52ba61230b..a0191e4e19 100755 --- a/setup_board +++ b/setup_board @@ -319,9 +319,8 @@ if ! ${HOST_BOARD}; then fi # Setup make.globals and the profile. cmds=( - "touch /etc/make.conf.user" - "ln -sf /etc/make.globals '${BOARD_ROOT}/etc/make.globals'" - "ln -sf /etc/make.conf.user '${BOARD_ROOT}/etc/make.conf.user'" + "touch /etc/portage/make.conf.user" + "ln -sf /etc/portage/make.conf.user '${BOARD_ROOT}/etc/make.conf.user'" "mkdir -p '${BOARD_ROOT}/etc/portage/hooks'" ) for d in "${SCRIPTS_DIR}"/hooks/*; do From ac931bd088781b226a16f1fffc768edaf0f1ab94 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 22 Jul 2013 12:49:46 -0400 Subject: [PATCH 2/3] fix(setup_board): Install baselayout with USE=build We need to install baselayout with the build use flag as the very first package in the new board sysroot to ensure the system's directory structure is created correctly. This should resolve surprise failures with the bootengine ebuild. --- setup_board | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/setup_board b/setup_board index a0191e4e19..cd272e0bb6 100755 --- a/setup_board +++ b/setup_board @@ -310,12 +310,6 @@ EOF if ! ${HOST_BOARD}; then sudo ln -sf "${CHROMIUMOS_CONFIG}/make.conf.${ARCH}-target" \ "${BOARD_ETC}/make.conf" - - # We install the toolchain related bits after the BOARD_ROOT, BOARD_PROFILE - # and BOARD_ETC directories have been created. - if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then - install_toolchain - fi fi # Setup make.globals and the profile. cmds=( @@ -399,6 +393,14 @@ if ${HOST_BOARD}; then sed -i -e "s|$BOARD_ROOT/|/|g" else if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then + # First thing first, install baselayout with USE=build to create a + # working directory tree. Don't use binpkgs due to the use flag change. + sudo -E USE=build "${EMERGE_WRAPPER}" --usepkg=n --buildpkg=n \ + --oneshot --quiet --nodeps sys-apps/baselayout + + # Now time for tool chain happy fun time + install_toolchain + # Emerge the kernel headers into the board build root. Use rdeps to # avoid pulling any spurious DEPEND things in that we don't care about. KERNEL_EMERGE_FLAGS="--select --quiet --root-deps=rdeps" From 2ae0c30f4ec3eb57581494151e4fe7a035af342f Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 22 Jul 2013 14:42:28 -0400 Subject: [PATCH 3/3] fix(install_toolchain): Prevent tar from replacing lib symlinks The cross toolchain doesn't have lib symlinks but this works because it also doesn't install things to lib. However when this script manually extracts the toolchain packages to BOARD_ROOT tar includes those empty directories, replacing the symlinks that were previously there. Longer term this really needs to go away, whatever build time is saved by re-using the cross toolchain packages in BOARD_ROOT is not worth this insane level of complexity it causes... --- install_toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_toolchain b/install_toolchain index 3ba0235462..c3ed9575df 100755 --- a/install_toolchain +++ b/install_toolchain @@ -117,7 +117,7 @@ install_toolchain_in_board() { if [ "${CHOST}" != "$FLAGS_toolchain" ] ; then local libc_path="${PKGDIR}/cross-${FLAGS_toolchain}/${libc_tar}" cmds=( - "tar jxpf '${libc_path}' -C '${BOARD_ROOT}' \ + "tar jxpf '${libc_path}' -C '${BOARD_ROOT}' --exclude=lib \ './usr/${FLAGS_toolchain}' --strip-components=3" "mkdir -p '${BOARD_ROOT}/usr/lib/debug'" "tar jxpf '${libc_path}' -C '${BOARD_ROOT}/usr/lib/debug' \