elogind: update to 255.22.

Co-authored-by: Daniel Martinez <danielpedromartinez@duck.com>
Co-authored-by: oreo639 <oreo6391@gmail.com>
This commit is contained in:
Komeil Parseh
2026-01-08 17:38:09 -08:00
committed by oreo639
co-authored by Daniel Martinez oreo639
parent 2db6e799ff
commit 589788a74f
10 changed files with 143 additions and 192 deletions
+9 -9
View File
@@ -2,19 +2,15 @@ Upstream:no
Our musl version doesn't expose the SEEK_DATA and SEEK_HOLE in `unisted.h`...
Only version >= 1.2.3 do that.
---
src/shared/copy.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/shared/copy.h b/src/shared/copy.h
index a34a87c..d258afc 100644
index 7cf74f3b5..ab2eeea1d 100644
--- a/src/shared/copy.h
+++ b/src/shared/copy.h
@@ -79,3 +79,11 @@ static inline int copy_rights(int fdf, int fdt) {
@@ -93,6 +93,14 @@ static inline int copy_directory_at(int dir_fdf, const char *from, int dir_fdt,
}
int copy_xattr(int fdf, int fdt, CopyFlags copy_flags);
#endif // 0
+
+#ifndef SEEK_DATA
+#define SEEK_DATA 3
+#endif
@@ -22,5 +18,9 @@ index a34a87c..d258afc 100644
+#ifndef SEEK_HOLE
+#define SEEK_HOLE 4
+#endif
--
2.42.0
+
int copy_bytes_full(int fdf, int fdt, uint64_t max_bytes, CopyFlags copy_flags, void **ret_remains, size_t *ret_remains_size, copy_progress_bytes_t progress, void *userdata);
static inline int copy_bytes(int fdf, int fdt, uint64_t max_bytes, CopyFlags copy_flags) {
return copy_bytes_full(fdf, fdt, max_bytes, copy_flags, NULL, NULL, NULL, NULL);
--
2.50.1
@@ -0,0 +1,13 @@
diff --git a/src/libelogind/sd-journal/journal-file.h b/src/libelogind/sd-journal/journal-file.h
index c3c5f59..3e62495 100644
--- a/src/libelogind/sd-journal/journal-file.h
+++ b/src/libelogind/sd-journal/journal-file.h
@@ -3,6 +3,7 @@
#include <fcntl.h>
#include <inttypes.h>
+#include <sys/stat.h>
//#include <sys/uio.h>
#if HAVE_GCRYPT
@@ -1,42 +0,0 @@
Add missing include for POSIX basename, since systemd-logind expects basename in string.h
diff -rup src/basic/musl_missing.h.orig src/basic/musl_missing.h
--- a/src/basic/musl_missing.h
+++ b/src/basic/musl_missing.h
@@ -56,6 +54,10 @@ void elogind_set_program_name(const char
} ) )
#endif
+/* Poor man's basename */
+#define basename(path) \
+ (strrchr(path, '/') ? strrchr(path, '/')+1 : path)
+
/* getnameinfo(3) glibc extensions are undefined in musl libc */
#define NI_IDN 0
#define NI_IDN_USE_STD3_ASCII_RULES 0
From c8d96ff2b87b8dfb8d521d4c2e6fb57992dbf659 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 21 Dec 2022 16:13:23 +0100
Subject: [PATCH] tests: we don't actually use basename() anymore
---
src/shared/tests.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/src/shared/tests.c b/src/shared/tests.c
index 5a05daa643..9d8bbeea79 100644
--- a/src/shared/tests.c
+++ b/src/shared/tests.c
@@ -7,12 +7,6 @@
#include <sys/mount.h>
#include <sys/wait.h>
-/* When we include libgen.h because we need dirname() we immediately
- * undefine basename() since libgen.h defines it as a macro to the POSIX
- * version which is really broken. We prefer GNU basename(). */
-#include <libgen.h>
-#undef basename
-
#include "sd-bus.h"
#include "alloc-util.h"
@@ -1,58 +0,0 @@
From 4eddcc680ba6ffff6f3de2657df3e7ec1a4f3d88 Mon Sep 17 00:00:00 2001
From: Sam James <sam@gentoo.org>
Date: Wed, 10 May 2023 01:47:13 +0100
Subject: [PATCH] dirent: conditionalize dirent assert based on dirent64
existence
>=musl-1.2.4 doesn't define dirent64 and its LFS friends as its "native"
functions are already LFS-aware.
Check for dirent64 in meson.build and only assert if it exists.
Bug: https://bugs.gentoo.org/905900
Closes: https://github.com/systemd/systemd/pull/25809
---
meson.build | 2 ++
src/basic/dirent-util.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/meson.build b/meson.build
index 31c348d969..addd0fd44e 100644
--- a/meson.build
+++ b/meson.build
@@ -637,6 +637,7 @@ decl_headers = '''
# define _GNU_SOURCE 1
# endif // _GNU_SOURCE
#endif // 1
+#include <dirent.h>
#include <uchar.h>
#include <sys/mount.h>
#include <sys/stat.h>
@@ -646,6 +647,7 @@ foreach decl : ['char16_t',
'char32_t',
'struct mount_attr',
'struct statx',
+ 'struct dirent64',
]
# We get -1 if the size cannot be determined
diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
index 7606a7d2d8..552c4f997a 100644
--- a/src/basic/dirent-util.h
+++ b/src/basic/dirent-util.h
@@ -40,6 +40,7 @@ struct dirent *readdir_no_dot(DIR *dirp);
/* Only if 64bit off_t is enabled struct dirent + struct dirent64 are actually the same. We require this, and
* we want them to be interchangeable to make getdents64() work, hence verify that. */
assert_cc(_FILE_OFFSET_BITS == 64);
+#if HAVE_STRUCT_DIRENT64
assert_cc(sizeof(struct dirent) == sizeof(struct dirent64));
assert_cc(offsetof(struct dirent, d_ino) == offsetof(struct dirent64, d_ino));
assert_cc(sizeof_field(struct dirent, d_ino) == sizeof_field(struct dirent64, d_ino));
@@ -51,6 +52,7 @@ assert_cc(offsetof(struct dirent, d_type) == offsetof(struct dirent64, d_type));
assert_cc(sizeof_field(struct dirent, d_type) == sizeof_field(struct dirent64, d_type));
assert_cc(offsetof(struct dirent, d_name) == offsetof(struct dirent64, d_name));
assert_cc(sizeof_field(struct dirent, d_name) == sizeof_field(struct dirent64, d_name));
+#endif
#define FOREACH_DIRENT_IN_BUFFER(de, buf, sz) \
for (void *_end = (uint8_t*) ({ (de) = (buf); }) + (sz); \
@@ -1,42 +0,0 @@
Patch-Source: https://github.com/elogind/elogind/issues/258
--
diff --git a/meson.build b/meson.build
index 694a2fd..a575f69 100644
--- a/meson.build
+++ b/meson.build
@@ -2903,7 +2903,7 @@ executable('elogind',
dependencies : [threads,
libacl,
libudev],
- install_rpath : rootlibexecdir,
+ install_rpath : rootpkglibdir,
install : true,
install_dir : rootlibexecdir)
@@ -2913,7 +2913,7 @@ exe = executable('loginctl',
link_with : [libshared],
dependencies : [threads,
libudev],
- install_rpath : rootlibexecdir,
+ install_rpath : rootpkglibdir,
install : true,
install_dir : rootbindir)
public_programs += [exe]
@@ -2923,7 +2923,7 @@ exe = executable('elogind-inhibit',
include_directories : includes,
link_with : [libshared],
dependencies : [threads],
- install_rpath : rootlibexecdir,
+ install_rpath : rootpkglibdir,
install : true,
install_dir : rootbindir)
public_programs += [exe]
@@ -4283,7 +4283,7 @@ executable('elogind-uaccess-command',
libshared],
dependencies: [libacl,
libudev],
- install_rpath : rootlibexecdir,
+ install_rpath : rootpkglibdir,
install : true,
install_dir : rootlibexecdir)
#endif // 0
+2 -4
View File
@@ -1,7 +1,5 @@
diff --git a/src/basic/async.h b/src/basic/async.h
index cf80acf..d22e77d 100644
--- a/src/basic/async.h
+++ b/src/basic/async.h
--- a/src/shared/async.h
+++ b/src/shared/async.h
@@ -2,6 +2,7 @@
#pragma once
-30
View File
@@ -1,30 +0,0 @@
Upstream: no, musl only
Source: https://raw.githubusercontent.com/chimera-linux/cports/81f0a3c25df2a841c2d99d752e60296062bf7543/main/elogind/patches/statx.patch
diff --git a/src/basic/mountpoint-util.c b/src/basic/mountpoint-util.c
index ab8744b..59ff466 100644
--- a/src/basic/mountpoint-util.c
+++ b/src/basic/mountpoint-util.c
@@ -11,7 +11,7 @@
//#include "filesystems.h"
#include "fs-util.h"
#include "missing_stat.h"
-//#include "missing_syscall.h"
+#include "missing_syscall.h"
//#include "mkdir.h"
#include "mountpoint-util.h"
#include "nulstr-util.h"
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
index d8e0693..f8324ed 100644
--- a/src/basic/stat-util.c
+++ b/src/basic/stat-util.c
@@ -18,7 +18,7 @@
#include "macro.h"
//#include "missing_fs.h"
#include "missing_magic.h"
-//#include "missing_syscall.h"
+#include "missing_syscall.h"
#include "nulstr-util.h"
//#include "parse-util.h"
#include "stat-util.h"
+24
View File
@@ -0,0 +1,24 @@
Avoid duplicate declaration of prctl_mm_map:
In file included from ../src/basic/missing_prctl.h:4,
from ../src/basic/capability-util.c:16:
/usr/include/linux/prctl.h:134:8: error: redefinition of 'struct prctl_mm_map'
134 | struct prctl_mm_map {
| ^~~~~~~~~~~~
In file included from ../src/basic/capability-util.c:6:
/usr/include/sys/prctl.h:88:8: note: originally defined here
88 | struct prctl_mm_map {
| ^~~~~~~~~~~~
diff -rup missing_prctl.h.orig missing_prctl.h
--- a/src/basic/missing_prctl.h
+++ b/src/basic/missing_prctl.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
-#include <linux/prctl.h>
+#include <sys/prctl.h>
/* 58319057b7847667f0c9585b9de0e8932b0fdb08 (4.3) */
#ifndef PR_CAP_AMBIENT
+89
View File
@@ -0,0 +1,89 @@
Partially taken from: https://github.com/chimera-linux/cports/blob/1c65848071683787eac91da86823339c4e85d208/main/elogind/patches/xxx-musl-fixes.patch
FTW_CONTINUE does not exist on musl
Read-only permission in fdopen() doesn't get applied in musl
EINVAL is returned by parse_sec(" .22s ", &u)
Fix test-login without active logind session due to using if instead of else if.
diff --git a/src/test/test-recurse-dir.c b/src/test/test-recurse-dir.c
index f607048..d6f1b29 100644
--- a/src/test/test-recurse-dir.c
+++ b/src/test/test-recurse-dir.c
@@ -1,5 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#if 0
#include <ftw.h>
#include "fd-util.h"
@@ -116,8 +117,10 @@ static int recurse_dir_callback(
return RECURSE_DIR_CONTINUE;
}
+#endif
int main(int argc, char *argv[]) {
+#if 0
_cleanup_strv_free_ char **list_recurse_dir = NULL;
const char *p;
usec_t t1, t2, t3, t4;
@@ -173,5 +176,6 @@ int main(int argc, char *argv[]) {
}
list_nftw = strv_free(list_nftw);
+#endif
return 0;
}
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index b9b82e7..5a43685 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -427,6 +428,7 @@ TEST(read_one_line_file) {
assert_se(streq_ptr(buf5, "x"));
}
+#if 0
TEST(write_string_stream) {
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-write_string_stream-XXXXXX";
_cleanup_fclose_ FILE *f = NULL;
@@ -461,6 +463,7 @@ TEST(write_string_stream) {
printf(">%s<", buf);
assert_se(streq(buf, "boohoo"));
}
+#endif
TEST(write_string_file) {
_cleanup_(unlink_tempfilep) char fn[] = "/tmp/test-write_string_file-XXXXXX";
diff --git a/src/test/test-time-util.c b/src/test/test-time-util.c
index 1ce6710..8d247a7 100644
--- a/src/test/test-time-util.c
+++ b/src/test/test-time-util.c
@@ -12,6 +12,7 @@
#define TRIAL 100u
+#if 0
TEST(parse_sec) {
usec_t u;
@@ -1181,6 +1162,7 @@ TEST(timezone_offset_change) {
tzset();
}
#endif // 0
+#endif
static int intro(void) {
/* Tests have hard-coded results that do not expect a specific timezone to be set by the caller */
diff -rup test-login.c.orig test-login.c
--- a/src/libelogind/sd-login/test-login.c
+++ b/src/libelogind/sd-login/test-login.c
@@ -149,7 +149,7 @@ TEST(login) {
log_notice("sd_session_is_active() failed with ENXIO, it seems logind is not running.");
#if 1 /// If elogind is tested on a system run by systemd, we will get -EINVAL,
// because elogind does not support systemd scopes, services and slices.
- if (r == -EINVAL)
+ else if (r == -EINVAL)
log_notice("sd_session_is_active() failed with EINVAL, elogind can not handle systemd powered systems.");
#endif // 1
else {
+6 -7
View File
@@ -1,13 +1,12 @@
# Template file for 'elogind'
pkgname=elogind
version=252.9
revision=2
version=255.22
revision=1
build_style=meson
configure_args="-Dcgroup-controller=elogind -Ddefault-hierarchy=legacy
-Ddefault-kill-user-processes=false -Dhalt-path=/usr/bin/halt
-Dkexec-path=/usr/bin/kexec -Dman=true -Dpolkit=true
-Dreboot-path=/usr/bin/reboot -Drootlibdir=/usr/lib
-Drootlibexecdir=/usr/libexec/elogind"
-Dkexec-path=/usr/bin/kexec -Dman=enabled -Dpolkit=enabled
-Dreboot-path=/usr/bin/reboot --libexecdir=/usr/libexec/elogind"
hostmakedepends="docbook-xsl glib-devel gperf gettext libxslt
m4 pkg-config python3-Jinja2 shadow"
makedepends="acl-devel eudev-libudev-devel libcap-devel
@@ -17,8 +16,8 @@ short_desc="Standalone logind fork"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.0-or-later"
homepage="https://github.com/elogind/elogind"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
checksum=7af8caa8225a406e77fb99c9f33dba5e1f0a94f0e1277c9d91dcfc016f116d85
distfiles="https://github.com/elogind/elogind/archive/refs/tags/V${version}.tar.gz"
checksum=79b5eb96bccf3a6101b35e62d0f80b2d0a47077a1507a6edc705f8cb7bdb0619
conf_files="/etc/elogind/*.conf"
# tests fail differently due to containerization and kernel features
make_check=ci-skip