armbian_build/extensions/image-output-qcow2.sh
Ricardo Pardini 4a9529dd34
armbian-next: qemu-uboot-arm64 and qemu-uboot-x86 new boards
- sharing most UEFI code, will replace the `virtual` one soon
- x86: patch uboot defconfig to use the `q35` machine type, not `i440fx`
  - separate x86 bootscript, due to non-uInitrd-ness of it
  - hack ramdisk load address both in u-boot source and bootscript
  - use 32-bit u-boot, not 64-bit
- grub: introduce `UEFI_GRUB=skip`, does not deploy GRUB (but does the kernel packages, etc)
- auto-enable qcow2 output for these
- works with both distro's and Armbian's kernels
2023-02-18 07:40:33 -03:00

21 lines
984 B
Bash

function add_host_dependencies__qcow2_host_deps() {
[[ "${SKIP_QCOW2}" == "yes" ]] && return 0
export EXTRA_BUILD_DEPS="${EXTRA_BUILD_DEPS} qemu-utils"
}
function post_build_image__900_convert_to_qcow2_img() {
[[ "${SKIP_QCOW2}" == "yes" ]] && return 0
display_alert "Converting image to qcow2" "${EXTENSION}" "info"
export QCOW2_IMAGE_FILE="${DESTIMG}/${version}.img.qcow2"
run_host_command_logged qemu-img convert -f raw -O qcow2 "${DESTIMG}/${version}.img" "${QCOW2_IMAGE_FILE}"
run_host_command_logged qemu-img info "${QCOW2_IMAGE_FILE}"
if [[ "${QCOW2_RESIZE_AMOUNT}" != "" ]]; then
display_alert "Resizing qcow2 image by '${QCOW2_RESIZE_AMOUNT}' " "${EXTENSION}" "info"
qemu-img resize "${QCOW2_IMAGE_FILE}" "${QCOW2_RESIZE_AMOUNT}"
fi
if [[ "${QCOW2_KEEP_IMG}" != "yes" ]]; then
display_alert "Discarding original .img image after" "conversion to qcow2" "info"
run_host_command_logged rm -vf "${DESTIMG}/${version}.img" "${DESTIMG}/${version}.img.txt"
fi
}