]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
5 months agomkosi-obs: add support for UEFI SecureBoot self enrollment 3550/head
Luca Boccassi [Tue, 25 Feb 2025 00:12:36 +0000 (00:12 +0000)] 
mkosi-obs: add support for UEFI SecureBoot self enrollment

Create authvars and store them in the ESP with the project cert
used as PK/KEK/db

5 months agomkosi-obs: sign bootloaders in ESPs
Luca Boccassi [Tue, 25 Feb 2025 00:11:46 +0000 (00:11 +0000)] 
mkosi-obs: sign bootloaders in ESPs

If there are bootloaders in the ESP(s), sign them too. Useful to
ensure everything is signed also with the certificate in the project
where the image is built.

5 months agomkosi-obs: add support for .raw.img
Luca Boccassi [Tue, 25 Feb 2025 00:09:51 +0000 (00:09 +0000)] 
mkosi-obs: add support for .raw.img

Needed for netesp

5 months agomkosi-obs: create directories in ESP before calling mcopy
Luca Boccassi [Tue, 25 Feb 2025 00:08:38 +0000 (00:08 +0000)] 
mkosi-obs: create directories in ESP before calling mcopy

It does not create leading directories. Set -D s to skip when
they already exist.

5 months agomkosi-obs: also check that ESP offset is not an empty string
Luca Boccassi [Tue, 25 Feb 2025 00:06:52 +0000 (00:06 +0000)] 
mkosi-obs: also check that ESP offset is not an empty string

Can also happen, not just 'null'

5 months agoFix parse_drive()
Daan De Meyer [Mon, 24 Feb 2025 14:58:58 +0000 (15:58 +0100)] 
Fix parse_drive()

5 months agodocs: Update building-rpms-from-source.md
Daan De Meyer [Sun, 23 Feb 2025 15:40:27 +0000 (16:40 +0100)] 
docs: Update building-rpms-from-source.md

5 months agoMerge pull request #3545 from DaanDeMeyer/suppress-sync
Daan De Meyer [Sun, 23 Feb 2025 16:19:52 +0000 (17:19 +0100)] 
Merge pull request #3545 from DaanDeMeyer/suppress-sync

5 months agoSpecify --suppress-sync when running package managers 3545/head
Daan De Meyer [Sun, 23 Feb 2025 15:20:53 +0000 (16:20 +0100)] 
Specify --suppress-sync when running package managers

Package managers tend to make sure of sync() and friends to ensure
that any files they write are actually written to disk. This is
important when a package manager is used to do system package upgrades,
but is unnecessary when using package managers to build OS images. So
let's make sync() and friends a noop when we invoke package managers

Replaces #3544

5 months agosandbox: Add --suppress-sync option to suppress sync() syscalls
Daan De Meyer [Sun, 23 Feb 2025 15:18:27 +0000 (16:18 +0100)] 
sandbox: Add --suppress-sync option to suppress sync() syscalls

We'll make use of this to suppress calls to sync() when running
package managers.

5 months agomkosi-obs: use new sd-keyutil verb to attach dm-verity signature
Luca Boccassi [Mon, 17 Feb 2025 13:21:42 +0000 (13:21 +0000)] 
mkosi-obs: use new sd-keyutil verb to attach dm-verity signature

5 months agoReduce the number of filesystems we remount noexec/nosuid/nodev when root
Daan De Meyer [Fri, 21 Feb 2025 09:57:39 +0000 (10:57 +0100)] 
Reduce the number of filesystems we remount noexec/nosuid/nodev when root

For mkosi-initrd, /etc might very well contain executable scripts which
we should allow to run, so let's only mount /boot and /efi nodev/nosuid/noexec.

5 months agoAdd --debug-sandbox option to mkosi-initrd and mkosi-addon
Antonio Alvarez Feijoo [Fri, 21 Feb 2025 09:48:39 +0000 (10:48 +0100)] 
Add --debug-sandbox option to mkosi-initrd and mkosi-addon

5 months agoUse Config.finalize_environment() in Installer.finalize_environment()
Daan De Meyer [Thu, 20 Feb 2025 19:43:43 +0000 (20:43 +0100)] 
Use Config.finalize_environment() in Installer.finalize_environment()

Otherwise we don't get the required proxy environment variables.

5 months agoinitrd: add modules for fido2 and amd laptop
Luca Boccassi [Wed, 19 Feb 2025 23:13:27 +0000 (23:13 +0000)] 
initrd: add modules for fido2 and amd laptop

Needed for FIDO2 unlock and other stuff on my laptop. Adds
~200kb or so to the UKI.

5 months agoCopy /etc/group into the sandbox tree instead of passwd
Jörg Behrmann [Thu, 20 Feb 2025 17:34:21 +0000 (18:34 +0100)] 
Copy /etc/group into the sandbox tree instead of passwd

5 months agoREADME: Reference EXAMPLES and mkosi documentation
Philip Molloy [Thu, 20 Feb 2025 13:49:26 +0000 (14:49 +0100)] 
README: Reference EXAMPLES and mkosi documentation

Generally, examples are a great way to get started with a new tool.
Additionally, there does not appear to be formal getting started
documentation for mkosi.

5 months agoBump Fedora initrd size
Daan De Meyer [Wed, 19 Feb 2025 15:01:39 +0000 (16:01 +0100)] 
Bump Fedora initrd size

Fixes CI failure because the Fedora initrd increased in size again.

5 months agomkosi-obs: fix searching for multiple files to sign
Luca Boccassi [Wed, 19 Feb 2025 15:15:45 +0000 (15:15 +0000)] 
mkosi-obs: fix searching for multiple files to sign

Due to quotes a single entry in the array is created by 'find', instead of one
entry per file

5 months agomkosi-obs: fix creating subfolder structure for signature cpio
Luca Boccassi [Wed, 19 Feb 2025 15:15:12 +0000 (15:15 +0000)] 
mkosi-obs: fix creating subfolder structure for signature cpio

The signature file will be stored in the same directory structure it was
picked from, to allow having multiple files with the same name

5 months agoClean up default tools tree package lists
Daan De Meyer [Wed, 19 Feb 2025 14:21:18 +0000 (15:21 +0100)] 
Clean up default tools tree package lists

- util-linux is not needed anymore since we do mounts ourselves now
- dpkg is pulled in by apt on arch and we don't list it explicitly elsewhere
- glibc-gconv-modules-extra should be pulled in by something else on opensuse by now
- python3-cryptography is only required on ubuntu, rest already has a dependency on
  it in systemd-ukify or is already on systemd v257 which doesn't need it anymore
- libarchive-tools seems like a leftover that isn't installed anywhere else

5 months agoMerge pull request #3527 from DaanDeMeyer/dependencies
Daan De Meyer [Wed, 19 Feb 2025 14:02:23 +0000 (15:02 +0100)] 
Merge pull request #3527 from DaanDeMeyer/dependencies

5 months agomkosi-tools: Split off misc, package-manager and runtime profiles 3527/head
Daan De Meyer [Wed, 19 Feb 2025 11:39:06 +0000 (12:39 +0100)] 
mkosi-tools: Split off misc, package-manager and runtime profiles

Let's make the dependencies verb a little more flexible by splitting
off various profiles in mkosi-tools, the misc, package-manager and
runtime profiles. The misc profile contains all the useful tools we
install to make sure they're available in scripts. The package manager
contains non-native package managers and related tools. The runtime
profile contains all the tools required to boot images. The regular
configuration now only includes the tools required to build native images
with mkosi.

The default tools tree still includes both the misc, package-manager and
runtime profiles by default but the list of profiles can be changed with
the new ToolsTreeProfiles= setting. The dependencies verb includes neither
profile, but we now allow passing arbitrary settings to the dependency verb
as arguments so that packages from additional profiles can be requested if
needed.

5 months agoSort dependencies before writing them to stdout
Daan De Meyer [Wed, 19 Feb 2025 12:14:15 +0000 (13:14 +0100)] 
Sort dependencies before writing them to stdout

5 months agoconfig: Fix enum parsing in enum_list_transformer()
Daan De Meyer [Wed, 19 Feb 2025 13:21:47 +0000 (14:21 +0100)] 
config: Fix enum parsing in enum_list_transformer()

We expect enum values, not keys, so use parentheses instead of
brackets.

5 months agoconfig: Don't load history if --directory "" is passed
Daan De Meyer [Wed, 19 Feb 2025 11:37:08 +0000 (12:37 +0100)] 
config: Don't load history if --directory "" is passed

5 months agoconfig: Fix variable typo in parse_new_includes()
Daan De Meyer [Wed, 19 Feb 2025 11:35:56 +0000 (12:35 +0100)] 
config: Fix variable typo in parse_new_includes()

p might be Path("mkosi-tools") when a default config is included.
path contains the actual path to the resolved default config.

5 months agoconfig: Pass resources to nested parse_config() call
Daan De Meyer [Wed, 19 Feb 2025 11:35:10 +0000 (12:35 +0100)] 
config: Pass resources to nested parse_config() call

5 months agoAdd intel VMD to kernel modules
sim [Wed, 19 Feb 2025 08:51:12 +0000 (09:51 +0100)] 
Add intel VMD to kernel modules

5 months agoSearch for underscores in `systemd-stub`
Russell Bunch [Tue, 18 Feb 2025 16:58:52 +0000 (10:58 -0600)] 
Search for underscores in `systemd-stub`

Building raw disk images of RHEL 9 x86-64 are failing with:
```
...‣ Unable to determine systemd-stub version, found '#### LoaderInfo: systemd-stub 252-46.el9_5.2 ####'
```

Changes the regex for `systemd-stub` to include underscores for RHEL95.

5 months agoMerge pull request #3520 from bluca/obs
Daan De Meyer [Tue, 18 Feb 2025 12:26:12 +0000 (13:26 +0100)] 
Merge pull request #3520 from bluca/obs

5 months agorun: Wait for child process in try block in spawn()
Daan De Meyer [Tue, 18 Feb 2025 10:06:43 +0000 (11:06 +0100)] 
run: Wait for child process in try block in spawn()

If we only wait in finally block then any keyboard interrupt
triggered during the wait will leave the child process alive and
won't wait for it to exit. Let's make sure this doesn't happen by
waiting in the try block as well.

5 months agoDrop boot counting support
Daan De Meyer [Tue, 18 Feb 2025 09:44:11 +0000 (10:44 +0100)] 
Drop boot counting support

Setting up boot counting for the initial UKI in an image does not
make sense as there's nothing to fall back to. The existing interface
where we pick up the number of tries from a file in /etc inside the
image was also rather bad so let's get rid of the boot counting
specifier.

5 months agoukify: check for 257.999 instead of 258~devel
Luca Boccassi [Mon, 17 Feb 2025 14:25:40 +0000 (14:25 +0000)] 
ukify: check for 257.999 instead of 258~devel

We cannot do 258~devel for packages built on OBS, we use
xxx.999 instead. This can be bumped after we release 258.

5 months agomkosi-obs: compress output by default 3520/head
Luca Boccassi [Mon, 17 Feb 2025 13:21:22 +0000 (13:21 +0000)] 
mkosi-obs: compress output by default

DDIs can be quite large due to the fixed-size ESP, enable
zstd compression by default to save space and bandwidth

5 months agomkosi-obs: when building DDI + UKI, update ESP after signing
Luca Boccassi [Mon, 17 Feb 2025 13:20:09 +0000 (13:20 +0000)] 
mkosi-obs: when building DDI + UKI, update ESP after signing

If a DDI with an ESP is built, update the UKI after signing it

5 months agoAdd SplitArtifacts=os-release
Luca Boccassi [Sun, 16 Feb 2025 21:09:10 +0000 (21:09 +0000)] 
Add SplitArtifacts=os-release

Useful to work on metadata in post-processing scripts

5 months agoAdd Splash= to set the boot splash for unified kernel images
Daan De Meyer [Sun, 16 Feb 2025 14:54:49 +0000 (15:54 +0100)] 
Add Splash= to set the boot splash for unified kernel images

5 months agoMerge pull request #3517 from DaanDeMeyer/fix
Daan De Meyer [Sun, 16 Feb 2025 14:47:27 +0000 (15:47 +0100)] 
Merge pull request #3517 from DaanDeMeyer/fix

sandbox: Fix chattr()

5 months agotree: Fix maybe_make_nocow() 3517/head
Daan De Meyer [Sun, 16 Feb 2025 14:20:59 +0000 (15:20 +0100)] 
tree: Fix maybe_make_nocow()

5 months agosandbox: Fix chattr()
Daan De Meyer [Sun, 16 Feb 2025 14:18:56 +0000 (15:18 +0100)] 
sandbox: Fix chattr()

5 months agoMerge pull request #3516 from DaanDeMeyer/split
Daan De Meyer [Sun, 16 Feb 2025 14:09:53 +0000 (15:09 +0100)] 
Merge pull request #3516 from DaanDeMeyer/split

5 months agosysupdate: Don't use temporary directory for on demand split partitions 3516/head
Daan De Meyer [Sat, 15 Feb 2025 20:15:15 +0000 (21:15 +0100)] 
sysupdate: Don't use temporary directory for on demand split partitions

Instead, we can easily find out the split partitions after running repart
and just make sure to delete them again on exit.

5 months agotree: Implement file attributes logic with ioctls instead of tools
Daan De Meyer [Sun, 16 Feb 2025 12:06:48 +0000 (13:06 +0100)] 
tree: Implement file attributes logic with ioctls instead of tools

5 months agoMerge pull request #3515 from DaanDeMeyer/split
Jörg Behrmann [Sun, 16 Feb 2025 11:39:03 +0000 (12:39 +0100)] 
Merge pull request #3515 from DaanDeMeyer/split

sysupdate: Split partitions on demand if not done in the image build

5 months agoReduce the number of executed processes during mkosi vm a little
Daan De Meyer [Fri, 14 Feb 2025 15:41:48 +0000 (16:41 +0100)] 
Reduce the number of executed processes during mkosi vm a little

5 months agosysupdate: Split partitions on demand if not done in the image build 3515/head
Daan De Meyer [Sat, 15 Feb 2025 20:15:15 +0000 (21:15 +0100)] 
sysupdate: Split partitions on demand if not done in the image build

Let's not require SplitArtifacts=partitions to use the sysupdate verb.

5 months agoqemu: Move nocow check into copy_tree()
Daan De Meyer [Sat, 15 Feb 2025 23:29:33 +0000 (00:29 +0100)] 
qemu: Move nocow check into copy_tree()

Let's do this for every file we copy automatically.

5 months agoMake sure we always delete workspace / "root" as a subvolume
Daan De Meyer [Sat, 15 Feb 2025 21:58:04 +0000 (22:58 +0100)] 
Make sure we always delete workspace / "root" as a subvolume

Currently, we delete it as a subvolume if the build succeeds but not
if the build fails. Let's handle the deletion in setup_workspace() so
we delete it as a subvolume both on success and on failure.

5 months agoMerge pull request #3513 from bluca/obs
Luca Boccassi [Sat, 15 Feb 2025 13:53:40 +0000 (13:53 +0000)] 
Merge pull request #3513 from bluca/obs

Couple of OBS fixes for ParticleOS

5 months agoCreate split pcrs file also when going through install_uki 3513/head
Luca Boccassi [Sat, 15 Feb 2025 00:58:41 +0000 (00:58 +0000)] 
Create split pcrs file also when going through install_uki

This happens when building ParticleOS

Follow-up for 393b16cf8410c40695b776e709a4b8029c860c0c

5 months agoREADME: add note about new packages built on OBS
Luca Boccassi [Sat, 15 Feb 2025 01:19:11 +0000 (01:19 +0000)] 
README: add note about new packages built on OBS

5 months agomkosi-obs: override settings to allow building on OBS
Luca Boccassi [Fri, 14 Feb 2025 22:43:58 +0000 (22:43 +0000)] 
mkosi-obs: override settings to allow building on OBS

Needed to build ParticleOS. All of these settings break building
on OBS, so set defaults so that it works out of the box,
including packages mirror.

5 months agoRebuild OBS package on push to main
Luca Boccassi [Fri, 14 Feb 2025 17:14:34 +0000 (17:14 +0000)] 
Rebuild OBS package on push to main

https://build.opensuse.org/package/show/system:systemd/mkosi

5 months agoMerge pull request #3509 from DaanDeMeyer/stuff
Daan De Meyer [Fri, 14 Feb 2025 14:20:01 +0000 (15:20 +0100)] 
Merge pull request #3509 from DaanDeMeyer/stuff

Add BuildKey= and CacheKey= settings

5 months agoMake Linux= support delayed specifiers 3509/head
Daan De Meyer [Fri, 14 Feb 2025 12:39:48 +0000 (13:39 +0100)] 
Make Linux= support delayed specifiers

In mkosi-kernel, I want to add the following:

```
Linux=&b/kernel/arch/x86_64/boot/bzImage
```

So that I can run `mkosi -t none` to rebuild the kernel image and
`mkosi qemu` to boot into it. To make this work, let's add support
for a delayed specifier to Linux= that expands to the finalized
build directory.

5 months agoAdd BuildKey= and CacheKey= settings
Daan De Meyer [Thu, 13 Feb 2025 23:34:36 +0000 (00:34 +0100)] 
Add BuildKey= and CacheKey= settings

Let's give users more control over how many different cache and
build subdirectories we maintain by introducing CacheKey= and
BuildKey= with support for delayed specifiers.

5 months agoFix tools keyring/metadata cache cleanup
Daan De Meyer [Fri, 14 Feb 2025 08:41:02 +0000 (09:41 +0100)] 
Fix tools keyring/metadata cache cleanup

5 months agoSet config.image for the main image to 'main'
Daan De Meyer [Fri, 14 Feb 2025 08:51:20 +0000 (09:51 +0100)] 
Set config.image for the main image to 'main'

5 months agodocs: Fix formatting
Daan De Meyer [Fri, 14 Feb 2025 08:20:15 +0000 (09:20 +0100)] 
docs: Fix formatting

5 months agoInline load_args()
Daan De Meyer [Thu, 13 Feb 2025 21:37:28 +0000 (22:37 +0100)] 
Inline load_args()

5 months agoMove load_environment() into finalize_environment() method of Config
Daan De Meyer [Thu, 13 Feb 2025 21:23:41 +0000 (22:23 +0100)] 
Move load_environment() into finalize_environment() method of Config

Let's stop showing all derived environment variables values in the
summary and let's stop passing them to the default tools and initrd
images since they'll be derived again there anyway.

5 months agoUse default_factory for Checksum= default value
Daan De Meyer [Thu, 13 Feb 2025 20:40:26 +0000 (21:40 +0100)] 
Use default_factory for Checksum= default value

5 months agoMove two more checks from load_config() to check_inputs()
Daan De Meyer [Thu, 13 Feb 2025 20:38:55 +0000 (21:38 +0100)] 
Move two more checks from load_config() to check_inputs()

5 months agoDrop 5.11 check
Daan De Meyer [Thu, 13 Feb 2025 20:37:30 +0000 (21:37 +0100)] 
Drop 5.11 check

We already depend on 5.12 for mount_setattr(), so let's drop this
check for 5.11 now.

5 months agoinitrd: Add crc module
Daan De Meyer [Fri, 14 Feb 2025 13:45:05 +0000 (14:45 +0100)] 
initrd: Add crc module

5 months agoAdd back compat for OBS until a new version is deployed
Daan De Meyer [Fri, 14 Feb 2025 09:20:40 +0000 (10:20 +0100)] 
Add back compat for OBS until a new version is deployed

See https://github.com/openSUSE/obs-build/pull/1059

6 months agodocs: Various fixes
Daan De Meyer [Thu, 13 Feb 2025 19:13:18 +0000 (20:13 +0100)] 
docs: Various fixes

- Make sure we suffix all long CLI options with '='
- Make sure whenever we use a boolean option that we pass an argument
- Make sure we prefix with '--' whenever we pass extra arguments

6 months agoStop using nargs="?" for options
Daan De Meyer [Thu, 13 Feb 2025 13:52:34 +0000 (14:52 +0100)] 
Stop using nargs="?" for options

This allows us to get rid of the ambiguity when parsing the verb which
could be interpreted as the argument of the previous option by argparse.

We also have to change the argument parser plumbing to only allow specifying
short options without an argument.

6 months agoMerge pull request #3504 from christian-heusel/zypper-official-arch-repos
Daan De Meyer [Thu, 13 Feb 2025 16:05:58 +0000 (17:05 +0100)] 
Merge pull request #3504 from christian-heusel/zypper-official-arch-repos

6 months agoAdd zypper to the tools image on Arch Linux 3504/head
Christian Heusel [Thu, 13 Feb 2025 15:28:24 +0000 (16:28 +0100)] 
Add zypper to the tools image on Arch Linux

Suggested-by: Jörg Behrmann <behrmann@physik.fu-berlin.de>
Signed-off-by: Christian Heusel <christian@heusel.eu>
6 months agoFix documented configuration names for --vsock and --vsock-cid
Martin Hundebøll [Thu, 13 Feb 2025 14:25:34 +0000 (15:25 +0100)] 
Fix documented configuration names for --vsock and --vsock-cid

6 months agoqemu: Fix Initrds= fallback
Daan De Meyer [Thu, 13 Feb 2025 13:10:51 +0000 (14:10 +0100)] 
qemu: Fix Initrds= fallback

6 months agoman: Document zypper being added to Arch Repos
Christian Heusel [Thu, 13 Feb 2025 14:15:40 +0000 (15:15 +0100)] 
man: Document zypper being added to Arch Repos

Signed-off-by: Christian Heusel <christian@heusel.eu>
6 months agoForce ssh to use bash to run the ProxyCommand
Daan De Meyer [Thu, 13 Feb 2025 09:14:32 +0000 (10:14 +0100)] 
Force ssh to use bash to run the ProxyCommand

We only have bash installed in the tools tree and by default ssh
will try to use the user's shell to execute the proxy command which
might not be available so force it use bash.

Fixes #3500

6 months agoMerge pull request #3499 from DaanDeMeyer/netesp
Daan De Meyer [Wed, 12 Feb 2025 20:33:34 +0000 (21:33 +0100)] 
Merge pull request #3499 from DaanDeMeyer/netesp

6 months agoAdd OutputExtension= 3499/head
Daan De Meyer [Wed, 12 Feb 2025 11:00:53 +0000 (12:00 +0100)] 
Add OutputExtension=

6 months agoAllow building esp images without a UKI
Daan De Meyer [Wed, 12 Feb 2025 10:44:25 +0000 (11:44 +0100)] 
Allow building esp images without a UKI

Let's only add a UKI to these if the required components are installed.

6 months agoRequire delimiting extra options for invoked commands with '--'
Daan De Meyer [Wed, 12 Feb 2025 09:49:59 +0000 (10:49 +0100)] 
Require delimiting extra options for invoked commands with '--'

This is one of the biggest footguns when using mkosi so let's break
compat and fix it. Any options that should be passed to the command
invoked by mkosi when using various verbs should be delimited from
regular options now using '--'.

Fixes #3165

6 months agokmod: run proper cmdline in modinfo
Antonio Alvarez Feijoo [Wed, 12 Feb 2025 10:57:26 +0000 (11:57 +0100)] 
kmod: run proper cmdline in modinfo

Fixes a4818d7defc816c0d00322815597524597ed7818

6 months agoMerge pull request #3496 from DaanDeMeyer/sandbox
Daan De Meyer [Tue, 11 Feb 2025 18:57:32 +0000 (19:57 +0100)] 
Merge pull request #3496 from DaanDeMeyer/sandbox

mkosi-sandbox: Implement --pack-fds

6 months agoStrip --suspend from --debug-shell sandbox 3496/head
Daan De Meyer [Tue, 11 Feb 2025 17:01:17 +0000 (18:01 +0100)] 
Strip --suspend from --debug-shell sandbox

6 months agorun: Remove unused user/group arguments from run()
Daan De Meyer [Tue, 11 Feb 2025 15:07:27 +0000 (16:07 +0100)] 
run: Remove unused user/group arguments from run()

6 months agorun: Simplify spawn()
Daan De Meyer [Tue, 11 Feb 2025 14:58:38 +0000 (15:58 +0100)] 
run: Simplify spawn()

Let's reduce the nesting by stopping usage of Popen() as a context
manager. It's __exit__() method doesn't handle anything important that
we don't already handle ourselves. Let's also only handle
FileNotFoundError when spawning the process but not after yielding.
Finally, get rid of the failed() nested function as it only has one
remaining caller.

6 months agomkosi-sandbox: Implement --pack-fds
Daan De Meyer [Tue, 11 Feb 2025 14:48:29 +0000 (15:48 +0100)] 
mkosi-sandbox: Implement --pack-fds

This allows us to move the file descriptor packing logic from spawn()
to mkosi-sandbox. The main advantage here is that we can pass file
descriptors now without necessarily packing them together, which we now
only do for systemd-journal-remote which requires it.

6 months agoMerge pull request #3494 from bluca/obs_repart
Luca Boccassi [Tue, 11 Feb 2025 16:04:13 +0000 (16:04 +0000)] 
Merge pull request #3494 from bluca/obs_repart

Add SplitArtifacts=roothash

6 months agomkosi-obs: split and sign dm-verity roothashes 3494/head
Luca Boccassi [Mon, 10 Feb 2025 22:59:03 +0000 (22:59 +0000)] 
mkosi-obs: split and sign dm-verity roothashes

6 months agoAdd SplitArtifacts=roothash
Luca Boccassi [Mon, 10 Feb 2025 22:17:03 +0000 (22:17 +0000)] 
Add SplitArtifacts=roothash

6 months agopartition: do not return TBD as roothash
Luca Boccassi [Tue, 11 Feb 2025 13:19:15 +0000 (13:19 +0000)] 
partition: do not return TBD as roothash

When a verity partition is skipped/deferred (eg: second run for ESP
partitioning) the JSON output will list the roothash as 'TBD' which
is obviously not valid, so skip it in that case

6 months agoman: document SplitArtifacts=pcrs
Luca Boccassi [Mon, 10 Feb 2025 22:19:48 +0000 (22:19 +0000)] 
man: document SplitArtifacts=pcrs

Follow-up for 393b16cf8410c40695b776e709a4b8029c860c0c

6 months agoman: Remove erroneous FD parameter
Nils K [Tue, 11 Feb 2025 14:03:17 +0000 (15:03 +0100)] 
man: Remove erroneous FD parameter

6 months agoMerge pull request #3493 from DaanDeMeyer/process-group
Daan De Meyer [Tue, 11 Feb 2025 12:50:49 +0000 (13:50 +0100)] 
Merge pull request #3493 from DaanDeMeyer/process-group

serve: Add StorageTargetMode= feature

6 months agoMake various tools more quiet 3493/head
Daan De Meyer [Tue, 11 Feb 2025 10:14:09 +0000 (11:14 +0100)] 
Make various tools more quiet

Let's reduce the noise when booting a vm with mkosi vm by silencing
the output of some tools used during setup that isn't useful.

6 months agoMake VM registration work unprivileged
Daan De Meyer [Mon, 10 Feb 2025 20:24:37 +0000 (21:24 +0100)] 
Make VM registration work unprivileged

Since systemd 257, it's possible for unprivileged users to register
VMs with systemd-machined (gated behind polkit). So let's not require
root privileges to register virtual machines with systemd-machined, but
only do it as an unprivileged user if registration is explicitly requested
to avoid the polkit prompt.

To avoid having to detect which systemd version the system is running,
we skip errors on varlink registration for now when running unprivileged.
https://github.com/systemd/systemd/pull/36344 will allow us to detect if
the machined varlink interface can be accessed as an unprivileged user or
not.

6 months agosandbox: Replace --exec-fd with --suspend
Daan De Meyer [Tue, 11 Feb 2025 09:54:13 +0000 (10:54 +0100)] 
sandbox: Replace --exec-fd with --suspend

Let's change our synchronization mechanism from a file descriptor
to use SIGSTOP instead. This is both simpler and gives us a two way
synchronization mechanism. We can wait in the parent for the initialization
to complete just like before by waiting for the process to go into the
stopped state. But we can also have the subprocess wait indefinitely
until the parent tells it to continue by sending the SIGCONT signal. We make
use of this to register the qemu VM with systemd-machined before actually
starting the qemu process itself.

6 months agoserve: Add StorageTargetMode= feature
Daan De Meyer [Mon, 10 Feb 2025 18:18:46 +0000 (19:18 +0100)] 
serve: Add StorageTargetMode= feature

Let's make it configurable whether we run systemd-storagetm as part
of serve.

6 months agoDrop foreground process logic
Daan De Meyer [Tue, 11 Feb 2025 09:29:37 +0000 (10:29 +0100)] 
Drop foreground process logic

Let's stop messing around with process groups in favor of handling
terminal signals properly ourselves. We had to use process groups in
the past because we still used subprocess.run() which meant that by
the time we had a chance to handle KeyboardInterrupt(), the subprocess
would have already been SIGKILLed by subprocess.run(). Now that we don't
use subprocess.run() anymore, we can catch KeyboardInterrupt() at the
right time and forward it to the child process.

For the mkosi process itself, we have to modify the signal handlers
slightly to make sure we only raise the KeyboardInterrupt() exception
once, as when we're running a forked subprocess, both the parent process
and the forked subprocess will receive SIGINT if Ctrl+C is entered on the
terminal, and the parent process will forward the SIGINT to the child process,
which is already handling its own SIGINT, causing KeyboardInterrupt() to get
raised twice if we don't add an extra check to the signal handler to make sure
it only gets raised once.

6 months agomkosi: support nvme-over-tcp in the initrd + thunderbolt-net
Lennart Poettering [Mon, 10 Feb 2025 15:21:51 +0000 (16:21 +0100)] 
mkosi: support nvme-over-tcp in the initrd + thunderbolt-net

Let's make storage target mode a thing, and support nvme-over-tcp in the
initrd, as well as thunderbolt-net.

nvme-over-tcp probably makes sense anyway for supporting the probbaly
best way to do network booting these days.

6 months agoAdd ToolsTreePrepareScripts=
Daan De Meyer [Sun, 9 Feb 2025 15:04:32 +0000 (16:04 +0100)] 
Add ToolsTreePrepareScripts=

Let's give users a way to make arbitrary modifications to the default
tools tree.

6 months agoShow better error when script fails with exit code 127
Daan De Meyer [Sun, 9 Feb 2025 21:11:44 +0000 (22:11 +0100)] 
Show better error when script fails with exit code 127

Fixes #3481