1
0
mirror of https://github.com/systemd/systemd synced 2026-04-22 15:04:49 +02:00

Compare commits

..

No commits in common. "da637c8fcad1baa530578982d41a6ecb1440f7c5" and "55c09511e13c6a57ffe64bef4a9d0a00f34d37d9" have entirely different histories.

10 changed files with 33 additions and 34 deletions

View File

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

View File

@ -334,10 +334,3 @@ behaviour, by setting the `ProtectSystem=strict` option. In this case writable
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
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,17 +1345,6 @@ evdev:name:MSI Laptop hotkeys:dmi:bvn*:bvr*:bd*:svn*:pnM[iI][cC][rR][oO]-S[tT][a
KEYBOARD_KEY_0213=f22
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
###########################################################

View File

@ -561,7 +561,7 @@
<varlistentry>
<term><constant>SD_BUS_VTABLE_CAPABILITY(<replaceable>capability</replaceable>)</constant></term>
<listitem><para>Access to this vtable entry will be allowed if the calling process has the
<listitem><para>Access to this vtable entry will be allowed if the calling proccess has the
capability <replaceable>capability</replaceable>, as described in
<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

View File

@ -361,7 +361,7 @@ possible_common_cc_flags = [
'-Wno-string-plus-int', # clang
]
# Disable -Wmaybe-uninitialized when compiling with -Os/-O1/-O3/etc. There are
# Disable -Wmaybe-unitialized when compiling with -Os/-O1/-O3/etc. There are
# 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
# busywork. See https://github.com/systemd/systemd/pull/19226.

View File

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

View File

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

View File

@ -607,7 +607,7 @@ ExecStart=sleep 120
EOF
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 -quiet
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_0.raw" -noappend
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"
@ -615,7 +615,7 @@ EOF
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"
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend -quiet
mksquashfs "$initdir" "$oldinitdir/usr/share/minimal_1.raw" -noappend
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"
@ -647,7 +647,7 @@ cat /usr/lib/extension-release.d/extension-release.app0
EOF
chmod +x "$initdir/opt/script0.sh"
echo MARKER=1 >"$initdir/usr/lib/systemd/system/some_file"
mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend -quiet
mksquashfs "$initdir" "$oldinitdir/usr/share/app0.raw" -noappend
export initdir="$TESTDIR/app1"
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
chmod +x "$initdir/opt/script1.sh"
echo MARKER=1 >"$initdir/usr/lib/systemd/system/other_file"
mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend -quiet
mksquashfs "$initdir" "$oldinitdir/usr/share/app1.raw" -noappend
)
}

View File

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