Commit dc598719 authored by Ivan Melnikov's avatar Ivan Melnikov Committed by Michael Shigorin

build-vm, main.mk, pack: add recovery.tar

recovery.tar needed for tavolga (mipsel). This commit is the result of transferring the required functionality from build-mr (mipsel rootfs). This change uses external tool to build Tavolga-compatible recovery.tar. This simplifies the logic and avoids having recovery workdir in the profile. After this change, m-p will require tavolga-image-tools >= 3.0.
parent dc502493
......@@ -25,6 +25,9 @@ VM_SIZE ?= 0
VM_GZIP_COMMAND ?= gzip
VM_XZ_COMMAND ?= xz -T0
# tavolga
RECOVERY_LINE ?= Press ENTER to start
check-sudo:
@if ! type -t sudo >&/dev/null; then \
echo "** error: sudo not available, see doc/vm.txt" >&2; \
......@@ -75,6 +78,16 @@ convert-image/qcow2 convert-image/qcow2c convert-image/vmdk \
qemu-img convert $$VM_COMPRESS -O "$$VM_FORMAT" \
"$(VM_RAWDISK)" "$(IMAGE_OUTPATH)"
# for tavolga
convert-image/recovery.tar:
build-recovery-tar \
--image-name $(IMAGE_NAME) \
--date $(DATE) \
--compress-command '$(VM_GZIP_COMMAND)' \
--rootfs "$(VM_TARBALL)" \
--output "$(IMAGE_OUTPATH)" \
--line '$(RECOVERY_LINE)'
post-convert:
@rm -f "$(VM_RAWDISK)"; \
if [ "0$(DEBUG)" -le 1 ]; then rm -f "$(VM_TARBALL)"; fi
......
......@@ -38,9 +38,14 @@ endif
# extensions for buld-vm
VM_EXTS := .tar .tar.gz .tar.xz .img .qcow2 .qcow2c .vdi .vmdk .vhd
VM_TAVOLGA_EXTS := .recovery.tar
ifeq (vm,$(IMAGE_CLASS))
$(VM_EXTS:.%=use/pack/%): use/pack; @:
ifeq (mipsel,$(ARCH))
use/pack/recovery.tar: use/pack/tar; @:
endif
endif
......@@ -61,7 +61,8 @@ VE_TARGETS := $(call targets,ve)
VM_TARGETS := $(call targets,vm)
DISTROS := $(call addsuffices,$(DISTRO_EXTS),$(DISTRO_TARGETS))
VES := $(call addsuffices,$(VE_EXTS),$(VE_TARGETS))
VMS := $(call addsuffices,$(VM_EXTS),$(VM_TARGETS))
VMS := $(call addsuffices,$(VM_EXTS),$(VM_TARGETS)) \
$(call addsuffices,$(VM_TAVOLGA_EXTS), $(filter vm/tavolga-%, $(VM_TARGETS)))
IMAGES := $(DISTROS) $(VES) $(VMS)
.PHONY: $(IMAGES) $(DISTRO_TARGETS) $(VE_TARGETS) $(VM_TARGETS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment