Commit graph

65748 commits

Author SHA1 Message Date
Yu Watanabe 6750c1af24 unit: also condition out systemd-backlight in initrd
Follow-up for 9173d31dfea5c2b05ff08480972c499cb7aac940.

The systemd-backlight@.service also save/restore state but the data
is in /var/.
2023-07-05 09:01:27 +02:00
Lennart Poettering 49c55abcbe units: condition out a few services in the initrd
Let's make our units more robust to being added to an initrd:

1. systemd-boot-update only makes sense if sd-boot is available in /usr/
   to copy into the ESP. This is generally not the case in initrds, and
   even if it was, we shouldn't update the ESP from the initrd, but from
   the host instead.

2. The rfkill services save/restore rfkill state, but that information
   is only available once /var/ is mounted, which generally happens
   after the initrd transition.

3. utmp management is partly in /var/, and legacy anyway, hence don't
   bother with it in the initrd.
2023-07-05 10:58:47 +09:00
Igor Tsiglyar 9f6e0bd417 journal-remote: upload journals from namespace 2023-07-04 18:47:54 +01:00
Thomas Genty 41f34dcf3b hwdb : add support for Archos 101 Cesium Educ to 60-sensor.hwdb 2023-07-04 17:00:52 +01:00
Lennart Poettering d5163f9c87 NEWS/--help: correct/be clearer on bootclt -R vs. -RR
The NEWS file was simply wrong. Let's also improve the --help text on
this.

Fixes: #28221
2023-07-04 12:50:22 +01:00
Lennart Poettering 0b20c56ee1 hibernate-resume-generator: downgrade 'noresume' log message
This log message is shown pretty regular at boot in various scenarios
(such as CI builds), and it's not a reason for any concern, it's just the
immediate effect of explicit configuration. Hence let's downgrade from
LOG_NOTICE to LOG_INFO so that it is still usually in the boot output,
but not particularly highlighted, since there's really no reason to.
2023-07-04 12:30:33 +01:00
Lennart Poettering c86a95082b systemctl: implement a new "whoami" verb, that just returns unit of caller/PID 2023-07-04 01:05:02 +01:00
Frantisek Sumsal f2492d39ba test: wait for the interface to become routable after reconfiguring
Since 6e8477edd3 TEST-75 started failing with:

[  571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[  571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[  571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[  571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[  571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[  571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ

Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.
2023-07-04 08:10:11 +09:00
Yu Watanabe d979b39811
Merge pull request #28245 from rpigott/dhcp6-relax-assert
relax data assert in dchp6_option_parse_string
2023-07-04 08:06:13 +09:00
Mike Yuan f96eeea71a
Merge pull request #28215 from poettering/start-as-restart
pid1: enqueue auto-restart job for the unit itself as JOB_START and for dependending units as JOB_RESTART
2023-07-04 05:54:56 +08:00
Ronan Pigott 1219391c9f test-network: add test for an invalid captive portal uri
This could probably be extended to include many more invalid uri
2023-07-03 13:47:12 -07:00
Ronan Pigott 46bc8561f0 dhcp6: relax data assert in dhcp6_option_parse_string
dhcp6_option_parse_string is intended to clear strings with length 0,
for consistency. The data assert is too strict for this purpose, so we
will allow data || data_len == 0, similar to other dhcp6_option_parse*
helpers.

Fixes: fde788601b ("dhcp6-client: parse RFC8910 captive portal dhcp6 option")
2023-07-03 13:07:29 -07:00
Yu Watanabe c470513eea
Merge pull request #28232 from rpigott/ndisc-captive-portal-mfree
ndisc: clear ndisc captive portal value on bogus zero-len option
2023-07-04 01:27:20 +09:00
Lennart Poettering 7c9437fdc5 loginctl,machinectl: use same ansi formatting in --help texts as in systemctl 2023-07-03 17:56:57 +02:00
Lennart Poettering c65e3d7a9b units: skip systemd-battery-check in environments where it doesn't make sense
Let's condition the service so that it doesn't run where we aren't
directly run on baremetal, or where no power sources are discovered at
all.
2023-07-03 16:38:42 +01:00
Mike Yuan ba5e342c0e core/service: show correct restart usec for services in SERVICE_AUTO_RESTART_QUEUED
Follow-up for #28215

We can now correctly distinguish enqueued auto-restarts
from those that are still pending. Let's take advantage
of that.
2023-07-03 17:31:25 +02:00
Lennart Poettering f4b24db7c3 test: add test case for recent OnSuccess=/OnFailure= state machine changes 2023-07-03 17:31:25 +02:00
Lennart Poettering 09d04ad325 core: introduce a new job mode JOB_RESTART_DEPENDENCIES
This new job mode will enqueue a start job for a unit, and all units
depending on the unit will get a restart job enqueued. This is then used
for automatic sevice restarts: the unit itself is only started, the
depending units restarted. This way the unit will not go down
unnecessarily, triggering OnSuccess= needlessly.

This also introduces a new state SERVICE_AUTO_RESTART_QUEUED that is
entered once the restart jobs are enqueued. Previously we'd stay in
SERVICE_AUTO_RESTART, but that's problematic, since we'd lose
information whether we still need to enqueue the restart job during a
serialization/deserialization cycle or not. By having an explicit state
for this we know exactly whether we still need to enqueue the job or
not. It's also good since when we are in SERVICE_AUTO_RESTART_QUEUED we
want to act on unit_start(), but on SERVICE_AUTO_RESTART we want to wait
for the holdoff time to pass before we act on unit_start().

Fixes: #27722
2023-07-03 17:31:25 +02:00
Lennart Poettering 0c59d2e4ab service: re-linebreak some comments matching current coding style 2023-07-03 17:31:25 +02:00
Luca Boccassi fc613c8450
Merge pull request #28230 from yuwata/network-wait-address-configure
network: delay to configure address untill it is removed on reconfigure
2023-07-03 15:04:32 +01:00
Ronan Pigott 8231286faf ndisc: reject malformed captive portal URI with EBADMSG
This allows the correct, gracious, error handling to follow up in the
ndisc handler. Otherwise, an internal error is assumed and the interface
disabled.

Fixes: 9747955d2d ("ndisc: parse RFC8910 captive portal ipv6ra option")
2023-07-03 03:07:57 -07:00
Lennart Poettering 89ee9e59f7 update TODO 2023-07-03 11:59:45 +02:00
Ronan Pigott 16290f50e9 ndisc: clear ndisc captive portal value on bogus zero-len option
This value was freed but erroneously never cleared, leading to
use-after-free.

Fixes: 9747955d2d ("ndisc: parse RFC8910 captive portal ipv6ra option")
2023-07-03 01:10:41 -07:00
Yu Watanabe e4948bb2cd test-network: add test for static route with preferred source
This adds possible reproducer for issue #28009 (though, the issue is
highly racy, hence this may not trigger the issue reliably).
2023-07-03 16:13:49 +09:00
Yu Watanabe 7e30527806 test-network: check route more strictly 2023-07-03 16:06:17 +09:00
Yu Watanabe 6e8477edd3 network: delay to configure address until it is removed on reconfigure
When we request an address that already exists and is under removing,
we need to wait for the address being removed. Otherwise, configuration
of a route whose preferred source is the address will fail.

Fixes #28009.
Replaces #28088.
2023-07-03 16:06:17 +09:00
Yu Watanabe b088c3d3fc network: constify several functions 2023-07-03 16:06:17 +09:00
Yu Watanabe 86c2a76e09
Merge pull request #28132 from rpigott/dhcp-captive-portal
Implement RFC8910: captive portal dhcp options
2023-07-03 14:51:56 +09:00
Bastien Nocera 56506988f2 hwdb: Add override for headset form-factors
Correct the SOUND_FORM_FACTOR property for Steelseries Arctis headsets.
The USB IDs were all gathered from HeadsetControl[1].

[1]: https://github.com/Sapd/HeadsetControl
2023-07-02 15:55:24 +01:00
Luca Boccassi b9d29a2028
Merge pull request #28226 from mrc0mmand/coverity-fixes
A couple of Coverity-related fixes
2023-07-02 15:54:56 +01:00
Frantisek Sumsal 5000cea8d2 tree-wide: explicitly ignore return value in a couple more places
Resolves:
  - CID#1490777
  - CID#1498366
  - CID#1508639
  - CID#1509084
  - CID#1509086
  - CID#1509087
2023-07-02 12:22:45 +02:00
Frantisek Sumsal 85773a7fd0 unit: drop an unused assignment
Resolves: CID#1509244
2023-07-02 12:22:45 +02:00
Frantisek Sumsal 9cf7f7a82f virt: drop an unused assignment
As `v` gets overwritten by the following detect_vm_cpuid() call.

Resolves: CID#1509247
2023-07-02 12:22:41 +02:00
Zbigniew Jędrzejewski-Szmek da89046643 tree-wide: "<n>bit" → "<n>-bit"
In some places, "<n> bits" is used when more appropriate.
2023-07-02 11:10:12 +01:00
Frantisek Sumsal e3747380fb test: drop an unused assignment
Unused since 788c2d9523.
Resolves: CID#1509248
2023-07-02 11:04:38 +02:00
Ronan Pigott dbe960f07f test-network: add tests for captive portal dhcp options 2023-07-02 01:13:43 -07:00
Ronan Pigott e469d2a2ed networkctl: show captive portal configuration in link status 2023-07-02 01:13:43 -07:00
Ronan Pigott 8628267f31 networkd: include captive portal information in link json description 2023-07-02 01:13:43 -07:00
Ronan Pigott d74c4ce103 network: Introduce UseCaptivePortal IPv6RA option
Accepts a boolean. When enabled retains captive portal configuration
advertised by the router.
2023-07-02 01:13:43 -07:00
Ronan Pigott a75feb554b network: Introduce UseCaptivePortal DHCPv6 option
Acepts a boolean. When enabled requests and retains captive portal
configuration from the DHCPv6 server.
2023-07-02 01:13:43 -07:00
Ronan Pigott edb88a7201 network: Introduce UseCaptivePortal DHCPv4 option
Accepts a boolean. When enabled, UseCaptivePortal will request and
retain the captive portal configuration from the DHCP server.
2023-07-02 01:13:43 -07:00
Ronan Pigott 9747955d2d ndisc: parse RFC8910 captive portal ipv6ra option 2023-07-02 01:13:29 -07:00
Zbigniew Jędrzejewski-Szmek 221332ee13 NEWS: reword/fix/extend the entries for v254 2023-07-01 14:07:25 -06:00
Zbigniew Jędrzejewski-Szmek 33db1b9055 NEWS: drop doubled space after period
Emacs does this, but it doesn't make much sense. It makes even
less sense if done only in some places.
2023-07-01 13:54:14 -06:00
dependabot[bot] 1cdaba52a5 build(deps): bump github/codeql-action from 2.3.5 to 2.20.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.3.5 to 2.20.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](0225834cc5...f6e388ebf0)

---
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>
2023-07-01 14:05:22 +00:00
dependabot[bot] 6cc0fd0044 build(deps): bump actions/labeler from 4.0.4 to 4.2.0
Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.4 to 4.2.0.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](0776a67936...0967ca812e)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:37:11 +00:00
dependabot[bot] a2c9096790 build(deps): bump actions/checkout from 3.5.2 to 3.5.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.2 to 3.5.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](8e5e7e5ab8...c85c95e3d7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:36:23 +00:00
dependabot[bot] 479f9f3004 build(deps): bump ossf/scorecard-action from 2.1.3 to 2.2.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](80e868c13c...08b4669551)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-01 10:35:10 +00:00
Luca Boccassi cc5afe481e
Merge pull request #28187 from bluca/sbat
ukify: merge .sbat sections from stub and kernel
2023-06-30 21:55:58 +01:00
Lennart Poettering 6a58026df7
Merge pull request #28211 from poettering/unit-abstract
remove some explicit unit type checks from generic code, and make them abstract
2023-06-30 22:51:15 +02:00