summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-04-07chore: prepare release 0.27vmdb2-0.27Lars Wirzenius2-2/+28
Sponsored-by: author
2023-04-07Allow customisation of hard-coded grub Linux kernel params.Tim Small2-6/+7
The kernel parameters `biosdevname=0 net.ifnames=0 consoleblank=0 rw` were previously hard-coded and non-modifiable in the grub step. Allow user customisation of these parameters, whilst setting the default to the current parameter set for backwards compatibility.
2023-04-07Use set_grub_default() for all grub defaults edits.Tim Small1-25/+5
2023-04-07Don't duplicate GRUB_TIMEOUT= in /etc/default/grubTim Small1-3/+24
Previously the `GRUB_TIMEOUT` parameter in `/etc/default/grub` was set at the end of the file. This superseded the previous definition of `GRUB_TIMEOUT=5` at the top of the file, but the resulting duplication was potentially confusing for the user. This uses a newly added helper method to update the timeout instead. When possible, the new method updates the original definitions within the defaults file instead (at the same location within the file as the original definition, or after commented-out example lines).
2023-04-07When initializing an ext4 filesystem, omit the large_dir and ↵Gunnar Wolf1-0/+11
metadata_csum_seed flags (issue #69)
2023-04-07fix: set locale to C.UTF8Lars Wirzenius1-1/+3
Ansible now tests that its locale supports UTF8 (I don't know why). Also, log the environment, to help debug this kind of thing in the future. Sponsored-by: author
2023-04-07chore: remove trailing whitespace from linesLars Wirzenius1-2/+2
Sponsored-by: author
2022-10-25chore: drop debootstrap plugin's run_even_if_skippedLars Wirzenius1-4/+0
It's never called. That functionality is gone. Sponsored-by: author
2022-10-17arm64-uefi.vmdb: update from Antonio Terceiro for debootrap fixLars Wirzenius1-6/+22
Sponsored-by: author
2022-10-17fix(debootstrap plugin): set architecture for later stagesAntonio Terceiro1-4/+6
debootstrap takes an architecture argument, but does not propagate that to later stages of the image build. This causes, for example, the GRUB plugin to fail to install the correct packages when creating an images for a foreign archiecture. The call to dpkg --print-architecture to discover the native architecture is already done when state is first populated, so there is no need to do it again in the grub plugin.
2022-06-11feat! drop qemu-deboostrap plugin, run_even_if_skipped featureLars Wirzenius20-184/+29
The qemu-deboostrap plugin is entirely replaced with the debootstrap one, on versions of Debian 10 onward. There is no need to keep it. The `run_even_if_skipped` feature was only used by that plugin, so it has been dropped as well. Sponsored-by: author
2022-05-12Fix for simple typoUli Heller1-1/+1
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