1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00
Commit Graph

53374 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
51fe206fb3 Define ioprio_{get,set} the same as other compat syscalls 2021-09-22 12:58:47 +02:00
Zbigniew Jędrzejewski-Szmek
3c9fbb993b variuos: add missing includes 2021-09-22 12:58:46 +02:00
Zbigniew Jędrzejewski-Szmek
465a6f1544
Merge pull request #20767 from bluca/portable_extract_selinux
portable: copy SELinux label when extracting units from images
2021-09-22 12:57:30 +02:00
John Lindgren
750bb04785 Add Logitech USB-PS/2 M-BT96A to hwdb 2021-09-22 11:36:43 +01:00
Luca Boccassi
721d13b19f
Merge pull request #20756 from benzea/benzea/usb-persist
hwdb: Permit unsetting power/persist for USB devices
2021-09-22 10:50:07 +01:00
Yu Watanabe
7df4e57470
Merge pull request #20800 from keszybz/smack-compilatio-fix
smack: move helper function to smack-util.c
2021-09-22 16:56:37 +09:00
Franck Bui
9fbb13acbc test: wc is needed by test/units/testsuite-50.sh 2021-09-22 09:04:52 +02:00
Franck Bui
f7d47cc862 test: make the installation of the debug tools optional in the image 2021-09-22 08:37:34 +02:00
Yu Watanabe
3346eb1800
Merge pull request #20652 from OnkelUlla/fix_systemd.netdev_manpage
Some Fixes for SYSTEMD.NETDEV(5)
2021-09-22 15:34:21 +09:00
Frantisek Sumsal
220261ef94 unit: install the systemd-bless-boot.service only if we have gnu-efi
Follow-up to #20591.
2021-09-22 08:47:59 +09:00
Benjamin Berg
e68220221c hwdb: update fingerprint autosuspend rules
This pulls in a few new devices and adds ID_PERSIST=0.
2021-09-21 20:28:10 +02:00
Benjamin Berg
bd37360a21 hwdb: Permit unsetting power/persist for USB devices
The USB persist feature allows devices that can retain their state when
powered down to work across suspend/resume. This is in particular useful
for USB drives.

However, the persist feature can get in the way for devices that are
unable to retain their state when power is lost. An example of such
stateful devices are fingerprint readers where USB persist should be
disabled to ensure userspace can detect whether the USB device had a
power loss during system suspend.

This will initially be used by the libfprint autosuspend hwdb.

Closes: #20754
2021-09-21 20:28:10 +02:00
Zbigniew Jędrzejewski-Szmek
07b382cc2b meson: ignore -Dsmack-run-label= if -Dsmack=false
Compilation would fail because we could have HAVE_SMACK_RUN_LABEL without
HAVE_SMACK. This doesn't make much sense, so let's just make -Dsmack=false
completely disable smack.

Also, the logic in smack-setup.c seems dubious: '#ifdef SMACK_RUN_LABEL'
would evaluate to true even if -Dsmack-run-label='' is used. I think
this was introduced in the conversion to meson:
8b197c3a8a added

AC_ARG_WITH(smack-run-label,
AS_HELP_STRING([--with-smack-run-label=STRING],
        [run systemd --system with a specific SMACK label]),
        [AC_DEFINE_UNQUOTED(SMACK_RUN_LABEL, ["$withval"], [Run with a smack label])],
        [])

i.e. it really was undefined if not specified. And it was same
still in 72cdb3e783 when configure.ac
was dropped.

So let's use the single conditional HAVE_SMACK_RUN_LABEL everywhere.
2021-09-21 20:13:37 +02:00
Daan De Meyer
7e99216c1d mkosi: Fix CI
\#20629 moved the mkosi configs to mkosi.default.d/ so we were building
for the host distro (Ubuntu) in each CI configuration. To fix it, we
write the distro we want to test to a mkosi.default file and mkosi
will apply the other necessary configs automatically from mkosi.default.d/<distro>

This commit also removes unnecessary CLI options that are already handled
by the config files.
2021-09-21 17:39:00 +01:00
Zbigniew Jędrzejewski-Szmek
ce0458be09 smack: move helper function to smack-util.c
The function was in basic/fileio.c, but it's more appropriate to
keep it out of src/basic.

Fixes compilation with -Dsmack-run-label= set.
2021-09-21 18:31:42 +02:00
Luca Boccassi
71a80dcc0b
Merge pull request #20690 from DaanDeMeyer/oomd-user-services
oom: Support for user services
2021-09-21 15:39:48 +01:00
Zbigniew Jędrzejewski-Szmek
a7052c6e5c meson: fix creation of man pages indices
Fixes #20795. Bug introduced in f12c5d36a9.
2021-09-21 15:36:46 +01:00
Zbigniew Jędrzejewski-Szmek
e7f46ee3ae Drop bundled copy of linux/if_arp.h
As far as I can see, we use this to get a list of ARPHRD_* defines (used in
particular for Type= in .link files). If we drop our copy, and build against
old kernel headers, the user will have a shorter list of types available.  This
seems OK, and I don't think it's worth carrying our own version of this file
just to have newest possible entries.

7c5b9952c4 recently updated this file, but we'd
have to update it every time the kernel adds new entries. But if we look at
the failure carefully:

src/basic/arphrd-from-name.gperf:65:16: error: ‘ARPHRD_MCTP’ undeclared (first use in this function); did you mean ‘ARPHRD_FCPP’?
   65 | MCTP, ARPHRD_MCTP
      |                ^~
      |                ARPHRD_FCPP

we see that the list we were generating was from the system headers, so it was
only as good as the system headers anyway, without the newer entries in our
bundled copy, if there were any. So let's make things simpler by always using
system headers.

And if somebody wants to fix things so that we always have the newest list,
then we should just generate and store the converted list, not the full header.
2021-09-21 12:04:28 +01:00
Lennart Poettering
f0c6333d4e
Merge pull request #20790 from poettering/boot-fixes
various EFI/boot fixes
2021-09-21 11:35:04 +02:00
Lennart Poettering
5b5d365d73 stub: prepare section pointers in separate steps
In a follow-up patch we are going to modify the initrd, hence prepare
the pointers/"physical addresses" to it, first, so that we can do so
easily.

Also, do some other tweaks and cleanups to physical address/pointer
conversion.
2021-09-20 22:18:27 +02:00
Lennart Poettering
e41d3d8929 stub: use proper enums instead of hardcoded numeric indexes for identifying PE sections 2021-09-20 22:18:22 +02:00
Lennart Poettering
04394aa185 boot: ReallocatePool() supports NULL pointers as first argument
Just like userspace realloc() the EFIlib ReallocatePool() function is
happy to use a NULL pointer as input, in which case it is equivalent to
AllocatePool(). See:

269ef9dbc7/lib/misc.c (L57)
2021-09-20 22:18:17 +02:00
Lennart Poettering
ff3aa8d1e0 boot: modernize measure.c
Let's use _cleanup_freepool_, compound literals for initialization,
OFFSETOF() and let's remove some unnecessary casts.

No change in behaviour.
2021-09-20 22:18:12 +02:00
Lennart Poettering
b4f25c649d boot: move TCG/TPM protocol definitions into missing_efi.h
That's what it is for...
2021-09-20 22:18:08 +02:00
Lennart Poettering
2da0a7e154 boot: use cleanup-based file handle closing a bit more 2021-09-20 22:18:03 +02:00
Lennart Poettering
70d24fedc1 boot: invert if check, to reduce indentation level 2021-09-20 22:17:49 +02:00
Lennart Poettering
f62c5bd152 units: hookup systemd-boot-update.service
It was apparently missed to hook this up in
71c8bf2837.
2021-09-20 19:39:03 +02:00
Michal Sekletar
3435754559 boot: don't build bootctl when -Dgnu-efi=false is set 2021-09-20 17:41:23 +02:00
Luca Boccassi
409f4cf1f2 portable: copy SELinux label when extracting units from images
Units are copied out via sendmsg datafd from images, but that means
the SELinux labels get lost in transit. Extract them and copy them over.

Given recvmsg cannot use multiple IOV transparently when the sizes are
variable, use a '\0' as a separator between the filename and the label.
2021-09-20 14:23:55 +01:00
Luca Boccassi
447d46879c portable: use send_one_fd_iov/receive_one_fd_iov instead of custom helpers
Will be useful for the next commit switching to multiple IOVs
2021-09-20 14:23:55 +01:00
Luca Boccassi
6f7ccbcc74 selinux: add mac_selinux_create_file_prepare_label helper
Allow to use setfscreatecon with a custom label rather than the default
2021-09-20 14:23:55 +01:00
Daan De Meyer
064a5c1438 oom: Add support for user unit ManagedOOM property updates
Compared to PID1 where systemd-oomd has to be the client to PID1
because PID1 is a more privileged process than systemd-oomd, systemd-oomd
is the more privileged process compared to a user manager so we have
user managers be the client whereas systemd-oomd is now the server.

The same varlink protocol is used between user managers and systemd-oomd
to deliver ManagedOOM property updates. systemd-oomd now sets up a varlink
server that user managers connect to to send ManagedOOM property updates.

We also add extra validation to make sure that non-root senders don't
send updates for cgroups they don't own.

The integration test was extended to repeat the chill/bloat test using
a user manager instead of PID1.
2021-09-20 13:53:11 +01:00
Luca Boccassi
f621b8d773 socket-util: const-ify iov parameter in send_one_fd_iov_sa 2021-09-20 12:30:02 +01:00
Lukas Senionis
fa4f366211
hwdb: add touchpad fuzz for Asus UX362FA (#20770) 2021-09-20 14:00:42 +10:00
Luca Boccassi
4ee41ed515
Merge pull request #20780 from mrc0mmand/test-storage-btrfs
test: btrfs-related udev tests
2021-09-19 19:04:45 +01:00
Frantisek Sumsal
26a5ae8e95 test: dump the test output to console as well for easier debugging 2021-09-19 13:46:55 +02:00
Frantisek Sumsal
41187e716d test: regenerate module dependencies after installing all modules 2021-09-19 13:46:55 +02:00
Frantisek Sumsal
abfa9a0e7d test: fix error handling with set -e
Unfortunately, when checking the return/exit code using &&, ||, if,
while, etc., `set -e` is disabled for all nested functions as well,
which leads to incorrectly ignored errors, *sigh*.

Example:

```
set -eu
set -o pipefail

task() {
    echo "task init"
    echo "this should fail"
    false
    nonexistentcommand
    echo "task end (we shouldn't be here)"
}

if ! task; then
    echo >&2 "The task failed"
    exit 1
else
    echo "The task passed"
fi
```

```
$ bash test.sh
task init
this should fail
test.sh: line 10: nonexistentcommand: command not found
task end (we shouldn't be here)
The task passed
$ echo $?
0
```

But without the `if`, everything works "as expected":

```
set -eu
set -o pipefail

task() {
    echo "task init"
    echo "this should fail"
    false
    nonexistentcommand
    echo "task end (we shouldn't be here)"
}

task
```

```
$ bash test.sh
task init
this should fail
$ echo $?
1
```

Wonderful.
2021-09-19 13:46:55 +02:00
Frantisek Sumsal
b1471e559e test: btrfs-related udev tests 2021-09-19 13:46:49 +02:00
Frantisek Sumsal
677acd2101 test: check symlinks under /dev/mapper by default as well 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
de11005c1a test: use subshells a bit more
to tweak shell flags in specific functions without affecting the rest of
the script.
2021-09-18 20:44:34 +02:00
Frantisek Sumsal
b216501a8e test: cleanup the intermediate disk images 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
70ec7736f8 test: tidy up the feature handling 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
babe935563 test: add a btrfs helper 2021-09-18 20:44:34 +02:00
Frantisek Sumsal
dbc04797c1 test: lower the number of iterations in LVM tests
as some of the operations take a really long time.
2021-09-18 20:44:34 +02:00
Lia Lenckowski
66e10d45d9 bash-completion: circumvent aliases for 'ls' 2021-09-18 15:19:40 +09:00
Frantisek Sumsal
776fc8c385 test: unify handling of supported "features" 2021-09-17 17:45:39 +02:00
Frantisek Sumsal
af861917c5 ci: temporarily set -Wno-deprecated-declarations in Packit
to suppress OpenSSL 3.0 deprecation warnings (until a proper solution
is deployed):

```
../src/shared/creds-util.c: In function ‘sha256_hash_host_and_tpm2_key’:
../src/shared/creds-util.c:412:9: error: ‘SHA256_Init’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  412 |         if (SHA256_Init(&sha256_context) != 1)
      |         ^~
In file included from /usr/include/openssl/x509.h:41,
                 from ../src/shared/openssl-util.h:8,
                 from ../src/shared/creds-util.c:21:
/usr/include/openssl/sha.h:73:27: note: declared here
   73 | OSSL_DEPRECATEDIN_3_0 int SHA256_Init(SHA256_CTX *c);
      |                           ^~~~~~~~~~~
../src/shared/creds-util.c:415:9: error: ‘SHA256_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  415 |         if (host_key && SHA256_Update(&sha256_context, host_key, host_key_size) != 1)
      |         ^~
In file included from /usr/include/openssl/x509.h:41,
                 from ../src/shared/openssl-util.h:8,
                 from ../src/shared/creds-util.c:21:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
../src/shared/creds-util.c:418:9: error: ‘SHA256_Update’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  418 |         if (tpm2_key && SHA256_Update(&sha256_context, tpm2_key, tpm2_key_size) != 1)
      |         ^~
In file included from /usr/include/openssl/x509.h:41,
                 from ../src/shared/openssl-util.h:8,
                 from ../src/shared/creds-util.c:21:
/usr/include/openssl/sha.h:74:27: note: declared here
   74 | OSSL_DEPRECATEDIN_3_0 int SHA256_Update(SHA256_CTX *c,
      |                           ^~~~~~~~~~~~~
../src/shared/creds-util.c:421:9: error: ‘SHA256_Final’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  421 |         if (SHA256_Final(ret, &sha256_context) != 1)
      |         ^~
In file included from /usr/include/openssl/x509.h:41,
                 from ../src/shared/openssl-util.h:8,
                 from ../src/shared/creds-util.c:21:
/usr/include/openssl/sha.h:76:27: note: declared here
   76 | OSSL_DEPRECATEDIN_3_0 int SHA256_Final(unsigned char *md, SHA256_CTX *c);
      |                           ^~~~~~~~~~~~
cc1: all warnings being treated as errors

```
2021-09-17 12:07:02 +01:00
Frantisek Sumsal
93caec7ed6
Merge pull request #20769 from weblate/weblate-systemd-master
Translations update from Weblate
2021-09-16 20:23:51 +02:00
Hugo Carvalho
b6c5a863a5 po: Translated using Weblate (Portuguese)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pt/
Translation: systemd/main
2021-09-16 20:05:00 +02:00