REBIRTH
This commit is contained in:
@@ -2,34 +2,53 @@
|
||||
title: Void Autologin
|
||||
tags:
|
||||
- void
|
||||
- autologin
|
||||
---
|
||||
|
||||
Make the autologin service:
|
||||
The virtual terminals are run as services.
|
||||
Make a new service by making symbolic links to the generic one.
|
||||
|
||||
```sh
|
||||
cp -R /etc/sv/agetty-tty1 /etc/sv/agetty-autologin-tty1
|
||||
login=agetty-autologin
|
||||
sudo cp -rs /etc/sv/agetty-generic/ /etc/sv/${login}/
|
||||
|
||||
```
|
||||
|
||||
Copy the configuration file for the `agetty-tty1` service, and add the `--autologin` argument.
|
||||
|
||||
```sh
|
||||
sed "s/--noclear/--autologin ${USER} &/" /etc/sv/agetty-tty1/conf | sudo tee /etc/sv/${login}/conf
|
||||
|
||||
```
|
||||
|
||||
It should look like this:
|
||||
|
||||
|
||||
```
|
||||
if [ -x /sbin/agetty -o -x /bin/agetty ]; then
|
||||
# util-linux specific settings
|
||||
if [ "${tty}" = "tty1" ]; then
|
||||
GETTY_ARGS="--noclear"
|
||||
fi
|
||||
# util-linux specific settings
|
||||
if [ "${tty}" = "tty1" ]; then
|
||||
GETTY_ARGS="--autologin ${your_username} --noclear"
|
||||
fi
|
||||
fi
|
||||
|
||||
GETTY_ARGS="--autologin [ your username ] --noclear"
|
||||
BAUD_RATE=38400
|
||||
TERM_NAME=linux
|
||||
|
||||
```
|
||||
|
||||
Then stick this at the end of the bashrc:
|
||||
If you see the actual variable `${USER}` then you probably used the wrong quotes.
|
||||
|
||||
Disable the `tty1` service (because the login takes its place).
|
||||
|
||||
|
||||
```sh
|
||||
# autologin on tty1
|
||||
if [ -z "$DISPLAY" ] && [ "$(fgconsole)" -eq 1 ]; then
|
||||
exec startx
|
||||
fi
|
||||
|
||||
sudo touch /etc/sv/agetty-tty1/down
|
||||
```
|
||||
|
||||
Enable your `${login}` service:
|
||||
|
||||
|
||||
```sh
|
||||
sudo ln -s /etc/sv/${login} /var/service/
|
||||
```
|
||||
|
||||
Reboot.
|
||||
|
||||
Pizza party for one.
|
||||
|
||||
Reference in New Issue
Block a user