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.
This commit is contained in:
Michael Marineau 2014-03-27 22:17:32 -07:00
parent a78c5fb665
commit e0cfea50fb

View File

@ -245,15 +245,17 @@ setup_disk_image() {
# If the current type defines a oem package install it to the given fs image. # If the current type defines a oem package install it to the given fs image.
install_oem_package() { install_oem_package() {
local oem_pkg=$(_get_vm_opt 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 if [[ -z "${oem_pkg}" ]]; then
return 0 return 0
fi fi
info "Installing ${oem_pkg} to OEM partition" info "Installing ${oem_pkg} to OEM partition"
emerge-${BOARD} --root="${oem_mnt}" --root-deps=rdeps "${oem_pkg}" emerge-${BOARD} --root="${oem_tmp}" \
sudo rm -rf "${oem_mnt}/var" # clean out /var/pkg/db and friends --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 # Write the vm disk image to the target directory in the proper format