Enable systemd-logind

This commit is contained in:
joe committed 2026-06-16 15:55:17 -04:00
1 parent 398fecb5be
commit 90ce800112
8 files changed
+28 -11

No files matched your search

+11 -1
View File
@@ -12,7 +12,7 @@ require_cmd make rsync cpio gzip
ensure_dirs
[[ -x "$BUSYBOX_BUILD_DIR/busybox" ]] || "$ROOT_DIR/scripts/build-busybox.sh"
[[ -x "$SYSTEMD_STAGING_DIR/usr/lib/systemd/systemd" && -f "$SYSTEMD_STAGING_DIR/.forgeos-systemd-complete" ]] || "$ROOT_DIR/scripts/build-systemd.sh"
[[ -x "$SYSTEMD_STAGING_DIR/usr/lib/systemd/systemd" && -x "$SYSTEMD_STAGING_DIR/usr/lib/systemd/systemd-logind" && -f "$SYSTEMD_STAGING_DIR/.forgeos-systemd-complete" ]] || "$ROOT_DIR/scripts/build-systemd.sh"
[[ -x "$DBUS_STAGING_DIR/usr/bin/dbus-daemon" && -f "$DBUS_STAGING_DIR/.forgeos-dbus-complete" ]] || "$ROOT_DIR/scripts/build-dbus.sh"
[[ -f "$OUT_DIR/bzImage" ]] || "$ROOT_DIR/scripts/build-kernel.sh"
@@ -48,6 +48,16 @@ ln -sfn /etc/systemd/system/forgeos-bootdiag.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/multi-user.target.wants/forgeos-bootdiag.service"
ln -sfn /etc/systemd/system/forgeos-console-banner.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/multi-user.target.wants/forgeos-console-banner.service"
ln -sfn /usr/lib/systemd/system/dbus.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/multi-user.target.wants/dbus.service"
ln -sfn /usr/lib/systemd/system/dbus.socket \
"$ROOTFS_STAGING_DIR/etc/systemd/system/sockets.target.wants/dbus.socket"
ln -sfn /usr/lib/systemd/system/systemd-logind.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/multi-user.target.wants/systemd-logind.service"
ln -sfn /usr/lib/systemd/system/systemd-logind.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/dbus-org.freedesktop.login1.service"
ln -sfn /usr/lib/systemd/system/systemd-logind-varlink.socket \
"$ROOTFS_STAGING_DIR/etc/systemd/system/sockets.target.wants/systemd-logind-varlink.socket"
ln -sfn /usr/lib/systemd/system/systemd-networkd.service \
"$ROOTFS_STAGING_DIR/etc/systemd/system/multi-user.target.wants/systemd-networkd.service"
ln -sfn /usr/lib/systemd/system/systemd-resolved.service \
+8 -4
View File
@@ -4,7 +4,7 @@ set -euo pipefail
source "$(dirname "$0")/common.sh"
require_cmd meson ninja pkg-config "$CC" file ldd ldconfig install tar gzip
require_cmd meson ninja pkg-config "$CC" gperf file ldd ldconfig install tar gzip
ensure_dirs
[[ -z "$CROSS_COMPILE" ]] || die "systemd rootfs staging currently requires a native build; CROSS_COMPILE is not supported"
@@ -44,9 +44,10 @@ copy_elf_deps() {
copy_named_library() {
local soname=$1
local path
local ldconfig_output path
path=$(ldconfig -p 2>/dev/null | awk -v soname="$soname" '$1 == soname { print $NF; exit }')
ldconfig_output=$(ldconfig -p 2>/dev/null || true)
path=$(awk -v soname="$soname" '$1 == soname { print $NF; exit }' <<< "$ldconfig_output")
[[ -n "$path" ]] || die "could not locate runtime library: $soname"
copy_runtime_dep "$path"
copy_elf_deps "$path"
@@ -102,7 +103,7 @@ meson setup "$SYSTEMD_BUILD_DIR" "$SYSTEMD_SRC_DIR" \
-Dcoredump=false \
-Dpstore=false \
-Doomd=false \
-Dlogind=false \
-Dlogind=true \
-Dhostnamed=false \
-Dlocaled=false \
-Dmachined=false \
@@ -194,5 +195,8 @@ done < <(find "$SYSTEMD_STAGING_DIR" -type f \( -perm /111 -o -name '*.so' -o -n
copy_named_library libmount.so.1
[[ -x "$SYSTEMD_STAGING_DIR/usr/lib/systemd/systemd" ]] || die "systemd binary was not installed"
[[ -x "$SYSTEMD_STAGING_DIR/usr/lib/systemd/systemd-logind" ]] || die "systemd-logind binary was not installed"
[[ -x "$SYSTEMD_STAGING_DIR/usr/bin/loginctl" ]] || die "loginctl binary was not installed"
[[ -f "$SYSTEMD_STAGING_DIR/usr/share/dbus-1/system.d/org.freedesktop.login1.conf" ]] || die "logind D-Bus policy was not installed"
touch "$SYSTEMD_STAGING_DIR/.forgeos-systemd-complete"
msg "systemd staging tree: $SYSTEMD_STAGING_DIR"
+2 -2
View File
@@ -183,8 +183,8 @@ EOF
cat > "$ROOTFS_STAGING_DIR/etc/systemd/system/forgeos-desktop.service" <<'EOF'
[Unit]
Description=ForgeOS Openbox desktop
Wants=dbus.service systemd-udevd.service
After=dbus.service systemd-udevd.service systemd-user-sessions.service
Wants=dbus.service systemd-logind.service systemd-udevd.service
After=dbus.service systemd-logind.service systemd-udevd.service systemd-user-sessions.service
Conflicts=forgeos-shell@tty1.service getty@tty1.service
[Service]