From e0cfea50fb0f5a3bee09aadd2037be6b11254a44 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Thu, 27 Mar 2014 22:17:32 -0700 Subject: [PATCH] fix(vm_image_util): Require OEM packages to be aware of /usr/share/oem Installing to a temporary directory and then copying over the final contents of /usr/share/oem allows more complicated OEM packages such as python to be configured with --prefix=/usr/share/oem while previously the atypical use of ROOT=/usr/share/oem would have complicated things. --- build_library/vm_image_util.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 0f3c66eaa7..1cae8d12dd 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -245,15 +245,17 @@ setup_disk_image() { # If the current type defines a oem package install it to the given fs image. install_oem_package() { local oem_pkg=$(_get_vm_opt OEM_PACKAGE) - local oem_mnt="${VM_TMP_ROOT}/usr/share/oem" + local oem_tmp="${VM_TMP_DIR}/oem" if [[ -z "${oem_pkg}" ]]; then return 0 fi info "Installing ${oem_pkg} to OEM partition" - emerge-${BOARD} --root="${oem_mnt}" --root-deps=rdeps "${oem_pkg}" - sudo rm -rf "${oem_mnt}/var" # clean out /var/pkg/db and friends + emerge-${BOARD} --root="${oem_tmp}" \ + --root-deps=rdeps --usepkg --quiet "${oem_pkg}" + sudo rsync -a "${oem_tmp}/usr/share/oem/" "${VM_TMP_ROOT}/usr/share/oem/" + sudo rm -rf "${oem_tmp}" } # Write the vm disk image to the target directory in the proper format