summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-04-20chore: release vmdb2 0.26vmdb2-0.26Lars Wirzenius2-6/+13
Sponsored-by: author
2022-04-16fix(ansible plugin): delete all temporary filesLars Wirzenius1-16/+22
Remember the temporary files (inventory, variables) for the Ansible step, for every step using it, and remove all of them. Previously, when there were more than one "ansible" step, the Ansible plugin would only remember the temporary files for the last step. This meant that only those got removed at the end. Also, it would try to remove them for every "ansible" step, resulting in harmless, but worrying error messages. Sponsored-by: author
2022-04-16test: explicitly say all tests pass, if they doLars Wirzenius1-0/+2
Sponsored-by: author
2022-02-19chore: bump version number for releaseLars Wirzenius1-2/+2
Sponsored-by: author
2022-02-19docs: update NEWS for upcoming releasevmdb2-0.25Lars Wirzenius1-0/+60
Sponsored-by: author
2022-02-19debootstrap: allow user to say target need not be emptyLars Wirzenius1-1/+3
Sponsored-by: author
2022-02-16fix: how luksFormat is calledLars Wirzenius1-3/+11
Sponsored-by: author
2022-02-16feat: use luks2 and allow SSD discardsLars Wirzenius1-1/+2
This isn't yet tested on bare metal hardware. I need a .deb built from main to test easily. I'll revert this if testing fails. Sponsored-by: author
2022-02-16test: drop commented-out use of lvm2.vmdbLars Wirzenius1-3/+0
The lines wouldn't have worked if uncommented. Sponsored-by: author
2022-02-16style: reformat ./check-images scriptLars Wirzenius1-34/+22
Sponsored-by: author
2022-02-16fix: drop use of zerofree step in sample filesLars Wirzenius21-41/+0
We briefly had a step called zerofree, but we dropped. The functionality is now done unconditionally. This is simpler and doesn't seem to have drawbacks so far. Sponsored-by: author
2022-02-10test: add ./check-all script to run entire test suiteLars Wirzenius1-0/+10
Sponsored-by: author
2022-02-10test: rename check-all to check-imagesLars Wirzenius2-2/+2
This makes room for a new check-all that actually runs all tests. Sponsored-by: author
2022-02-10fix: test suite after debootstrap-target-must-be-empty changeLars Wirzenius2-19/+21
Now allow lost+found in target. Sponsored-by: author
2022-01-17remove the (now obsolete) zerofree pluginAndy Piper2-51/+0
2022-01-17mount_plugin: run zerofree by default on unmountAndy Piper2-1/+14
When unmounting `ext*` filesystems, run zerofree by default unless told not to via a `zerofree: false` key
2022-01-16fix: if debootstrap target is exists, it must be an empty dirLars Wirzenius1-1/+6
Sponsored-by: author
2022-01-03fix typoSebastian Bachmann1-1/+1
2022-01-03Check loop device before trying to removeSebastian Bachmann1-0/+13
If the loop device was already sucessfully removed by kpartx, losetup -d would fail and thus crash the vmdb2 run. A check was added to query the loop device's back-file and only remove the loop device if there is still one. Resolves #60
2022-01-02Fix part-naming and add timeout while waitingSebastian Bachmann1-4/+28
When installing on a blockdevice which device name ends in a number, a 'p' is added between the device name and the partition number. This will be the case, for example, when installing to /dev/nbd0 or /dev/nvme0. Further, added a timeout to the wait_for_file_to_exist function, in order not to hang when a partition was not found. Both changes should resolve #46
2022-01-01feat: cryptsetup stepLars Wirzenius8-11/+219
This adds a step to use cryptsetup to encrypt a block device with LUKS, using the cryptsetup tool. A crypttab is written by the fstab step. Sponsored-by: author
2021-11-23set_part_flag_plugin: fix copy pasta in docsAndy Piper1-2/+1
2021-11-22debootstrap_plugin: add `include` and `install_keyring` keysAndy Piper2-29/+55
The "include" key maps to debootstrap's `--include` parameter, allowing additional packages to be installed. The `install_keyring` key is a Boolean that determines if the gpg keyring specified by the `keyring` key is installed in the disk image for use when installing packages from non-official Debian repositories, e.g. local mirrors created using aptly, etc.
2021-11-22debootstrap_plugin: don't always run apt-get updateAndy Piper2-7/+0
The apt_plugin always runs `apt-get update` before installing packages, so the `apt-get update` in deboostrap_plugin is redundant. It also blocks provisioning the TLS certs required to validate connections to package repos that use https instead of http connections.
2021-11-22ansible_plugin.py: Extend ansible plugin parametersAndy Piper2-14/+57
Add the ability to optionally configure: - The inventory group name - The Ansible tags to be executed - An Ansible configuration file - An `extra_vars` dictionary to be passed to the playbook This enables existing image-creation builds with complex Ansible playbooks to be converted to use vmdb2.
2021-11-22app.py: Add `--variable` param for user-supplied jinja2 variablesAndy Piper1-1/+24
The `--variable` command line parameter can be used to supply values for Jinja2 variables in vmdb2 build specification YAML files using the format `name=value`. This is useful for builds which need to be parameterized, e.g they use remote services in different AWS regions and/or accounts.
2021-11-22grub_plugin: add support for the root filesystem on a logical volume.Andy Piper1-11/+77
Detect if the root filesystem is inside a know logical volume group by examining the output of the `lvs` command. If the rootfs is in a known LV group, determine the name of the mapped device for the group. If the `lvs` command shows the device as `/dev/dm-X` instead of `/dev/mapper/loopXpY`, use the `dmsetup ls` command to determine the name of the loop device.
2021-11-22grub_plugin.py: run apt-get update before installing grubAndy Piper1-0/+1
This fixes build failures where no packages are installed by vmdb2 (and so there is no local package metadata for apt-get to read) before the grub plugin is executed. This can be the case when an `unpack-rootfs` build step comes after all of steps that install packages.
2021-11-22Add set_part_flag_plugin.pyAndy Piper3-0/+90
This enables things like setting the `bios_grub` flag on a partition. It seemed simpler to create a plugin to set these flags than to overload the pupose of the mkpart_plugin.
2021-11-22Add copy_dir_plugin.pyAndy Piper3-0/+138
Adds the ability to copy directory trees into the build chroot
2021-11-22Add zerofree_plugin.pyAndy Piper24-0/+94
The `zerofree` utility zeroes out unused disk space on `ext[2-4]` filesystems and is much faster than using `dd`. This enables better compression of the output disk image when being packaged as a OVA or a Vagrant Box, etc.
2021-11-22lvcreate_plugin: add ability to fill available spaceAndy Piper2-2/+6
The special size value "fill" will instruct the lvcreate_plugin to create a partition that uses all of the available space in the specified logical volume
2021-11-22Clean up mapped partitions in docker on macOSAndy Piper2-2/+17
Docker containers running in Docker Desktop for Mac appear to have a version of `kpartx` that doesn't properly clean up mapped partitions upon execution of `kpartx -dsv`. To work around this behaviour, the kpartx_plugin now unmaps mapped partitions as required using `dmsetup remove <part>`, and frees the loopback device using `losetup -d <device>` This change requires the list of partition mounpoints to be an ordered list in order to be able to unmap mapped partitions in the correct order, so `Tags.get_tags()` has been updated to return the ordered list `self._tagnames` instead of `self._tags.keys()` which (for Python versions before 3.7) returns an unorderd list.
2021-10-15grub_plugin.py: detect grub-install --no-extra-removableZygmunt Krynicki1-1/+2
This makes the vmdb2 compatible with Ubuntu's modified grub-install by interrogating grub-install --help to check which of the options to pass: --no-extra-removable or --force-extra-removable. Closes: https://gitlab.com/larswirzenius/vmdb2/-/issues/36 Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@huawei.com>
2021-09-30grub_plugin.py: set grub option systemd.show_status only onceFlorian La Roche1-2/+6
These items are fixed with this change: - "systemd.show_status=true" is always added, even if it was turned off later on. - If the option quiet is selected, then "systemd.show_status=false" is added twice instead of only once. With this patch "systemd.show_status" is only set once with either the value "true" or "false". Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
2021-08-23docs: say in README project is in "selish maintenance mode"Lars Wirzenius1-0/+8
Sponsored-by: author
2021-08-22chore: update version number in Pythonvmdb2-0.24Lars Wirzenius1-2/+2
Sponsored-by: author
2021-08-22docs: update NEWS for upcoming releaseLars Wirzenius1-1/+24
Sponsored-by: author
2021-08-22disable tests that don't passLars Wirzenius1-14/+14
I'm too tired to debug this mess today. Sponsored-by: author
2021-08-06fix typoSebastian Bachmann1-1/+1
2021-07-17fix: strip spaces and newlines from host architectureLars Wirzenius1-1/+5
When running dpkg --print-architecure, the output contains a newline. This understandably confuses debootstrap, so strip it away. Sponsored-by: author
2021-07-17fix: make lvcreate not ask questionsLars Wirzenius1-1/+1
The -qq option to lvcreate tells it to be quiet and to assume the answer to any question it may have is "no". Sponsored-by: author
2021-07-17fix: disable realpath'ing the output device in mkpartLars Wirzenius1-2/+6
The os.path.realpath resolves symlinks, and for some reason I do not currently understand this breaks using vmdb2 with --image pointing at an LVM2 logical volume. Sponsored-by: author
2021-07-17fix: disable arm64 test in check-allLars Wirzenius1-1/+1
It never passes for me, so disabling it for now. Sponsored-by: author
2021-07-12Merge branch 'AaronDewes/vmdb2-merge-qemu-debootstrap-into-debootstrap'Lars Wirzenius3-2/+31
2021-07-12fix: get config key "arch" for arch instead of "keyring"Lars Wirzenius1-1/+1
Sponsored-by: author
2021-06-29Fix logic of the apt plugin's 'recommends' optionAndres Salomon1-1/+1
The documentation says to set 'recommends' to true or false, with false telling apt not to install recommends. However, the logic in the code does the opposite of that. This also means that by default, all apt-get install calls from vmdb2 run with --no-install-recommends. As a user, it doesn't make much sense to set 'recommends' to true to tell apt not to install recommends. So I think fixing the logic in the code makes more sense than updating the documentation.
2021-06-24Merge qemu-debootstrap into debootstrapAaron Dewes3-2/+31
Cross-architecture debootstrap without qemu-debootstrap requires Debian >= Buster
2021-04-01docs: update NEWS for releasevmdb2-0.23Lars Wirzenius1-1/+4
2021-03-17Add an option to apt allowing users to set --no-install-recommendsGunnar Wolf2-5/+14