From dc598719d00d33df800f6109d73898dcdcf4f155 Mon Sep 17 00:00:00 2001 From: Ivan Melnikov Date: Sun, 19 May 2019 16:39:04 +0700 Subject: [PATCH] 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. --- features.in/build-vm/lib/90-build-vm.mk | 13 +++++++++++++ features.in/pack/config.mk | 5 +++++ main.mk | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/features.in/build-vm/lib/90-build-vm.mk b/features.in/build-vm/lib/90-build-vm.mk index 0bd81806..b373dc8c 100644 --- a/features.in/build-vm/lib/90-build-vm.mk +++ b/features.in/build-vm/lib/90-build-vm.mk @@ -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 diff --git a/features.in/pack/config.mk b/features.in/pack/config.mk index fbace003..87d41227 100644 --- a/features.in/pack/config.mk +++ b/features.in/pack/config.mk @@ -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 diff --git a/main.mk b/main.mk index f01ef923..2bd38800 100644 --- a/main.mk +++ b/main.mk @@ -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)