Merge pull request #50 from marineam/baselayout

Baselayout
This commit is contained in:
Michael Marineau 2013-07-22 19:14:42 -07:00
commit a3da99ab4c
3 changed files with 11 additions and 36 deletions

View File

@ -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

View File

@ -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' \

View File

@ -310,18 +310,11 @@ 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=(
"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
@ -400,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"