mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
refactor(update_chroot): Write make.conf.host_setup
There is no need for this to be in sdk_lib any more, remove what little remains of make_conf_util.sh.
This commit is contained in:
parent
a3d3d30b24
commit
57d19d0f06
@ -1,11 +0,0 @@
|
||||
# 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.
|
||||
|
||||
create_host_setup() {
|
||||
local host_setup="$2/etc/portage/make.conf.host_setup"
|
||||
( echo "# Automatically generated. EDIT THIS AND BE SORRY."
|
||||
echo "MAKEOPTS='--jobs=${NUM_JOBS} --load-average=${NUM_JOBS}'"
|
||||
) | sudo_clobber "$host_setup"
|
||||
sudo chmod 644 "$host_setup"
|
||||
}
|
@ -46,27 +46,19 @@ eval set -- "${FLAGS_ARGV}"
|
||||
switch_to_strict_mode
|
||||
|
||||
. "${BUILD_LIBRARY_DIR}/toolchain_util.sh"
|
||||
. "${SCRIPTS_DIR}/sdk_lib/make_conf_util.sh"
|
||||
|
||||
# Create /etc/make.conf.host_setup. The file content is regenerated
|
||||
# from scratch every update. There are various reasons to do this:
|
||||
# + It's cheap, so this is an easy way to guarantee correct content
|
||||
# after an upgrade.
|
||||
# + Inside make_chroot.sh, we use a temporary version of the file
|
||||
# which must be updated before the script completes; that final
|
||||
# update happens here.
|
||||
# + If the repositories change to add or remove the private
|
||||
# overlay, the file may need to be regenerated.
|
||||
create_host_setup
|
||||
|
||||
PORTAGE_STABLE_OVERLAY="/usr/local/portage/stable"
|
||||
CROSSDEV_OVERLAY="/usr/local/portage/crossdev"
|
||||
CHROOT_OVERLAY="/usr/local/portage/coreos"
|
||||
|
||||
# Create repos.conf configs.
|
||||
info "Setting up repos.conf..."
|
||||
info "Setting up portage..."
|
||||
sudo mkdir -p "/etc/portage/repos.conf/"
|
||||
sudo tee "/etc/portage/repos.conf/coreos.conf" > /dev/null <<EOF
|
||||
sudo_clobber "/etc/portage/make.conf.host_setup" <<EOF
|
||||
# Created by update_chroot
|
||||
MAKEOPTS="--jobs=${NUM_JOBS} --load-average=$((NUM_JOBS * 2))"
|
||||
EOF
|
||||
|
||||
sudo_clobber "/etc/portage/repos.conf/coreos.conf" <<EOF
|
||||
[DEFAULT]
|
||||
main-repo = portage-stable
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user