mirror of
https://github.com/flatcar/scripts.git
synced 2026-03-09 07:21:03 +01:00
build_library: Switch pvgrub xen config to use our grub
In PVH mode grub can't be chainloaded from grub, so we either need to use pygrub or the host provided grub needs to support Flatcar specifics. Publish our xen-pvh grub along with the image and use it from the pvgrub config. Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
parent
21f4a50dfd
commit
6d9bc1bed8
@ -874,6 +874,9 @@ EOF
|
||||
)
|
||||
fi
|
||||
for target in ${target_list}; do
|
||||
if [[ "${target}" = "i386-xen_pvh" ]]; then
|
||||
grub_args+=(--copy_xen_grub="${BUILD_DIR}/${image_grub%.grub}-grub-xen_pvh.bin")
|
||||
fi
|
||||
${BUILD_LIBRARY_DIR}/grub_install.sh \
|
||||
--board="${BOARD}" \
|
||||
--target="${target}" \
|
||||
|
||||
@ -26,6 +26,8 @@ DEFINE_string copy_efi_grub "" \
|
||||
"Copy the EFI GRUB image to the specified path."
|
||||
DEFINE_string copy_shim "" \
|
||||
"Copy the shim image to the specified path."
|
||||
DEFINE_string copy_xen_grub "" \
|
||||
"Copy Xen PVH grub to the specified path."
|
||||
|
||||
# Parse flags
|
||||
FLAGS "$@" || exit 1
|
||||
@ -242,6 +244,10 @@ case "${FLAGS_target}" in
|
||||
"${ESP_DIR}/xen/pvboot-x86_64.elf"
|
||||
sudo cp "${BUILD_LIBRARY_DIR}/menu.lst" \
|
||||
"${ESP_DIR}/boot/grub/menu.lst"
|
||||
if [[ -n "${FLAGS_copy_xen_grub}" ]]; then
|
||||
cp --no-preserve=mode "${ESP_DIR}/xen/pvboot-x86_64.elf" \
|
||||
"${FLAGS_copy_xen_grub}"
|
||||
fi
|
||||
;;
|
||||
arm64-efi)
|
||||
info "Installing default arm64 UEFI bootloader."
|
||||
|
||||
@ -991,6 +991,7 @@ _write_xl_conf() {
|
||||
local src_name=$(basename "$VM_SRC_IMG")
|
||||
local dst_name=$(basename "$VM_DST_IMG")
|
||||
local dst_dir=$(dirname "$VM_DST_IMG")
|
||||
local grub_name="flatcar_production_image-grub-xen_pvh.bin"
|
||||
local pygrub="${dst_dir}/$(_src_to_dst_name "${src_name}" "_pygrub.cfg")"
|
||||
local pvgrub="${dst_dir}/$(_src_to_dst_name "${src_name}" "_pvgrub.cfg")"
|
||||
local disk_format=$(_get_vm_opt DISK_FORMAT)
|
||||
@ -1000,8 +1001,7 @@ _write_xl_conf() {
|
||||
echo 'bootloader = "pygrub"' >> "${pygrub}"
|
||||
|
||||
echo '# Xen PV config using pvgrub' > "${pvgrub}"
|
||||
echo 'kernel = "/usr/lib/xen/boot/pv-grub-x86_64.gz"' >> "${pvgrub}"
|
||||
echo 'extra = "(hd0,0)/boot/grub/menu.lst"' >> "${pvgrub}"
|
||||
echo "kernel = \"${grub_name}\"" >> "${pvgrub}"
|
||||
|
||||
# The rest is the same
|
||||
tee -a "${pygrub}" "${pvgrub}" >/dev/null <<EOF
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user