You are not logged in.

#1 2024-05-21 18:54:07

MacTavish02
Guest

/run/udev/data/+drm:card0-eDP-1 doesn't exist when trying to autostart

Hello everyone.

I'm not a complete Linux newbie, however I'm willing to learn. I will explain all my issue to avoid XY problem

I'm using Arch with Hyprland, and I'm trying to make Hyprland starting directly at boot without any greeter, following fellow user csdvrx idea https://www.reddit.com/r/hyprland/comme … _guide_to/

However I'm running into an issue. So here's the thing.

I have a getty@tty1.service that seems to work

[Unit]
Description=Start hyprland
After=sysinit.target
After=initrd-switch-root.service
Wants=systemd-udev-trigger.service
After=systemd-udev-trigger.service
Wants=seatd.service
After=seatd.service
Wants=systemd-logind.service
After=systemd-logind.service
ConditionPathExists=/home/mactavish
OnFailure=emergency.target

[Service]
Type=simple
ExecStartPre=+/usr/sbin/rm -f /run/nologin
ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin mactavish %I $TERM
StandardOutput=null
StandardError=journal

[Install]
WantedBy=graphical.target
WantedBy=initrd-switch-root.service
At this point, everything seems to work.

In my ~/.profile file, I start hyprland.sh, wich is another script in /home that should start Hyprland

sh hyprland.sh && echo "goodbye, now logging out" && exit 0 \
 || echo "$? hyperland.sh failed" && tty |grep tty1 \
  && echo "refusing autologin without hyprland on tty1" && exit 0 \
  || echo "not on tt1, letting in"

And here is this hyprland.sh script

#!/bin/sh
[ ! -f /run/udev/data/+drm:card0-eDP-1 ] \
 && sudo systemctl restart systemd-udev-trigger > /dev/null

sudo systemctl status iwd|grep Active..active \
 || sudo systemctl start iwd &

while [ ! -f /run/udev/data/+drm:card0-eDP-1 ] ; do echo "waiting for drm" && sleep 0.2 ; done

export USER=mactavish
[ -z $TERM ] && export TERM=linux
[ -z $LOGNAME ] && export LOGNAME=$USER
[ -z $HOME ] && export HOME=/home/$USER
[ -z $LANG ] && export LANG=C.UTF-8
[ -z $PATH ] && export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
[ -z $XDG_SEAT ] && export XDG_SEAT=seat0
[ -z $XDG_SESSION_TYPE ]  && export XDG_SESSION_TYPE=tty
[ -z $XDG_SESSION_CLASS ] && export XDG_SESSION_CLASS=user
[ -z $XDG_VTNR ] && export XDG_VTNR=1
[ -z $XDG_RUNTIME_DIR ] && export XDG_RUNTIME_DIR=/run/user/1000
[ -z $DBUS_SESSION_BUS_ADDRESS ] && export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

[ ! -f /run/udev/data/+drm:card0-eDP-1 ] \
 && echo "Hyprland needs drm, bailing out" && exit -1

exec Hyprland > .hyprland.log.txt 2> .hyprland.err.txt

But it doesn't work

The problem here is during startup, well, first it doesn't want to autologin and asks me for my password (with username autofilled) but anyway I'll keep things as it is (if you have any idea why it doesn't fill in the password and autologin, please feel free to help).

But the real problem is once I'm logged, I get the message waiting for drm every 0.2s, because the while [ ! -f /run/udev/data/+drm:card0-eDP-1 ] at line 8 of hyprland.sh is true.

So if I understand correctly, this +drm:card0-eDP-1 file doesnt exist

I'm not an absolute beginner in Linux, but at the moment I have no knowledge of how video cards and drivers work, nor of how Windows Manager and DE handle all this.

Hyprland needs this DRM file, but I can't work out which of these scripts is wrong, because I've made virtually no changes, apart from the username, to the original script in the reddit link up there. And the guy seems to get it working

What could be the problem? Thank you in advance for your help.

#2 2024-05-21 21:04:47

seth
Member
Registered: 2012-09-03
Posts: 60,805

Re: /run/udev/data/+drm:card0-eDP-1 doesn't exist when trying to autostart

IS "card0" even correct?
W/ the simpledrm device, you're actual DRM device would become - and stay - card1?

Offline

Board footer

Powered by FluxBB