Commit graph

72537 commits

Author SHA1 Message Date
Daan De Meyer d6f206b944 mkosi: Make scripts more generic
We might want to run the build scripts outside of mkosi as well at
some point, e.g. to build an rpm after booting the image, so let's
make them more generic by using /usr/lib/os-release to figure out
which pkg specs we should use instead of $PKG_SUBDIR. To make ubuntu
use the debian pkg spec, we add a symlink pkg/ubuntu which points to
debian/ in the same directory.
2024-04-09 11:57:05 +02:00
Daan De Meyer 0e4eba6fcb mkosi: Update to latest 2024-04-09 11:56:45 +02:00
Daan De Meyer 9c611095ca mkosi: Update pkg/arch to latest and install systemd-tests
The arch PKGBUILD now packages the tests when building for upstream
so let's make sure we install the new package.
2024-04-09 11:47:37 +02:00
Mike Yuan 52e555fa27 hibernate-resume-config: apply ENABLE_EFI ifdef correctly
Currently, validate_efi_hibernate_location is
fully conditioned out if !ENABLE_EFI, but
get_efi_hibernate_location() still calls it.
2024-04-09 09:40:21 +02:00
Daan De Meyer ae4088b23e test: Various build environment fixes
All bets are off in build chroots, so let's handle more cases of
files or executables that might not be available in build chroots.

Specifically, these are all fixes to allow the unit tests to run
in the opensuse build chroot.
2024-04-09 09:40:03 +02:00
Ronan Pigott 73f77f38cf resolve: really always initialize aux
dns_transaction_request_dnssec_rr was already adjusted in 4001710365,
to allow for the return parameter to be passed uninitialized. However
this codepath was missed, meaning this function could sometimes return
success without having actually set the parameter.

Fixes: 4001710365 ("resolved: minor dnssec fixups")
Fixes: 47690634f1 ("resolved: don't request the SOA for every dns label")
2024-04-09 09:39:49 +02:00
Yu Watanabe d4dae4c243 network/dhcp6: return earlier if no lease acquired
Previously, even If an interface has not acquired a DHCPv6 lease,
networkd logs a misleading message:
===
Apr 09 10:44:57 systemd-networkd[3970750]: veth99: DHCPv6 lease lost
===
The function should do nothing when no lease acquired. Let's return
earlier and suppress the log message.
2024-04-09 09:39:36 +02:00
Yu Watanabe 0ac03e004c network/address-generation: make generate_stable_private_address() optionally take the previously generated address
Currently, the argument is not used yet. The new argument will be used later
for regenerating prefix stable address on conflict.
2024-04-09 12:06:32 +09:00
Yu Watanabe e700e48257 network/address-generation: also provide used tokens when generating address
Then, assign the token to the corresponding Address object.
2024-04-09 12:06:32 +09:00
Yu Watanabe e39bb29100 network/address: make Address object optionally take reference to IPv6Token
Currently, the element is unused. Preparation for later commits.
2024-04-09 12:06:32 +09:00
Yu Watanabe ffafb56125 network/address-generation: expose IPv6Token and introduce new/ref/unref functions for the type
No functional change. Preparation for later commits.
2024-04-09 12:06:32 +09:00
Yu Watanabe 43d184682d network/ndisc: allow to call ndisc_request_address() without sd_ndisc_router object
Preparation for later commits.
2024-04-09 12:06:32 +09:00
Yu Watanabe b03565bc17 network/dhcp-pd: split out dhcp_pd_request_address_one()
No functional change. Preparation for later commit.
2024-04-09 12:06:32 +09:00
Yu Watanabe c848a0eef6
Merge pull request #31997 from yuwata/network-ndisc-zero-lifetime
network: fixlets for zero lifetime
2024-04-09 07:52:28 +09:00
Antonio Alvarez Feijoo 92966b3ac0 vmspawn: fix sd_bus_message_append() arguments and add missing error check 2024-04-09 06:47:48 +08: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
Luca Boccassi 0f0d001254
Merge pull request #32104 from yuwata/network-ndisc-redirect
network/ndisc: add support for Redirect message
2024-04-08 20:03:32 +01:00
Mike Yuan 5b677c7dfc
Merge pull request #32156 from YHNdnzj/mountfsd-followup
Some cleanup for uid-range
2024-04-09 02:48:30 +08:00
Daan De Meyer 3b8b6910d1 mkosi: Fix debian submodule commit
This was accidentally changed in https://github.com/systemd/systemd/pull/32155
2024-04-08 17:26:16 +02:00
Usman Akinyemi f9d273e67a I made more unit test to use the test macro 2024-04-08 16:58:52 +02:00
Mike Yuan 8ef347de67
userdbctl: correct uid_range_covers check
The third param should be the number of uids.
2024-04-08 20:24:23 +08:00
Mike Yuan fc759fdf35
userdbctl: use FOREACH_ARRAY more 2024-04-08 20:24:02 +08:00
Mike Yuan f48b487ddb
userdbctl: avoid NULL pointer deref
Error from uid_range_load_userns is ignored,
so 'p' could be NULL.
2024-04-08 20:20:26 +08:00
Mike Yuan 7fe28d8386
uid-range: place 'ret' param at last 2024-04-08 20:14:38 +08:00
Mike Yuan 0aec92a5cc
uid-range: use FOREACH_ARRAY at one more place 2024-04-08 20:14:38 +08:00
Mike Yuan 8953917d00
labeler: add mountfsd and nsresource 2024-04-08 20:14:37 +08:00
Daan De Meyer e71b40fd00 docs: Add note on RuntimeBuildSources= to hacking guide 2024-04-08 11:37:34 +01:00
Daan De Meyer bbecef795b
Merge pull request #32141 from DaanDeMeyer/mkosi
Install build dependencies into final image
2024-04-08 11:59:16 +02:00
Luca Boccassi b1b5d7e4bf
Merge pull request #32140 from YHNdnzj/socket-per-peer-source
Minor tweaks to socket manual & shorten the code a bit
2024-04-08 10:38:07 +01:00
Daan De Meyer 44b6e43e8d mkosi: Update submodules to latest 2024-04-08 11:36:59 +02:00
Daan De Meyer da38f93bd6 mkosi: Fix environment variable in arch prepare script 2024-04-08 11:36:40 +02:00
Daan De Meyer 8440ea8f21 Install build dependencies into final image
This allows us to build and install after booting without having to
build a new image. Together with
https://github.com/systemd/mkosi/pull/2601 and after enabling
RuntimeBuildSources=yes, after booting, "meson install -C /work/build"
can be used to do an incremental build and install. This won't build
proper packages, but will be invaluable for having a quick compile,
edit, test cycle without having to rebuild the image all the time.
2024-04-08 11:36:40 +02:00
Luca Boccassi 8826953547 Update pkg/debian/ to latest
lz4-tool, nsresourced, kmod changes
2024-04-08 11:34:30 +02:00
Luca Boccassi 9dcc2a5838 nsresource: fix FD leak
Also fix return code, namespace_open_by_type uses RET_NERRNO

CID#1542923

Follow-up for 54452c7b2a
2024-04-08 10:19:42 +01:00
Zbigniew Jędrzejewski-Szmek f50be1870d networkd: report error if lease file cannot be loaded and ignore
On my system, networkd would report that interface ve-rawhide is "Failed"
without anything in the logs:
systemd-networkd[651095]: ve-rawhide: Trying to reconfigure the interface.
systemd-networkd[651095]: ve-rawhide: Gained IPv6LL
systemd-networkd[651095]: ve-rawhide: Link DOWN
systemd-networkd[651095]: ve-rawhide: Lost carrier
systemd-networkd[651095]: ve-rawhide: Configuring with /usr/lib/systemd/network/80-container-ve.network.
systemd-networkd[651095]: ve-rawhide: Link UP
systemd-networkd[651095]: ve-rawhide: Gained carrier
systemd-networkd[651095]: ve-rawhide: Failed

At debug level:
systemd-networkd[799993]: dhcp-server-lease/ve-rawhide:1:1: Missing object field 'Address'.

$ jq </var/lib/systemd/network/dhcp-server-lease/ve-rawhide
{
  "BootID": "5d86b34b98894322bfd4ae8443ce59b3",
  "Leases": [
    {
      "ClientId": [ ... ],
      "Address": [ 192, 168, 120, 179 ],
      "Hostname": "rawhide",
      "ExpirationUSec": 966046821158,
      "ExpirationRealtimeUSec": 1711203197266940
    }
  ]
}

I'm not sure why "Address" is missing, but anyway, in this case, we should ignore the
lease file rather than refusing to configure the interface. Also, warn at the point
where we know what the filename is.
2024-04-08 17:28:22 +09:00
Antonio Alvarez Feijoo ef6bf96749 core: fix typo 2024-04-08 17:25:29 +09:00
Yu Watanabe 6952ebae3b tree-wide: drop several remaining license headers
And downgrade the license of utf8.c to LGPL-2.0-or-later, to follow the
original license.
2024-04-08 10:14:50 +02:00
Yu Watanabe caaf95985f mountfsd: fix typo
Follow-up for 702a52f4b5.
2024-04-08 09:22:06 +09:00
Yu Watanabe 1ea9151e6c nsresourced: fix typo
Follow-up for 8aee931e7a.
2024-04-08 09:20:20 +09:00
Yu Watanabe a1952a5c79 dissect: fix typo
Follow-up for 9444e54e56.
2024-04-08 09:17:53 +09:00
Yu Watanabe 693a28d748 nspawn: fix typo
Follow-up for 0af7e29434.
2024-04-08 09:12:08 +09:00
Luca Boccassi 69484aa6c2
Merge pull request #32136 from YHNdnzj/nextroot-auto-mountpoint
systemctl-logind: auto soft-reboot only if /run/nextroot/ is mountpoint
2024-04-07 23:32:18 +01:00
Luca Boccassi 1b0cc135d0 test-execute: check for s390x first and duplicate test
s390x will define both s390x and s390, so exec-personality-s390.service is ran
in both cases but fails on s390x, as the personality returned is s390x.
Split the test and check specifically for s390x.
2024-04-08 07:29:06 +09:00
Mike Yuan b8b0704ce9 hibernate-util: check 'noresume' before reading resume setting
Also hibernation_is_safe() should really take this
into consideration too.
2024-04-07 23:28:56 +01:00
Luca Boccassi 7a5edb0795
Merge pull request #26826 from poettering/mntfsd
unprivileged DDI mounts + dynamic userns range allocation via IPC
2024-04-07 19:43:34 +01:00
Mike Yuan 6b014a2ac4
man/systemd.socket: be explicit that MaxConnectionsPerSource=0 means disabled 2024-04-08 01:49:49 +08:00
Mike Yuan 8d83e0c20e
core/service: use GREEDY_REALLOC_APPEND 2024-04-08 01:35:24 +08:00
Daan De Meyer 84affd46d5 mkosi: Install dnf5 in Fedora image 2024-04-07 19:09:11 +02:00
Luca Boccassi 7190be5dd4
Merge pull request #32135 from keszybz/compiler-warning-cleanup
Compiler warning cleanup
2024-04-07 16:33:38 +01:00
Mike Yuan 9eb7f4cebf
systemctl-logind: auto soft-reboot only if /run/nextroot/ is mountpoint
Consider the following case: a user sets up a minimum rootfs for
file system maintenance work in /run/nextroot/ dir directly. When
they're done, they expect 'systemctl reboot' to perform a full reboot.
But they keep soft-rebooting back to the tmpfs root, until they
find out about $SYSTEMCTL_SKIP_AUTO_SOFT_REBOOT.

So currently, when /run/nextroot/ is a normal dir, pid1 automatically
turns it into a bind mount to soft-reboot into. This is good, but when
combined with automatic soft-reboot it has an arguably unexpected
behavior, since /run/nextroot/ can never go away in such a case.
OTOH, if /run/nextroot/ is a mountpoint in the first place, the mount
is *moved* so a second reboot would not trigger auto soft-reboot.
Let's just make things more friendly to users, and do auto soft-reboot
only if /run/nextroot/ is also a mountpoint.
2024-04-07 20:02:40 +08:00