mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
Update console autologin method for Buster
This commit is contained in:
parent
f4e6d18751
commit
d33487cbea
18
raspi-config
18
raspi-config
@ -951,16 +951,22 @@ do_boot_behaviour() {
|
|||||||
B1*)
|
B1*)
|
||||||
systemctl set-default multi-user.target
|
systemctl set-default multi-user.target
|
||||||
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||||
|
rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||||
;;
|
;;
|
||||||
B2*)
|
B2*)
|
||||||
systemctl set-default multi-user.target
|
systemctl set-default multi-user.target
|
||||||
sed /etc/systemd/system/autologin@.service -i -e "s#^ExecStart=-/sbin/agetty --autologin [^[:space:]]*#ExecStart=-/sbin/agetty --autologin $SUDO_USER#"
|
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||||
ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
|
||||||
|
[Service]
|
||||||
|
ExecStart=
|
||||||
|
ExecStart=-/sbin/agetty --autologin $SUDO_USER --noclear %I $TERM
|
||||||
|
EOF
|
||||||
;;
|
;;
|
||||||
B3*)
|
B3*)
|
||||||
if [ -e /etc/init.d/lightdm ]; then
|
if [ -e /etc/init.d/lightdm ]; then
|
||||||
systemctl set-default graphical.target
|
systemctl set-default graphical.target
|
||||||
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||||
|
rm /etc/systemd/system/getty@tty1.service.d/autologin.conf
|
||||||
sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/"
|
sed /etc/lightdm/lightdm.conf -i -e "s/^autologin-user=.*/#autologin-user=/"
|
||||||
disable_raspi_config_at_boot
|
disable_raspi_config_at_boot
|
||||||
else
|
else
|
||||||
@ -971,8 +977,12 @@ do_boot_behaviour() {
|
|||||||
B4*)
|
B4*)
|
||||||
if [ -e /etc/init.d/lightdm ]; then
|
if [ -e /etc/init.d/lightdm ]; then
|
||||||
systemctl set-default graphical.target
|
systemctl set-default graphical.target
|
||||||
ln -fs /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
ln -fs /lib/systemd/system/getty@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||||
sed /etc/systemd/system/autologin@.service -i -e "s#^ExecStart=-/sbin/agetty --autologin [^[:space:]]*#ExecStart=-/sbin/agetty --autologin $SUDO_USER#"
|
cat > /etc/systemd/system/getty@tty1.service.d/autologin.conf << EOF
|
||||||
|
[Service]
|
||||||
|
ExecStart=
|
||||||
|
ExecStart=-/sbin/agetty --autologin $SUDO_USER --noclear %I $TERM
|
||||||
|
EOF
|
||||||
sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$SUDO_USER/"
|
sed /etc/lightdm/lightdm.conf -i -e "s/^\(#\|\)autologin-user=.*/autologin-user=$SUDO_USER/"
|
||||||
disable_raspi_config_at_boot
|
disable_raspi_config_at_boot
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user