From 9a4ec472ce6cf03d97676d774c4d4fbf680e7b27 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 9 Jun 2014 16:10:40 -0700 Subject: [PATCH 1/5] fix(build_library): Update amd64-usr's portage profile The usr profile is just an alias to generic now so drop the old name. --- build_library/toolchain_util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index 01dbd7f810..1789f4995c 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -21,7 +21,7 @@ CROSS_PROFILES["x86_64-cros-linux-gnu"]="coreos:coreos/amd64/generic" # guesses or hard-code these. All that should migrate to this list. declare -A BOARD_CHOSTS BOARD_PROFILES BOARD_CHOSTS["amd64-usr"]="x86_64-cros-linux-gnu" -BOARD_PROFILES["amd64-usr"]="coreos:coreos/amd64/usr" +BOARD_PROFILES["amd64-usr"]="coreos:coreos/amd64/generic" BOARD_NAMES=( "${!BOARD_CHOSTS[@]}" ) # Declare the above globals as read-only to avoid accidental conflicts. From 93b0ec304af6dd8e7858030da1a9dd596d6b1698 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 9 Jun 2014 16:15:55 -0700 Subject: [PATCH 2/5] fix(build_library): Remove reference to old SDK profile The SDK's profile changed to coreos:coreos/amd64/sdk quite a long time ago. Remove this last reference to it so the alias can be forgotten. --- build_library/catalyst.sh | 7 ++++--- build_toolchains | 1 - 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_library/catalyst.sh b/build_library/catalyst.sh index b2f25fb0e5..9fe8e692ad 100644 --- a/build_library/catalyst.sh +++ b/build_library/catalyst.sh @@ -5,14 +5,15 @@ # common.sh should be sourced first [[ -n "${DEFAULT_BUILD_ROOT}" ]] || exit 1 -. "${SCRIPTS_DIR}/sdk_lib/sdk_util.sh" +. "${SCRIPTS_DIR}/sdk_lib/sdk_util.sh" || exit 1 +. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1 # Default option values, may be provided before including this file : ${TYPE:="coreos-sdk"} -: ${ARCH:=$(portageq envvar ARCH)} +: ${ARCH:=$(get_sdk_arch)} : ${DEFAULT_CATALYST_ROOT:="${DEFAULT_BUILD_ROOT}/catalyst"} : ${DEFAULT_SEED:=${COREOS_SDK_TARBALL_PATH}} -: ${DEFAULT_PROFILE:="coreos:default/linux/${ARCH}/10.0"} +: ${DEFAULT_PROFILE:=$(get_sdk_profile)} # Set to something like "stage4" to restrict what to build # FORCE_STAGES= diff --git a/build_toolchains b/build_toolchains index c61c6b4bda..190cf3ddaa 100755 --- a/build_toolchains +++ b/build_toolchains @@ -11,7 +11,6 @@ TYPE="coreos-toolchains" FORCE_STAGES="stage4" . "${BUILD_LIBRARY_DIR}/catalyst.sh" || exit 1 -. "${BUILD_LIBRARY_DIR}/toolchain_util.sh" || exit 1 # include upload options . "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1 From 09faef6d028a04f42994bbbe8c9fc14d41f4044d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 9 Jun 2014 17:23:27 -0700 Subject: [PATCH 3/5] feat(setup_board): Generate a complete make.conf Add settings that are currently provided by make.conf.common-target in coreos-overlay. Most of these are better off being derived directly from the host environment's portage configuration. The PKGDIR, TMPDIR, and LOGDIR values are changing to be more consistant with the SDK configuration but these changes won't take effect until the old make.conf.common-target is removed since its values override these. --- setup_board | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/setup_board b/setup_board index c6628f885d..e5b4a4853f 100755 --- a/setup_board +++ b/setup_board @@ -235,12 +235,33 @@ sudo_multi "${cmds[@]}" sudo_clobber "${BOARD_SETUP}" < Date: Mon, 9 Jun 2014 19:05:18 -0700 Subject: [PATCH 4/5] fix(*): Use binary package for baselayout It is no longer necessary to use the build USE flag or avoid binary packages when installing baselayout for the first time. --- build_library/build_image_util.sh | 7 +++---- setup_board | 16 ++++++---------- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/build_library/build_image_util.sh b/build_library/build_image_util.sh index 154fb266b1..9c6ffbf22f 100755 --- a/build_library/build_image_util.sh +++ b/build_library/build_image_util.sh @@ -153,10 +153,9 @@ start_image() { mount "${disk_img}" "${root_fs_dir}" trap "cleanup_mounts '${root_fs_dir}' && delete_prompt" EXIT - # 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-${BOARD}" --root="${root_fs_dir}" \ - --usepkg=n --buildpkg=n --oneshot --quiet --nodeps sys-apps/baselayout + # First thing first, install baselayout to create a working filesystem. + emerge-${BOARD} --root="${root_fs_dir}" \ + --usepkgonly --oneshot --quiet --nodeps sys-apps/baselayout # FIXME(marineam): Work around glibc setting EROOT=$ROOT # https://bugs.gentoo.org/show_bug.cgi?id=473728#c12 diff --git a/setup_board b/setup_board index e5b4a4853f..65fff0ec93 100755 --- a/setup_board +++ b/setup_board @@ -267,14 +267,6 @@ EOF generate_all_wrappers if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then - info "Installing baselayout" - - # 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 EMERGE_FLAGS="--select --quiet --root-deps=rdeps" if [[ "${FLAGS_jobs}" -ne -1 ]]; then EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}" @@ -283,7 +275,8 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \ "${FLAGS_getbinpkg}" -eq "${FLAGS_TRUE}" ]] then - EMERGE_FLAGS+=" --usepkgonly --getbinpkg" + EMERGE_FLAGS+=" --usepkg --getbinpkg" + EMERGE_TOOLCHAIN_FLAGS="${EMERGE_FLAGS} --usepkgonly" else # When binary packages are disabled we need to make sure the cross # sysroot includes any build dependencies for the toolchain. @@ -291,9 +284,12 @@ if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then install_cross_libs "${BOARD_CHOST}" ${EMERGE_FLAGS} --buildpkg=n fi + info "Installing baselayout" + "${EMERGE_WRAPPER}" ${EMERGE_FLAGS} --nodeps sys-apps/baselayout + info "Installing toolchain" SYSROOT="/usr/${BOARD_CHOST}" "${EMERGE_WRAPPER}" \ - ${EMERGE_FLAGS} "${TOOLCHAIN_PKGS[@]}" + ${EMERGE_TOOLCHAIN_FLAGS} "${TOOLCHAIN_PKGS[@]}" fi if [ $FLAGS_default -eq $FLAGS_TRUE ] ; then From 9a973e4113f038351d23bd0b96850d062dd260f8 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 10 Jun 2014 11:37:49 -0700 Subject: [PATCH 5/5] fix(setup_board): Migrate packages in existing board roots. --- setup_board | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/setup_board b/setup_board index 65fff0ec93..bf35fdf28f 100755 --- a/setup_board +++ b/setup_board @@ -214,6 +214,23 @@ else FLAGS_regen_configs=${FLAGS_FALSE} fi +# Migrate board roots that were created before the package location +# was standardized to /var/lib/portage/pkgs, build_image will fail if we +# simply forget about the old location and start writing to the new. +# Keep /packages as a compatibility symlink until everyone is updated. +if [[ ! -L "${BOARD_ROOT}/packages" ]]; then + if [[ ! -d "${BOARD_ROOT}/var/lib/portage/pkgs" ]]; then + if [[ -d "${BOARD_ROOT}/packages" ]]; then + warn "Moving board package directory to ${BOARD_ROOT}/var/lib/portage/pkgs" + sudo mkdir -p "${BOARD_ROOT}/var/lib/portage" + sudo mv "${BOARD_ROOT}/packages" "${BOARD_ROOT}/var/lib/portage/pkgs" + fi + else + sudo mkdir -p "${BOARD_ROOT}/var/lib/portage/pkgs" + fi + sudo ln -sfT "var/lib/portage/pkgs" "${BOARD_ROOT}/packages" +fi + info "Configuring portage in ${BOARD_ROOT}" cmds=( "mkdir -p '${BOARD_ROOT}' '${BOARD_PROFILE}'"