Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mkimage-profiles
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
mkimage-profiles
Commits
2987fa8f
Commit
2987fa8f
authored
May 01, 2021
by
Anton Midyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build-vm, image.in: add VM_SAVE_TARBALL parameter
The parameter is used to save the intermediate tarball used to build the virtual machine image.
parent
f9ef0e95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
params.txt
doc/params.txt
+6
-0
90-build-vm.mk
features.in/build-vm/lib/90-build-vm.mk
+21
-6
Makefile
image.in/Makefile
+5
-2
No files found.
doc/params.txt
View file @
2987fa8f
...
...
@@ -121,6 +121,12 @@
*** пусто (по умолчанию) либо строка (например, "alpha", "beta")
** см. image.in/Makefile
* VM_SAVE_TARBALL
** указывает, что нужно сохранить промежуточный тарбол, из которого
** создаётся образ виртуальной машины, в заданном формате
** значения: tar tar.gz tar.xz
** см. features.in/build-vm/lib/90-build-vm.mk
* VM_SIZE
** задаёт размер несжатого образа виртуальной машины в байтах
** значение: пусто (по умолчанию двойной размер чрута) или целое
...
...
features.in/build-vm/lib/90-build-vm.mk
View file @
2987fa8f
...
...
@@ -18,6 +18,7 @@ endif
# intermediate chroot archive
VM_TARBALL := $(IMAGE_OUTDIR)/$(IMAGE_NAME).tar
VM_OUT_TARBALL := $(IMAGE_OUTDIR)/$(IMAGE_OUTNAME).tar
VM_RAWDISK := $(IMAGE_OUTDIR)/$(IMAGE_NAME).raw
VM_FSTYPE ?= ext4
VM_SIZE ?= 0
...
...
@@ -28,6 +29,16 @@ VM_XZ_COMMAND ?= xz -T0
# tavolga
RECOVERY_LINE ?= Press ENTER to start
# tarball save
#SAVE_TARBALL := convert-image/tar
ifdef VM_SAVE_TAR
ifeq (,$(filter-out img img.xz qcow2 qcow2c vdi vmdk vhd,$(IMAGE_TYPE)))
ifeq (,$(filter-out tar tar.gz tar.xz,$(VM_SAVE_TAR)))
SAVE_TARBALL := convert-image/$(VM_SAVE_TAR)
endif
endif
endif
check-sudo:
@if ! type -t sudo >&/dev/null; then \
echo "** error: sudo not available, see doc/vm.txt" >&2; \
...
...
@@ -39,7 +50,7 @@ check-qemu:
exit 1; \
fi
tar2fs: check-sudo prepare-tarball-qemu
tar2fs:
$(SAVE_TARBALL)
check-sudo prepare-tarball-qemu
@if [ -x /usr/share/mkimage-profiles/bin/tar2fs ]; then \
TOPDIR=/usr/share/mkimage-profiles; \
fi; \
...
...
@@ -57,13 +68,17 @@ prepare-tarball-qemu:
tar -rf "$(VM_TARBALL)" ./.host/qemu*) ||:
convert-image/tar:
mv "$(VM_TARBALL)" "$(IMAGE_OUTPATH)"
ifdef SAVE_TARBALL
cp "$(VM_TARBALL)" "$(VM_OUT_TARBALL)"
else
mv "$(VM_TARBALL)" "$(VM_OUT_TARBALL)"
endif
convert-image/tar.gz:
$(VM_GZIP_COMMAND)
< "$(VM_TARBALL)" > "$(IMAGE_OUTPATH
)"
convert-image/tar.gz:
convert-image/tar
$(VM_GZIP_COMMAND)
"$(VM_OUT_TARBALL
)"
convert-image/tar.xz:
$(VM_XZ_COMMAND)
< "$(VM_TARBALL)" > "$(IMAGE_OUTPATH
)"
convert-image/tar.xz:
convert-image/tar
$(VM_XZ_COMMAND)
"$(VM_OUT_TARBALL
)"
convert-image/img: tar2fs
mv "$(VM_RAWDISK)" "$(IMAGE_OUTPATH)"
...
...
image.in/Makefile
View file @
2987fa8f
...
...
@@ -41,8 +41,8 @@ IMAGE_VERSION := -$(DISTRO_VERSION)
IMAGE_VER_LINK
:=
$(IMAGE_NAME)$(IMAGE_VERSION)
-latest-
$(ARCH)
.
$(IMAGE_TYPE)
endif
IMAGE_OUT
FILE
:=
\
$(IMAGE_NAME)$(IMAGE_VERSION)
-
$(STATUS)$(DATE)
-
$(ARCH
)
.
$(IMAGE_TYPE)
IMAGE_OUT
NAME
:=
$(IMAGE_NAME)$(IMAGE_VERSION)
-
$(STATUS)$(DATE)
-
$(ARCH)
IMAGE_OUTFILE
:=
$(IMAGE_OUTNAME
)
.
$(IMAGE_TYPE)
IMAGE_OUTDIR
:=
$(IMAGEDIR)
$
(
IMAGE_SORTDIR:%
=
/%
)
IMAGE_OUTPATH
:=
$(IMAGE_OUTDIR)
/
$(IMAGE_OUTFILE)
IMAGE_RELPATH
:=
$
(
IMAGE_SORTDIR:%
=
%/
)
$(IMAGE_OUTFILE)
...
...
@@ -95,6 +95,9 @@ postprocess: | $(addprefix postprocess-,$(sort $(POSTPROCESS_TARGETS)))
echo
"** error:
$(IMAGE_OUTPATH)
missing"
>
&2
;
\
exit
1
;
\
fi
;
\
if
[
-n
"
$(VM_SAVE_TAR)
"
]
;
then
\
echo
"** tarball saved:
$(IMAGE_OUTPATH)
/
$(IMAGE_OUTNAME)
.
$(VM_SAVE_TAR)
"
>
&2
;
\
fi
;
\
echo
"** image:
$(IMAGE_OUTPATH)
[
$$
OUTSIZE]"
>
&2
&&
\
echo
"IMAGE_OUTPATH =
$(IMAGE_OUTPATH)
"
&&
\
echo
"IMAGE_OUTFILE =
$(IMAGE_OUTFILE)
"
&&
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment