]> git.ipfire.org Git - thirdparty/mkosi.git/log
thirdparty/mkosi.git
2 years agoDocumentation and summary improvements 1744/head
Daan De Meyer [Sun, 6 Aug 2023 08:55:25 +0000 (10:55 +0200)] 
Documentation and summary improvements

- Reorder config items in the summary to put more related stuff together
- Add missing config items to the summary
- Move Ssh= option to Content as it modifies the image
- Move CacheOnly= option to Distribution
- Document Passphrase=
- Reorder documentation to match summary

2 years agoAdd some newlines to compare_versions()
Daan De Meyer [Sun, 6 Aug 2023 08:04:35 +0000 (10:04 +0200)] 
Add some newlines to compare_versions()

Let's make the method a little less claustrophobic by adding a few
newlines.

2 years agoInline find_image_version()
Daan De Meyer [Sun, 6 Aug 2023 08:01:49 +0000 (10:01 +0200)] 
Inline find_image_version()

Only has one call site, so let's inline the function.

2 years agoRemove unused absolute path conversion in load_config()
Daan De Meyer [Sun, 6 Aug 2023 07:58:42 +0000 (09:58 +0200)] 
Remove unused absolute path conversion in load_config()

We already convert these paths to absolute paths during config
parsing.

2 years agoMerge pull request #1738 from DaanDeMeyer/tree
Daan De Meyer [Sun, 6 Aug 2023 07:54:23 +0000 (09:54 +0200)] 
Merge pull request #1738 from DaanDeMeyer/tree

tree: Introduce install_tree()

2 years agoUse umask to control new file/directory permissions 1738/head
Daan De Meyer [Sat, 5 Aug 2023 15:14:08 +0000 (17:14 +0200)] 
Use umask to control new file/directory permissions

The primary reason to use umask is that python's mkdir() functions
and methods only apply the given mode to the final component of the
path, and not to its parent paths if parents=True is specified. Aside
from that, it's also just nicer to make sure the file/directory has
the right mode from the start instead of having to modify it later with
chmod().

We also clean up permissions in general, making sure we set umask
explicitly whenever we create a file or directory in state.root and
remove explicit permissions when we're not writing files in state.root.

2 years agotree: Introduce install_tree()
Daan De Meyer [Sat, 5 Aug 2023 14:40:00 +0000 (16:40 +0200)] 
tree: Introduce install_tree()

2 years agoGet rid of scandir_recursive() and find_files()
Daan De Meyer [Sat, 5 Aug 2023 16:55:10 +0000 (18:55 +0200)] 
Get rid of scandir_recursive() and find_files()

- Use rglob() from pathlib instead of scandir_recursive()
- Use absolute paths when dealing with kernel modules instead of
relative paths. Only make the paths relative in make_cpio()

2 years agoMerge pull request #1742 from DaanDeMeyer/ci
Daan De Meyer [Sat, 5 Aug 2023 19:06:46 +0000 (21:06 +0200)] 
Merge pull request #1742 from DaanDeMeyer/ci

CI fixes

2 years agoMerge pull request #1740 from DaanDeMeyer/check-root
Daan De Meyer [Sat, 5 Aug 2023 19:06:19 +0000 (21:06 +0200)] 
Merge pull request #1740 from DaanDeMeyer/check-root

Get rid of check_root() function

2 years agoMachine name fixes
Daan De Meyer [Sat, 5 Aug 2023 15:49:07 +0000 (17:49 +0200)] 
Machine name fixes

- Prefer the image id or preset name over the output name
- Make sure the machine name doesn't contain underscores as those
  are not allowed.

2 years agoci: Drop arch geo mirror debug step 1742/head
Daan De Meyer [Sat, 5 Aug 2023 18:02:47 +0000 (20:02 +0200)] 
ci: Drop arch geo mirror debug step

2 years agoci: Share configs between centos, alma and rocky
Daan De Meyer [Sat, 5 Aug 2023 18:02:30 +0000 (20:02 +0200)] 
ci: Share configs between centos, alma and rocky

2 years agoRemove unused argument from certificate_common_name() 1740/head
Daan De Meyer [Sat, 5 Aug 2023 16:26:44 +0000 (18:26 +0200)] 
Remove unused argument from certificate_common_name()

2 years agoMove one_zero() to util.py
Daan De Meyer [Sat, 5 Aug 2023 16:22:27 +0000 (18:22 +0200)] 
Move one_zero() to util.py

2 years agoGet rid of check_root() function
Daan De Meyer [Sat, 5 Aug 2023 16:20:42 +0000 (18:20 +0200)] 
Get rid of check_root() function

Only has one call site so let's just inline it.

2 years agoMerge pull request #1736 from DaanDeMeyer/tar
Daan De Meyer [Sat, 5 Aug 2023 14:34:50 +0000 (16:34 +0200)] 
Merge pull request #1736 from DaanDeMeyer/tar

Rework tar archive handling

2 years agoRework tar archive handling 1736/head
Daan De Meyer [Sat, 5 Aug 2023 14:12:43 +0000 (16:12 +0200)] 
Rework tar archive handling

- Instead of relying on shutil.unpack_archive(), let's always use tar
- Introduce archive_tree() and extract_tree() to abstract tar archives
- Make sure tar always uses the user/group information from the root dir
- Enable all features
- Make sure tar doesn't overwrite directory permissions

2 years agoRemove TarStripSelinuxContext=
Daan De Meyer [Sat, 5 Aug 2023 13:49:54 +0000 (15:49 +0200)] 
Remove TarStripSelinuxContext=

We now generate images with correct selinux labels. If selinux labels
are not needed, they can simply be excluded when extracting the archive,
but let's always include them when generating the archive and then users
can choose what to do with the labels when extracting.

2 years agoAlign table
Daan De Meyer [Sat, 5 Aug 2023 14:21:47 +0000 (16:21 +0200)] 
Align table

2 years agoMove summary() to config.py
Daan De Meyer [Sat, 5 Aug 2023 13:05:06 +0000 (15:05 +0200)] 
Move summary() to config.py

Also removes check_script_input() and its usages since we already
check scripts during config parsing.

2 years agoMake sure we mount cache and workspace writable when running package managers
Daan De Meyer [Sat, 5 Aug 2023 11:04:12 +0000 (13:04 +0200)] 
Make sure we mount cache and workspace writable when running package managers

2 years agoDon't log stacktraces for non-zero exits from ssh, qemu or systemd-nspawn
Daan De Meyer [Fri, 4 Aug 2023 14:38:05 +0000 (16:38 +0200)] 
Don't log stacktraces for non-zero exits from ssh, qemu or systemd-nspawn

2 years agoMerge pull request #1731 from DaanDeMeyer/opensuse-distribution-release
Daan De Meyer [Fri, 4 Aug 2023 12:03:10 +0000 (14:03 +0200)] 
Merge pull request #1731 from DaanDeMeyer/opensuse-distribution-release

opensuse: Install distribution-release by default

2 years agoApply all configuration after running the postinst script 1731/head
Daan De Meyer [Fri, 4 Aug 2023 11:28:26 +0000 (13:28 +0200)] 
Apply all configuration after running the postinst script

Let's put all the functions writing dropins together and run them
after running the postinst script.

2 years agoInstall boot loader after running postinst script
Daan De Meyer [Fri, 4 Aug 2023 11:27:25 +0000 (13:27 +0200)] 
Install boot loader after running postinst script

The boot loader package might be installed by the postinst script so let's
account for that and only do the boot loader stuff after running the
postinst script.

2 years agoMake sure the parent directory where ukify will write the UKI exists
Daan De Meyer [Fri, 4 Aug 2023 11:25:44 +0000 (13:25 +0200)] 
Make sure the parent directory where ukify will write the UKI exists

Otherwise we get an exception from ukify.

2 years agoAdd some extra environment variables for scripts
Daan De Meyer [Fri, 4 Aug 2023 10:26:30 +0000 (12:26 +0200)] 
Add some extra environment variables for scripts

When running a command with mkosi-chroot, one often wants to refer
to paths under $SRCDIR, $OUTPUTDIR, ... inside the chroot. The issue
is that variable expansion happens before mkosi-chroot is called and
has a chance to modify them to point to the locations inside the chroot.

To allow easily referring to the locations inside the chroot, let's
add variants of the directory environment variables prefixed with
"CHROOT_" containing the location of the paths inside the chroot.

2 years agoFix typo
Daan De Meyer [Fri, 4 Aug 2023 09:49:36 +0000 (11:49 +0200)] 
Fix typo

2 years agoopensuse: Install distribution-release by default
Daan De Meyer [Fri, 4 Aug 2023 09:10:56 +0000 (11:10 +0200)] 
opensuse: Install distribution-release by default

This is the package providing /usr/lib/os-release so let's make
sure it's installed by default.

2 years agoUse a dash in the workspace directory prefix
Daan De Meyer [Fri, 4 Aug 2023 08:35:04 +0000 (10:35 +0200)] 
Use a dash in the workspace directory prefix

We used to use a dash here as well so let's keep existing gitignore's
working by keeping that in place.

2 years agoMake sure package managers are always configured
Daan De Meyer [Thu, 3 Aug 2023 15:50:23 +0000 (17:50 +0200)] 
Make sure package managers are always configured

Currently, when using cached images, setup_dnf() and friends won't
be called when a cached image is used. Yet it's now entirely possible
that dnf might be called to install extra packages in the postinstall
script, so we always need the package managers to be configured
properly. Let's make sure we do that by introducing a new setup()
method that is always called.

2 years agoFix shellcheck warning in mkosi-chroot examples
Daan De Meyer [Thu, 3 Aug 2023 13:42:28 +0000 (15:42 +0200)] 
Fix shellcheck warning in mkosi-chroot examples

2 years agoMerge pull request #1701 from DaanDeMeyer/scripts-host
Daan De Meyer [Thu, 3 Aug 2023 13:29:48 +0000 (15:29 +0200)] 
Merge pull request #1701 from DaanDeMeyer/scripts-host

Run scripts on the host by default

2 years agoRun scripts on the host by default 1701/head
Daan De Meyer [Wed, 26 Jul 2023 14:33:57 +0000 (16:33 +0200)] 
Run scripts on the host by default

Scripts currently run chrooted in the image. This is not great because
it means the tool you want to run from a script has to be installed in
the image, even if it has --root support to run from outside the image.

Specifically, to install extra packages from a script, you currently
have to install the package manager inside the image itself. Even then,
it might be completely different than the package manager on the host
(both in version and in build options), possibly leading to all kinds
of weird issues.

To allow users to install extra packages from scripts, we now default
to running scripts on the host. Additionally, to make life easy for
users, we provide a set of scripts in the PATH for the package managers
we support that call them with the necessary options to install packages
in the same way mkosi installs packages into the root directory. This
means all that users have to do is "dnf install xxx" from the script to
install a new package into the root directory.

Because some tools do not have a --root option and to provide an easy
migration for users that depend on scripts running in the image, we
also put a script "mkosi-chroot" in the PATH which uses bubblewrap to chroot
into the image as we did before. Users can keep their old scripts working
by simply adding the following to the top of their script:

```
if [ "$container" != "mkosi" ]; then
    exec mkosi-chroot $SCRIPT "$@"
fi
```

When running scripts on the host, no APIVFS directories are mounted into
the image. When using the "mkosi-chroot" and package manager scripts, the APIVFS
directories are automatically mounted before executing the corresponding
command. The apivfs_cmd() function is introduced to make implementing this
easier.

Additionally, we now always consider the current working directory a
BuildSources= directory. BuildSources= is now used to declare additional
source directories. The current working directory can always be overmounted
with another directory by simply specifying a source directory in BuildSources=
without a target directory.

To allow scripts running on the host to find the image, we set the
BUILDROOT variable for all scripts.

To prevent scripts on the host from messing with the host system when mkosi
is running as root, we extend the sandboxing to cover many more directories
which are all mounted read-only while a script is executing.

This change also allows scripts to be written in python or other scripting
languages without having to install python into the image itself.

2 years agoSort packages for every distribution
Daan De Meyer [Thu, 3 Aug 2023 11:28:12 +0000 (13:28 +0200)] 
Sort packages for every distribution

2 years agoFix rename bug in finalize_staging()
Daan De Meyer [Thu, 3 Aug 2023 08:20:32 +0000 (10:20 +0200)] 
Fix rename bug in finalize_staging()

2 years agoMerge pull request #1725 from DaanDeMeyer/stdin
Daan De Meyer [Wed, 2 Aug 2023 13:20:04 +0000 (15:20 +0200)] 
Merge pull request #1725 from DaanDeMeyer/stdin

Give scripts access to sys.stdin

2 years agocentos: Fix extras source repo id 1725/head
Daan De Meyer [Wed, 2 Aug 2023 13:04:19 +0000 (15:04 +0200)] 
centos: Fix extras source repo id

2 years agoGive scripts access to sys.stdin
Daan De Meyer [Wed, 2 Aug 2023 12:54:51 +0000 (14:54 +0200)] 
Give scripts access to sys.stdin

It's very useful to be able to put "bash" in a script to get a shell,
so let's support that.

2 years agoMake sure outputs are always prefixed with the output name
Daan De Meyer [Wed, 2 Aug 2023 11:20:38 +0000 (13:20 +0200)] 
Make sure outputs are always prefixed with the output name

Our output unlinking logic currently works based off the name of
the output. Everything that is prefixed with the output name is
removed. We need to fix that properly, but for now, let's make sure
that all outputs that we generate are prefixed with the name of the
output.

2 years agoMerge pull request #1723 from DaanDeMeyer/stuff
Daan De Meyer [Wed, 2 Aug 2023 11:15:16 +0000 (13:15 +0200)] 
Merge pull request #1723 from DaanDeMeyer/stuff

Stuff

2 years agoMove run_build_script() next to the other script functions 1723/head
Daan De Meyer [Wed, 2 Aug 2023 08:42:32 +0000 (10:42 +0200)] 
Move run_build_script() next to the other script functions

2 years agoUse explicit "build" verb when calling ukify
Daan De Meyer [Wed, 2 Aug 2023 08:34:22 +0000 (10:34 +0200)] 
Use explicit "build" verb when calling ukify

2 years agoIntroduce StrEnum and Use enum.auto() everywhere
Daan De Meyer [Wed, 2 Aug 2023 08:32:58 +0000 (10:32 +0200)] 
Introduce StrEnum and Use enum.auto() everywhere

2 years agorun: Fix escaping bug
Daan De Meyer [Tue, 1 Aug 2023 06:29:16 +0000 (08:29 +0200)] 
run: Fix escaping bug

2 years agoinstaller: Return list[PathString] instead of list[str]
Daan De Meyer [Mon, 31 Jul 2023 19:55:50 +0000 (21:55 +0200)] 
installer: Return list[PathString] instead of list[str]

2 years agoMerge pull request #1722 from DaanDeMeyer/fix
Daan De Meyer [Tue, 1 Aug 2023 21:12:28 +0000 (23:12 +0200)] 
Merge pull request #1722 from DaanDeMeyer/fix

More comprehensive tmpfile fix

2 years agoMore comprehensive tmpfile fix 1722/head
Daan De Meyer [Tue, 1 Aug 2023 20:30:05 +0000 (22:30 +0200)] 
More comprehensive tmpfile fix

2 years agoMerge pull request #1721 from DaanDeMeyer/fixes
Daan De Meyer [Tue, 1 Aug 2023 19:24:39 +0000 (21:24 +0200)] 
Merge pull request #1721 from DaanDeMeyer/fixes

Fixes

2 years agoOnly do a lazy umount when needed 1721/head
Daan De Meyer [Tue, 1 Aug 2023 16:45:37 +0000 (18:45 +0200)] 
Only do a lazy umount when needed

2 years agoMake sure the temporary directory is recalculated when we modify TMPDIR
Daan De Meyer [Tue, 1 Aug 2023 16:44:49 +0000 (18:44 +0200)] 
Make sure the temporary directory is recalculated when we modify TMPDIR

2 years agoMerge pull request #1719 from DaanDeMeyer/distro
Daan De Meyer [Mon, 31 Jul 2023 13:27:25 +0000 (15:27 +0200)] 
Merge pull request #1719 from DaanDeMeyer/distro

Distribution cleanups

2 years agoRework clean_package_manager_metadata() 1719/head
Daan De Meyer [Wed, 26 Jul 2023 21:14:23 +0000 (23:14 +0200)] 
Rework clean_package_manager_metadata()

2 years agoRework distributions
Daan De Meyer [Fri, 28 Jul 2023 10:10:19 +0000 (12:10 +0200)] 
Rework distributions

Let's make the following changes
- Instead of having an instance of the installer object stored in
  MkosiState, let's have an installer() method on the Distribution
  enum that returns the specific type implementing the distribution
- Let's move Distribution to mkosi.distributions
- Let's add a method to DistributionInstaller to return the package
  type instead of storing it directly in the Distribution enum
- Let's add methods to the Distribution enum that delegate to its
  installer type
- Use enum.auto() instead of specifying values directly.

2 years agoqemu: Remove debian specific workaround
Daan De Meyer [Mon, 31 Jul 2023 12:53:19 +0000 (14:53 +0200)] 
qemu: Remove debian specific workaround

This seems to not be required anymore so let's drop the workaround

2 years agoMerge pull request #1718 from DaanDeMeyer/builddep
Daan De Meyer [Mon, 31 Jul 2023 12:19:48 +0000 (14:19 +0200)] 
Merge pull request #1718 from DaanDeMeyer/builddep

Add source and debuginfo repositories

2 years agocentos: Add debuginfo and source repositories 1718/head
Daan De Meyer [Thu, 27 Jul 2023 12:53:49 +0000 (14:53 +0200)] 
centos: Add debuginfo and source repositories

2 years agodebian/ubuntu: Add source and debug repositories
Daan De Meyer [Thu, 27 Jul 2023 10:58:38 +0000 (12:58 +0200)] 
debian/ubuntu: Add source and debug repositories

These are not trivial to integrate into --repositories so we enable
them by default.

2 years agofedora: Add source and debuginfo repositories
Daan De Meyer [Wed, 26 Jul 2023 15:48:11 +0000 (17:48 +0200)] 
fedora: Add source and debuginfo repositories

2 years agodnf: Enable builddep plugin
Daan De Meyer [Wed, 26 Jul 2023 15:47:35 +0000 (17:47 +0200)] 
dnf: Enable builddep plugin

This one is actually useful and has to be invoked explicitly so
there's no harm in enabling it.

2 years agoapt: Make invoke_apt() and apt_cmd() slightly more generic
Daan De Meyer [Fri, 28 Jul 2023 09:31:58 +0000 (11:31 +0200)] 
apt: Make invoke_apt() and apt_cmd() slightly more generic

Let's allow passing in the apt command we want to execute.

2 years agoFix filelists on fedora
Daan De Meyer [Wed, 26 Jul 2023 14:12:58 +0000 (16:12 +0200)] 
Fix filelists on fedora

We should only download these on older Fedora's, not newer ones.

2 years agoSet KERNEL_INSTALL_BYPASS=1 in load_environment()
Daan De Meyer [Wed, 26 Jul 2023 13:54:14 +0000 (15:54 +0200)] 
Set KERNEL_INSTALL_BYPASS=1 in load_environment()

2 years agoMerge pull request #1714 from DaanDeMeyer/installer
Daan De Meyer [Mon, 31 Jul 2023 09:25:08 +0000 (11:25 +0200)] 
Merge pull request #1714 from DaanDeMeyer/installer

Move package manager logic to separate submodule

2 years agoSeparate out functions to get package manager commands + options 1714/head
Daan De Meyer [Fri, 28 Jul 2023 09:22:02 +0000 (11:22 +0200)] 
Separate out functions to get package manager commands + options

2 years agoIntroduce zypper.py for zypper related logic
Daan De Meyer [Fri, 28 Jul 2023 09:19:45 +0000 (11:19 +0200)] 
Introduce zypper.py for zypper related logic

2 years agoIntroduce apt.py for apt related logic
Daan De Meyer [Wed, 26 Jul 2023 13:17:21 +0000 (15:17 +0200)] 
Introduce apt.py for apt related logic

2 years agoIntroduce pacman.py for pacman related logic
Daan De Meyer [Wed, 26 Jul 2023 13:13:28 +0000 (15:13 +0200)] 
Introduce pacman.py for pacman related logic

2 years agoIntroduce dnf.py for dnf related logic
Daan De Meyer [Wed, 26 Jul 2023 13:09:42 +0000 (15:09 +0200)] 
Introduce dnf.py for dnf related logic

We put this in a new "installer" submodule as well.

2 years agodocs: fix syntax
Zbigniew JÄ™drzejewski-Szmek [Sat, 29 Jul 2023 10:44:37 +0000 (12:44 +0200)] 
docs: fix syntax

Quick fixup for a7944939724bcf1fab8cb9129d5ad9e47d0ddf99.

2 years agoIntroduce rmtree() and remove unlink_try_hard()
Daan De Meyer [Wed, 26 Jul 2023 13:06:40 +0000 (15:06 +0200)] 
Introduce rmtree() and remove unlink_try_hard()

2 years agoMove sandboxing from chroot_cmd() to bwrap()
Daan De Meyer [Fri, 28 Jul 2023 17:07:51 +0000 (19:07 +0200)] 
Move sandboxing from chroot_cmd() to bwrap()

Let's leave it to bwrap() to set up any sandboxing that we need.
Let's also add a bit more sandboxing to bwrap(), to avoid details
from the host accidentally leaking into the image builds.

2 years agorun: Make env dict[str, str]
Daan De Meyer [Fri, 28 Jul 2023 09:07:54 +0000 (11:07 +0200)] 
run: Make env dict[str, str]

2 years agoUpdate documentation
Daan De Meyer [Thu, 27 Jul 2023 17:05:05 +0000 (19:05 +0200)] 
Update documentation

Too many changes to mention. Primarily this commit updates or removes
outdated documentation.

2 years agoMerge pull request #1708 from DaanDeMeyer/fixes
Daan De Meyer [Fri, 28 Jul 2023 16:39:47 +0000 (18:39 +0200)] 
Merge pull request #1708 from DaanDeMeyer/fixes

Fixes

2 years agoarch: Put testing repositories first if enabled so they take priority 1708/head
Daan De Meyer [Fri, 28 Jul 2023 13:52:43 +0000 (15:52 +0200)] 
arch: Put testing repositories first if enabled so they take priority

2 years agorun: Unshare pid namespace again in bwrap()
Daan De Meyer [Fri, 28 Jul 2023 13:51:48 +0000 (15:51 +0200)] 
run: Unshare pid namespace again in bwrap()

This was removed when we had a brief experiment with running everything
with bwrap(), but since we don't do that anymore, let's add this back
to make chroot detection work again.

2 years agorun: Make sure we resolve relative /etc/resolv.conf symlinks properly
Daan De Meyer [Fri, 28 Jul 2023 10:54:26 +0000 (12:54 +0200)] 
run: Make sure we resolve relative /etc/resolv.conf symlinks properly

If the symlink is relative, we should resolve it relative to /etc/resolv.conf
and not /

2 years agoOnly install bash in the initrd on gentoo
Daan De Meyer [Fri, 28 Jul 2023 08:39:48 +0000 (10:39 +0200)] 
Only install bash in the initrd on gentoo

I initially added this because no shell is pulled into the initrd
by default on gentoo when just installing systemd and util-linux.
Since this seems to override other distro's default shell, let's
limit this to just gentoo and rely on other distros pulling in a
shell via dependencies.

2 years agoMerge pull request #1700 from DaanDeMeyer/stuff
Daan De Meyer [Wed, 26 Jul 2023 07:56:18 +0000 (09:56 +0200)] 
Merge pull request #1700 from DaanDeMeyer/stuff

Stuff

2 years agoAlways install bash in the initrd 1700/head
Daan De Meyer [Sun, 23 Jul 2023 08:01:25 +0000 (10:01 +0200)] 
Always install bash in the initrd

Let's make sure we always have a shell in the initrd so that sulogin
works correctly.

2 years agoMake sure all dnf log files are removed
Daan De Meyer [Sat, 22 Jul 2023 18:22:18 +0000 (20:22 +0200)] 
Make sure all dnf log files are removed

2 years agoUse input instead of writing to stdin in make_cpio()
Daan De Meyer [Sat, 22 Jul 2023 18:20:48 +0000 (20:20 +0200)] 
Use input instead of writing to stdin in make_cpio()

Also remove the text= argument from spawn() and default it to True
just like run().

2 years agoGentoo fixes
Daan De Meyer [Sun, 23 Jul 2023 17:33:34 +0000 (19:33 +0200)] 
Gentoo fixes

- Drop --update, we never want to update packages, only install new
ones
- Drop --changed-use and --new-use, these apply to updating an existing
system, we're always installing a new one
- Drop --deep and --complete-graph-if-new-use, these don't seem to
have any noticeable effect
- Move getbinpkg from FEATURE to emerge CLI option --getbinpkg
- Do not disable spinner and candy option
- Explicitly disable all sandboxing features

2 years agoMerge pull request #1692 from DaanDeMeyer/stuff
Daan De Meyer [Sat, 22 Jul 2023 18:19:02 +0000 (20:19 +0200)] 
Merge pull request #1692 from DaanDeMeyer/stuff

More stuff

2 years agoAdd move_tree() 1692/head
Daan De Meyer [Fri, 21 Jul 2023 19:13:05 +0000 (21:13 +0200)] 
Add move_tree()

This function is intended to be a more efficient way of moving trees
than shutil.move(). Specifically, it will use reflinks and btrfs
snapshots if possible to make copying more efficient.

2 years agoRename btrfs.py to tree.py and move copy_path() into it
Daan De Meyer [Fri, 21 Jul 2023 19:15:30 +0000 (21:15 +0200)] 
Rename btrfs.py to tree.py and move copy_path() into it

Let's hide btrfs subvolumes as an implementation detail in a new
tree module. We have two functions, make_tree() and copy_tree()
(renamed from copy_path()), which will both take advantage of btrfs
subvolumes if configured to do so.

We also extend copy_tree() to not try to snapshot files.

2 years agomount_passwd() cleanups
Daan De Meyer [Fri, 21 Jul 2023 18:32:47 +0000 (20:32 +0200)] 
mount_passwd() cleanups

2 years agoMake MkosiState a context manager
Daan De Meyer [Fri, 21 Jul 2023 14:59:00 +0000 (16:59 +0200)] 
Make MkosiState a context manager

We have to make sure we properly cleanup the workspace object we
allocate so let's make MkosiState a context manager so we do just
that.

2 years agoMove more enums to config.py
Daan De Meyer [Fri, 21 Jul 2023 13:11:21 +0000 (15:11 +0200)] 
Move more enums to config.py

Also move is_xxx_distribution() functions into Distribution enum.

2 years agoSet TMPDIR=state.workspace when building an image
Daan De Meyer [Fri, 21 Jul 2023 13:04:19 +0000 (15:04 +0200)] 
Set TMPDIR=state.workspace when building an image

2 years agogentoo: Set FEATURES by appending to /etc/portage/make.conf
Daan De Meyer [Sat, 22 Jul 2023 14:53:43 +0000 (16:53 +0200)] 
gentoo: Set FEATURES by appending to /etc/portage/make.conf

Setting via the environment variable doesn't work in all cases, so
let's append to /etc/portage/make.conf instead. This allows us to
get rid of the custom devtpms for portage as it doesn't try to chown
tty's anymore now that userpriv is actually disabled.

2 years agoDrop filesystem_options() and make xfs default for centos again
Daan De Meyer [Fri, 21 Jul 2023 12:37:50 +0000 (14:37 +0200)] 
Drop filesystem_options() and make xfs default for centos again

Requires https://github.com/systemd/systemd/pull/26541 but after that
building XFS root filesystems will work reliably again and we can use
xfs as the default filesystem for centos which removes the need for
filesystem_options().

2 years agoGet rid of kernel_image() in DistributionInstaller
Daan De Meyer [Fri, 21 Jul 2023 10:51:10 +0000 (12:51 +0200)] 
Get rid of kernel_image() in DistributionInstaller

Instead, let's make sure in the install_packages() method that we
can find the kernel image at the expected location.

2 years agoGet rid of kernel_command_line() in DistributionInstaller
Daan De Meyer [Fri, 21 Jul 2023 10:22:21 +0000 (12:22 +0200)] 
Get rid of kernel_command_line() in DistributionInstaller

Let's just let anyone using CentOS 8 Stream set rw themselves.

2 years agoFix do-a-release script
Daan De Meyer [Fri, 21 Jul 2023 10:19:42 +0000 (12:19 +0200)] 
Fix do-a-release script

2 years agoMove Verb to config.py
Daan De Meyer [Fri, 21 Jul 2023 10:19:32 +0000 (12:19 +0200)] 
Move Verb to config.py

2 years agoMerge pull request #1667 from DaanDeMeyer/gentoo-bwrap
Daan De Meyer [Sat, 22 Jul 2023 10:21:15 +0000 (12:21 +0200)] 
Merge pull request #1667 from DaanDeMeyer/gentoo-bwrap

gentoo: Use bwrap() instead of run_workspace_command() to run emerge

2 years agogentoo: Use bwrap() instead of run_workspace_command() to run emerge 1667/head
Daan De Meyer [Thu, 6 Jul 2023 11:34:59 +0000 (13:34 +0200)] 
gentoo: Use bwrap() instead of run_workspace_command() to run emerge

Similar to the other distros, run the package manager with bwrap()
instead of run_workspace_command(). Also disable the sandboxing of
emerge as we do it in mkosi already.