mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
commit
a3da99ab4c
@ -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
|
|
@ -117,7 +117,7 @@ install_toolchain_in_board() {
|
|||||||
if [ "${CHOST}" != "$FLAGS_toolchain" ] ; then
|
if [ "${CHOST}" != "$FLAGS_toolchain" ] ; then
|
||||||
local libc_path="${PKGDIR}/cross-${FLAGS_toolchain}/${libc_tar}"
|
local libc_path="${PKGDIR}/cross-${FLAGS_toolchain}/${libc_tar}"
|
||||||
cmds=(
|
cmds=(
|
||||||
"tar jxpf '${libc_path}' -C '${BOARD_ROOT}' \
|
"tar jxpf '${libc_path}' -C '${BOARD_ROOT}' --exclude=lib \
|
||||||
'./usr/${FLAGS_toolchain}' --strip-components=3"
|
'./usr/${FLAGS_toolchain}' --strip-components=3"
|
||||||
"mkdir -p '${BOARD_ROOT}/usr/lib/debug'"
|
"mkdir -p '${BOARD_ROOT}/usr/lib/debug'"
|
||||||
"tar jxpf '${libc_path}' -C '${BOARD_ROOT}/usr/lib/debug' \
|
"tar jxpf '${libc_path}' -C '${BOARD_ROOT}/usr/lib/debug' \
|
||||||
|
19
setup_board
19
setup_board
@ -310,18 +310,11 @@ EOF
|
|||||||
if ! ${HOST_BOARD}; then
|
if ! ${HOST_BOARD}; then
|
||||||
sudo ln -sf "${CHROMIUMOS_CONFIG}/make.conf.${ARCH}-target" \
|
sudo ln -sf "${CHROMIUMOS_CONFIG}/make.conf.${ARCH}-target" \
|
||||||
"${BOARD_ETC}/make.conf"
|
"${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
|
fi
|
||||||
# Setup make.globals and the profile.
|
# Setup make.globals and the profile.
|
||||||
cmds=(
|
cmds=(
|
||||||
"touch /etc/make.conf.user"
|
"touch /etc/portage/make.conf.user"
|
||||||
"ln -sf /etc/make.globals '${BOARD_ROOT}/etc/make.globals'"
|
"ln -sf /etc/portage/make.conf.user '${BOARD_ROOT}/etc/make.conf.user'"
|
||||||
"ln -sf /etc/make.conf.user '${BOARD_ROOT}/etc/make.conf.user'"
|
|
||||||
"mkdir -p '${BOARD_ROOT}/etc/portage/hooks'"
|
"mkdir -p '${BOARD_ROOT}/etc/portage/hooks'"
|
||||||
)
|
)
|
||||||
for d in "${SCRIPTS_DIR}"/hooks/*; do
|
for d in "${SCRIPTS_DIR}"/hooks/*; do
|
||||||
@ -400,6 +393,14 @@ if ${HOST_BOARD}; then
|
|||||||
sed -i -e "s|$BOARD_ROOT/|/|g"
|
sed -i -e "s|$BOARD_ROOT/|/|g"
|
||||||
else
|
else
|
||||||
if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then
|
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
|
# 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.
|
# avoid pulling any spurious DEPEND things in that we don't care about.
|
||||||
KERNEL_EMERGE_FLAGS="--select --quiet --root-deps=rdeps"
|
KERNEL_EMERGE_FLAGS="--select --quiet --root-deps=rdeps"
|
||||||
|
Loading…
Reference in New Issue
Block a user