Commit Graph

97 Commits

Author SHA1 Message Date
Daan De Meyer
7ae96246f6 docs: Update instructions for building distribution packages in HACKING.md
When building distribution packages without building an image, the
distribution packages will only be located in mkosi.builddir/ now and
not in mkosi.output/, so update the documentation to reflect that.

Also add installation instructions for distributions other than CentOS/Fedora
while we're at it.
2024-10-30 11:16:42 +01:00
Daan De Meyer
a33f453702 docs: Align some comments in HACKING.md 2024-10-30 11:16:36 +01:00
Daan De Meyer
c2c75d5ade docs: Mention that a local build might be required to use mkosi
Currently we need ukify with support for --profile and --join-profile
which isn't in an official release yet so mention that a local build
from source might be required.
2024-10-24 05:33:30 +09:00
Daan De Meyer
6d862a9dc0 mkosi: Add back support for running clangd within mkosi
This allows hacking on systemd without installing any build
dependencies except mkosi on the host machine.
2024-09-22 15:23:01 +02:00
Daan De Meyer
5f5b6fa901 docs: Update upgrade commands in HACKING.md
- Add the required options to make the package managers non interactive
- Use apt-get instead of apt
- Remove --reinstall from apt-get command so we only install newer packages
- Add --needed to pacman command so we only install newer packages
2024-08-05 15:00:24 +02:00
Daan De Meyer
ecfdecfd6a docs: Simplify hacking instructions a bit
We enable RuntimeBuildSources=yes by default so let's drop it from
the documentation.
2024-07-29 13:42:28 +02:00
Daan De Meyer
d279ec4a50 mkosi: Streamline running the integration tests without building systemd
Let's document in detail how to build the integration test image and run
the integration tests without building systemd. To streamline the process,
we stop automatically using binaries from build/ when invoking mkosi directly
and don't automatically use a tools tree anymore if systemd on the host is too
old. Instead, we document these options in HACKING.md and change the mkosi meson
target to automatically use the current build directory as an extra binary search
path for mkosi.
2024-07-18 11:39:07 +02:00
migleeson
cb2d6214ca
docs: update mkosi version mentioned in HACKING.md (#33723)
* fix: update docs since the default config uses a setting only available in v23

* fix: update docs to only refer to installing from the mkosi repo
2024-07-17 09:45:26 +02:00
Daan De Meyer
00acdb3147 docs: Simplify update commands in HACKING.md
Let's make use of mkosi ssh to give everyone a one liner to run instead
of having to execute two commands (one outside the VM, one inside).
2024-07-10 17:17:42 +02:00
Daan De Meyer
20345a86b7 mkosi: Adapt configuration to take into account configuration rework
In https://github.com/systemd/mkosi/pull/2847, the '@' specifier is
removed, CLI arguments take priority over configuration files again
and the "main" image is defined at the top level instead of in
mkosi.images/. Additionally, not every setting from the top level
configuration is inherited by the images in mkosi.images/ anymore,
only settings which make sense to be inherited are inherited.

This commit gets rid of all the usages of '@', moves the "main" image
configuration from mkosi.images/system to the top level and gets rid
of various hacks we had in place to deal with quirks of the old
configuration parsing logic.

We also remove usages of Images= and --append as these options are
removed by the mentioned PR.
2024-07-09 08:07:09 +02:00
Daan De Meyer
575f954b5d TEST-06-SELINUX: Disable RuntimeBuildSources=
Otherwise fixfiles will try to relabel it which could potentially
lead to disaster. We also change the recommendation in HACKING.md
to set the default so that TEST-06-SELINUX can override it.
2024-07-05 19:20:42 +02:00
Daan De Meyer
96110261ee mkosi: Build a disk image by default again
Now that we have a way to rebuild and reinstall systemd without
having to rebuild the image, let's default to building a disk image
again.
2024-07-04 12:43:50 +02:00
Daan De Meyer
a2403af329 docs: Update HACKING
Let's mention the new way to install the latest changes without
rebuilding the image. Let's also remove the duplicate info about
distribution packages that is already mentioned in its own section.
2024-07-03 22:59:40 +02:00
Daan De Meyer
17ef81a764 docs: Add section to HACKING.md on distribution packages 2024-06-26 15:56:41 +02:00
Daan De Meyer
ba592dc715 mkosi: Replace submodules with our own thing
Unfortunately, git submodules break in all sorts of ways:

- Various github workflows (dependabot, github pages) try to do a shallow
clone of git submodules which does not work at all when the git repository
is hosted on pagure (https://pagure.io/pagure/issue/5453,
https://github.com/dependabot/dependabot-core/issues/9391).
- If the git forge hosting the git repository uses SHA256, then it breaks our
usage of it as a submodule as SHA256 repositories cannot be used as submodules
in SHA1 repositories (src.opensuse.org moved to SHA256 which broke our usage of
opensuse's systemd spec as a submodule).
- git submodules completely break usage of git worktrees.
- ...

Let's avoid all these issues by just doing our own home grown implementation of
git submodules. We lose the automatic dependabot updates this way but since dependabot
fails to run more often that not with submodules we don't really lose anything.
2024-05-30 19:31:32 +02:00
Daan De Meyer
f779fd1f8f meson: Set up git submodule update on post checkout as well 2024-05-05 14:49:21 +02:00
Luca Boccassi
4d3d187493
Merge pull request #32324 from mrc0mmand/more-website-fixes
docs: use absolute links for our pages
2024-04-18 10:55:01 +02:00
Daan De Meyer
9fede461ca docs: Add note on packages produced by mkosi builds 2024-04-18 09:58:50 +02:00
Frantisek Sumsal
0d592a5e17 docs: use absolute links for our pages
Since 56b2970 has proven to be a no-go for us, as it breaks existing
links, let's embrace the trailing slash and use absolute links
everywhere for our pages. This way we'll get around browser cleverly
appending the relative link to the current location (since it ends with
a slash), and given our docs/ layout is flat it's not much of a hassle
either.

Converted using this beauty:
  $ sed -ri 's/(\[.+\]\()([A-Z_]+\))/\1\/\2/g' *.md

Resolves: #32088 (again) and #32310
2024-04-17 21:21:23 +02:00
Zbigniew Jędrzejewski-Szmek
9f74901a1e Merge pull request #31648 from neighbourhoodie/review-content
I did the merge manually to resolve a trivial conflict.
2024-04-17 17:41:07 +02:00
Daan De Meyer
9d98617c1a Update debugging with vscode section
- We have ssh-generator now, so need for mkosi's Ssh= option anymore.
- By enabling RuntimeBuildSources= by default, we don't need the gdb
  config file in the image anymore, since the build and source
  directories will be mounted at the expected locations.
2024-04-16 15:25:34 +02:00
Daan De Meyer
f1e9e8041c git: Add post-rewrite hook that invokes git submodule update
git rebase does not support a --recurse-submodules switch to automatically
check out the submodules at their registered commits during or after a rebase.

Instead, let's use the post-rewrite git hook to do this ourselves.
2024-04-10 14:39:49 +02:00
Daan De Meyer
957dc5f190 docs: Suggest soft-reboot to restart pid1 and all daemons in mkosi VM 2024-04-08 22:21:51 +01:00
Daan De Meyer
e71b40fd00 docs: Add note on RuntimeBuildSources= to hacking guide 2024-04-08 11:37:34 +01:00
hulkoba
3038994792
docs/HACKING: format text 2024-03-27 07:11:59 +01:00
hulkoba
257889efb3
docs/HACKING: fix jinja link 2024-03-27 06:53:42 +01:00
hulkoba
517fd35f94
docs/HACKING: link mkosi webpage
and remove one of two mkosi github links
2024-03-27 06:53:29 +01:00
Daan De Meyer
e33d43b059 docs: Add one more git submodule setting to configure 2024-03-21 23:02:52 +00:00
Daan De Meyer
6233a76932 meson: Rename add-git-hook.sh to git-setup.sh and configure git in it
Let's automatically apply the recommended git config with meson.
2024-03-15 17:27:49 +01:00
Daan De Meyer
c735424908 docs: Update HACKING guide with recommended git config 2024-03-15 17:27:49 +01:00
Daan De Meyer
4d0f1451b5 Build distribution packages in mkosi
Instead of running meson install and hoping for the best, let's build
distribution packages from the downstream packaging specs. This gets
us the following:

- Vastly simplified mkosi scripts since we don't need a separate initrd
  image anymore but can just reuse the default mkosi initrd.
- Almost everything can move to the base image as its not the basis
  anymore for the initrd and as such we don't need to care about the
  size anymore.
- The systemd packages that get pulled in as dependencies of other
  packages get properly uninstalled and replaced with our packages that
  we built instead of just installing on top of an existing systemd
  installation with no guarantee that everything from that previous
  installation was removed.
- Much better testing coverage as what we're testing is much closer
  to what will actually be deployed in distributions.
- Immediate feedback if something we change breaks distribution packaging
- We get integration with the distribution for free as we'll automatically
  use the proper directories and such instead of having to hack this
  into a mkosi build script.
- ...
2024-03-07 10:47:19 +01:00
Zbigniew Jędrzejewski-Szmek
1b4dc2ea28 docs: drop .md suffixes again 2024-02-23 09:56:00 +01:00
Zbigniew Jędrzejewski-Szmek
8e3fee33af Revert "docs: use collections to structure the data"
This reverts commit 5e8ff010a1.

This broke all the URLs, we can't have that. (And actually, we probably don't
_want_ to make the change either. It's nicer to have all the pages in one
directory, so one doesn't have to figure out to which collection the page
belongs.)
2024-02-23 09:48:47 +01:00
hulkoba
5e8ff010a1
docs: use collections to structure the data 2024-02-22 10:11:54 +01:00
Daan De Meyer
52842bb2c5 mkosi: Build a directory image by default
Both building and booting a directory image is much faster than
building or booting a disk image so let's default to a directory
image.

In CI, we stick to a disk image to make sure that keeps working as
well.

The only extra dependency this introduces is virtiofsd which is
packaged in all distributions except Debian stable. For users
hacking on systemd on Debian stable, a disk image can be built by
writing the following to mkosi.local.conf:

```
[Output]
Format=disk
```
2024-01-12 16:19:48 +01:00
Daan De Meyer
c417615c12 mkosi: Drop building custom kernel logic
Now that mkosi-kernel is a thing, this logic in systemd is just mostly
bitrotting since I just use mkosi-kernel these days. If I ever need to
hack on systemd and the kernel in tandem, I'll just add support for
building systemd to mkosi-kernel instead, so let's drop the support for
building a custom kernel in systemd's mkosi configuration.
2023-11-29 15:00:34 +00:00
Daan De Meyer
bcb335ac68 Update to mkosi v19
- Use mkosi.images/ instead of mkosi.presets/
- Use the .chroot suffix to run scripts in the image
- Use BuildSources= match for the kernel build
- Move 10-systemd.conf to mkosi.conf and rely on mkosi.local.conf
  for local configuration
2023-11-28 19:54:58 +01:00
Daan De Meyer
ee7304df5d mkosi: Use RuntimeTrees= to mount sources
Instead of using ExtraTrees=, let's use the new RuntimeTrees= option
to mount the full repository into the VM/container. Let's also store
the sources under /usr/src/systemd and update the gdbinit file and
vscode HACKING guide section to match the new location.
2023-10-20 12:43:57 +02:00
Frantisek Sumsal
d04af6aaca docs: update fuzzers docs 2023-10-14 17:55:29 +02:00
Daan De Meyer
f478b6e97d Update HACKING instructions
Let's mention that we just need the latest stable release of mkosi,
not the latest git commit. We also split the instructions for building
on the host and the instructions for building with mkosi into two blocks,
as it's not required to build on the host anymore to build with mkosi.
2023-10-06 09:16:33 +02:00
Mike Yuan
ba96ba0420 docs/HACKING: Arch has dropped asp in favor of pkgctl
Prompted by #29461

See also: https://wiki.archlinux.org/title/Arch_build_system#Using_the_pkgctl_tool
2023-10-05 17:54:37 +02:00
Daan De Meyer
2fe24cccde mkosi: Enable Incremental= mode by default
Since mkosi is now smart enough to drop the caches when the list of
packages changes, let's enable Incremental= mode by default to ensure
a good experience for anyone new to hacking on systemd with mkosi.
2023-06-29 13:11:39 +01:00
Zbigniew Jędrzejewski-Szmek
badea0d6df sd-boot,sd-stub: also print version after the address
The kernel, systemd, and many other things print their version during boot.
sd-boot and sd-stub are also important, so let's print the version if EFI_DEBUG.
(If !EFI_DEBUG, continue to be quiet.)

When updating the docs, I saw that that the text in HACKING.md was out of date.
Instead of trying to update the instructions there, make it shorter and refer
the reader to tools/debug-sd-boot.sh for details.
2023-05-24 04:34:56 +09:00
Daan De Meyer
47e5e12866 mkosi: Package a erofs usr partition with signed verity
Let's start moving towards a more involved partitioning setup to
test our stuff more when using mkosi.

The root partition is generated on boot with systemd-repart.

CentOS supports neither erofs nor btrfs so we use squashfs and xfs
instead.

We also enable SecureBoot= locally for additional coverage. This
and the use of verity means users need to run `mkosi genkey` once
to generate the keys necessary to do secure boot and verity.
2023-05-13 10:49:17 +02:00
Klaus
ab13274a19
docs: add correct pacman command (#27486)
The `pacman` command in order to install packages on Arch in the documentation is invalid.
This PR fixes the command.
2023-05-02 17:18:10 +08:00
Daan De Meyer
94c9855a18 mkosi: Update to latest
- Drop Netdev= as it was removed in mkosi
- Always install python-psutil in the final image (required for networkd tests)
- Always Install python-pytest in the final image (required for ukify tests)
- Use the narrow glob for all centos python packages
- Drop the networkd mkosi config files (the default image can be used instead)
- Use ".conf" as the mkosi config file suffix everywhere
- Copy src/ to /root/src in the final image and set gdb substitute path in
  .gdbinit to make gdb work properly
2023-03-29 13:27:19 +02:00
Daan De Meyer
1441a6a751 docs: Explicitly tell developers to enable mkosi required meson options
We need repart, bootctl, analyze and ukify for mkosi so let's make
sure those get built in the HACKING guide.
2023-03-23 13:09:09 +00:00
Daan De Meyer
c84d14c525 docs: Fix vscode debugging section in HACKING.md
Let's account for the recent changes in mkosi in the debugging
with vscode section.
2023-03-21 17:47:51 +00:00
Daan De Meyer
e9c47453d2 Drop mkosi + clang section from HACKING
We removed a few features that made this work, will be added back
in the future when we restructure the way mkosi does build images.
2023-02-16 20:06:27 +01:00
Daan De Meyer
2edcf8e7db Update HACKING for latest mkosi 2023-02-16 20:05:55 +01:00