mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 22:51:03 +02:00
Merge pull request #503 from marineam/vm-pkgs
Add --getbinpkg flag to image_to_vm
This commit is contained in:
commit
fc33f611fe
@ -422,9 +422,24 @@ 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}"
|
||||
|
||||
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 --usepkg --quiet "${oem_pkg}"
|
||||
--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}"
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user