mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
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:
parent
a78c5fb665
commit
e0cfea50fb
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user