Commit 9b511c6c authored by Kristian Klausen's avatar Kristian Klausen 🎉
Browse files

Improve disk compaction by trimming the disk

This only affect the qemu and virtualbox image. I'm not sure how you
enable trim support in VMware and the documentation is spare.

Tested with: packer build -only=qemu local.json
698M	Arch-Linux-x86_64-libvirt-2020-08-01.box <- before
425M	Arch-Linux-x86_64-libvirt-2020-08-01.box <- after

Fix #106
parent ec363126
Pipeline #964 failed with stages
in 60 minutes and 29 seconds
......@@ -19,6 +19,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"disk_discard": "unmap",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "arch",
......
......@@ -18,6 +18,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"hard_drive_discard": "true",
"guest_os_type": "ArchLinux_64",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......@@ -53,6 +54,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"disk_discard": "unmap",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
"ssh_username": "vagrant",
......
......@@ -9,3 +9,6 @@ yes | sudo pacman -Scc
rm /etc/machine-id
# Remove pacman key ring for re-initialization
rm -rf /etc/pacman.d/gnupg/
sync
fstrim --all --verbose
......@@ -17,6 +17,7 @@
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_size": "{{user `disk_size`}}",
"hard_drive_discard": "true",
"guest_os_type": "ArchLinux_64",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......@@ -51,6 +52,7 @@
"type": "qemu",
"boot_wait": "{{user `boot_wait`}}",
"http_directory": "http",
"disk_discard": "unmap",
"disk_size": "{{user `disk_size`}}",
"iso_checksum": "file:{{user `iso_checksum_url`}}",
"iso_url": "{{user `iso_url`}}",
......
Supports Markdown
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