diff options
| author | Etienne Cordonnier <ecordonnier@snap.com> | 2025-09-10 16:25:27 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2025-09-15 09:55:17 -0700 |
| commit | 3956b3a958e5a26b4f8edbf4b7a6460e92719362 (patch) | |
| tree | 2882ddfb7d06ff8f4d9b420fb1b841bc12696b78 | |
| parent | f50cdaea20ad852992b509cb9b37664cb770e99e (diff) | |
| download | meta-openembedded-3956b3a958e5a26b4f8edbf4b7a6460e92719362.tar.gz | |
uutils-coreutils: add feat_systemd_logind
It allows commands such as "who" to work even when systemd is compiled without "utmp" support.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-core/uutils-coreutils/uutils-coreutils/0001-systemd_logind-replace-i8-with-libc-c_char.patch | 76 | ||||
| -rw-r--r-- | meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.2.0.bb | 8 |
2 files changed, 82 insertions, 2 deletions
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils/0001-systemd_logind-replace-i8-with-libc-c_char.patch b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils/0001-systemd_logind-replace-i8-with-libc-c_char.patch new file mode 100644 index 0000000000..30845a3b12 --- /dev/null +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils/0001-systemd_logind-replace-i8-with-libc-c_char.patch | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | From f5b5a3dec5d77cca53423f21d2a7652f2b432aa6 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Etienne Cordonnier <ecordonnier@snap.com> | ||
| 3 | Date: Tue, 9 Sep 2025 23:36:05 +0200 | ||
| 4 | Subject: [PATCH] systemd_logind: replace i8 with libc::c_char | ||
| 5 | |||
| 6 | The C type "char" defaults to unsigned on arm linux, and signed on x86-64 linux. This causes some build errors in the systemd_logind ffi code when compiling for arm. | ||
| 7 | |||
| 8 | Fixes https://github.com/uutils/coreutils/issues/8593 | ||
| 9 | |||
| 10 | Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com> | ||
| 11 | Upstream-Status: Backport [https://github.com/uutils/coreutils/commit/f5b5a3dec5d77cca53423f21d2a7652f2b432aa6] | ||
| 12 | --- | ||
| 13 | src/uucore/src/lib/features/systemd_logind.rs | 12 ++++++------ | ||
| 14 | 1 file changed, 6 insertions(+), 6 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/src/uucore/src/lib/features/systemd_logind.rs b/src/uucore/src/lib/features/systemd_logind.rs | ||
| 17 | index d2727c530..537cb1e3f 100644 | ||
| 18 | --- a/src/uucore/src/lib/features/systemd_logind.rs | ||
| 19 | +++ b/src/uucore/src/lib/features/systemd_logind.rs | ||
| 20 | @@ -51,7 +51,7 @@ mod login { | ||
| 21 | |||
| 22 | /// Get all active sessions | ||
| 23 | pub fn get_sessions() -> Result<Vec<String>, Box<dyn std::error::Error>> { | ||
| 24 | - let mut sessions_ptr: *mut *mut i8 = ptr::null_mut(); | ||
| 25 | + let mut sessions_ptr: *mut *mut libc::c_char = ptr::null_mut(); | ||
| 26 | |||
| 27 | let result = unsafe { ffi::sd_get_sessions(&mut sessions_ptr) }; | ||
| 28 | |||
| 29 | @@ -120,7 +120,7 @@ mod login { | ||
| 30 | /// Get TTY for a session | ||
| 31 | pub fn get_session_tty(session_id: &str) -> Result<Option<String>, Box<dyn std::error::Error>> { | ||
| 32 | let session_cstring = CString::new(session_id)?; | ||
| 33 | - let mut tty_ptr: *mut i8 = ptr::null_mut(); | ||
| 34 | + let mut tty_ptr: *mut libc::c_char = ptr::null_mut(); | ||
| 35 | |||
| 36 | let result = unsafe { ffi::sd_session_get_tty(session_cstring.as_ptr(), &mut tty_ptr) }; | ||
| 37 | |||
| 38 | @@ -149,7 +149,7 @@ mod login { | ||
| 39 | session_id: &str, | ||
| 40 | ) -> Result<Option<String>, Box<dyn std::error::Error>> { | ||
| 41 | let session_cstring = CString::new(session_id)?; | ||
| 42 | - let mut host_ptr: *mut i8 = ptr::null_mut(); | ||
| 43 | + let mut host_ptr: *mut libc::c_char = ptr::null_mut(); | ||
| 44 | |||
| 45 | let result = | ||
| 46 | unsafe { ffi::sd_session_get_remote_host(session_cstring.as_ptr(), &mut host_ptr) }; | ||
| 47 | @@ -179,7 +179,7 @@ mod login { | ||
| 48 | session_id: &str, | ||
| 49 | ) -> Result<Option<String>, Box<dyn std::error::Error>> { | ||
| 50 | let session_cstring = CString::new(session_id)?; | ||
| 51 | - let mut display_ptr: *mut i8 = ptr::null_mut(); | ||
| 52 | + let mut display_ptr: *mut libc::c_char = ptr::null_mut(); | ||
| 53 | |||
| 54 | let result = | ||
| 55 | unsafe { ffi::sd_session_get_display(session_cstring.as_ptr(), &mut display_ptr) }; | ||
| 56 | @@ -209,7 +209,7 @@ mod login { | ||
| 57 | session_id: &str, | ||
| 58 | ) -> Result<Option<String>, Box<dyn std::error::Error>> { | ||
| 59 | let session_cstring = CString::new(session_id)?; | ||
| 60 | - let mut type_ptr: *mut i8 = ptr::null_mut(); | ||
| 61 | + let mut type_ptr: *mut libc::c_char = ptr::null_mut(); | ||
| 62 | |||
| 63 | let result = unsafe { ffi::sd_session_get_type(session_cstring.as_ptr(), &mut type_ptr) }; | ||
| 64 | |||
| 65 | @@ -238,7 +238,7 @@ mod login { | ||
| 66 | session_id: &str, | ||
| 67 | ) -> Result<Option<String>, Box<dyn std::error::Error>> { | ||
| 68 | let session_cstring = CString::new(session_id)?; | ||
| 69 | - let mut seat_ptr: *mut i8 = ptr::null_mut(); | ||
| 70 | + let mut seat_ptr: *mut libc::c_char = ptr::null_mut(); | ||
| 71 | |||
| 72 | let result = unsafe { ffi::sd_session_get_seat(session_cstring.as_ptr(), &mut seat_ptr) }; | ||
| 73 | |||
| 74 | -- | ||
| 75 | 2.43.0 | ||
| 76 | |||
diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.2.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.2.0.bb index 039130c9d3..88663ccb21 100644 --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.2.0.bb +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.2.0.bb | |||
| @@ -7,7 +7,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=e74349878141b240070458d414ab3b64" | |||
| 7 | 7 | ||
| 8 | inherit cargo cargo-update-recipe-crates | 8 | inherit cargo cargo-update-recipe-crates |
| 9 | 9 | ||
| 10 | SRC_URI = "git://github.com/uutils/coreutils.git;protocol=https;branch=main" | 10 | SRC_URI = " \ |
| 11 | git://github.com/uutils/coreutils.git;protocol=https;branch=main \ | ||
| 12 | file://0001-systemd_logind-replace-i8-with-libc-c_char.patch \ | ||
| 13 | " | ||
| 11 | 14 | ||
| 12 | SRCREV = "38a248cba6ddf72a453a79365cd919fa40783a44" | 15 | SRCREV = "38a248cba6ddf72a453a79365cd919fa40783a44" |
| 13 | 16 | ||
| @@ -16,8 +19,9 @@ require ${BPN}-crates.inc | |||
| 16 | PROVIDES = "coreutils" | 19 | PROVIDES = "coreutils" |
| 17 | RPROVIDES:${PN} = "coreutils" | 20 | RPROVIDES:${PN} = "coreutils" |
| 18 | 21 | ||
| 19 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}" | 22 | PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}" |
| 20 | PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux" | 23 | PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux" |
| 24 | PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd" | ||
| 21 | 25 | ||
| 22 | CARGO_BUILD_FLAGS += "--features unix --features feat_external_libstdbuf" | 26 | CARGO_BUILD_FLAGS += "--features unix --features feat_external_libstdbuf" |
| 23 | 27 | ||
