]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
17 months agokmod: Don't assume all modules are in kernel/ subdirectory 2532/head
Daan De Meyer [Tue, 19 Mar 2024 09:31:31 +0000 (10:31 +0100)] 
kmod: Don't assume all modules are in kernel/ subdirectory

When dkms is used or depending on the distribution, there might be modules
in other directories than kernel/.

17 months agokmod: Simplify resolve_module_dependencies() slightly
Daan De Meyer [Tue, 19 Mar 2024 09:30:20 +0000 (10:30 +0100)] 
kmod: Simplify resolve_module_dependencies() slightly

17 months agoci: Use pcid=off with qemu instead of disabling secure boot
Daan De Meyer [Mon, 18 Mar 2024 10:24:37 +0000 (11:24 +0100)] 
ci: Use pcid=off with qemu instead of disabling secure boot

This allows us to boot with secure boot again until the Hyper-V bug
is fixed that causes KVM to crash.

We also switch back to using 2Gs of ram by default as a second Hyper-V
bug prevents us from using any more on Github Actions.

17 months agoSimplify gen_required_kernel_modules()
Daan De Meyer [Mon, 18 Mar 2024 10:58:29 +0000 (11:58 +0100)] 
Simplify gen_required_kernel_modules()

- Make sure we yield paths in sorted order
- Use yield from more
- Replace parents_relative_to() with a simpler solution

17 months agoMerge pull request #2523 from DaanDeMeyer/kmod
Daan De Meyer [Mon, 18 Mar 2024 09:56:05 +0000 (10:56 +0100)] 
Merge pull request #2523 from DaanDeMeyer/kmod

Only add directories with modules in them to the kmods initrd

17 months agomkosi-initrd: Tighten up kernel module regexes 2523/head
Daan De Meyer [Mon, 18 Mar 2024 09:02:49 +0000 (10:02 +0100)] 
mkosi-initrd: Tighten up kernel module regexes

The previous ones matched more than than the modules we wanted, so
let's make sure we only match the ones we want.

17 months agoRemove unneeded directories as well in process_kernel_modules()
Daan De Meyer [Mon, 18 Mar 2024 09:01:28 +0000 (10:01 +0100)] 
Remove unneeded directories as well in process_kernel_modules()

17 months agoOnly add directories with modules in them to the kmods initrd
Daan De Meyer [Mon, 18 Mar 2024 08:39:03 +0000 (09:39 +0100)] 
Only add directories with modules in them to the kmods initrd

17 months agoDefault to UTC timezone if we can't figure out the local one
Daan De Meyer [Sun, 17 Mar 2024 16:14:10 +0000 (17:14 +0100)] 
Default to UTC timezone if we can't figure out the local one

17 months agoMerge pull request #2521 from septatrix/fix/include-firmware
Daan De Meyer [Mon, 18 Mar 2024 07:13:34 +0000 (08:13 +0100)] 
Merge pull request #2521 from septatrix/fix/include-firmware

Fix erroneous negation leading to omitted firmware files

17 months agoFix inclusion of firmware files 2521/head
Septatrix [Mon, 18 Mar 2024 00:08:45 +0000 (01:08 +0100)] 
Fix inclusion of firmware files

17 months agoAdd .venv to gitignore
Septatrix [Sun, 17 Mar 2024 18:30:27 +0000 (19:30 +0100)] 
Add .venv to gitignore

17 months agoMerge pull request #2518 from DaanDeMeyer/hypervisor
Daan De Meyer [Sun, 17 Mar 2024 15:55:40 +0000 (16:55 +0100)] 
Merge pull request #2518 from DaanDeMeyer/hypervisor

Introduce VirtualMachineMonitor= and various cleanups

17 months agoSwitch to debian unstable temporarily in default image and tests 2518/head
Daan De Meyer [Sun, 17 Mar 2024 13:44:03 +0000 (14:44 +0100)] 
Switch to debian unstable temporarily in default image and tests

pacman got removed from Debian Testing, so let's use unstable until
it's added back.

17 months agoHard code cache directory in test framework
Daan De Meyer [Sun, 17 Mar 2024 14:58:34 +0000 (15:58 +0100)] 
Hard code cache directory in test framework

17 months agoAdd ToolsTreeDistribution= match
Daan De Meyer [Sun, 17 Mar 2024 14:13:10 +0000 (15:13 +0100)] 
Add ToolsTreeDistribution= match

17 months agomkosi-initrd: Merge libtss configs again
Daan De Meyer [Sun, 17 Mar 2024 13:40:39 +0000 (14:40 +0100)] 
mkosi-initrd: Merge libtss configs again

Removing the Suggests on the old name from systemd in Debian Testing
seems to have fixed the apt error we were getting before.

17 months agoCheck whether ukify is available in want_uki()
Daan De Meyer [Sun, 17 Mar 2024 13:26:36 +0000 (14:26 +0100)] 
Check whether ukify is available in want_uki()

17 months agoFix missing tss libraries on OpenSUSE
Daan De Meyer [Sun, 17 Mar 2024 09:51:20 +0000 (10:51 +0100)] 
Fix missing tss libraries on OpenSUSE

17 months agoqemu: Set vmm.notify_socket credential even if SMBIOS is not supported
Daan De Meyer [Sun, 17 Mar 2024 08:47:54 +0000 (09:47 +0100)] 
qemu: Set vmm.notify_socket credential even if SMBIOS is not supported

Let's apply the same credential passing logic to vmm.notify_socket that
we apply to all other credentials. Use SMBIOS if available and fall back
to fw_cfg and kernel command line otherwise.

17 months agoqemu: Use -no-user-config option
Daan De Meyer [Sat, 16 Mar 2024 20:54:22 +0000 (21:54 +0100)] 
qemu: Use -no-user-config option

We want full control over the qemu command line, so let's make sure
qemu doesn't look up any user config files.

17 months agoqemu: Introduce generate_scratch_fs()
Daan De Meyer [Sat, 16 Mar 2024 19:55:42 +0000 (20:55 +0100)] 
qemu: Introduce generate_scratch_fs()

17 months agoqemu: Introduce finalize_drive()
Daan De Meyer [Sat, 16 Mar 2024 19:55:28 +0000 (20:55 +0100)] 
qemu: Introduce finalize_drive()

17 months agovmspawn: Drop unnecessary exists check
Daan De Meyer [Sat, 16 Mar 2024 19:39:04 +0000 (20:39 +0100)] 
vmspawn: Drop unnecessary exists check

config.qemu_kernel is verified to exist at config parsing time
already;

17 months agovmspawn: Inline variable
Daan De Meyer [Sat, 16 Mar 2024 19:35:57 +0000 (20:35 +0100)] 
vmspawn: Inline variable

17 months agoMove condition check into copy_ephemeral()
Daan De Meyer [Sat, 16 Mar 2024 19:35:10 +0000 (20:35 +0100)] 
Move condition check into copy_ephemeral()

17 months agoIntroduce apply_runtime_size()
Daan De Meyer [Sat, 16 Mar 2024 19:32:00 +0000 (20:32 +0100)] 
Introduce apply_runtime_size()

17 months agoStore cpus and memory as integers
Daan De Meyer [Sat, 16 Mar 2024 19:31:38 +0000 (20:31 +0100)] 
Store cpus and memory as integers

17 months agoRemove vmspawn verb in favor of VirtualMachineMonitor= setting
Daan De Meyer [Sat, 16 Mar 2024 19:04:36 +0000 (20:04 +0100)] 
Remove vmspawn verb in favor of VirtualMachineMonitor= setting

Instead of adding a new verb for each new virtual machine monitor  we
want to support, let's configure the vmm to use with a new setting. As
vmspawn is still experimental we don't need to keep backwards compat
intact in this case.

17 months agoAdd link to new blog about mkosi
Daan De Meyer [Fri, 15 Mar 2024 21:25:06 +0000 (22:25 +0100)] 
Add link to new blog about mkosi

17 months agoMerge pull request #2516 from DaanDeMeyer/virtiofsd
Daan De Meyer [Fri, 15 Mar 2024 18:27:14 +0000 (19:27 +0100)] 
Merge pull request #2516 from DaanDeMeyer/virtiofsd

Virtiofsd fixes

17 months agoMerge pull request #2513 from DaanDeMeyer/mounts
Jörg Behrmann [Fri, 15 Mar 2024 18:14:23 +0000 (19:14 +0100)] 
Merge pull request #2513 from DaanDeMeyer/mounts

Always mount context.root to /buildroot

17 months agoFix kernel module glob
Daan De Meyer [Fri, 15 Mar 2024 16:13:45 +0000 (17:13 +0100)] 
Fix kernel module glob

When dkms modules are installed there will be .ko modules in directories
other than "kernel" so make sure we only look for modules in the "kernel"
directory.

17 months agoAlways mount context.root to /buildroot 2513/head
Daan De Meyer [Fri, 15 Mar 2024 12:09:39 +0000 (13:09 +0100)] 
Always mount context.root to /buildroot

Let's leak fewer host specific details into the sandbox by always
mounting the image root directory to /buildroot in the sandbox. This
also simplifies debugging as the image rootfs will always be at /rootfs
instead of in some host specific path.

17 months agoAdd more logging when we don't reuse cached images 2516/head
Daan De Meyer [Fri, 15 Mar 2024 14:05:58 +0000 (15:05 +0100)] 
Add more logging when we don't reuse cached images

17 months agoForce virtiofsd to use inode-handles when running as root
Daan De Meyer [Fri, 15 Mar 2024 16:11:12 +0000 (17:11 +0100)] 
Force virtiofsd to use inode-handles when running as root

When running as root virtiofsd should have all it needs to use
file handles which reduces the chance of running out of file descriptors,
so make sure it uses them when running as root.

17 months agoEnable --cache=always for virtiofsd
Daan De Meyer [Fri, 15 Mar 2024 13:41:12 +0000 (14:41 +0100)] 
Enable --cache=always for virtiofsd

According to the documentation, this can be enabled when virtiofsd
has exclusive access to the directory, which is the case for us so
let's enable this.

17 months agoapt: Drop duplicate option
Daan De Meyer [Fri, 15 Mar 2024 12:24:00 +0000 (13:24 +0100)] 
apt: Drop duplicate option

This was leftover from earlier times. Let's make sure the first
Dir::Log option we set actually takes effect.

17 months agoMerge pull request #2511 from DaanDeMeyer/mounts
Daan De Meyer [Fri, 15 Mar 2024 11:57:33 +0000 (12:57 +0100)] 
Merge pull request #2511 from DaanDeMeyer/mounts

Filter and sort all mounts in sandbox_cmd()

17 months agoFilter and sort all mounts in sandbox_cmd() 2511/head
Daan De Meyer [Fri, 15 Mar 2024 10:57:14 +0000 (11:57 +0100)] 
Filter and sort all mounts in sandbox_cmd()

We don't want users of sandbox_cmd() to have to care about mount
ordering. Currently, if mounts with a more general destination are
ordered after mounts with a more specific destination, the earlier
mount is hidden by the later mount. By sorting by destination, we
avoid this issue.

17 months agoIntroduce Mount named tuple to pass mounts to sandbox_cmd()
Daan De Meyer [Fri, 15 Mar 2024 08:59:04 +0000 (09:59 +0100)] 
Introduce Mount named tuple to pass mounts to sandbox_cmd()

No change in behavior, but this will allow us to post-process mounts
in sandbox_cmd() in later commits.

17 months agoCheck sync scripts are executable in run_sync()
Daan De Meyer [Fri, 15 Mar 2024 10:01:01 +0000 (11:01 +0100)] 
Check sync scripts are executable in run_sync()

check_inputs() is only invoked after sync scripts have already run,
so do the check in run_sync() instead.

17 months agoMerge pull request #2510 from DaanDeMeyer/microcode
Jörg Behrmann [Fri, 15 Mar 2024 09:03:48 +0000 (10:03 +0100)] 
Merge pull request #2510 from DaanDeMeyer/microcode

Microcode improvements

17 months agoBuild microcode initrd for ESP and UKI images in save_uki_components() 2510/head
Daan De Meyer [Fri, 15 Mar 2024 07:41:55 +0000 (08:41 +0100)] 
Build microcode initrd for ESP and UKI images in save_uki_components()

Otherwise the necessary files might have already been removed from
the rootfs.

17 months agoDon't remove microcode files in process_kernel_modules()
Daan De Meyer [Fri, 15 Mar 2024 07:39:21 +0000 (08:39 +0100)] 
Don't remove microcode files in process_kernel_modules()

These are somewhat special so let's not remove them in
process_kernel_modules().

17 months agokmod: Simplify
Daan De Meyer [Fri, 15 Mar 2024 07:40:58 +0000 (08:40 +0100)] 
kmod: Simplify

Both m and fw are already absolute paths to within the root.

17 months agoMerge pull request #2508 from CodethinkLabs/richardmaw/shared-build-machine-fixes
Jörg Behrmann [Thu, 14 Mar 2024 17:07:55 +0000 (18:07 +0100)] 
Merge pull request #2508 from CodethinkLabs/richardmaw/shared-build-machine-fixes

Misc fixes for running mkosi as root on a shared build machines

17 months agoRestore all of a user's groups when running sync 2508/head
Richard Maw [Wed, 13 Mar 2024 17:30:34 +0000 (17:30 +0000)] 
Restore all of a user's groups when running sync

Shared development hardware often has storage partitioned up by project
groups, with the root of the shared storage owned by root:project.

Since this group isn't the primary group of the user
using setgroups and restoring groups to just the user's primary gid
will mean that it does not have this project group gid
and so won't be able to see the contents of this shared directory.

Using getgrouplist to get all of the groups from the user database
allows these additional groups to be set.

17 months agoReorder ExtraSearchPaths mounts before options
Richard Maw [Wed, 13 Mar 2024 17:17:39 +0000 (17:17 +0000)] 
Reorder ExtraSearchPaths mounts before options

When not running in a tools tree the extra search paths are
read-only bind-mounted into the sandbox.

Files are initially created in the workspace tree but then moved
into the output directory after they are complete.

If the directories are on different devices the rename syscall
falls back to a copy then delete.

It is not unusual to have a single build output directory
and you might potentially want your mkosi output directory in there.

If you are adding ExtraSearchPaths to use just-built executables
then this probably points to your `build/` directory.

If search paths are bind-mounted in read-only after the copy command's
sandboxing options, then this generates a command-line with options:
`--bind build/mkosi.output build/mkosi.output ... --bind-ro build build`
which means that the output directory is not writable.

Ordering the sandbox's own mount arguments before the command's options
should ensure the read-only search paths mount doesn't inferfere with
the command's writable bind-mounts.

17 months agoMerge pull request #2507 from DaanDeMeyer/flock
Daan De Meyer [Thu, 14 Mar 2024 15:24:55 +0000 (16:24 +0100)] 
Merge pull request #2507 from DaanDeMeyer/flock

Be more careful about concurrent access to outputs

17 months agoIntroduce flock_or_die() and use it in various places 2507/head
Daan De Meyer [Thu, 14 Mar 2024 13:54:45 +0000 (14:54 +0100)] 
Introduce flock_or_die() and use it in various places

Let's avoid weird error cases caused by two instances of mkosi trying
to currently do stuff with the same output by taking a BSD lock when
trying to do something with the output.

17 months agoIntroduce lock_repository_metadata()
Daan De Meyer [Thu, 14 Mar 2024 13:30:25 +0000 (14:30 +0100)] 
Introduce lock_repository_metadata()

17 months agoAdd flags argument to flock()
Daan De Meyer [Thu, 14 Mar 2024 13:21:14 +0000 (14:21 +0100)] 
Add flags argument to flock()

17 months agoRelease 22 v22
Luca Boccassi [Thu, 14 Mar 2024 11:19:28 +0000 (11:19 +0000)] 
Release 22

17 months agoUpdate NEWS
Daan De Meyer [Thu, 14 Mar 2024 09:08:08 +0000 (10:08 +0100)] 
Update NEWS

17 months agoSet $PROFILE to the current profile
Daan De Meyer [Thu, 14 Mar 2024 08:40:58 +0000 (09:40 +0100)] 
Set $PROFILE to the current profile

17 months agoMerge pull request #2487 from behrmann/cisection
Daan De Meyer [Thu, 14 Mar 2024 08:35:20 +0000 (09:35 +0100)] 
Merge pull request #2487 from behrmann/cisection

ci: print group section lines for GitHub workflow

17 months agoci: print group section lines for GitHub workflow 2487/head
Jörg Behrmann [Tue, 12 Mar 2024 15:16:29 +0000 (16:16 +0100)] 
ci: print group section lines for GitHub workflow

Partially fixes: #2361

17 months agoarch: install dbus-broker and dbus-broker-units explicitly
Jörg Behrmann [Tue, 12 Mar 2024 16:56:27 +0000 (17:56 +0100)] 
arch: install dbus-broker and dbus-broker-units explicitly

dbus and dbus-units have been split in Arch recently. Currently everything
seems to be pulled in CI, let's see whether we can get this down to just
dbus-broker.

17 months agoci: Remove btrfs logic
Daan De Meyer [Thu, 14 Mar 2024 07:16:32 +0000 (08:16 +0100)] 
ci: Remove btrfs logic

Doesn't seem to noticeably speed things up.

17 months agoMerge pull request #2499 from DaanDeMeyer/async-rm
Daan De Meyer [Thu, 14 Mar 2024 07:11:15 +0000 (08:11 +0100)] 
Merge pull request #2499 from DaanDeMeyer/async-rm

ci: Free up disk space asynchronously

17 months agoci: Btrfs mount option tuning 2499/head
Daan De Meyer [Wed, 13 Mar 2024 22:51:11 +0000 (23:51 +0100)] 
ci: Btrfs mount option tuning

Let's choose the lowest compression level so as to not impact CPU
usage too much. Use noatime as it's generally a straight speed boost
and make sure some new btrfs features are enabled (should already
be enabled but never hurts to be sure).

17 months agoci: Free up disk space asynchronously
Daan De Meyer [Wed, 13 Mar 2024 22:10:51 +0000 (23:10 +0100)] 
ci: Free up disk space asynchronously

Free-ing up disk space can take up to 8 minutes so let's make sure
we do it asynchronously since we don't need the free space immediately.

17 months agoMerge pull request #2497 from DaanDeMeyer/btrfs
Daan De Meyer [Wed, 13 Mar 2024 22:46:19 +0000 (23:46 +0100)] 
Merge pull request #2497 from DaanDeMeyer/btrfs

Use btrfs in CI

17 months agoci: Do all work on a btrfs filesystem 2497/head
Daan De Meyer [Wed, 13 Mar 2024 16:20:19 +0000 (17:20 +0100)] 
ci: Do all work on a btrfs filesystem

Let's make sure we take advantage of our COW and subvolume support
in CI by doing all work in a btrfs filesystem. Additionally enable
compression and user subvolume deletes on the btrfs filesystem to
speed things up even more.

17 months agoAlways create directories as invoking user if not invoked as root
Daan De Meyer [Wed, 13 Mar 2024 21:05:24 +0000 (22:05 +0100)] 
Always create directories as invoking user if not invoked as root

We don't want to leak the subuids into the system, so make sure any
directories created by INVOKING_USER.mkdir() are always created as
the invoking user if we're not invoked as root.

17 months agoFix double whitespace
Daan De Meyer [Wed, 13 Mar 2024 16:19:55 +0000 (17:19 +0100)] 
Fix double whitespace

17 months agoOptimize rmtree() for btrfs subvolumes
Daan De Meyer [Wed, 13 Mar 2024 16:18:50 +0000 (17:18 +0100)] 
Optimize rmtree() for btrfs subvolumes

Try "btrfs subvolume delete" on subvolumes and fall back to a regular
delete since it will fail for unprivileged users without the
user_subvol_rm_allowed mount option.

17 months agoOptimize is_subvolume()
Daan De Meyer [Wed, 13 Mar 2024 16:18:16 +0000 (17:18 +0100)] 
Optimize is_subvolume()

Try the condition that doesn't need a subprocess to run first.

17 months agoUse KVM when running an x86 image on x86_64
Daan De Meyer [Wed, 13 Mar 2024 14:34:36 +0000 (15:34 +0100)] 
Use KVM when running an x86 image on x86_64

17 months agoci: Enable KVM
Daan De Meyer [Wed, 13 Mar 2024 13:16:17 +0000 (14:16 +0100)] 
ci: Enable KVM

Since https://github.blog/2024-01-17-github-hosted-runners-double-the-power-for-open-source/,
it seems that KVM has started working, so let's make sure we take
advantage of it to speed up CI.

17 months agoMerge pull request #2492 from DaanDeMeyer/timeout
Daan De Meyer [Wed, 13 Mar 2024 13:04:23 +0000 (14:04 +0100)] 
Merge pull request #2492 from DaanDeMeyer/timeout

Extend timeout of systemd-machine-id-commit.service to 90s

17 months agoRun sync scripts in strict sandbox again
Daan De Meyer [Wed, 13 Mar 2024 08:43:08 +0000 (09:43 +0100)] 
Run sync scripts in strict sandbox again

We can't use a relaxed sandbox as we need to be able to mount the
directories containing certificates and keys from the tools tree
(finalize_crypto_mounts()) which will fail with permission errors
in a relaxed sandbox if the required mountpoints do not already
exist in the host filesystem.

So let's switch back to a strict sandbox, except that we now always
run as root in the strict sandbox so the overlay mount for /usr from
the package manager tree won't fail anymore.

Partial revert of 9dd49ad22944bdb90a748d5b35d138ed1ce0ae2a

17 months agoExtend timeout of systemd-machine-id-commit.service to 90s 2492/head
Daan De Meyer [Wed, 13 Mar 2024 12:07:42 +0000 (13:07 +0100)] 
Extend timeout of systemd-machine-id-commit.service to 90s

Should hopefully reduce the number of CI failures.
See https://github.com/systemd/systemd/pull/31750

17 months agoRemove mkosi.extra from .gitignore
Daan De Meyer [Wed, 13 Mar 2024 12:06:56 +0000 (13:06 +0100)] 
Remove mkosi.extra from .gitignore

It's way to complicated to include files in an excluded directory so
let's simply not exclude it.

17 months agoFix typing error
Daan De Meyer [Wed, 13 Mar 2024 10:45:16 +0000 (11:45 +0100)] 
Fix typing error

We drop the special logic for TERM since we do **env later which
will make sure any value for TERM from env overrides the default
value we pick.

17 months agoMerge pull request #2478 from DaanDeMeyer/shim
Daan De Meyer [Wed, 13 Mar 2024 10:27:33 +0000 (11:27 +0100)] 
Merge pull request #2478 from DaanDeMeyer/shim

Boot improvements

17 months agoRework QemuFirmware= 2478/head
Daan De Meyer [Mon, 11 Mar 2024 13:57:58 +0000 (14:57 +0100)] 
Rework QemuFirmware=

- Use the qemu official firmware descriptions to look up OVMF
  firmware instead of having our own homegrown logic.
- Add QemuFirmware=uefi-secure-boot to explicitly look for firmware
  with secure boot support
- Add QemuFirmwareVariables=microsoft to use OVMF variables with
  Microsoft keys enrolled
- Add QemuFirmwareVariables=custom to enroll the certificate from
  SecureBootCertificate= into the OVMF variables

This commit also contains the changes from a second commit that
was accidentally rebased into this one:

Only use already signed binaries when ShimBootloader=signed

When we're using signed shim, we need to make sure we use already
signed bootloaders, kernel images and UKIs. Anything we sign ourselves
will cause security violations in shim.

17 months agoDon't log sandbox for every command
Daan De Meyer [Tue, 12 Mar 2024 21:29:56 +0000 (21:29 +0000)] 
Don't log sandbox for every command

This is excessively verbose. Let's instead log only the command
we're executing but still log the full sandbox if a command fails.

17 months agoPass custom environment to other verbs as well
Daan De Meyer [Wed, 13 Mar 2024 10:08:49 +0000 (11:08 +0100)] 
Pass custom environment to other verbs as well

Let's use both the host environment and the custom env variables,
and let the custom env variables override the host ones.

17 months agoCheck for TERM=unknown and set TERM=dumb if not on tty
Daan De Meyer [Tue, 12 Mar 2024 20:05:50 +0000 (20:05 +0000)] 
Check for TERM=unknown and set TERM=dumb if not on tty

in CI, TERM is set to "unknown" so let's check for that and translate
it to "dumb" if we're not on a tty which systemd checks for when it
decides whether to enable logging or not. Also set TERM itself on
the kernel command line which is another thing parsed by systemd to check
whether to log colors or not. Finally, make sure we set "TERM" correctly
in our own environment that is passed to scripts

17 months agoUse sandbox for cp --version
Daan De Meyer [Tue, 12 Mar 2024 19:41:47 +0000 (19:41 +0000)] 
Use sandbox for cp --version

So that we detect the correct version.

17 months agoSimplify chroot_cmd()
Daan De Meyer [Tue, 12 Mar 2024 18:14:11 +0000 (18:14 +0000)] 
Simplify chroot_cmd()

17 months agoReduce number of mounts in rmtree()
Daan De Meyer [Tue, 12 Mar 2024 17:45:25 +0000 (17:45 +0000)] 
Reduce number of mounts in rmtree()

Make sure we mount each parent directory only once.

17 months agoDrop --verbose from grub tools if --debug is specified
Daan De Meyer [Tue, 12 Mar 2024 17:15:28 +0000 (17:15 +0000)] 
Drop --verbose from grub tools if --debug is specified

This makes grub tools incredibly noisy so let's drop it given
this has been working smoothly for a while now.

17 months agoStop setting SYSTEMD_LOG_LEVEL=debug when --debug is specified
Daan De Meyer [Tue, 12 Mar 2024 16:42:41 +0000 (16:42 +0000)] 
Stop setting SYSTEMD_LOG_LEVEL=debug when --debug is specified

This is generally too noisy (tmpfiles, sysusers and presets especially).
Let's not imply it when using --debug.

17 months agoDisable SELinux relabeling by default for default image
Daan De Meyer [Tue, 12 Mar 2024 16:41:51 +0000 (16:41 +0000)] 
Disable SELinux relabeling by default for default image

Sometimes selinux-policy gets pulled in as a dependency, causing
SELinux relabels even though we don't care about SELinux at all in
the general case, so let's by default not relabel anything.

17 months agoStreamline test logging
Daan De Meyer [Tue, 12 Mar 2024 16:12:06 +0000 (16:12 +0000)] 
Streamline test logging

Let's get rid of the status messages in favor of logging the journal
itself to the console. Let's also make sure we get info messages on
the console from the journal. Finally, make the kernel log at INFO
level instead of the default WARNING.

17 months agoSkip UKI/ESP/CPIO format boot for all distributions
Daan De Meyer [Tue, 12 Mar 2024 08:32:26 +0000 (09:32 +0100)] 
Skip UKI/ESP/CPIO format boot for all distributions

We need to write a separate test with a minimal image for these as
these images have to fit into memory.

17 months agoCatch ENODEV as well when checking if a device is available
Daan De Meyer [Tue, 12 Mar 2024 11:19:31 +0000 (12:19 +0100)] 
Catch ENODEV as well when checking if a device is available

This triggers on kernel updates on Arch without rebooting first so
let's make sure we handle it as well.

17 months agoUse --close with flock and drop --no-fork
Daan De Meyer [Tue, 12 Mar 2024 08:38:29 +0000 (09:38 +0100)] 
Use --close with flock and drop --no-fork

Let's make sure only flock holds the lock and it's not inherited by
the child process it spawns. This fixes an SELinux denial on some
systems.

17 months agoDon't remount /usr read-only if the output dir is inside of it
Daan De Meyer [Mon, 11 Mar 2024 22:39:08 +0000 (23:39 +0100)] 
Don't remount /usr read-only if the output dir is inside of it

Because some build systems use output directories in /usr, let's only remount
/usr read-only if the output directory is not relative to it.

17 months agoFix --local-mirror mounting
Daan De Meyer [Mon, 11 Mar 2024 21:37:14 +0000 (22:37 +0100)] 
Fix --local-mirror mounting

This can be specified as a URI, let's make sure we handle that
properly.

17 months agoOnly mount /etc/resolv.conf if it actually exists
Daan De Meyer [Mon, 11 Mar 2024 18:53:46 +0000 (19:53 +0100)] 
Only mount /etc/resolv.conf if it actually exists

17 months agoHandle symlink explicitly in finalize_staging()
Daan De Meyer [Mon, 11 Mar 2024 16:33:57 +0000 (17:33 +0100)] 
Handle symlink explicitly in finalize_staging()

move_tree() doesn't handle symlinks so add some special casing for
the symlink we create in the staging directory.

Fixes #2479

17 months agoMerge pull request #2477 from DaanDeMeyer/fix
Daan De Meyer [Mon, 11 Mar 2024 15:52:08 +0000 (16:52 +0100)] 
Merge pull request #2477 from DaanDeMeyer/fix

Run sync scripts in relaxed sandbox without package manager trees

17 months agoRun sync scripts in relaxed sandbox without package manager trees 2477/head
Daan De Meyer [Mon, 11 Mar 2024 11:22:09 +0000 (12:22 +0100)] 
Run sync scripts in relaxed sandbox without package manager trees

Sync scripts run as the invoking user in the sandbox, which means
that they're not able to mount an overlayfs over /usr in the sandbox
to overlay extra files from package manager trees.

To circumvent the issue, let's run sync scripts in a relaxed sandbox
without package manager trees, which shouldn't be crucial to have
when running sync scripts.

17 months agoAlways run as root in Context sandbox
Daan De Meyer [Mon, 11 Mar 2024 11:18:01 +0000 (12:18 +0100)] 
Always run as root in Context sandbox

If there's files in /usr in the package manager tree, we need to
be running as root to mount an overlayfs on top of /usr so make
sure we are always root in the Context sandbox.

17 months agoMerge pull request #2476 from DaanDeMeyer/grub
Daan De Meyer [Mon, 11 Mar 2024 10:46:36 +0000 (11:46 +0100)] 
Merge pull request #2476 from DaanDeMeyer/grub

Add grub for EFI support

17 months agoAdd grub for EFI support 2476/head
Daan De Meyer [Sun, 10 Mar 2024 21:15:39 +0000 (22:15 +0100)] 
Add grub for EFI support

We also rework the grub setup to not copy the grub modules into the
ESP anymore. We do this as grub for EFI booted in secure boot mode
does not load any unsigned modules for security reasons so we opt
to include all necessary modules into the grub image itself.