1
0
mirror of https://github.com/foxlet/macOS-Simple-KVM.git synced 2024-06-02 06:03:31 +02:00

If QEMU on path is new enough, use qemu-img for dmg conversion instead.

This commit is contained in:
zer0def 2019-10-01 23:25:06 +02:00
parent 5273550f00
commit 43d1cb9260
2 changed files with 3 additions and 1 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
BaseSystem.img
BaseSystem.dmg
BaseSystem.chunklist
template.xml

View File

@ -36,4 +36,5 @@ case $argument in
;;
esac
"$TOOLS/dmg2img" "$TOOLS/FetchMacOS/BaseSystem/BaseSystem.dmg" "$PWD/BaseSystem.img"
QEMU_IMG_VERSION="$(qemu-img --version | awk '/version/ {print $NF}')"
[ "${QEMU_IMG_VERSION%%.*}" -ge 4 ] && qemu-img convert "${TOOLS}/FetchMacOS/BaseSystem/BaseSystem.dmg" -O raw "${PWD}/BaseSystem.img" || "${TOOLS}/dmg2img" "${TOOLS}/FetchMacOS/BaseSystem/BaseSystem.dmg" "${PWD}/BaseSystem.img"