Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for /etc/issue #24

Open
Fjorge0 opened this issue Jan 3, 2021 · 2 comments
Open

add support for /etc/issue #24

Fjorge0 opened this issue Jan 3, 2021 · 2 comments

Comments

@Fjorge0
Copy link

Fjorge0 commented Jan 3, 2021

I think you should add support for the /etc/issue file like gettys such as agetty (agetty --show-issue).
I believe it'll also solve dvdhrm#107

@kreijack
Copy link

I recently face the same issue. I solved using /sbin/agetty instead of /bin/login.
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt -l /sbin/agetty -- -o '-p -- \u' --noclear - linux
image

Unfortunately doing this, no terminal identifier is printed (only a '-'). I developed a patch (https://github.com/kreijack/kmscon/tree/ptsname) which allow to pass '{ptsname}' in agetty command line, which will be replace by the terminal name (like 'pts/1').
'
ExecStart=/usr/bin/kmscon "--vt=%I" --seats=seat0 --no-switchvt -l /sbin/agetty -- -o '-p -- \u' --noclear {ptsname} linux
'
image

I even tried to implement the printing of /etc/issue in kmscon (https://github.com/kreijack/kmscon/tree/random-dev), but it is a lot of code (you have to take care of a lot of '<character>' code); moreover /bin/login has a timeout so if no key is pressed at login time, it exit and kmscon has to restart it.

Both of these issues disappear using /sbin/agetty instead of /bin/login.

Unfortunately, there is still noway to show the tty.

@ghost
Copy link

ghost commented Feb 18, 2022

@kreijack
If the only thing you really care about is printing, not actually passing the terminal value to agetty, you can do:

/usr/bin/kmscon "--vt=/dev/tty2" --seats=seat0 --no-switchvt -l /bin/bash -- -c "tty; /sbin/agetty -o \"-p -- \u\" - linux"

For some reason, substituting it like this:

/usr/bin/kmscon "--vt=/dev/tty2" --seats=seat0 --no-switchvt -l /bin/bash -- -c "/sbin/agetty -o \"-p -- \u\" `tty` linux"

did not really work.

You can get the VT (not PT) number with $XDG_VTNR instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants