Skip to content

Commit 8898cae

Browse files
committed
removed greetd due to edge case with installed setup and fixed niri bugs
1 parent db6b9d3 commit 8898cae

5 files changed

Lines changed: 29 additions & 62 deletions

File tree

eclipse-installer/src/config.rs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,12 @@ pub const TIMEZONE_REGIONS: &[&str] = &[
2727
"US",
2828
];
2929

30-
/// Content of the greetd service file written to the target.
31-
pub const GREETD_SERVICE: &str = r#"[service]
32-
name = "greetd"
33-
supervisor = "root"
34-
exec = ["/usr/bin/greetd"]
35-
type = "simple"
36-
37-
[restart]
38-
policy = "permanent"
39-
delay = "2s"
40-
max-restarts = 5
41-
max-restart-window = "60s"
42-
43-
[dependencies]
44-
after = ["dbus", "seatd", "udev-coldplug"]
45-
46-
[readiness]
47-
type = "none"
48-
49-
[shutdown]
50-
stop-signal = "SIGTERM"
51-
stop-timeout = "10s"
30+
/// Profile script that auto-starts the niri Wayland session on tty1.
31+
/// Replaces greetd which has session-worker hangs in seatd/dynamod environments.
32+
pub const NIRI_AUTOSTART_PROFILE: &str = r#"# Auto-start Eclipse niri session on tty1 after login
33+
if [ "$(tty)" = "/dev/tty1" ] && [ -z "$WAYLAND_DISPLAY" ]; then
34+
exec /usr/bin/eclipse-niri-session
35+
fi
5236
"#;
5337

5438
/// Busybox symlinks created inside the initramfs staging directory.

eclipse-installer/src/install.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ use std::thread;
88
use std::time::Duration;
99

1010
use crate::config::{
11-
FsType, InstallConfig, BUSYBOX_SYMLINKS, EFI_LABEL, GREETD_SERVICE, GRUB_BIOS_MODULES,
12-
INITRAMFS_LIB_PATTERNS, ROOT_LABEL, RSYNC_EXCLUDES, TARGET_MNT, USER_GROUPS, USER_SHELL,
11+
FsType, InstallConfig, BUSYBOX_SYMLINKS, EFI_LABEL, GRUB_BIOS_MODULES,
12+
INITRAMFS_LIB_PATTERNS, NIRI_AUTOSTART_PROFILE, ROOT_LABEL, RSYNC_EXCLUDES, TARGET_MNT,
13+
USER_GROUPS, USER_SHELL,
1314
};
1415
use crate::log;
1516

@@ -428,16 +429,11 @@ fn configure_system(config: &InstallConfig) -> Result<(), String> {
428429
.map_err(|e| format!("Failed to write passwd: {}", e))?;
429430
}
430431

431-
// Replace agetty with greetd service
432-
let agetty_path = format!("{}/etc/dynamod/services/agetty-tty1.toml", TARGET_MNT);
433-
let _ = fs::remove_file(&agetty_path);
434-
435-
let greetd_dir = format!("{}/etc/dynamod/services", TARGET_MNT);
436-
fs::create_dir_all(&greetd_dir)
437-
.map_err(|e| format!("mkdir {}: {}", greetd_dir, e))?;
438-
let greetd_path = format!("{}/greetd.toml", greetd_dir);
439-
fs::write(&greetd_path, GREETD_SERVICE)
440-
.map_err(|e| format!("Failed to write greetd service: {}", e))?;
432+
// Auto-start niri session on tty1 after login (replaces greetd which has
433+
// session-worker hangs in seatd/dynamod environments).
434+
let autostart_path = format!("{}/etc/profile.d/eclipse-niri-autostart.sh", TARGET_MNT);
435+
fs::write(&autostart_path, NIRI_AUTOSTART_PROFILE)
436+
.map_err(|e| format!("Failed to write niri autostart profile: {}", e))?;
441437

442438
// Remove live-environment artifacts
443439
let live_profile = format!("{}/etc/profile.d/eclipse-live.sh", TARGET_MNT);

scripts/build-rootfs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ cat > "$ROOTFS/etc/dynamod/services/seatd.toml" <<'SEATD'
393393
[service]
394394
name = "seatd"
395395
supervisor = "root"
396-
exec = ["/bin/sh", "-c", "exec env SEATD_VTBOUND=0 /usr/bin/seatd"]
396+
exec = ["/bin/sh", "-c", "exec env SEATD_VTBOUND=0 /usr/bin/seatd -g _seatd"]
397397
type = "simple"
398398
399399
[restart]

scripts/eclipse-install

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -445,31 +445,15 @@ fi
445445
# restore the 'x' marker so login checks /etc/shadow for the real hash.
446446
sed -i 's|^root:[^:]*:|root:x:|' "$TARGET_MNT/etc/passwd"
447447

448-
# Replace agetty console login with greetd for graphical login
449-
rm -f "$TARGET_MNT/etc/dynamod/services/agetty-tty1.toml"
450-
cat > "$TARGET_MNT/etc/dynamod/services/greetd.toml" <<'GREETD_SVC'
451-
[service]
452-
name = "greetd"
453-
supervisor = "root"
454-
exec = ["/usr/bin/greetd"]
455-
type = "simple"
456-
457-
[restart]
458-
policy = "permanent"
459-
delay = "2s"
460-
max-restarts = 5
461-
max-restart-window = "60s"
462-
463-
[dependencies]
464-
after = ["dbus", "seatd", "udev-coldplug"]
465-
466-
[readiness]
467-
type = "none"
468-
469-
[shutdown]
470-
stop-signal = "SIGTERM"
471-
stop-timeout = "10s"
472-
GREETD_SVC
448+
# Auto-start niri session on tty1 after login (replaces greetd which has
449+
# session-worker hangs in seatd/dynamod environments).
450+
cat > "$TARGET_MNT/etc/profile.d/eclipse-niri-autostart.sh" <<'NIRI_AUTOSTART'
451+
# Auto-start Eclipse niri session on tty1 after login
452+
if [ "$(tty)" = "/dev/tty1" ] && [ -z "$WAYLAND_DISPLAY" ]; then
453+
exec /usr/bin/eclipse-niri-session
454+
fi
455+
NIRI_AUTOSTART
456+
chmod 644 "$TARGET_MNT/etc/profile.d/eclipse-niri-autostart.sh"
473457

474458
# Remove live-environment artifacts
475459
rm -f "$TARGET_MNT/etc/profile.d/eclipse-live.sh"

scripts/eclipse-niri-session

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
# Prefer this over raw `niri --session`: session D-Bus, udev settle, short delay for libinput.
44

55
export LIBSEAT_BACKEND=seatd
6-
: "${XDG_RUNTIME_DIR:=/run/user/$(id -u)}"
7-
mkdir -m 0700 -p "$XDG_RUNTIME_DIR" 2>/dev/null || true
6+
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
7+
if ! mkdir -m 0700 -p "$XDG_RUNTIME_DIR" 2>/dev/null; then
8+
export XDG_RUNTIME_DIR="/tmp/eclipse-runtime-$(id -u)"
9+
mkdir -m 0700 -p "$XDG_RUNTIME_DIR"
10+
fi
811

912
# Mesa: ensure DRI drivers resolve (musl/live); avoid llvmpipe being picked for virtio
1013
# (niri skips "software" EGL devices — then the first DRM device has no allocator yet).

0 commit comments

Comments
 (0)