]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
11 months agoWrap long comments, add more punctuation 3010/head
Zbigniew Jędrzejewski-Szmek [Mon, 9 Sep 2024 13:33:32 +0000 (15:33 +0200)] 
Wrap long comments, add more punctuation

.dir-locals specifies "fill-column" as 99 for .py files.
This seems resonable, because then the comments mostly match the
general width of the surrounding code.

11 months agoAdd bin/mkosi-initrd and bin/mkosi-sandbox
Zbigniew Jędrzejewski-Szmek [Sun, 8 Sep 2024 11:02:03 +0000 (13:02 +0200)] 
Add bin/mkosi-initrd and bin/mkosi-sandbox

It is convenient to be able to invoke those two during development
too, just like mkosi itself.

11 months agosandbox: use ValueError
Zbigniew Jędrzejewski-Szmek [Mon, 9 Sep 2024 13:34:29 +0000 (15:34 +0200)] 
sandbox: use ValueError

RuntimeError is for "unexpected errors". When the argument has a
wrong value, ValueError is the standard exception to use.

11 months agoUpdate NEWS.md
Daan De Meyer [Thu, 12 Sep 2024 11:30:56 +0000 (13:30 +0200)] 
Update NEWS.md

11 months agomkosi-initrd: allow configuration from /usr/local
Jörg Behrmann [Thu, 12 Sep 2024 07:07:21 +0000 (09:07 +0200)] 
mkosi-initrd: allow configuration from /usr/local

11 months agoBeef up tty checks for color handling
Daan De Meyer [Wed, 11 Sep 2024 17:48:08 +0000 (19:48 +0200)] 
Beef up tty checks for color handling

Let's use the same checks used by systemd.

Fixes #3013

11 months agodissect: do not attempt to load verity for just-built images
Luca Boccassi [Wed, 11 Sep 2024 16:23:35 +0000 (18:23 +0200)] 
dissect: do not attempt to load verity for just-built images

Verity is useful to establish trust at runtime in production
environments where we don't know if a payload is trusted in advance,
but we can implicitly trust the image we just built ourselves, so set
the env vars to disable loading images using verity when building
sub-images

11 months agomkosi-initrd: allow transient configuration
Antonio Alvarez Feijoo [Wed, 11 Sep 2024 14:59:17 +0000 (16:59 +0200)] 
mkosi-initrd: allow transient configuration

Include `/run/mkosi-initrd` if it exists.

11 months agoAdd sysupdate verb
Daan De Meyer [Sun, 8 Sep 2024 14:38:55 +0000 (16:38 +0200)] 
Add sysupdate verb

11 months agoMerge pull request #3012 from DaanDeMeyer/config
Daan De Meyer [Wed, 11 Sep 2024 09:03:40 +0000 (11:03 +0200)] 
Merge pull request #3012 from DaanDeMeyer/config

Introduce History= setting

11 months agoIntroduce History= setting 3012/head
Daan De Meyer [Tue, 10 Sep 2024 12:26:08 +0000 (14:26 +0200)] 
Introduce History= setting

Currently, to boot an image with mkosi qemu after building it with
mkosi build, various settings have to be identical to when mkosi build
was invoked to make sure that mkosi can find the outputs of the previous
build. Because this is rather error prone and annoying, let's introduce
a History= setting to allow mkosi to remember the configuration of the
last build which can then be read again when running a verb that operates
on a built image.

Another case where this is extremely useful is when some part of the
configuration changes every single time, for example if mkosi.version
is an executable script that outputs the current time, which is then
encoded in the output name, we have to remember the previous config,
otherwise mkosi wouldn't be able to find the outputs of the previous
build.

Note that while we load the configuration of the previous build, we
ignore all settings from the [Host] section which we read again from
the configuration files, as the user should be able to change these
without rebuilding the image.

11 months agoMake JSON loading methods more robust against changes in Config and Args
Daan De Meyer [Wed, 11 Sep 2024 07:59:12 +0000 (09:59 +0200)] 
Make JSON loading methods more robust against changes in Config and Args

We don't want failures to load JSON every time we add a new field, so let's
consider every JSON object we read as potentially partial and merge it with
a default instance of Config/Args. Also, sometimes we drop or rename fields
so let's show a proper error in the case that happens.

11 months agoFix comments
Daan De Meyer [Wed, 11 Sep 2024 07:41:16 +0000 (09:41 +0200)] 
Fix comments

11 months agoOnly append distro~release~arch suffix to build dir if not already there
Daan De Meyer [Tue, 10 Sep 2024 12:39:50 +0000 (14:39 +0200)] 
Only append distro~release~arch suffix to build dir if not already there

11 months agoMake parse_new_includes() a regular function
Daan De Meyer [Tue, 10 Sep 2024 12:01:15 +0000 (14:01 +0200)] 
Make parse_new_includes() a regular function

There's no need for this to be a context manager anymore.

11 months agoMove Include= setting to [Include] section
Daan De Meyer [Tue, 10 Sep 2024 11:59:00 +0000 (13:59 +0200)] 
Move Include= setting to [Include] section

This allows us to treat includes distinctly from other [Config]
settings in the next commit.

11 months agoIntroduce new Build section and move various settings to it
Daan De Meyer [Tue, 10 Sep 2024 10:02:12 +0000 (12:02 +0200)] 
Introduce new Build section and move various settings to it

11 months agoRemove "Include" from JSON serialization
Daan De Meyer [Tue, 10 Sep 2024 09:42:27 +0000 (11:42 +0200)] 
Remove "Include" from JSON serialization

We already have Files to cover everything so no need to include what
we included separately.

11 months agoDrop InitrdInclude=
Daan De Meyer [Tue, 10 Sep 2024 09:39:45 +0000 (11:39 +0200)] 
Drop InitrdInclude=

11 months agoMerge pull request #3008 from DaanDeMeyer/sandbox
Daan De Meyer [Mon, 9 Sep 2024 17:08:50 +0000 (19:08 +0200)] 
Merge pull request #3008 from DaanDeMeyer/sandbox

Use more directories of sandbox trees in the sandbox

11 months agoPort more code over to workdir() 3008/head
Daan De Meyer [Sun, 8 Sep 2024 15:18:50 +0000 (17:18 +0200)] 
Port more code over to workdir()

Let's not rely on tools not writing logs or errors to /dev/stdout
and instead use workdir() as well to mount the required parent
directory into the expected location so the output can be written
there.

11 months agoInstall various shells in the default image
Daan De Meyer [Sun, 8 Sep 2024 14:38:41 +0000 (16:38 +0200)] 
Install various shells in the default image

11 months agoLog when we're copying repository metadata
Daan De Meyer [Sun, 8 Sep 2024 14:37:34 +0000 (16:37 +0200)] 
Log when we're copying repository metadata

11 months agoUse package cache from /root if we're running as root from /root
Daan De Meyer [Sun, 8 Sep 2024 14:37:16 +0000 (16:37 +0200)] 
Use package cache from /root if we're running as root from /root

11 months agoAdd RuntimeHome= option
Daan De Meyer [Fri, 6 Sep 2024 15:19:06 +0000 (17:19 +0200)] 
Add RuntimeHome= option

11 months agoUse more directories of sandbox trees in the sandbox
Daan De Meyer [Fri, 6 Sep 2024 11:53:23 +0000 (13:53 +0200)] 
Use more directories of sandbox trees in the sandbox

Previously, we only picked up /usr and /etc from the sandbox trees.
Let's make this more generic and pick up a bunch of extra directories
as well. To avoid any changes persisting outside of the sandbox, let's
use overlayfs with a temporary writable directory as the upperdir of the
overlayfs (and make sure we use a tmpfs as the upperdir for /tmp and /run).

11 months agoStop using sandbox tree to shovel out list of essential packages
Daan De Meyer [Fri, 6 Sep 2024 12:01:16 +0000 (14:01 +0200)] 
Stop using sandbox tree to shovel out list of essential packages

We don't want to persist changes to the sandbox tree so in preparation
for that let's stop using the sandbox tree as a channel to shovel out
the list of essential packages when building debian images.

11 months agosandbox: Allow using tmpfs as overlayfs upperdir and workdir
Daan De Meyer [Fri, 6 Sep 2024 11:47:15 +0000 (13:47 +0200)] 
sandbox: Allow using tmpfs as overlayfs upperdir and workdir

11 months agoAlways add /var/tmp to the sandbox
Daan De Meyer [Fri, 6 Sep 2024 11:42:43 +0000 (13:42 +0200)] 
Always add /var/tmp to the sandbox

Now that we don't have to worry anymore about various operations
conflicting with other sandbox mounts, let's always add /var/tmp
to the sandbox again (we originally stopped doing this to make sure
rmtree() could remove directories in /var/tmp).

11 months agoAlways mount parent directories under /work
Daan De Meyer [Fri, 6 Sep 2024 11:28:56 +0000 (13:28 +0200)] 
Always mount parent directories under /work

When we do something where we need to mount the parent directory
because we're creating or deleting a file or directory, let's operate
under /work in the sandbox. Otherwise there's a good chance we'll
end up interfering with regular mounts in the sandbox e.g /var/tmp
when the workspace directory is in /var/tmp.

11 months agomkosi-initrd: correct `--debug-shell` help output
Antonio Alvarez Feijoo [Mon, 9 Sep 2024 11:47:40 +0000 (13:47 +0200)] 
mkosi-initrd: correct `--debug-shell` help output

11 months agoMove relaxed checks in sandbox_cmd() into one condition
Daan De Meyer [Fri, 6 Sep 2024 08:43:37 +0000 (10:43 +0200)] 
Move relaxed checks in sandbox_cmd() into one condition

We also fix a minor bug where we mounted /run into the sandbox when
devices=True when this isn't actually required.

11 months agoOnly mount /etc/ld.so.cache if not relaxed or mountpoint available
Daan De Meyer [Fri, 6 Sep 2024 08:32:08 +0000 (10:32 +0200)] 
Only mount /etc/ld.so.cache if not relaxed or mountpoint available

While we're at it, move all the tools related stuff together in
sandbox_cmd().

11 months agoMerge pull request #2990 from behrmann/allthemanuals
Daan De Meyer [Thu, 5 Sep 2024 17:57:44 +0000 (19:57 +0200)] 
Merge pull request #2990 from behrmann/allthemanuals

More docs at your finger tips

11 months agoinitrd: add --show-documentation option 2990/head
Jörg Behrmann [Thu, 5 Sep 2024 14:52:01 +0000 (16:52 +0200)] 
initrd: add --show-documentation option

11 months agoUpdate documentation links
Daan De Meyer [Thu, 5 Sep 2024 16:07:01 +0000 (18:07 +0200)] 
Update documentation links

11 months agoMove show_docs to its own module
Jörg Behrmann [Thu, 5 Sep 2024 14:22:45 +0000 (16:22 +0200)] 
Move show_docs to its own module

11 months agodoc: make documentation command take an argument
Jörg Behrmann [Fri, 30 Aug 2024 09:13:39 +0000 (11:13 +0200)] 
doc: make documentation command take an argument

Also let's leave out errors if things don't work, but we're still trying. This
way the last message "No manual entry for foo" will bubble up.

11 months agoOnly write to /etc/machine-id if /etc exists
Daan De Meyer [Thu, 5 Sep 2024 13:30:24 +0000 (15:30 +0200)] 
Only write to /etc/machine-id if /etc exists

11 months agoMerge pull request #3005 from DaanDeMeyer/mypy
Daan De Meyer [Thu, 5 Sep 2024 13:34:13 +0000 (15:34 +0200)] 
Merge pull request #3005 from DaanDeMeyer/mypy

Various mypy fixes

11 months agoDon't delete reader in _tempfile() backport 3005/head
Daan De Meyer [Thu, 5 Sep 2024 12:30:52 +0000 (14:30 +0200)] 
Don't delete reader in _tempfile() backport

This is only passed Path.read_bytes so there is nothing to delete
hence drop this part since it confuses mypyc.

11 months agoMark all class variables as Final
Daan De Meyer [Thu, 5 Sep 2024 12:30:24 +0000 (14:30 +0200)] 
Mark all class variables as Final

11 months agoAnnotate two more variables that need it
Daan De Meyer [Thu, 5 Sep 2024 12:30:03 +0000 (14:30 +0200)] 
Annotate two more variables that need it

11 months agoMove KeySource.Type out of KeySource
Daan De Meyer [Thu, 5 Sep 2024 12:28:47 +0000 (14:28 +0200)] 
Move KeySource.Type out of KeySource

We've done this for our other nested classes as well, so let's do
it for KeySource.Type as well.

11 months agouser: Drop lru_cache() for home() and name()
Daan De Meyer [Thu, 5 Sep 2024 11:48:49 +0000 (13:48 +0200)] 
user: Drop lru_cache() for home() and name()

Not required anymore now that we don't change user anymore.

11 months agoMove code backported from cpython upstream to backport.py
Daan De Meyer [Thu, 5 Sep 2024 11:45:59 +0000 (13:45 +0200)] 
Move code backported from cpython upstream to backport.py

11 months agoDrop listify()
Daan De Meyer [Thu, 5 Sep 2024 11:34:46 +0000 (13:34 +0200)] 
Drop listify()

Causes issues with mypyc and wrapping the callsites in list() isn't
really any worse when it comes to readability.

11 months agomypy: Disable allow_redefinition
Daan De Meyer [Thu, 5 Sep 2024 11:03:05 +0000 (13:03 +0200)] 
mypy: Disable allow_redefinition

Let's not allow redefining variables with different types. Even
when allowed it causes issues with mypy so we're better off just
disabling it.

11 months agoFix mypyc warnings in sandbox.py
Daan De Meyer [Thu, 5 Sep 2024 11:09:35 +0000 (13:09 +0200)] 
Fix mypyc warnings in sandbox.py

Fixes the following two warnings when compiling sandbox.py with mypyc:

"""
➜  mkosi git:(mypy) mypyc mkosi/sandbox.py
mkosi/sandbox.py:356: warning: Treating generator comprehension as list
mkosi/sandbox.py:446: warning: Unsupported default attribute value
"""

11 months agosandbox: Use separate variable name when we change types
Daan De Meyer [Thu, 5 Sep 2024 10:35:46 +0000 (12:35 +0200)] 
sandbox: Use separate variable name when we change types

11 months agoMerge pull request #3003 from DaanDeMeyer/initrd
Daan De Meyer [Thu, 5 Sep 2024 10:34:27 +0000 (12:34 +0200)] 
Merge pull request #3003 from DaanDeMeyer/initrd

Various mkosi-initrd fixes

11 months agomkosi-initrd: Ignore gnupg subdirectory 3003/head
Daan De Meyer [Thu, 5 Sep 2024 09:55:37 +0000 (11:55 +0200)] 
mkosi-initrd: Ignore gnupg subdirectory

/etc/pacman.d/gnupg is already made available by mkosi's internal
logic so we don't need to copy it in. This prevents failures when
running unprivileged as /etc/pacman.d/gnupg can have rather strict
permissions.

11 months agomkosi-initrd: Only set --cacheonly=metadata when running as root
Daan De Meyer [Thu, 5 Sep 2024 09:47:10 +0000 (11:47 +0200)] 
mkosi-initrd: Only set --cacheonly=metadata when running as root

If we're not running as root, we don't use the host's package cache,
but we still use the host's repositories. It's very unlikely that the
user's default package cache directory will have an up-to-date repository
metadata snapshot, so let's update the repository metadata if we're not
running as root.

11 months agomkosi-initrd: Add --debug-shell argument
Daan De Meyer [Thu, 5 Sep 2024 09:46:22 +0000 (11:46 +0200)] 
mkosi-initrd: Add --debug-shell argument

This is passed through directly to mkosi. To make this work we also
pass through stdout/stdin directly to the invoked mkosi process.

11 months agoMerge pull request #3002 from DaanDeMeyer/cherry-pick
Daan De Meyer [Thu, 5 Sep 2024 09:43:57 +0000 (11:43 +0200)] 
Merge pull request #3002 from DaanDeMeyer/cherry-pick

Various commits from #2990

11 months agonews: add note to change where the manual pages are 3002/head
Jörg Behrmann [Fri, 30 Aug 2024 09:36:02 +0000 (11:36 +0200)] 
news: add note to change where the manual pages are

11 months agoinitrd: flatten module into a single file
Jörg Behrmann [Fri, 30 Aug 2024 09:31:46 +0000 (11:31 +0200)] 
initrd: flatten module into a single file

11 months agosandbox: flatten module into a single file
Jörg Behrmann [Fri, 30 Aug 2024 09:30:00 +0000 (11:30 +0200)] 
sandbox: flatten module into a single file

11 months agocli: add missing completion stubs to pyproject.toml
Jörg Behrmann [Fri, 30 Aug 2024 09:23:24 +0000 (11:23 +0200)] 
cli: add missing completion stubs to pyproject.toml

11 months agodoc: move man pages to resources/man
Jörg Behrmann [Fri, 30 Aug 2024 09:16:50 +0000 (11:16 +0200)] 
doc: move man pages to resources/man

11 months agocli: use ellipsis ligature instead of writing out ...
Jörg Behrmann [Fri, 30 Aug 2024 09:06:15 +0000 (11:06 +0200)] 
cli: use ellipsis ligature instead of writing out ...

11 months agoMove various functions to bootloader.py
Daan De Meyer [Wed, 4 Sep 2024 13:44:55 +0000 (15:44 +0200)] 
Move various functions to bootloader.py

Our main file is growing too large again, so let's split off a bunch
of bootloader stuff into bootloader.py

This is very rough, the kernel stuff should probably move somewhere
else as well, but I wanted to move stuff without actually changing
code.

11 months agoUpdate NEWS.md
Daan De Meyer [Wed, 4 Sep 2024 13:18:37 +0000 (15:18 +0200)] 
Update NEWS.md

11 months agoSimplify package cache dir mirror key
Daan De Meyer [Wed, 4 Sep 2024 10:25:00 +0000 (12:25 +0200)] 
Simplify package cache dir mirror key

Let's just replace slashes with hyphens.

11 months agoMerge pull request #2998 from DaanDeMeyer/ci
Daan De Meyer [Wed, 4 Sep 2024 08:04:13 +0000 (10:04 +0200)] 
Merge pull request #2998 from DaanDeMeyer/ci

ci: Enable debug logging for systemd-repart

11 months agobase64 encode mirror if we put it in package cache dir key
Daan De Meyer [Tue, 3 Sep 2024 20:55:33 +0000 (22:55 +0200)] 
base64 encode mirror if we put it in package cache dir key

Mirrors contain / characters. Paths can't contain / characters. Let's
base64 encode the mirrors to avoid this issue.

11 months agotests: Show debug messages on console 2998/head
Daan De Meyer [Wed, 4 Sep 2024 07:14:57 +0000 (09:14 +0200)] 
tests: Show debug messages on console

Should help debug the spurious OpenSUSE CI failures.

11 months agoci: Drop machine-id commit timeout drop-in
Daan De Meyer [Wed, 4 Sep 2024 07:09:31 +0000 (09:09 +0200)] 
ci: Drop machine-id commit timeout drop-in

Let's see if we still need this.

11 months agoAdd 'login' to Debian/Ubuntu/Kali package list
Luca Boccassi [Tue, 3 Sep 2024 08:10:45 +0000 (09:10 +0100)] 
Add 'login' to Debian/Ubuntu/Kali package list

The login package as provided by util-linux is 'Protected' but no
longer 'Essential' and that's intentional, so it will not be pulled
in by default. Add it to the list.

11 months agoBump github/codeql-action from 3.25.15 to 3.26.6
dependabot[bot] [Sun, 1 Sep 2024 22:29:52 +0000 (22:29 +0000)] 
Bump github/codeql-action from 3.25.15 to 3.26.6

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.15 to 3.26.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/afb54ba388a7dca6ecae48f608c4ff05ff4cc77a...4dd16135b69a43b6c8efb853346f8437d92d3c93)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
11 months agoMerge pull request #2993 from keszybz/cat-config
Daan De Meyer [Sat, 31 Aug 2024 13:48:53 +0000 (15:48 +0200)] 
Merge pull request #2993 from keszybz/cat-config

Add cat-config verb

11 months agoReformat comments and shorten error messages 2993/head
Zbigniew Jędrzejewski-Szmek [Sat, 31 Aug 2024 07:25:37 +0000 (10:25 +0300)] 
Reformat comments and shorten error messages

11 months agodocs: describe cat-config
Zbigniew Jędrzejewski-Szmek [Sat, 31 Aug 2024 08:51:01 +0000 (11:51 +0300)] 
docs: describe cat-config

Also adjust surrounding text a bit.

11 months agoAdd new 'cat-config' verb
Zbigniew Jędrzejewski-Szmek [Sat, 31 Aug 2024 07:16:41 +0000 (10:16 +0300)] 
Add new 'cat-config' verb

This is similar to 'systemd-analyze cat-config'. With many config
files, it can be a bit difficult to figure out where some setting is
set.

11 months agoShortcut chase() if root == "/"
Daan De Meyer [Sat, 31 Aug 2024 09:31:48 +0000 (11:31 +0200)] 
Shortcut chase() if root == "/"

11 months agoconfig: match against verb value not verb name
Zbigniew Jędrzejewski-Szmek [Sat, 31 Aug 2024 07:25:01 +0000 (10:25 +0300)] 
config: match against verb value not verb name

For the existing verbs, those are the same. But for a verb with
a dash, which I want to add next, the name has the underscore,
which will not match the verb on the commandline.

11 months agoMerge pull request #2991 from DaanDeMeyer/fix
Jörg Behrmann [Fri, 30 Aug 2024 11:29:48 +0000 (13:29 +0200)] 
Merge pull request #2991 from DaanDeMeyer/fix

Don't change the working directory in chase()

11 months agoDon't change the working directory in chase() 2991/head
Daan De Meyer [Fri, 30 Aug 2024 09:49:20 +0000 (11:49 +0200)] 
Don't change the working directory in chase()

11 months agoAdd missing return type declaration
Daan De Meyer [Fri, 30 Aug 2024 09:49:07 +0000 (11:49 +0200)] 
Add missing return type declaration

11 months agoMerge pull request #2986 from behrmann/nochown
Jörg Behrmann [Fri, 30 Aug 2024 09:02:35 +0000 (11:02 +0200)] 
Merge pull request #2986 from behrmann/nochown

sandbox: introduce the MKOSI_CHROOT_SUPPRESS_CHOWN variable

11 months agoMerge pull request #2989 from DaanDeMeyer/azure
Daan De Meyer [Fri, 30 Aug 2024 08:59:34 +0000 (10:59 +0200)] 
Merge pull request #2989 from DaanDeMeyer/azure

Detect Azure Linux properly

11 months agoOnly run sync scripts if we're going to build the image
Daan De Meyer [Thu, 29 Aug 2024 15:59:21 +0000 (17:59 +0200)] 
Only run sync scripts if we're going to build the image

11 months agoDetect Azure Linux properly 2989/head
Daan De Meyer [Thu, 29 Aug 2024 20:29:03 +0000 (22:29 +0200)] 
Detect Azure Linux properly

Fixes #2988

11 months agoazure: Don't try to install erofs-utils
Daan De Meyer [Fri, 30 Aug 2024 08:20:14 +0000 (10:20 +0200)] 
azure: Don't try to install erofs-utils

It's not actually available yet.

11 months agoInline apivfs_script_cmd 2986/head
Jörg Behrmann [Thu, 29 Aug 2024 09:05:37 +0000 (11:05 +0200)] 
Inline apivfs_script_cmd

11 months agosandbox: introduce the MKOSI_CHROOT_SUPPRESS_CHOWN variable
Jörg Behrmann [Wed, 28 Aug 2024 16:18:41 +0000 (18:18 +0200)] 
sandbox: introduce the MKOSI_CHROOT_SUPPRESS_CHOWN variable

This allows suppressing chowns in scripts. Also inline chroot_script_cmd since
it only as a single user.

11 months agoFix typo
Daan De Meyer [Wed, 28 Aug 2024 08:14:35 +0000 (10:14 +0200)] 
Fix typo

We were resetting the list on every iteration of the loop when using
ephemeral build sources which is obviously wrong.

11 months agoMerge pull request #2984 from DaanDeMeyer/sandbox
Daan De Meyer [Wed, 28 Aug 2024 07:44:36 +0000 (09:44 +0200)] 
Merge pull request #2984 from DaanDeMeyer/sandbox

Don't mount stuff twice from different sources in sandbox

11 months agoMount /etc/ld.so.cache into the sandbox if it exists 2984/head
Daan De Meyer [Wed, 28 Aug 2024 07:20:23 +0000 (09:20 +0200)] 
Mount /etc/ld.so.cache into the sandbox if it exists

Otherwise libraries in non-standard locations won't be found at runtime.

11 months agoDon't mount stuff twice from different sources in sandbox
Daan De Meyer [Wed, 28 Aug 2024 06:53:57 +0000 (08:53 +0200)] 
Don't mount stuff twice from different sources in sandbox

We were mounting /var/tmp and /etc/resolv.conf twice in chroot_cmd(),
let's make sure we avoid doing that by moving the CLI options into
the respective _script_cmd() functions.

11 months agoUse system python if python binary is interpreter is not in /usr
Daan De Meyer [Tue, 27 Aug 2024 15:05:03 +0000 (17:05 +0200)] 
Use system python if python binary is interpreter is not in /usr

Same fix as #2982, but for the python_binary() function.

11 months agoSpecify --noprep when building rpms from source
Daan De Meyer [Tue, 27 Aug 2024 11:04:48 +0000 (13:04 +0200)] 
Specify --noprep when building rpms from source

rpm upstream is moving in this direction as well so let's update our
docs to match.

11 months agoUse python3 in sandbox if host interpreter is not in /usr
Daan De Meyer [Tue, 27 Aug 2024 12:57:48 +0000 (14:57 +0200)] 
Use python3 in sandbox if host interpreter is not in /usr

We only mount /usr into the sandbox, so if mkosi is invoked from a
venv we'll fail to execute the apivfs script or chroot script in the
sandbox as it will try to use an interpreter that isn't available.

Let's check if the used interpreter is relative to /usr and only use
it to execute the chroot and apivfs scripts in the sandbox if it is.

11 months agoMerge pull request #2980 from DaanDeMeyer/sync-scripts
Jörg Behrmann [Tue, 27 Aug 2024 10:42:48 +0000 (12:42 +0200)] 
Merge pull request #2980 from DaanDeMeyer/sync-scripts

Run sync scripts for all images again

11 months agoRun sync scripts for all images again 2980/head
Daan De Meyer [Tue, 27 Aug 2024 09:12:50 +0000 (11:12 +0200)] 
Run sync scripts for all images again

Fixes https://github.com/systemd/mkosi/commit/af66d2391b17d21b6892759e4f4f97684ba1945b

11 months agoMake running sync scripts possible without a context
Daan De Meyer [Tue, 27 Aug 2024 09:10:17 +0000 (11:10 +0200)] 
Make running sync scripts possible without a context

11 months agoMove sandbox tree logic into Config.sandbox()
Daan De Meyer [Tue, 27 Aug 2024 09:08:40 +0000 (11:08 +0200)] 
Move sandbox tree logic into Config.sandbox()

11 months agoRename internal pkgmngr dir to sandbox_tree
Daan De Meyer [Tue, 27 Aug 2024 08:51:45 +0000 (10:51 +0200)] 
Rename internal pkgmngr dir to sandbox_tree

11 months agodocs: Sort list of universal settings
Daan De Meyer [Tue, 27 Aug 2024 08:42:13 +0000 (10:42 +0200)] 
docs: Sort list of universal settings

11 months agoman: mention the empty arguments in help
Zbigniew Jędrzejewski-Szmek [Mon, 26 Aug 2024 16:08:43 +0000 (19:08 +0300)] 
man: mention the empty arguments in help

The autogenerated help for --distribution/--format/… looks like {a,b,…,} (with
an emtpy arg at the end), and it is not obvious what this means. Describe the
empty args in the man page.