Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
arch-boxes
Commits
e7af4c56
Verified
Commit
e7af4c56
authored
Oct 02, 2020
by
Kristian Klausen
🎉
Browse files
Simplify create_image usage
parent
b5877a9e
Changes
1
Show whitespace changes
Inline
Side-by-side
build-inside-vm.sh
View file @
e7af4c56
...
@@ -148,17 +148,17 @@ function mv_to_output() {
...
@@ -148,17 +148,17 @@ function mv_to_output() {
}
}
# Helper function: create a new image from the "base" image
# Helper function: create a new image from the "base" image
# ${1} - new image file
# ${1} - final file
# ${2} - final file
# ${2} - pre
# ${3} - pre
# ${3} - post
# ${4} - post
function
create_image
()
{
function
create_image
()
{
copy_and_mount_image
"
${
1
}
"
local
tmp_image
=
"
$(
basename
"
$(
mktemp
-u
)
"
)
"
"
${
3
}
"
copy_and_mount_image
"
${
tmp_image
}
"
"
${
2
}
"
image_cleanup
image_cleanup
unmount_image
unmount_image
"
${
4
}
"
"
${
1
}
"
"
${
2
}
"
"
${
3
}
"
"
${
tmp_image
}
"
"
${
1
}
"
mv_to_output
"
${
2
}
"
mv_to_output
"
${
1
}
"
}
}
function
cloud_image
()
{
function
cloud_image
()
{
...
@@ -251,8 +251,8 @@ function main() {
...
@@ -251,8 +251,8 @@ function main() {
else
else
build_version
=
"
${
1
}
"
build_version
=
"
${
1
}
"
fi
fi
create_image
"cloud-img.img"
"Arch-Linux-x86_64-cloudimg-
${
build_version
}
.qcow2"
cloud_image cloud_image_post
create_image
"Arch-Linux-x86_64-cloudimg-
${
build_version
}
.qcow2"
cloud_image cloud_image_post
create_image
"vagrant-qemu.img"
"Arch-Linux-x86_64-libvirt-
${
build_version
}
.box"
vagrant_qemu vagrant_qemu_post
create_image
"Arch-Linux-x86_64-libvirt-
${
build_version
}
.box"
vagrant_qemu vagrant_qemu_post
create_image
"vagrant-virtualbox.img"
"Arch-Linux-x86_64-virtualbox-
${
build_version
}
.box"
vagrant_qemu vagrant_virtualbox_post
create_image
"Arch-Linux-x86_64-virtualbox-
${
build_version
}
.box"
vagrant_qemu vagrant_virtualbox_post
}
}
main
"
$@
"
main
"
$@
"
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