1
0
mirror of https://github.com/systemd/systemd synced 2026-04-22 06:54:51 +02:00

Compare commits

...

7 Commits

Author SHA1 Message Date
Daan De Meyer
da637c8fca mkosi: Add CentOS Stream 9
The blocker causing Stream 9 builds to fail was fixed
(https://bugzilla.redhat.com/show_bug.cgi?id=2056276) so we can add
CentOS Stream 9 builds as well now.
2022-03-07 14:30:49 +00:00
Zbigniew Jędrzejewski-Szmek
6d6104e0c9 docs: add more links for portabled 2022-03-07 14:32:16 +01:00
Zbigniew Jędrzejewski-Szmek
90e3f3581d portable: inline one variable declaration 2022-03-07 14:32:01 +01:00
Zbigniew Jędrzejewski-Szmek
573e33de07 portablectl: reorder if branches to match previous conditional in the same function
One is a ternary op, the other an normal conditional, but they should still use
the same order of branches.
2022-03-07 14:31:48 +01:00
Zbigniew Jędrzejewski-Szmek
13391986b5 TEST-29: trim output a bit
IIUC, pipefail doesn't matter for a sequence of commands joined with &&, and we
don't have any pipes. And such a failing expression also does not trigger an
exit, so the set +e/set -e were noops.
2022-03-07 14:31:36 +01:00
4piu
19a04e8071 Add support for NEC VersaPro VG-S
The brightness control key (Fn+F7 Fn+F8) and touchpad toggle key (Fn + Space) do not work on the NEC VersaPro VG-S laptop. Add the keycode to fix the problem.
2022-03-07 12:07:26 +00:00
Yu Watanabe
a17e54783a tree-wide: fix typo 2022-03-07 15:32:22 +09:00
10 changed files with 34 additions and 33 deletions

View File

@ -44,9 +44,8 @@ jobs:
release: tumbleweed release: tumbleweed
- distro: centos_epel - distro: centos_epel
release: 8-stream release: 8-stream
# TODO: Enable once https://github.com/systemd/mkosi/pull/915#issuecomment-1049035316 is fixed. - distro: centos_epel
# - distro: centos_epel release: 9-stream
# release: 9-stream
steps: steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 - uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579

View File

@ -334,3 +334,10 @@ behaviour, by setting the `ProtectSystem=strict` option. In this case writable
service data may be placed on the host file system. Use `StateDirectory=` in service data may be placed on the host file system. Use `StateDirectory=` in
the unit files to enable such behaviour and add a local data directory to the the unit files to enable such behaviour and add a local data directory to the
services copied onto the host. services copied onto the host.
## Links
[portablectl(1)](https://www.freedesktop.org/software/systemd/man/portablectl.html)<br>
[systemd-portabled.service(8)](https://www.freedesktop.org/software/systemd/man/systemd-portabled.service.html)<br>
[Walkthrough for Portable Services](https://0pointer.net/blog/walkthrough-for-portable-services.html)<br>
[Repo with examples](https://github.com/systemd/portable-walkthrough)

View File

@ -1345,6 +1345,17 @@ evdev:name:MSI Laptop hotkeys:dmi:bvn*:bvr*:bd*:svn*:pnM[iI][cC][rR][oO]-S[tT][a
KEYBOARD_KEY_0213=f22 KEYBOARD_KEY_0213=f22
KEYBOARD_KEY_0214=f23 KEYBOARD_KEY_0214=f23
##########################################
# NEC
##########################################
# VersaPro VG-S
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnNEC:pnPC-VK22TGSGS:pvr*
KEYBOARD_KEY_a8=f21 # Fn+Space touchpad toggle
KEYBOARD_KEY_67=brightnessdown # Fn+F7 brightness down
KEYBOARD_KEY_65=brightnessup # Fn+F8 brightness up
KEYBOARD_KEY_71=battery # Fn+F4 ECO
########################################################### ###########################################################
# Olimex # Olimex
########################################################### ###########################################################

View File

@ -561,7 +561,7 @@
<varlistentry> <varlistentry>
<term><constant>SD_BUS_VTABLE_CAPABILITY(<replaceable>capability</replaceable>)</constant></term> <term><constant>SD_BUS_VTABLE_CAPABILITY(<replaceable>capability</replaceable>)</constant></term>
<listitem><para>Access to this vtable entry will be allowed if the calling proccess has the <listitem><para>Access to this vtable entry will be allowed if the calling process has the
capability <replaceable>capability</replaceable>, as described in capability <replaceable>capability</replaceable>, as described in
<citerefentry><refentrytitle>sd_bus_query_sender_privilege</refentrytitle><manvolnum>3</manvolnum></citerefentry>. <citerefentry><refentrytitle>sd_bus_query_sender_privilege</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
If used for <constant>SD_BUS_VTABLE_START()</constant>, provides a default for all entries in the If used for <constant>SD_BUS_VTABLE_START()</constant>, provides a default for all entries in the

View File

@ -361,7 +361,7 @@ possible_common_cc_flags = [
'-Wno-string-plus-int', # clang '-Wno-string-plus-int', # clang
] ]
# Disable -Wmaybe-unitialized when compiling with -Os/-O1/-O3/etc. There are # Disable -Wmaybe-uninitialized when compiling with -Os/-O1/-O3/etc. There are
# too many false positives with gcc >= 8. Effectively, we only test with -O0 # too many false positives with gcc >= 8. Effectively, we only test with -O0
# and -O2; this should be enough to catch most important cases without too much # and -O2; this should be enough to catch most important cases without too much
# busywork. See https://github.com/systemd/systemd/pull/19226. # busywork. See https://github.com/systemd/systemd/pull/19226.

View File

@ -928,12 +928,13 @@ static int detach_image(int argc, char *argv[], void *userdata) {
if (r < 0) if (r < 0)
return r; return r;
if (!strv_isempty(arg_extension_images)) { if (strv_isempty(arg_extension_images))
r = sd_bus_message_append(m, "b", arg_runtime);
else {
uint64_t flags = arg_runtime ? PORTABLE_RUNTIME : 0; uint64_t flags = arg_runtime ? PORTABLE_RUNTIME : 0;
r = sd_bus_message_append(m, "t", flags); r = sd_bus_message_append(m, "t", flags);
} else }
r = sd_bus_message_append(m, "b", arg_runtime);
if (r < 0) if (r < 0)
return bus_log_create_error(r); return bus_log_create_error(r);

View File

@ -109,7 +109,6 @@ int bus_image_common_get_metadata(
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
_cleanup_free_ PortableMetadata **sorted = NULL; _cleanup_free_ PortableMetadata **sorted = NULL;
PortableFlags flags = 0; PortableFlags flags = 0;
size_t i;
int r; int r;
assert(name_or_path || image); assert(name_or_path || image);
@ -217,7 +216,7 @@ int bus_image_common_get_metadata(
} }
} }
for (i = 0; i < hashmap_size(unit_files); i++) { for (size_t i = 0; i < hashmap_size(unit_files); i++) {
r = sd_bus_message_open_container(reply, 'e', "say"); r = sd_bus_message_open_container(reply, 'e', "say");
if (r < 0) if (r < 0)

View File

@ -230,7 +230,7 @@ static int update_pretimeout(void) {
/* If we have a pretimeout governor, then pretimeout is supported. Without a governor /* If we have a pretimeout governor, then pretimeout is supported. Without a governor
* pretimeout does not work at all. * pretimeout does not work at all.
* Note that this might require a kernel module that is not autoloaded, so we don't * Note that this might require a kernel module that is not autoloaded, so we don't
* cache this, but we check everytime the configuration changes. */ * cache this, but we check every time the configuration changes. */
watchdog_supports_pretimeout = true; watchdog_supports_pretimeout = true;
/* Determine if the pretimeout is valid for the current watchdog timeout. */ /* Determine if the pretimeout is valid for the current watchdog timeout. */

View File

@ -607,7 +607,7 @@ ExecStart=sleep 120
EOF EOF
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-foo.service" cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_0.raw" -noappend mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_0.raw" -noappend -quiet
veritysetup format "$oldinitdir/usr/share/minimal_0.raw" "$oldinitdir/usr/share/minimal_0.verity" | \ veritysetup format "$oldinitdir/usr/share/minimal_0.raw" "$oldinitdir/usr/share/minimal_0.verity" | \
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_0.roothash" grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_0.roothash"
@ -615,7 +615,7 @@ EOF
rm "$initdir/usr/lib/systemd/system/minimal-app0-foo.service" rm "$initdir/usr/lib/systemd/system/minimal-app0-foo.service"
cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-bar.service" cp "$initdir/usr/lib/systemd/system/minimal-app0.service" "$initdir/usr/lib/systemd/system/minimal-app0-bar.service"
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend -quiet
veritysetup format "$oldinitdir/usr/share/minimal_1.raw" "$oldinitdir/usr/share/minimal_1.verity" | \ veritysetup format "$oldinitdir/usr/share/minimal_1.raw" "$oldinitdir/usr/share/minimal_1.verity" | \
grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_1.roothash" grep '^Root hash:' | cut -f2 | tr -d '\n' >"$oldinitdir/usr/share/minimal_1.roothash"
@ -647,7 +647,7 @@ cat /usr/lib/extension-release.d/extension-release.app0
EOF EOF
chmod +x "$initdir/opt/script0.sh" chmod +x "$initdir/opt/script0.sh"
echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file" echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file"
mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend -quiet
export initdir="$TESTDIR/app1" export initdir="$TESTDIR/app1"
mkdir -p "$initdir/usr/lib/extension-release.d" "$initdir/usr/lib/systemd/system" "$initdir/opt" mkdir -p "$initdir/usr/lib/extension-release.d" "$initdir/usr/lib/systemd/system" "$initdir/opt"
@ -673,7 +673,7 @@ cat /usr/lib/extension-release.d/extension-release.app2
EOF EOF
chmod +x "$initdir/opt/script1.sh" chmod +x "$initdir/opt/script1.sh"
echo MARKER=1 >"$initdir/usr/lib/systemd/system/other_file" echo MARKER=1 >"$initdir/usr/lib/systemd/system/other_file"
mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend -quiet
) )
} }

View File

@ -31,21 +31,13 @@ portablectl "${ARGS[@]}" attach --now --runtime /usr/share/minimal_0.raw minimal
systemctl is-active minimal-app0.service systemctl is-active minimal-app0.service
systemctl is-active minimal-app0-foo.service systemctl is-active minimal-app0-foo.service
set +o pipefail
set +e
systemctl is-active minimal-app0-bar.service && exit 1 systemctl is-active minimal-app0-bar.service && exit 1
set -e
set -o pipefail
portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0 portablectl "${ARGS[@]}" reattach --now --runtime /usr/share/minimal_1.raw minimal-app0
systemctl is-active minimal-app0.service systemctl is-active minimal-app0.service
systemctl is-active minimal-app0-bar.service systemctl is-active minimal-app0-bar.service
set +o pipefail
set +e
systemctl is-active minimal-app0-foo.service && exit 1 systemctl is-active minimal-app0-foo.service && exit 1
set -e
set -o pipefail
portablectl list | grep -q -F "minimal_1" portablectl list | grep -q -F "minimal_1"
@ -55,28 +47,20 @@ portablectl list | grep -q -F "No images."
# portablectl also works with directory paths rather than images # portablectl also works with directory paths rather than images
unsquashfs -dest /tmp/minimal_0 /usr/share/minimal_0.raw unsquashfs -q -dest /tmp/minimal_0 /usr/share/minimal_0.raw
unsquashfs -dest /tmp/minimal_1 /usr/share/minimal_1.raw unsquashfs -q -dest /tmp/minimal_1 /usr/share/minimal_1.raw
portablectl "${ARGS[@]}" attach --copy=symlink --now --runtime /tmp/minimal_0 minimal-app0 portablectl "${ARGS[@]}" attach --copy=symlink --now --runtime /tmp/minimal_0 minimal-app0
systemctl is-active minimal-app0.service systemctl is-active minimal-app0.service
systemctl is-active minimal-app0-foo.service systemctl is-active minimal-app0-foo.service
set +o pipefail
set +e
systemctl is-active minimal-app0-bar.service && exit 1 systemctl is-active minimal-app0-bar.service && exit 1
set -e
set -o pipefail
portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0 portablectl "${ARGS[@]}" reattach --now --enable --runtime /tmp/minimal_1 minimal-app0
systemctl is-active minimal-app0.service systemctl is-active minimal-app0.service
systemctl is-active minimal-app0-bar.service systemctl is-active minimal-app0-bar.service
set +o pipefail
set +e
systemctl is-active minimal-app0-foo.service && exit 1 systemctl is-active minimal-app0-foo.service && exit 1
set -e
set -o pipefail
portablectl list | grep -q -F "minimal_1" portablectl list | grep -q -F "minimal_1"