Merge pull request #276 from marineam/conf

make.conf cleanup
This commit is contained in:
Michael Marineau 2014-06-16 13:57:50 -07:00
commit 0b052bc756
3 changed files with 20 additions and 21 deletions

View File

@ -12,4 +12,4 @@ BOARD_ROOT="/build/${BOARD}"
ARCH=$(get_board_arch ${BOARD})
# What cross-build are we targeting?
. "${BOARD_ROOT}/etc/make.conf.board_setup"
. "${BOARD_ROOT}/etc/portage/make.conf"

View File

@ -187,7 +187,6 @@ esac
COREOS_CONFIG="/usr/local/portage/coreos/coreos/config"
BOARD_ROOT="/build/${BOARD_VARIANT}"
BOARD_ETC="${BOARD_ROOT}/etc"
BOARD_SETUP="${BOARD_ETC}/make.conf.board_setup"
BOARD_PROFILE="${BOARD_ETC}/portage/profile"
BOARD_ARCH=$(get_board_arch "$BOARD")
BOARD_CHOST=$(get_board_chost ${BOARD})
@ -232,25 +231,19 @@ if [[ ! -L "${BOARD_ROOT}/packages" ]]; then
fi
info "Configuring portage in ${BOARD_ROOT}"
cmds=(
"mkdir -p '${BOARD_ROOT}' '${BOARD_PROFILE}'"
"ROOT='${BOARD_ROOT}' eselect profile set --force '${PORTAGE_PROFILE}'"
)
sudo mkdir -p "${BOARD_PROFILE}"
sudo ROOT="${BOARD_ROOT}" eselect profile set --force "${PORTAGE_PROFILE}"
# Setup the make.confs. We use the following:
# make.conf <- Overall target make.conf [arm, x86, etc. version]
# make.conf.board_setup <- Declares CHOST, ROOT, etc.
# make.conf.common <- Common settings across all targets
cmds+=(
"ln -sf '${COREOS_CONFIG}/make.conf.${BOARD_ARCH}-target' \
'${BOARD_ETC}/make.conf'"
"ln -sf '${COREOS_CONFIG}/make.conf.common-target' \
'${BOARD_ETC}/make.conf.common'"
"touch '${BOARD_ROOT}/etc/make.conf.user'"
)
sudo_multi "${cmds[@]}"
# Cleanup/migrate from older make.conf files
sudo rm -f "${BOARD_ETC}/make.conf" "${BOARD_ETC}/make.conf.common"
if [[ -f "${BOARD_ETC}/make.conf.user" ]]; then
sudo mv "${BOARD_ETC}/make.conf.user" \
"${BOARD_ETC}/portage/make.conf.user"
else
sudo touch "${BOARD_ETC}/portage/make.conf.user"
fi
sudo_clobber "${BOARD_SETUP}" <<EOF
sudo_clobber "${BOARD_ETC}/portage/make.conf" <<EOF
# Created by setup_board
# Settings derived from the host environment
@ -279,6 +272,9 @@ PKG_CONFIG_SYSROOT_DIR="${BOARD_ROOT}"
# Generally there isn't any need to add packages to @world by default.
# You can use --select to override this.
EMERGE_DEFAULT_OPTS="--oneshot"
# Allow the user to override or define additional settings.
source "${BOARD_ETC}/portage/make.conf.user"
EOF
generate_all_wrappers

View File

@ -54,10 +54,10 @@ COREOS_CONFIG="${COREOS_OVERLAY}/coreos/config"
info "Setting up portage..."
sudo mkdir -p "/etc/portage/repos.conf/"
sudo ln -sf "${COREOS_CONFIG}/make.conf.amd64-host" "/etc/portage/make.conf"
sudo rm -f "/etc/portage/make.conf"
sudo touch "/etc/portage/make.conf.user"
sudo_clobber "/etc/portage/make.conf.host_setup" <<EOF
sudo_clobber "/etc/portage/make.conf" <<EOF
# Created by update_chroot
PORTDIR="${PORTAGE_STABLE_OVERLAY}"
PORTDIR_OVERLAY="${CROSSDEV_OVERLAY} ${COREOS_OVERLAY}"
@ -70,6 +70,9 @@ MAKEOPTS="--jobs=${NUM_JOBS} --load-average=$((NUM_JOBS * 2))"
# Generally there isn't any need to add packages to @world by default.
# You can use --select to override this.
EMERGE_DEFAULT_OPTS="--oneshot"
# Allow the user to override or define additional settings.
source "/etc/portage/make.conf.user"
EOF
sudo_clobber "/etc/portage/repos.conf/coreos.conf" <<EOF