]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoAdd grub EFI support 1797/head
Daan De Meyer [Fri, 18 Aug 2023 11:58:08 +0000 (13:58 +0200)] 
Add grub EFI support

Note that we only generate the necessary menu entries for the grub
configuration to chainload into our generated UKIs, we do not yet
install grub for EFI ourselves as this is a distribution specific
mess that we still need to figure out. On Fedora, because the
shim and grub2-efi packages install directly to /boot which we
redirect to /efi, this is sufficient to boot with grub on EFI by
simply installing the shim and grub2-efi packages.

For other distributions, a post install or finalize script will be
necessary that installs grub (and optionally shim) to the correct
locations in the ESP.

2 years agoAdd back BIOS support using grub
Daan De Meyer [Mon, 14 Aug 2023 11:52:29 +0000 (13:52 +0200)] 
Add back BIOS support using grub

Let's add back support for booting on BIOS using grub. This comes
with the following limitations:

- grub does not support UKIs on BIOS, so we set up the individual
components instead
- grub cannot search partitions by PARTUUID, so we're forced to have
it find the ESP by partition number instead.

We opt to generate grub.cfg ourselves instead of relying on grub-mkconfig.
grub-mkconfig is basically like kernel-install but for grub configuration,
it has a ton of distro specific cruft that we want to ignore, so we simply
don't use it and generate the grub configuration ourselves.

To allow for unprivileged installation of grub, we can't use grub-install
as it insists on opening the root device and probing its filesystem, which
isn't possible unprivileged. Instead, we run grub-mkimage and grub-bios-setup
ourselves, and manually copy the required files to the ESP.

We use the ESP to store the kernels, initrds and grub config. In the event
that grub adds support for UKIs on BIOS in the future, we can simply modify
the generated grub configuration to use our generated UKIs instead.

2 years agoAdd QemuBios= option
Daan De Meyer [Sun, 13 Aug 2023 22:16:37 +0000 (00:16 +0200)] 
Add QemuBios= option

2 years agoMake ESP logic bootloader independent
Daan De Meyer [Mon, 21 Aug 2023 10:13:04 +0000 (12:13 +0200)] 
Make ESP logic bootloader independent

Let's simply check if a bootloader was placed in the right location
instead of having systemd-boot specific checks.

2 years agoAdd none Bootloader option
Daan De Meyer [Fri, 18 Aug 2023 11:23:52 +0000 (13:23 +0200)] 
Add none Bootloader option

This disables adding any EFI bootloader altogether. Preparation
for adding BIOS support.

2 years agoRun tput smam to make sure line wrapping is reenabled
Daan De Meyer [Fri, 18 Aug 2023 19:11:34 +0000 (21:11 +0200)] 
Run tput smam to make sure line wrapping is reenabled

When running seabios, it disables line wrapping for some weird
reason, so let's make sure we reenable it before we exit.

2 years agoDrop XFS workaround
Daan De Meyer [Thu, 17 Aug 2023 12:08:23 +0000 (14:08 +0200)] 
Drop XFS workaround

Heuristic was changed upstream so should work OOTB now.

2 years agoMake /boot/efi a symlink to /efi
Daan De Meyer [Thu, 17 Aug 2023 22:25:40 +0000 (00:25 +0200)] 
Make /boot/efi a symlink to /efi

Let's make sure all EFI stuff is installed to /efi by making
/boot/efi a symlink to /efi.

2 years agoci: Install tzdata on Debian/Ubuntu
Daan De Meyer [Thu, 17 Aug 2023 19:25:48 +0000 (21:25 +0200)] 
ci: Install tzdata on Debian/Ubuntu

To make sure a timezone is set up so systemd-firstboot doesn't
prompt for it on boot.

2 years agoUnset TMPDIR in apivfs_cmd()
Daan De Meyer [Thu, 17 Aug 2023 18:54:36 +0000 (20:54 +0200)] 
Unset TMPDIR in apivfs_cmd()

dnf seems to have issues with this as well so let's unset TMPDIR
whenever we set up APIVFS as that's a good indication something is
going to chroot and we should unset TMPDIR.

2 years agoci: Install base group for Arch
Daan De Meyer [Thu, 17 Aug 2023 15:47:47 +0000 (17:47 +0200)] 
ci: Install base group for Arch

Packages have implicit dependencies on base so let's install it.

2 years agoReset terminal cursor if tput is available
Daan De Meyer [Thu, 17 Aug 2023 12:40:23 +0000 (14:40 +0200)] 
Reset terminal cursor if tput is available

When interrupting dnf5 or other programs, they sometimes mess up
the terminal cursor. So let's make sure we reset the cursor state
when we exit mkosi if tput is available.

2 years agoMerge pull request #1804 from DaanDeMeyer/boot
Luca Boccassi [Thu, 17 Aug 2023 08:29:58 +0000 (09:29 +0100)] 
Merge pull request #1804 from DaanDeMeyer/boot

systemd-boot improvements

2 years agoSet --no-variables when we invoke bootctl 1804/head
Daan De Meyer [Thu, 17 Aug 2023 08:15:00 +0000 (10:15 +0200)] 
Set --no-variables when we invoke bootctl

We already don't install variables because we're operating on a
root directory, but if we set --no-variables we don't get warnings
from bootctl about it.

2 years agoRename install_bootloader() to install_systemd_boot()
Daan De Meyer [Thu, 17 Aug 2023 08:14:40 +0000 (10:14 +0200)] 
Rename install_bootloader() to install_systemd_boot()

2 years agoAdd Bootloader option
Daan De Meyer [Wed, 16 Aug 2023 13:33:29 +0000 (15:33 +0200)] 
Add Bootloader option

For some use cases, we don't want systemd-boot but to boot directly
from a UKI, so let's support that by bringing back the --bootloader
option.

2 years agorepart: Set sector size using SectorSize=
Michael A Cassaniti [Wed, 16 Aug 2023 10:38:55 +0000 (20:38 +1000)] 
repart: Set sector size using SectorSize=

2 years agoUse paths and path_read_text to process mkosi.version file
Daan De Meyer [Wed, 16 Aug 2023 08:18:00 +0000 (10:18 +0200)] 
Use paths and path_read_text to process mkosi.version file

2 years agoReword systemd version requirement a bit
Daan De Meyer [Tue, 15 Aug 2023 08:03:13 +0000 (10:03 +0200)] 
Reword systemd version requirement a bit

We should use wording that still makes sense when reading documentation
from the distro packaged version of mkosi as well. Let's also mention
that the systemd requirement is only for bootable disk images.

2 years agoMake sure we pass through TMPDIR to run()
Daan De Meyer [Mon, 14 Aug 2023 18:57:30 +0000 (20:57 +0200)] 
Make sure we pass through TMPDIR to run()

2 years agoRun with --offline=no when Subvolumes= is used in repart definition files
Daan De Meyer [Mon, 14 Aug 2023 16:46:36 +0000 (18:46 +0200)] 
Run with --offline=no when Subvolumes= is used in repart definition files

2 years agoskip passwd bind mounts if the path does not exist on the host
Malte Poll [Mon, 14 Aug 2023 18:03:14 +0000 (20:03 +0200)] 
skip passwd bind mounts if the path does not exist on the host

2 years agoMerge pull request #1790 from DaanDeMeyer/grub
Daan De Meyer [Mon, 14 Aug 2023 09:30:27 +0000 (11:30 +0200)] 
Merge pull request #1790 from DaanDeMeyer/grub

Various cleanups

2 years agoDocument QemuCdrom= 1790/head
Daan De Meyer [Sun, 13 Aug 2023 22:14:54 +0000 (00:14 +0200)] 
Document QemuCdrom=

2 years agoFix typo
Daan De Meyer [Sun, 13 Aug 2023 22:13:26 +0000 (00:13 +0200)] 
Fix typo

2 years agoMake sure we Clean up cd-rom image after qemu exits
Daan De Meyer [Sun, 13 Aug 2023 20:30:03 +0000 (22:30 +0200)] 
Make sure we Clean up cd-rom image after qemu exits

2 years agoFix gray ansi color definition
Daan De Meyer [Sun, 13 Aug 2023 20:22:23 +0000 (22:22 +0200)] 
Fix gray ansi color definition

We weren't actually getting gray output with the previous definition.
Let's steal the one from systemd to make it work.

2 years agoImport full modules instead of individual members
Daan De Meyer [Sun, 13 Aug 2023 18:30:03 +0000 (20:30 +0200)] 
Import full modules instead of individual members

Let's lean more towards importing full modules except for a few
exceptions like typing and Path from pathlib.

2 years agoRework make_image_output()
Daan De Meyer [Sun, 13 Aug 2023 17:40:01 +0000 (19:40 +0200)] 
Rework make_image_output()

Instead of returning a tuple containing all the bits we're interested
in, let's just return a typed version of the repart json output and
calculate what we need based on that in install_unified_kernel(). We
also move the split paths logic into make_image().

2 years agoIntroduce build_initrd() and build_kernel_modules_initrd()
Daan De Meyer [Sun, 13 Aug 2023 14:40:48 +0000 (16:40 +0200)] 
Introduce build_initrd() and build_kernel_modules_initrd()

2 years agoRemove git blame section from README
Dridi Boukelmoune [Sun, 13 Aug 2023 20:52:42 +0000 (20:52 +0000)] 
Remove git blame section from README

The paragraph introduced in #585 became stale after #1777 was merged.

2 years agoupdate man page link
Leif Liddy [Sun, 13 Aug 2023 17:10:15 +0000 (19:10 +0200)] 
update man page link

2 years agoLog systemd-repart json output at debug level
Daan De Meyer [Sun, 13 Aug 2023 13:54:37 +0000 (15:54 +0200)] 
Log systemd-repart json output at debug level

2 years agoUse copy.deepcopy() to copy os.environ
Daan De Meyer [Sat, 12 Aug 2023 20:57:41 +0000 (22:57 +0200)] 
Use copy.deepcopy() to copy os.environ

Otherwise any changes we make to os.environ propagate into our
shallow copy.

2 years agoAdd QemuCdrom= option
Daan De Meyer [Sat, 12 Aug 2023 12:41:52 +0000 (14:41 +0200)] 
Add QemuCdrom= option

This attaches the image as a CD-ROM instead of a hard drive to the
virtual machine.

2 years agoset Dir::Etc option on apt based distros
Malte Poll [Sat, 12 Aug 2023 11:34:08 +0000 (13:34 +0200)] 
set Dir::Etc option on apt based distros

2 years agoPass through stdin when we call systemd-repart with --image=
Daan De Meyer [Fri, 11 Aug 2023 10:11:22 +0000 (12:11 +0200)] 
Pass through stdin when we call systemd-repart with --image=

When mounting an image, systemd's dissect logic might prompt for
verity/encryption passphrases. Let's make sure the user can enter
those if needed.

2 years agoMake sure we use python-pefile from the tools tree
Daan De Meyer [Thu, 10 Aug 2023 16:44:18 +0000 (18:44 +0200)] 
Make sure we use python-pefile from the tools tree

2 years agoMake sure we load pefile early
Daan De Meyer [Thu, 10 Aug 2023 14:59:03 +0000 (16:59 +0200)] 
Make sure we load pefile early

Otherwise we'll run into trouble later if we're using a tools tree.

2 years agoRelease 15.1 v15.1
Luca Boccassi [Thu, 10 Aug 2023 12:08:05 +0000 (13:08 +0100)] 
Release 15.1

2 years agoUpdate NEWS
Daan De Meyer [Thu, 10 Aug 2023 11:57:09 +0000 (13:57 +0200)] 
Update NEWS

2 years agoMerge pull request #1781 from keszybz/man-page-prep
Daan De Meyer [Thu, 10 Aug 2023 11:52:59 +0000 (13:52 +0200)] 
Merge pull request #1781 from keszybz/man-page-prep

Add script to prepare man pages, retitle release commits

2 years agoRetitle release commits to "Release vNN" 1781/head
Zbigniew Jędrzejewski-Szmek [Thu, 10 Aug 2023 11:30:16 +0000 (13:30 +0200)] 
Retitle release commits to "Release vNN"

I think this is just nicer and stands out more in the git log.

2 years agoAdd helper to build the man page
Zbigniew Jędrzejewski-Szmek [Thu, 10 Aug 2023 11:29:44 +0000 (13:29 +0200)] 
Add helper to build the man page

2 years agoDon't use capsh to figure out capabilities
Daan De Meyer [Thu, 10 Aug 2023 11:19:44 +0000 (13:19 +0200)] 
Don't use capsh to figure out capabilities

2 years agoMerge pull request #1779 from DaanDeMeyer/tmpfs
Daan De Meyer [Thu, 10 Aug 2023 11:11:21 +0000 (13:11 +0200)] 
Merge pull request #1779 from DaanDeMeyer/tmpfs

Make sure the private tmpfs in bwrap() doesn't hide workspace

2 years agoOnly unshare network namespace if we have CAP_NET_ADMIN 1779/head
Daan De Meyer [Thu, 10 Aug 2023 10:47:13 +0000 (12:47 +0200)] 
Only unshare network namespace if we have CAP_NET_ADMIN

2 years agoMake sure the private tmpfs in bwrap() doesn't hide workspace
Daan De Meyer [Thu, 10 Aug 2023 10:31:22 +0000 (12:31 +0200)] 
Make sure the private tmpfs in bwrap() doesn't hide workspace

The workspace might be in /tmp so we need to make sure we mount it
first before we mount the workspace so that the workspace is on top
of the private tmpfs.

2 years agoMerge pull request #1778 from DaanDeMeyer/all-packages
Jörg Behrmann [Thu, 10 Aug 2023 10:22:20 +0000 (12:22 +0200)] 
Merge pull request #1778 from DaanDeMeyer/all-packages

List all subpackages in pyproject.toml

2 years agoRemove unused package-data globs 1778/head
Daan De Meyer [Thu, 10 Aug 2023 10:09:16 +0000 (12:09 +0200)] 
Remove unused package-data globs

2 years agoAlso add mkosi.1 to package-data
Daan De Meyer [Thu, 10 Aug 2023 10:05:40 +0000 (12:05 +0200)] 
Also add mkosi.1 to package-data

2 years agoAdd mkosi.md to package-data
Daan De Meyer [Thu, 10 Aug 2023 09:57:03 +0000 (11:57 +0200)] 
Add mkosi.md to package-data

2 years agoDon't try to tun timedatectl or ssh-add if not available
Daan De Meyer [Thu, 10 Aug 2023 09:54:25 +0000 (11:54 +0200)] 
Don't try to tun timedatectl or ssh-add if not available

2 years agoList all subpackages in pyproject.toml
Daan De Meyer [Thu, 10 Aug 2023 09:40:52 +0000 (11:40 +0200)] 
List all subpackages in pyproject.toml

2 years agoBump version numbers for v15 v15
Luca Boccassi [Thu, 10 Aug 2023 08:46:24 +0000 (09:46 +0100)] 
Bump version numbers for v15

2 years agoRemove .git-blame-ignore-revs file
Daan De Meyer [Thu, 10 Aug 2023 08:24:52 +0000 (10:24 +0200)] 
Remove .git-blame-ignore-revs file

This has outlived its usefulness, there's no need to ignore the black
commit anymore when doing a git blame due to its age.

2 years agoUpdate do-a-release.sh script
Daan De Meyer [Thu, 10 Aug 2023 08:17:00 +0000 (10:17 +0200)] 
Update do-a-release.sh script

2 years agoReorder fields of MkosiConfig to match summary() and MkosiConfigSettings
Daan De Meyer [Thu, 10 Aug 2023 07:51:22 +0000 (09:51 +0200)] 
Reorder fields of MkosiConfig to match summary() and MkosiConfigSettings

2 years agoMerge pull request #1679 from behrmann/helpverb
Daan De Meyer [Wed, 9 Aug 2023 16:13:28 +0000 (18:13 +0200)] 
Merge pull request #1679 from behrmann/helpverb

Make docs available via the help verb.

2 years agoadd --doc-format option for choosing the output of the documentation verb 1679/head
Joerg Behrmann [Wed, 9 Aug 2023 13:48:47 +0000 (15:48 +0200)] 
add --doc-format option for choosing the output of the documentation verb

2 years agoadd NEWS entry for documentation verb.
Joerg Behrmann [Tue, 8 Aug 2023 11:16:31 +0000 (13:16 +0200)] 
add NEWS entry for documentation verb.

2 years agoadd symlink to docs in resources
Joerg Behrmann [Mon, 17 Jul 2023 13:36:18 +0000 (15:36 +0200)] 
add symlink to docs in resources

2 years agoaction: Don't install pandoc
Joerg Behrmann [Mon, 17 Jul 2023 13:50:58 +0000 (15:50 +0200)] 
action: Don't install pandoc

2 years agomake mkosi docs from resources available via the documentation verb
Joerg Behrmann [Mon, 17 Jul 2023 13:34:53 +0000 (15:34 +0200)] 
make mkosi docs from resources available via the documentation verb

This allows, especially when running different versions of mkosi, to always
have the right documentation on hand no matter how that version of mkosi was
installed.

2 years agomove mkosi.md to mkosi/resources
Joerg Behrmann [Mon, 17 Jul 2023 13:34:12 +0000 (15:34 +0200)] 
move mkosi.md to mkosi/resources

2 years agoReplace dd with pefile's get_data() method
Daan De Meyer [Wed, 9 Aug 2023 12:24:07 +0000 (14:24 +0200)] 
Replace dd with pefile's get_data() method

2 years agoci: Add job to check that we can still generate the man page
Daan De Meyer [Wed, 9 Aug 2023 14:50:01 +0000 (16:50 +0200)] 
ci: Add job to check that we can still generate the man page

2 years agoIntroduce preset dependencies
Daan De Meyer [Tue, 8 Aug 2023 13:57:14 +0000 (15:57 +0200)] 
Introduce preset dependencies

Instead of building presets in alphanumerical order, let's introduce
a proper concept of dependencies. Dependencies are configured with
the new "Dependencies=" option in the new "[Preset]" section. All
presets configured with "Dependencies=" are built before the current
preset.

We drop the alphanumerical preset in favor of explicit dependencies.

2 years agoSet agetty autologin credentials by default
Daan De Meyer [Wed, 9 Aug 2023 09:49:49 +0000 (11:49 +0200)] 
Set agetty autologin credentials by default

Eventually we'll replace --autologin with these but for now let's
set both.

2 years agoMake sure we output signed kernel instead of unsigned kernel
Daan De Meyer [Wed, 9 Aug 2023 07:44:01 +0000 (09:44 +0200)] 
Make sure we output signed kernel instead of unsigned kernel

Fixes #1589

2 years agoPrefer gcpio over cpio
Daan De Meyer [Wed, 9 Aug 2023 08:01:46 +0000 (10:01 +0200)] 
Prefer gcpio over cpio

Fixes #1201

2 years agoSet GPGTTY when calling gpg
Daan De Meyer [Wed, 9 Aug 2023 07:53:07 +0000 (09:53 +0200)] 
Set GPGTTY when calling gpg

Fixes #351

2 years agoDon't reverse list option values found in the same option
Daan De Meyer [Wed, 9 Aug 2023 06:48:29 +0000 (08:48 +0200)] 
Don't reverse list option values found in the same option

Items from earlier settings should take precedence over items from
later settings, but that doesn't mean we should reverse items found
in the same setting.

Fixes #1707

2 years agoTouch /usr/lib/clock-epoch during the build
Daan De Meyer [Wed, 9 Aug 2023 06:43:35 +0000 (08:43 +0200)] 
Touch /usr/lib/clock-epoch during the build

We'll handle the reproducible builds part of this together with all
the other changes for reproducible builds.

Fixes #1218

2 years agoRun finalize script after selinux relabel
Daan De Meyer [Tue, 8 Aug 2023 12:53:05 +0000 (14:53 +0200)] 
Run finalize script after selinux relabel

Let's make the finalize script true to its name and run it as the
final operation before we start packaging things up.

2 years agoMerge pull request #1763 from DaanDeMeyer/udev
Daan De Meyer [Tue, 8 Aug 2023 12:33:12 +0000 (14:33 +0200)] 
Merge pull request #1763 from DaanDeMeyer/udev

Install udev instead of systemd-udev

2 years agoMake sure we install udev in the initrd 1763/head
Daan De Meyer [Tue, 8 Aug 2023 12:17:24 +0000 (14:17 +0200)] 
Make sure we install udev in the initrd

Follow up for 7bb87d7d011162f503b842b02bbe9e157cb6f116

2 years agoInstall extra packages for centos/alma/rocky to fix CI failure
Daan De Meyer [Tue, 8 Aug 2023 11:38:39 +0000 (13:38 +0200)] 
Install extra packages for centos/alma/rocky to fix CI failure

This increases the size of the generated image a bit which makes
sure repart calculates a minimal partition size for the XFS
filesystem so that populating the partition doesn't run out of space.

2 years agoInstall udev instead of systemd-udev
Daan De Meyer [Tue, 8 Aug 2023 10:18:14 +0000 (12:18 +0200)] 
Install udev instead of systemd-udev

Installing systemd-udev means running into
https://bugzilla.redhat.com/show_bug.cgi?id=2183279 so let's install
udev which avoids that issue.

2 years agoMark gentoo as experimental and unsupported
Daan De Meyer [Tue, 8 Aug 2023 11:17:45 +0000 (13:17 +0200)] 
Mark gentoo as experimental and unsupported

Gentoo issues won't be actively looked at by the core maintainers and
there's no guarantee that gentoo PRs will get reviewed or not (or they
might just be merged without review). Gentoo specific hacks outside of
gentoo.py will generally not be accepted.

- We also drop all gentoo specific modifications outside of gentoo.py
- We also stop running CI for gentoo

Conditions for dropping the experimental status of gentoo:

- No more stage 3 tarball required to build a gentoo image. Either we only
do binary packages or gentoo images can be built from directly from an immutable
host system or tools tree with portage and compiler tools installed
- Proper division of systemd components into subpackages so that we can build
a gentoo initrd with systemd installed but without pulling in ukify and python
- An official and up-to-date binary package repository that allows gentoo CI
to complete in a similar amount of time as the other distributions

2 years agoMerge pull request #1754 from DaanDeMeyer/preset-docs
Jörg Behrmann [Tue, 8 Aug 2023 11:32:57 +0000 (13:32 +0200)] 
Merge pull request #1754 from DaanDeMeyer/preset-docs

Document presets

2 years agoRemove setup.py and use setuptools build backend in pyproject.toml
Joerg Behrmann [Fri, 30 Jun 2023 12:30:36 +0000 (14:30 +0200)] 
Remove setup.py and use setuptools build backend in pyproject.toml

Also remove setup.cfg, since we don't use flake8 and everything else can be
handled by pyproject.toml

2 years agoFix BuildSources= and BuildDirectory= docs 1754/head
Daan De Meyer [Tue, 8 Aug 2023 09:13:45 +0000 (11:13 +0200)] 
Fix BuildSources= and BuildDirectory= docs

2 years agoDocument presets
Daan De Meyer [Tue, 8 Aug 2023 09:06:00 +0000 (11:06 +0200)] 
Document presets

Also skip files in mkosi.presets that do not have the .conf suffix.

2 years agogentoo: swith to llvm (clang)
Paymon MARANDI [Wed, 19 Jul 2023 16:20:21 +0000 (12:20 -0400)] 
gentoo: swith to llvm (clang)

This will pave the way for actual arch support and cross-compiling

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2 years agoMerge pull request #1753 from DaanDeMeyer/resolv
Daan De Meyer [Mon, 7 Aug 2023 20:43:30 +0000 (22:43 +0200)] 
Merge pull request #1753 from DaanDeMeyer/resolv

Make sure options are always applied last in bwrap() and chroot_cmd()

2 years agoAdd ip=enp0s2:any to default kernel cmdline extra 1753/head
Daan De Meyer [Mon, 7 Aug 2023 19:25:17 +0000 (21:25 +0200)] 
Add ip=enp0s2:any to default kernel cmdline extra

When booting with --qemu-gui, the network interface is named
differently so let's account for that and configure networkd to
manage that interface as well.

2 years agoMake sure options are always applied last in bwrap() and chroot_cmd()
Daan De Meyer [Mon, 7 Aug 2023 18:03:44 +0000 (20:03 +0200)] 
Make sure options are always applied last in bwrap() and chroot_cmd()

That way, if the options remount anything read-only, we can be sure
it doesn't affect any of the operations set up in bwrap() and chroot_cmd()
themselves.

2 years agoMove network argument from chroot_cmd() to bwrap()
Daan De Meyer [Mon, 7 Aug 2023 15:02:43 +0000 (17:02 +0200)] 
Move network argument from chroot_cmd() to bwrap()

If we're not supposed to use the network, that should apply to the
script running on the host as well, so move the network argument
from chroot_cmd() to bwrap().

We just always mount resolv.conf into the image now. If the network
namespace is unshared, there's not much that can be done with the
info in there anyway.

2 years agoMerge finalize_source_mounts() and finalize_writable_mounts()
Daan De Meyer [Mon, 7 Aug 2023 11:48:59 +0000 (13:48 +0200)] 
Merge finalize_source_mounts() and finalize_writable_mounts()

We need to sort both lists so let's merge the two functions to make
that easier. Let's also make sure we remove any duplicates while we're
at it.

2 years agoMerge pull request #1750 from DaanDeMeyer/kvm-log
Daan De Meyer [Mon, 7 Aug 2023 11:24:24 +0000 (13:24 +0200)] 
Merge pull request #1750 from DaanDeMeyer/kvm-log

Add logging to qemu_check_kvm_support()

2 years agoRemove outdated comment 1750/head
Daan De Meyer [Mon, 7 Aug 2023 11:14:00 +0000 (13:14 +0200)] 
Remove outdated comment

2 years agoDon't drop privileges when running qemu and invoked as root
Daan De Meyer [Mon, 7 Aug 2023 10:53:32 +0000 (12:53 +0200)] 
Don't drop privileges when running qemu and invoked as root

Depending on the environment and what options are used, running qemu
might require root privileges. So if we're invoked as root and we're
going to run qemu, let's not drop privileges.

2 years agoAdd logging to qemu_check_kvm_support()
Daan De Meyer [Mon, 7 Aug 2023 10:13:37 +0000 (12:13 +0200)] 
Add logging to qemu_check_kvm_support()

2 years agoqemu: do not enable kvm when booting on non-native arch
Luca Boccassi [Mon, 7 Aug 2023 01:29:52 +0000 (02:29 +0100)] 
qemu: do not enable kvm when booting on non-native arch

kvm is only supported on the native architecture, so skip it
when booting a non-native one (eg: aarch64 on x86_64)

2 years agoMerge pull request #1747 from DaanDeMeyer/check-inputs
Daan De Meyer [Mon, 7 Aug 2023 08:45:31 +0000 (10:45 +0200)] 
Merge pull request #1747 from DaanDeMeyer/check-inputs

Rework check_inputs()

2 years agoDefault workspace directory to the current working directory 1747/head
Daan De Meyer [Sun, 6 Aug 2023 22:08:42 +0000 (00:08 +0200)] 
Default workspace directory to the current working directory

This was already the implicit assumption, let's make it explicit.

2 years agoMake sure we create an empty output file when using no output
Daan De Meyer [Sun, 6 Aug 2023 20:34:37 +0000 (22:34 +0200)] 
Make sure we create an empty output file when using no output

2 years agoAllocate workspace outside of MkosiState
Daan De Meyer [Sun, 6 Aug 2023 18:57:04 +0000 (20:57 +0200)] 
Allocate workspace outside of MkosiState

This way MkosiState doesn't need to be a context manager and we can
just use the workspace as a context manager directly.

2 years agoDon't resolve paths in two cases
Daan De Meyer [Sun, 6 Aug 2023 18:39:01 +0000 (20:39 +0200)] 
Don't resolve paths in two cases

- Target paths should not be resolved
- When checking paths for the paths logic, let's not resolve either
  and leave that to the parser implementation itself