mirror of
https://github.com/hanwckf/immortalwrt-mt798x.git
synced 2025-01-08 10:23:47 +08:00
x86: added support to generate VHDX images
Added support to generate dynamic-sized VHDX images for Hyper-V. Compile-tested on x86 and run-tested on Windows 10 21H2 (Hyper-V). Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com> (cherry picked from commit fd4ad6cae88d009e9560e4ee902bf20a5b42d36e)
This commit is contained in:
parent
f033f6fcea
commit
624c975a3e
@ -257,6 +257,13 @@ menu "Target Images"
|
|||||||
select PACKAGE_kmod-e1000
|
select PACKAGE_kmod-e1000
|
||||||
default y if BUILDBOT
|
default y if BUILDBOT
|
||||||
|
|
||||||
|
config VHDX_IMAGES
|
||||||
|
bool "Build Hyper-V image files (VHDX)"
|
||||||
|
depends on TARGET_x86
|
||||||
|
depends on GRUB_IMAGES || GRUB_EFI_IMAGES
|
||||||
|
select PACKAGE_kmod-e1000
|
||||||
|
default y if BUILDBOT
|
||||||
|
|
||||||
config TARGET_IMAGES_GZIP
|
config TARGET_IMAGES_GZIP
|
||||||
bool "GZip images"
|
bool "GZip images"
|
||||||
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
|
depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta
|
||||||
|
@ -328,7 +328,7 @@ define Build/patch-cmdline
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
# Convert a raw image into a $1 type image.
|
# Convert a raw image into a $1 type image.
|
||||||
# E.g. | qemu-image vdi
|
# E.g. | qemu-image vdi <optional extra arguments to qemu-img binary>
|
||||||
define Build/qemu-image
|
define Build/qemu-image
|
||||||
if command -v qemu-img; then \
|
if command -v qemu-img; then \
|
||||||
qemu-img convert -f raw -O $1 $@ $@.new; \
|
qemu-img convert -f raw -O $1 $@ $@.new; \
|
||||||
|
@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
ARCH:=i386
|
ARCH:=i386
|
||||||
BOARD:=x86
|
BOARD:=x86
|
||||||
BOARDNAME:=x86
|
BOARDNAME:=x86
|
||||||
FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu boot-part rootfs-part
|
FEATURES:=squashfs ext4 vdi vmdk vhdx pcmcia targz fpu boot-part rootfs-part
|
||||||
SUBTARGETS:=64 generic legacy geode
|
SUBTARGETS:=64 generic legacy geode
|
||||||
|
|
||||||
KERNEL_PATCHVER:=5.4
|
KERNEL_PATCHVER:=5.4
|
||||||
|
@ -109,6 +109,7 @@ define Device/Default
|
|||||||
IMAGE/combined.img.gz := grub-config pc | combined | grub-install | gzip | append-metadata
|
IMAGE/combined.img.gz := grub-config pc | combined | grub-install | gzip | append-metadata
|
||||||
IMAGE/combined.vdi := grub-config pc | combined | grub-install | qemu-image vdi
|
IMAGE/combined.vdi := grub-config pc | combined | grub-install | qemu-image vdi
|
||||||
IMAGE/combined.vmdk := grub-config pc | combined | grub-install | qemu-image vmdk
|
IMAGE/combined.vmdk := grub-config pc | combined | grub-install | qemu-image vmdk
|
||||||
|
IMAGE/combined.vhdx := grub-config pc | combined | grub-install | qemu-image vhdx -o subformat=dynamic
|
||||||
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
|
IMAGE/rootfs.img := append-rootfs | pad-to $(ROOTFS_PARTSIZE)
|
||||||
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
|
IMAGE/rootfs.img.gz := append-rootfs | pad-to $(ROOTFS_PARTSIZE) | gzip
|
||||||
ARTIFACT/image-efi.iso := grub-config iso | iso efi
|
ARTIFACT/image-efi.iso := grub-config iso | iso efi
|
||||||
@ -116,6 +117,7 @@ define Device/Default
|
|||||||
IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
|
IMAGE/combined-efi.img.gz := grub-config efi | combined efi | grub-install efi | gzip | append-metadata
|
||||||
IMAGE/combined-efi.vdi := grub-config efi | combined efi | grub-install efi | qemu-image vdi
|
IMAGE/combined-efi.vdi := grub-config efi | combined efi | grub-install efi | qemu-image vdi
|
||||||
IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
|
IMAGE/combined-efi.vmdk := grub-config efi | combined efi | grub-install efi | qemu-image vmdk
|
||||||
|
IMAGE/combined-efi.vhdx := grub-config efi | combined efi | grub-install efi | qemu-image vhdx -o subformat=dynamic
|
||||||
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
|
ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
|
||||||
IMAGES-y := rootfs.img.gz
|
IMAGES-y := rootfs.img.gz
|
||||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img.gz
|
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.img.gz
|
||||||
@ -140,6 +142,10 @@ define Device/Default
|
|||||||
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk
|
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vmdk
|
||||||
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk
|
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vmdk
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(CONFIG_VHDX_IMAGES),y)
|
||||||
|
IMAGES-$$(CONFIG_GRUB_IMAGES) += combined.vhdx
|
||||||
|
IMAGES-$$(CONFIG_GRUB_EFI_IMAGES) += combined-efi.vhdx
|
||||||
|
endif
|
||||||
IMAGES := $$(IMAGES-y)
|
IMAGES := $$(IMAGES-y)
|
||||||
ARTIFACTS := $$(ARTIFACTS-y)
|
ARTIFACTS := $$(ARTIFACTS-y)
|
||||||
SUPPORTED_DEVICES :=
|
SUPPORTED_DEVICES :=
|
||||||
|
Loading…
x
Reference in New Issue
Block a user