mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 14:01:43 +01:00
Merge pull request #121 from kinvolk/krnowak/jobs-be-gone
Drop `--jobs` parameter
This commit is contained in:
commit
3cf5d83056
@ -54,8 +54,6 @@ DEFINE_string version "" \
|
|||||||
"Sets the docker version to build."
|
"Sets the docker version to build."
|
||||||
DEFINE_integer aci_version "" \
|
DEFINE_integer aci_version "" \
|
||||||
"Sets the aci version tag identifier."
|
"Sets the aci version tag identifier."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
|
|
||||||
# Parse command line.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
|
|||||||
@ -72,8 +72,6 @@ show_help_if_requested "$@"
|
|||||||
# not needed for the typical developer workflow.
|
# not needed for the typical developer workflow.
|
||||||
DEFINE_integer build_attempt 1 \
|
DEFINE_integer build_attempt 1 \
|
||||||
"The build attempt for this image build."
|
"The build attempt for this image build."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
DEFINE_boolean replace ${FLAGS_FALSE} \
|
DEFINE_boolean replace ${FLAGS_FALSE} \
|
||||||
"Overwrite existing output, if any."
|
"Overwrite existing output, if any."
|
||||||
DEFINE_string version "" \
|
DEFINE_string version "" \
|
||||||
|
|||||||
@ -145,7 +145,7 @@ emerge_to_image() {
|
|||||||
|
|
||||||
sudo -E ROOT="${root_fs_dir}" \
|
sudo -E ROOT="${root_fs_dir}" \
|
||||||
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
|
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
|
||||||
emerge --root-deps=rdeps --usepkgonly --jobs=$FLAGS_jobs -v "$@"
|
emerge --root-deps=rdeps --usepkgonly --jobs="${NUM_JOBS}" -v "$@"
|
||||||
|
|
||||||
# Shortcut if this was just baselayout
|
# Shortcut if this was just baselayout
|
||||||
[[ "$*" == *sys-apps/baselayout ]] && return
|
[[ "$*" == *sys-apps/baselayout ]] && return
|
||||||
@ -172,7 +172,7 @@ emerge_to_image_unchecked() {
|
|||||||
|
|
||||||
sudo -E ROOT="${root_fs_dir}" \
|
sudo -E ROOT="${root_fs_dir}" \
|
||||||
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
|
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
|
||||||
emerge --root-deps=rdeps --usepkgonly --jobs=$FLAGS_jobs -v "$@"
|
emerge --root-deps=rdeps --usepkgonly --jobs="${NUM_JOBS}" -v "$@"
|
||||||
|
|
||||||
# Shortcut if this was just baselayout
|
# Shortcut if this was just baselayout
|
||||||
[[ "$*" == *sys-apps/baselayout ]] && return
|
[[ "$*" == *sys-apps/baselayout ]] && return
|
||||||
|
|||||||
@ -522,7 +522,6 @@ install_oem_aci() {
|
|||||||
"${SCRIPT_ROOT}/build_oem_aci" \
|
"${SCRIPT_ROOT}/build_oem_aci" \
|
||||||
--board="${BOARD}" \
|
--board="${BOARD}" \
|
||||||
--build_dir="${aci_dir}" \
|
--build_dir="${aci_dir}" \
|
||||||
--jobs="${FLAGS_jobs}" \
|
|
||||||
"${binpkgflags[@]}" \
|
"${binpkgflags[@]}" \
|
||||||
"${oem_aci}"
|
"${oem_aci}"
|
||||||
|
|
||||||
|
|||||||
@ -46,8 +46,6 @@ DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
|||||||
"Directory in which to place image result directories (named by version)"
|
"Directory in which to place image result directories (named by version)"
|
||||||
DEFINE_string version "" \
|
DEFINE_string version "" \
|
||||||
"Overrides version number in name to this version."
|
"Overrides version number in name to this version."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
|
|
||||||
# Parse command line.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
|
|||||||
@ -30,8 +30,6 @@ DEFINE_boolean workon "${FLAGS_TRUE}" \
|
|||||||
"Automatically rebuild updated cros-workon packages."
|
"Automatically rebuild updated cros-workon packages."
|
||||||
DEFINE_boolean fetchonly "${FLAGS_FALSE}" \
|
DEFINE_boolean fetchonly "${FLAGS_FALSE}" \
|
||||||
"Don't build anything, instead only fetch what is needed."
|
"Don't build anything, instead only fetch what is needed."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
DEFINE_boolean rebuild "${FLAGS_FALSE}" \
|
DEFINE_boolean rebuild "${FLAGS_FALSE}" \
|
||||||
"Automatically rebuild dependencies."
|
"Automatically rebuild dependencies."
|
||||||
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
||||||
@ -113,9 +111,6 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
|||||||
else
|
else
|
||||||
UPDATE_ARGS+=( --nousepkg )
|
UPDATE_ARGS+=( --nousepkg )
|
||||||
fi
|
fi
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
|
||||||
UPDATE_ARGS+=( --jobs=${FLAGS_jobs} )
|
|
||||||
fi
|
|
||||||
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
|
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
UPDATE_ARGS+=( --skip_toolchain_update )
|
UPDATE_ARGS+=( --skip_toolchain_update )
|
||||||
fi
|
fi
|
||||||
@ -161,10 +156,8 @@ if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
EMERGE_FLAGS+=( "--jobs=${NUM_JOBS}" )
|
||||||
EMERGE_FLAGS+=( --jobs=${FLAGS_jobs} )
|
REBUILD_FLAGS+=( "--jobs=${NUM_JOBS}" )
|
||||||
REBUILD_FLAGS+=( --jobs=${FLAGS_jobs} )
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${FLAGS_rebuild}" -eq "${FLAGS_TRUE}" ]]; then
|
if [[ "${FLAGS_rebuild}" -eq "${FLAGS_TRUE}" ]]; then
|
||||||
EMERGE_FLAGS+=( --rebuild-if-unbuilt )
|
EMERGE_FLAGS+=( --rebuild-if-unbuilt )
|
||||||
|
|||||||
@ -8,7 +8,10 @@
|
|||||||
|
|
||||||
# The number of jobs to pass to tools that can run in parallel (such as make
|
# The number of jobs to pass to tools that can run in parallel (such as make
|
||||||
# and dpkg-buildpackage
|
# and dpkg-buildpackage
|
||||||
if [[ -z ${NUM_JOBS} ]]; then
|
case "${NUM_JOBS}" in
|
||||||
|
*[!0-9]*) NUM_JOBS='' ;;
|
||||||
|
esac
|
||||||
|
if [[ -z ${NUM_JOBS} ]] || [[ ${NUM_JOBS} -eq 0 ]]; then
|
||||||
NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo)
|
NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo)
|
||||||
fi
|
fi
|
||||||
# Ensure that any sub scripts we invoke get the max proc count.
|
# Ensure that any sub scripts we invoke get the max proc count.
|
||||||
|
|||||||
@ -44,8 +44,6 @@ DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \
|
|||||||
"Download binary packages from remote repository."
|
"Download binary packages from remote repository."
|
||||||
DEFINE_string getbinpkgver "" \
|
DEFINE_string getbinpkgver "" \
|
||||||
"Use binary packages from a specific version."
|
"Use binary packages from a specific version."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
|
|
||||||
# include upload options
|
# include upload options
|
||||||
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
|
||||||
|
|||||||
@ -15,8 +15,6 @@ assert_not_root_user
|
|||||||
# Developer-visible flags.
|
# Developer-visible flags.
|
||||||
DEFINE_string board "${DEFAULT_BOARD}" \
|
DEFINE_string board "${DEFAULT_BOARD}" \
|
||||||
"The board to build packages for."
|
"The board to build packages for."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel."
|
|
||||||
|
|
||||||
# include upload options
|
# include upload options
|
||||||
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
|
||||||
@ -76,7 +74,7 @@ if [[ "${#rebuild_atoms[@]}" -eq 0 ]]; then
|
|||||||
info "No ebuild changes detected"
|
info "No ebuild changes detected"
|
||||||
else
|
else
|
||||||
info "Rebuilding ${#rebuild_atoms[@]} packages..."
|
info "Rebuilding ${#rebuild_atoms[@]} packages..."
|
||||||
emerge-$BOARD --jobs=${FLAGS_jobs} "${rebuild_atoms[@]}"
|
emerge-$BOARD "--jobs=${NUM_JOBS}" "${rebuild_atoms[@]}"
|
||||||
|
|
||||||
info "Checking build root"
|
info "Checking build root"
|
||||||
test_image_content "${BOARD_ROOT}"
|
test_image_content "${BOARD_ROOT}"
|
||||||
|
|||||||
@ -31,8 +31,6 @@ DEFINE_string binhost "" \
|
|||||||
"Use binary packages from a specific location (e.g. https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/2000.0.0/pkgs)"
|
"Use binary packages from a specific location (e.g. https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/2000.0.0/pkgs)"
|
||||||
DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \
|
DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \
|
||||||
"Use binary packages only for the board toolchain."
|
"Use binary packages only for the board toolchain."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
||||||
"Don't update toolchain automatically."
|
"Don't update toolchain automatically."
|
||||||
DEFINE_boolean skip_chroot_upgrade "${FLAGS_FALSE}" \
|
DEFINE_boolean skip_chroot_upgrade "${FLAGS_FALSE}" \
|
||||||
@ -206,9 +204,6 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
|||||||
else
|
else
|
||||||
UPDATE_ARGS+=" --nousepkg"
|
UPDATE_ARGS+=" --nousepkg"
|
||||||
fi
|
fi
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
|
||||||
UPDATE_ARGS+=" --jobs=${FLAGS_jobs}"
|
|
||||||
fi
|
|
||||||
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
|
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
UPDATE_ARGS+=" --skip_toolchain_update"
|
UPDATE_ARGS+=" --skip_toolchain_update"
|
||||||
fi
|
fi
|
||||||
@ -295,9 +290,7 @@ ${EMAINT_WRAPPER} --fix world
|
|||||||
|
|
||||||
if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then
|
if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then
|
||||||
EMERGE_FLAGS="--select --quiet --root-deps=rdeps"
|
EMERGE_FLAGS="--select --quiet --root-deps=rdeps"
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
EMERGE_FLAGS+=" --jobs=${NUM_JOBS}"
|
||||||
EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}"
|
|
||||||
fi
|
|
||||||
EMERGE_TOOLCHAIN_FLAGS="${EMERGE_FLAGS}"
|
EMERGE_TOOLCHAIN_FLAGS="${EMERGE_FLAGS}"
|
||||||
|
|
||||||
if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \
|
if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \
|
||||||
|
|||||||
@ -21,8 +21,6 @@ DEFINE_boolean usepkgonly "${FLAGS_FALSE}" \
|
|||||||
"Only use/download binary packages. Implies --noworkon"
|
"Only use/download binary packages. Implies --noworkon"
|
||||||
DEFINE_boolean workon "${FLAGS_TRUE}" \
|
DEFINE_boolean workon "${FLAGS_TRUE}" \
|
||||||
"Automatically rebuild updated cros-workon packages."
|
"Automatically rebuild updated cros-workon packages."
|
||||||
DEFINE_integer jobs "${NUM_JOBS}" \
|
|
||||||
"How many packages to build in parallel at maximum."
|
|
||||||
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
|
||||||
"Don't update the toolchains."
|
"Don't update the toolchains."
|
||||||
DEFINE_string toolchain_boards "" \
|
DEFINE_string toolchain_boards "" \
|
||||||
@ -201,10 +199,8 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
|
|||||||
REBUILD_FLAGS+=( $(get_binonly_args $(get_chost_list)) )
|
REBUILD_FLAGS+=( $(get_binonly_args $(get_chost_list)) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
|
EMERGE_FLAGS+=( "--jobs=${NUM_JOBS}" )
|
||||||
EMERGE_FLAGS+=( "--jobs=${FLAGS_jobs}" )
|
REBUILD_FLAGS+=( "--jobs=${NUM_JOBS}" )
|
||||||
REBUILD_FLAGS+=( "--jobs=${FLAGS_jobs}" )
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Perform an update of coreos-devel/sdk-depends and world in the chroot.
|
# Perform an update of coreos-devel/sdk-depends and world in the chroot.
|
||||||
EMERGE_CMD="emerge"
|
EMERGE_CMD="emerge"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user