1
0
mirror of https://github.com/systemd/systemd synced 2026-03-26 08:44:55 +01:00

Compare commits

..

11 Commits

Author SHA1 Message Date
Luca Boccassi
af80c9c224 test: use -force with unsquashfs for test reruns
In case a test is reran or a directory reused, overwrite it
instead of failing
2025-12-09 14:41:59 +09:00
Luca Boccassi
2abb433ca1 shell-completion: fix portablectl path completion with preceding params
The completion fails to complete to paths for verbs that need them when
a --param is the previous word, e.g.:

portablectl attach --runtime <tab>

fails to complete to paths
2025-12-09 14:39:07 +09:00
Lukáš Zaoral
1e5498e237 ukify: prefer compression.zstd when available
Python 3.14 introduced support for zstd in the standard library [1].  Therefore,
let's prefer it when available to decrease the number of necessary  external
dependencies.

[1] https://docs.python.org/3/whatsnew/3.14.html#whatsnew314-zstandard
2025-12-09 14:37:22 +09:00
David Tardon
7cfd4f3f51 find-esp: consistently quote paths in log messages 2025-12-09 14:36:31 +09:00
David Tardon
50482aced5 find-esp: replace assert by a runtime check
The path--as a whole--is no longer being opened with O_DIRECTORY, hence
the assertion is not valid.

Reproducer:
 # SYSTEMD_RELAX_ESP_CHECKS=1 bootctl list --esp-path=`pwd`/README
 Assertion 'S_ISDIR(sxa.stx_mode)' failed at src/shared/find-esp.c:295, function verify_fsroot_dir(). Aborting.

Follow-up-for: 63105f33edad423691e2d53bf7071f99c83799ba

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2417917
2025-12-09 14:36:31 +09:00
Yu Watanabe
a28ed65f4c
meson: a variety of build portability fixes (#40012)
This is for packaging systemd in Chimera Linux, which uses BSD-style
userland tools, alongside musl.
2025-12-09 14:35:22 +09:00
Luca Boccassi
28c68dbea0 portabled: list new methods in D-Bus policy
Access to these methods is also managed via polkit,
but they were never added to the access list in the
D-Bus policy.

Follow-up for 907952bbc92dd6656807d9b2eb0d0c94a4c9e865
2025-12-09 12:00:59 +09:00
q66
3d64cb9a54 vcs-tag.sh: use portable sed argument order 2025-12-08 21:35:28 +01:00
q66
abf73cb072 meson: try BSD-style date(1) for alt_time_epoch as a fallback
If we fail to calculate alt_time_epoch using the GNU-style syntax,
try if BSD-style syntax does not work. Fail for real if that does
not work either.
2025-12-08 21:35:28 +01:00
q66
57f911973a meson: try BSD-style stat(1) syntax when failing mtime check
The system may be using a stat(1) implementation that follows
BSD-style syntax. Try that as a fallback, but do fail for real
if that also fails.
2025-12-08 21:35:28 +01:00
q66
f40bd7af20 meson: drop ln --relative check
The coreutils release that included this was in 2012. Since then,
systemd requires a newer meson, mostly uses install_symlink, and
so on. Additionally, where it does use this feature, it uses the
'-r' short flag. There are implementations of 'ln' that do have
support for '-r' but no longopts. Things will still work on those
but this check will fail.
2025-12-08 21:35:28 +01:00
11 changed files with 87 additions and 35 deletions

View File

@ -659,10 +659,6 @@ foreach prog : progs
conf.set_quoted(name, path) conf.set_quoted(name, path)
endforeach endforeach
if run_command(ln, '--relative', '--help', check : false).returncode() != 0
error('ln does not support --relative (added in coreutils 8.16)')
endif
##################################################################### #####################################################################
gperf_test_format = ''' gperf_test_format = '''
@ -779,7 +775,13 @@ if time_epoch <= 0
if time_epoch == '' if time_epoch == ''
NEWS = files('NEWS') NEWS = files('NEWS')
time_epoch = run_command(stat, '-c', '%Y', NEWS, time_epoch = run_command(stat, '-c', '%Y', NEWS,
check : true).stdout() check : false)
if time_epoch.returncode() != 0
# If the above fails, maybe the stat(1) uses BSD-style syntax
time_epoch = run_command(stat, '-f', '%m', NEWS,
check : true)
endif
time_epoch = time_epoch.stdout()
endif endif
time_epoch = time_epoch.strip().to_int() time_epoch = time_epoch.strip().to_int()
endif endif
@ -3026,8 +3028,12 @@ if conf.get('ENABLE_HWDB') == 1
alias_target('hwdb', auto_suspend_rules, executables_by_name.get('systemd-hwdb'), hwdb_units) alias_target('hwdb', auto_suspend_rules, executables_by_name.get('systemd-hwdb'), hwdb_units)
endif endif
alt_time_epoch = run_command('date', '-Is', '-u', '-d', f'@@time_epoch@', alt_time_epoch = run_command('date', '-Is', '-u', '-d', f'@@time_epoch@', check : false)
check : true).stdout().strip() if alt_time_epoch.returncode() != 0
# If the above fails, maybe the date(1) uses BSD-style syntax
alt_time_epoch = run_command('date', '-Iseconds', '-u', '-r', f'@time_epoch@', check : true)
endif
alt_time_epoch = alt_time_epoch.stdout().strip()
summary({ summary({
'split bin-sbin' : split_bin, 'split bin-sbin' : split_bin,

View File

@ -91,7 +91,7 @@ _portablectl() {
elif __contains_word "$verb" ${VERBS[STANDALONE]}; then elif __contains_word "$verb" ${VERBS[STANDALONE]}; then
comps='' comps=''
elif __contains_word "$verb" ${VERBS[IMAGE]}; then elif __contains_word "$verb" ${VERBS[IMAGE]}; then
if [[ $n == 1 ]]; then if [[ $n == 1 ]] || [[ "$prev" = -* ]] || __contains_word "${COMP_WORDS[COMP_CWORD-2]}" ${OPTS[ARG]}; then
comps=$( compgen -A file -- "$cur" ) comps=$( compgen -A file -- "$cur" )
compopt -o filenames compopt -o filenames
else else
@ -101,10 +101,10 @@ _portablectl() {
comps=$( compgen -A file -- "$cur" ) comps=$( compgen -A file -- "$cur" )
compopt -o filenames compopt -o filenames
elif __contains_word "$verb" ${VERBS[IMAGE_WITH_BOOL]}; then elif __contains_word "$verb" ${VERBS[IMAGE_WITH_BOOL]}; then
if [[ $n == 1 ]]; then if [[ $n == 1 ]] || [[ "$prev" = -* ]] || __contains_word "${COMP_WORDS[COMP_CWORD-2]}" ${OPTS[ARG]}; then
comps=$( compgen -A file -- "$cur" ) comps=$( compgen -A file -- "$cur" )
compopt -o filenames compopt -o filenames
elif [[ $n == 2 ]]; then elif ! __contains_word "$prev" "yes" "no" && { [[ $n == 2 ]] || [[ "$prev" != -* ]]; }; then
comps='yes no' comps='yes no'
else else
comps='' comps=''

View File

@ -49,14 +49,26 @@
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="GetImageMetadata"/> send_member="GetImageMetadata"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager"
send_member="GetImageMetadataWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="GetImageState"/> send_member="GetImageState"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager"
send_member="GetImageStateWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="AttachImage"/> send_member="AttachImage"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager"
send_member="AttachImageWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="DetachImage"/> send_member="DetachImage"/>
@ -65,6 +77,10 @@
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="ReattachImage"/> send_member="ReattachImage"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager"
send_member="ReattachImageWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Manager" send_interface="org.freedesktop.portable1.Manager"
send_member="RemoveImage"/> send_member="RemoveImage"/>
@ -91,22 +107,42 @@
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="GetMetadata"/> send_member="GetMetadata"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
send_member="GetMetadataWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="GetState"/> send_member="GetState"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
send_member="GetStateWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="Attach"/> send_member="Attach"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
send_member="AttachWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="Detach"/> send_member="Detach"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
send_member="DetachWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="Reattach"/> send_member="Reattach"/>
<allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image"
send_member="ReattachWithExtensions"/>
<allow send_destination="org.freedesktop.portable1" <allow send_destination="org.freedesktop.portable1"
send_interface="org.freedesktop.portable1.Image" send_interface="org.freedesktop.portable1.Image"
send_member="Remove"/> send_member="Remove"/>

View File

@ -283,7 +283,7 @@ static int verify_fsroot_dir(
r = path_extract_filename(path, &f); r = path_extract_filename(path, &f);
if (r < 0 && r != -EADDRNOTAVAIL) if (r < 0 && r != -EADDRNOTAVAIL)
return log_error_errno(r, "Failed to extract filename of %s: %m", path); return log_error_errno(r, "Failed to extract filename of \"%s\": %m", path);
if (statx(dir_fd, strempty(f), if (statx(dir_fd, strempty(f),
AT_SYMLINK_NOFOLLOW|(isempty(f) ? AT_EMPTY_PATH : 0), AT_SYMLINK_NOFOLLOW|(isempty(f) ? AT_EMPTY_PATH : 0),
@ -292,7 +292,8 @@ static int verify_fsroot_dir(
(unprivileged_mode && ERRNO_IS_PRIVILEGE(errno)) ? LOG_DEBUG : LOG_ERR, errno, (unprivileged_mode && ERRNO_IS_PRIVILEGE(errno)) ? LOG_DEBUG : LOG_ERR, errno,
"Failed to determine block device node of \"%s\": %m", path); "Failed to determine block device node of \"%s\": %m", path);
assert(S_ISDIR(sxa.stx_mode)); /* We used O_DIRECTORY above, when opening, so this must hold */ if (!S_ISDIR(sxa.stx_mode))
return log_error_errno(SYNTHETIC_ERRNO(ENOTDIR), "Path \"%s\" is not a directory", path);
if (FLAGS_SET(sxa.stx_attributes_mask, STATX_ATTR_MOUNT_ROOT)) { if (FLAGS_SET(sxa.stx_attributes_mask, STATX_ATTR_MOUNT_ROOT)) {
@ -375,13 +376,13 @@ static int verify_esp(
r = path_extract_filename(p, &f); r = path_extract_filename(p, &f);
if (r < 0 && r != -EADDRNOTAVAIL) if (r < 0 && r != -EADDRNOTAVAIL)
return log_error_errno(r, "Failed to extract filename of %s: %m", p); return log_error_errno(r, "Failed to extract filename of \"%s\": %m", p);
/* Trigger any automounts so that xstatfsat() operates on the mount instead of the mountpoint /* Trigger any automounts so that xstatfsat() operates on the mount instead of the mountpoint
* directory. */ * directory. */
r = trigger_automount_at(pfd, f); r = trigger_automount_at(pfd, f);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to trigger automount at %s: %m", p); return log_error_errno(r, "Failed to trigger automount at \"%s\": %m", p);
r = xstatfsat(pfd, strempty(f), &sfs); r = xstatfsat(pfd, strempty(f), &sfs);
if (r < 0) if (r < 0)
@ -481,12 +482,12 @@ int find_esp_and_warn_at(
if (!path_is_valid(path) || !path_is_absolute(path)) if (!path_is_valid(path) || !path_is_absolute(path))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"$SYSTEMD_ESP_PATH does not refer to an absolute path, refusing to use it: %s", "$SYSTEMD_ESP_PATH does not refer to an absolute path, refusing to use it: \"%s\"",
path); path);
r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd); r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to resolve path %s: %m", path); return log_error_errno(r, "Failed to resolve path \"%s\": %m", path);
/* Note: when the user explicitly configured things with an env var we won't validate the /* Note: when the user explicitly configured things with an env var we won't validate the
* path beyond checking it refers to a directory. After all we want this to be useful for * path beyond checking it refers to a directory. After all we want this to be useful for
@ -833,12 +834,12 @@ int find_xbootldr_and_warn_at(
if (!path_is_valid(path) || !path_is_absolute(path)) if (!path_is_valid(path) || !path_is_absolute(path))
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"$SYSTEMD_XBOOTLDR_PATH does not refer to an absolute path, refusing to use it: %s", "$SYSTEMD_XBOOTLDR_PATH does not refer to an absolute path, refusing to use it: \"%s\"",
path); path);
r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd); r = chaseat(rfd, path, CHASE_AT_RESOLVE_IN_ROOT|CHASE_TRIGGER_AUTOFS, &p, &fd);
if (r < 0) if (r < 0)
return log_error_errno(r, "Failed to resolve path %s: %m", p); return log_error_errno(r, "Failed to resolve path \"%s\": %m", p);
if (fstat(fd, &st) < 0) if (fstat(fd, &st) < 0)
return log_error_errno(errno, "Failed to stat '%s': %m", p); return log_error_errno(errno, "Failed to stat '%s': %m", p);

View File

@ -198,9 +198,14 @@ def get_zboot_kernel(f: IO[bytes]) -> bytes:
elif comp_type.startswith(b'xzkern'): elif comp_type.startswith(b'xzkern'):
raise NotImplementedError('xzkern decompression not implemented') raise NotImplementedError('xzkern decompression not implemented')
elif comp_type.startswith(b'zstd'): elif comp_type.startswith(b'zstd'):
zstd = try_import('zstandard') try:
data = f.read(size) zstd = try_import('compression.zstd')
return cast(bytes, zstd.ZstdDecompressor().stream_reader(data).read()) data = f.read(size)
return cast(bytes, zstd.zstd.ZstdDecompressor().decompress(data))
except ValueError:
zstd = try_import('zstandard')
data = f.read(size)
return cast(bytes, zstd.ZstdDecompressor().stream_reader(data).read())
raise NotImplementedError(f'unknown compressed type: {comp_type!r}') raise NotImplementedError(f'unknown compressed type: {comp_type!r}')
@ -230,8 +235,12 @@ def maybe_decompress(filename: Union[str, Path]) -> bytes:
return cast(bytes, gzip.open(f).read()) return cast(bytes, gzip.open(f).read())
if start.startswith(b'\x28\xb5\x2f\xfd'): if start.startswith(b'\x28\xb5\x2f\xfd'):
zstd = try_import('zstandard') try:
return cast(bytes, zstd.ZstdDecompressor().stream_reader(f.read()).read()) zstd = try_import('compression.zstd')
return cast(bytes, zstd.zstd.ZstdDecompressor().decompress(f.read()))
except ValueError:
zstd = try_import('zstandard')
return cast(bytes, zstd.ZstdDecompressor().stream_reader(f.read()).read())
if start.startswith(b'\x02\x21\x4c\x18'): if start.startswith(b'\x02\x21\x4c\x18'):
lz4 = try_import('lz4.frame', 'lz4') lz4 = try_import('lz4.frame', 'lz4')

View File

@ -70,7 +70,7 @@ testcase_user_manager() {
} }
testcase_multiple_features() { testcase_multiple_features() {
unsquashfs -no-xattrs -d /tmp/TEST-07-PID1-delegate-namespaces-root /usr/share/minimal_0.raw unsquashfs -force -no-xattrs -d /tmp/TEST-07-PID1-delegate-namespaces-root /usr/share/minimal_0.raw
systemd-run \ systemd-run \
-p PrivatePIDs=yes \ -p PrivatePIDs=yes \

View File

@ -90,7 +90,7 @@ EOF
} }
testcase_multiple_features() { testcase_multiple_features() {
unsquashfs -no-xattrs -d /tmp/TEST-07-PID1-private-pids-root /usr/share/minimal_0.raw unsquashfs -force -no-xattrs -d /tmp/TEST-07-PID1-private-pids-root /usr/share/minimal_0.raw
systemd-run \ systemd-run \
-p PrivatePIDs=yes \ -p PrivatePIDs=yes \

View File

@ -17,8 +17,8 @@ if [[ -v ASAN_OPTIONS || -v UBSAN_OPTIONS ]]; then
ARGS+=(--profile=trusted) ARGS+=(--profile=trusted)
fi fi
unsquashfs -no-xattrs -d /tmp/minimal_0 /usr/share/minimal_0.raw unsquashfs -force -no-xattrs -d /tmp/minimal_0 /usr/share/minimal_0.raw
unsquashfs -no-xattrs -d /tmp/minimal_1 /usr/share/minimal_1.raw unsquashfs -force -no-xattrs -d /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

View File

@ -113,7 +113,7 @@ if sysctl kernel.dmesg_restrict=0; then
dmesg) dmesg)
fi fi
unsquashfs -no-xattrs -d /tmp/img /usr/share/minimal_0.raw unsquashfs -force -no-xattrs -d /tmp/img /usr/share/minimal_0.raw
runas testuser systemd-run --wait --user --unit=test-root-dir \ runas testuser systemd-run --wait --user --unit=test-root-dir \
-p RootDirectory=/tmp/img \ -p RootDirectory=/tmp/img \
grep MARKER=1 /etc/os-release grep MARKER=1 /etc/os-release
@ -128,7 +128,7 @@ umount /tmp/img_bind
# Unprivileged overlayfs was added to Linux 5.11, so try to detect it first # Unprivileged overlayfs was added to Linux 5.11, so try to detect it first
mkdir -p /tmp/a /tmp/b /tmp/c mkdir -p /tmp/a /tmp/b /tmp/c
if unshare --mount --user --map-root-user mount -t overlay overlay /tmp/c -o lowerdir=/tmp/a:/tmp/b; then if unshare --mount --user --map-root-user mount -t overlay overlay /tmp/c -o lowerdir=/tmp/a:/tmp/b; then
unsquashfs -no-xattrs -d /tmp/app2 /tmp/app1.raw unsquashfs -force -no-xattrs -d /tmp/app2 /tmp/app1.raw
runas testuser systemd-run --wait --user --unit=test-extension-dir \ runas testuser systemd-run --wait --user --unit=test-extension-dir \
-p ExtensionDirectories=/tmp/app2 \ -p ExtensionDirectories=/tmp/app2 \
-p TemporaryFileSystem=/run -p RootDirectory=/tmp/img \ -p TemporaryFileSystem=/run -p RootDirectory=/tmp/img \

View File

@ -704,7 +704,7 @@ grep -q -F "MARKER=1" /tmp/markers/50i
systemctl stop testservice-50i.service systemctl stop testservice-50i.service
rm -f /run/systemd/system/testservice-50i.service rm -f /run/systemd/system/testservice-50i.service
unsquashfs -no-xattrs -d /tmp/vpickminimg "$MINIMAL_IMAGE.raw" unsquashfs -force -no-xattrs -d /tmp/vpickminimg "$MINIMAL_IMAGE.raw"
cat >/run/systemd/system/testservice-50j.service <<EOF cat >/run/systemd/system/testservice-50j.service <<EOF
[Service] [Service]
Type=notify-reload Type=notify-reload
@ -903,7 +903,7 @@ systemd-confext status
systemd-confext unmerge systemd-confext unmerge
rm -rf /run/confexts/ rm -rf /run/confexts/
unsquashfs -no-xattrs -d /tmp/img "$MINIMAL_IMAGE.raw" unsquashfs -force -no-xattrs -d /tmp/img "$MINIMAL_IMAGE.raw"
systemd-run --unit=test-root-ephemeral \ systemd-run --unit=test-root-ephemeral \
-p RootDirectory=/tmp/img \ -p RootDirectory=/tmp/img \
-p RootEphemeral=yes \ -p RootEphemeral=yes \
@ -935,7 +935,7 @@ echo "ARCHITECTURE=_any" >>testkit/usr/lib/extension-release.d/extension-release
echo "MARKER_SYSEXT_123" >testkit/usr/lib/testfile echo "MARKER_SYSEXT_123" >testkit/usr/lib/testfile
mksquashfs testkit/ testkit.raw -noappend mksquashfs testkit/ testkit.raw -noappend
cp testkit.raw /run/extensions/ cp testkit.raw /run/extensions/
unsquashfs -l /run/extensions/testkit.raw unsquashfs -force -l /run/extensions/testkit.raw
systemd-dissect --no-pager /run/extensions/testkit.raw | grep -q '✓ sysext for portable service' systemd-dissect --no-pager /run/extensions/testkit.raw | grep -q '✓ sysext for portable service'
systemd-dissect --no-pager /run/extensions/testkit.raw | grep -q '✓ sysext for system' systemd-dissect --no-pager /run/extensions/testkit.raw | grep -q '✓ sysext for system'
systemd-sysext merge systemd-sysext merge
@ -951,7 +951,7 @@ echo "ARCHITECTURE=_any" >>testjob/etc/extension-release.d/extension-release.tes
echo "MARKER_CONFEXT_123" >testjob/etc/testfile echo "MARKER_CONFEXT_123" >testjob/etc/testfile
mksquashfs testjob/ testjob.raw -noappend mksquashfs testjob/ testjob.raw -noappend
cp testjob.raw /run/confexts/ cp testjob.raw /run/confexts/
unsquashfs -l /run/confexts/testjob.raw unsquashfs -force -l /run/confexts/testjob.raw
systemd-dissect --no-pager /run/confexts/testjob.raw | grep -q '✓ confext for system' systemd-dissect --no-pager /run/confexts/testjob.raw | grep -q '✓ confext for system'
systemd-dissect --no-pager /run/confexts/testjob.raw | grep -q '✓ confext for portable service' systemd-dissect --no-pager /run/confexts/testjob.raw | grep -q '✓ confext for portable service'
systemd-confext merge systemd-confext merge

View File

@ -8,7 +8,7 @@ ENABLED="$3"
if ! ((ENABLED)) || ! [[ -d .git ]] || ! command -v git >/dev/null || git describe --tags --exact-match &>/dev/null if ! ((ENABLED)) || ! [[ -d .git ]] || ! command -v git >/dev/null || git describe --tags --exact-match &>/dev/null
then then
sed "$INPUT" -e "s/@VCS_TAG@//" sed -e "s/@VCS_TAG@//" "$INPUT"
exit 0 exit 0
fi fi
@ -20,4 +20,4 @@ fi
TAG="-g$(git describe --abbrev=7 --match="" --always $DIRTY)" TAG="-g$(git describe --abbrev=7 --match="" --always $DIRTY)"
sed "$INPUT" -e "s/@VCS_TAG@/$TAG/" sed -e "s/@VCS_TAG@/$TAG/" "$INPUT"