From 744faa2df4ca5bb206e169fa5470fdb02a797ded Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 23 Feb 2016 12:50:52 -0800 Subject: [PATCH 1/2] vm_image_util: oems are always from ebuild, others always from binary This resolves two issues: - Large dependencies are *never* built during image_to_vm, build_packages must now handle that. - Since build_packages can't resonably do the oem-* packages (they all conflict with eachother) we do want to build them from the ebuild. This is now enforced so a old binpkg is never used. This resolves confusing issues people have always had while when editing oem ebuilds but getting a stale build instead. --- build_library/vm_image_util.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 6572590cc3..47d8fc3cc0 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -422,9 +422,19 @@ install_oem_package() { return 0 fi + # Split into two steps because we want to always install $oem_pkg from + # the ebuild (build_packages doesn't handle it) *but* we never want to + # build anything else from source here. emerge doesn't have a way to + # enforce this in a single command. + info "Building ${oem_pkg}" + USE="${oem_use}" emerge-${BOARD} --root="${oem_tmp}" \ + --nodeps --buildpkgonly --usepkg n \ + --quiet "${oem_pkg}" + info "Installing ${oem_pkg} to OEM partition" USE="${oem_use}" emerge-${BOARD} --root="${oem_tmp}" \ - --root-deps=rdeps --usepkg --quiet "${oem_pkg}" + --root-deps=rdeps --usepkgonly \ + --quiet --jobs=2 "${oem_pkg}" sudo rsync -a "${oem_tmp}/usr/share/oem/" "${VM_TMP_ROOT}/usr/share/oem/" sudo rm -rf "${oem_tmp}" } From 66ea5974cec608f8454c94f5bd123c8ebb3be8a5 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Tue, 23 Feb 2016 13:06:49 -0800 Subject: [PATCH 2/2] image_to_vm: add --getbinpkg option Now image_to_vm can be used without first running build_packages. --- build_library/vm_image_util.sh | 7 ++++++- image_to_vm.sh | 12 +++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 47d8fc3cc0..0b7fde4ada 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -431,9 +431,14 @@ install_oem_package() { --nodeps --buildpkgonly --usepkg n \ --quiet "${oem_pkg}" + local getbinpkg + if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then + getbinpkg=--getbinpkg + fi + info "Installing ${oem_pkg} to OEM partition" USE="${oem_use}" emerge-${BOARD} --root="${oem_tmp}" \ - --root-deps=rdeps --usepkgonly \ + --root-deps=rdeps --usepkgonly ${getbinpkg} \ --quiet --jobs=2 "${oem_pkg}" sudo rsync -a "${oem_tmp}/usr/share/oem/" "${VM_TMP_ROOT}/usr/share/oem/" sudo rm -rf "${oem_tmp}" diff --git a/image_to_vm.sh b/image_to_vm.sh index cb8341f6fd..8c9cc24cc1 100755 --- a/image_to_vm.sh +++ b/image_to_vm.sh @@ -42,6 +42,10 @@ DEFINE_string to "" \ "Destination folder for VM output file(s)" DEFINE_string oem_pkg "" \ "OEM package to install" +DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \ + "Download binary packages from remote repository." +DEFINE_string getbinpkgver "" \ + "Use binary packages from a specific version." # include upload options . "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1 @@ -67,7 +71,13 @@ if [ -z "${FLAGS_board}" ] ; then die_notrace "--board is required." fi -# Loaded after flags are parsed because board_options depends on --board +# If downloading packages is enabled ensure the board is configured properly. +if [[ ${FLAGS_getbinpkg} -eq ${FLAGS_TRUE} ]]; then + "${SRC_ROOT}/scripts/setup_board" --board="${FLAGS_board}" \ + --getbinpkgver="${FLAGS_getbinpkgver}" --regen_configs_only +fi + +# Loaded late because board_options depends on setup_board . "${BUILD_LIBRARY_DIR}/board_options.sh" || exit 1