From c80cea2d85049c8718443ff98b4ae4c16bf80b3f Mon Sep 17 00:00:00 2001 From: F5OEO Date: Sat, 17 Dec 2016 12:53:13 +0000 Subject: [PATCH] Change way of autostart like raspi-config --- install.sh | 9 +++++---- scripts/install_autostart.sh | 9 ++++++--- scripts/menu.sh | 15 ++++++--------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/install.sh b/install.sh index 3497a50..2586b29 100755 --- a/install.sh +++ b/install.sh @@ -159,10 +159,11 @@ then cp configs/rpidatvconfig.fr rpidatvconfig.txt cd /home/pi echo "Autostart install" - sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ - sudo cp "/home/pi/rpidatv/scripts/configs/autologin.conf" /etc/systemd/system/getty@tty1.service.d/ - sudo systemctl enable getty@tty1.service - cp "/home/pi/rpidatv/scripts/configs/console_tx.bashrc" /home/pi/.bashrc;; +#get from http://raspberrypi.stackexchange.com/questions/38025/disable-console-autologin-on-raspbian-jessie + sudo ln -fs /etc/systemd/system/autologin@.service \ + /etc/systemd/system/getty.target.wants/getty@tty1.service + + cp "/home/pi/rpidatv/scripts/configs/console_tx.bashrc" /home/pi/.bashrc echo "Completed French Install Auto" fi diff --git a/scripts/install_autostart.sh b/scripts/install_autostart.sh index 1841205..3066d1d 100755 --- a/scripts/install_autostart.sh +++ b/scripts/install_autostart.sh @@ -1,8 +1,11 @@ #FOR Jessie # Whiptail and /etc/rc.local is not running properly !!!! # Use systemd method -sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ -sudo cp ./autologin.conf /etc/systemd/system/getty@tty1.service.d/ -sudo systemctl enable getty@tty1.service +#sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ +#sudo cp ./autologin.conf /etc/systemd/system/getty@tty1.service.d/ +#sudo systemctl enable getty@tty1.service + +ln -fs /etc/systemd/system/autologin@.service \ + /etc/systemd/system/getty.target.wants/getty@tty1.service cp install_bashrc /home/pi/.bashrc diff --git a/scripts/menu.sh b/scripts/menu.sh index c88b2b6..30663a1 100755 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -732,14 +732,12 @@ do_autostart_setup() sudo rm /etc/systemd/system/getty@tty1.service.d/autologin.conf /dev/null 2>/dev/null cp $PATHCONFIGS"/button.bashrc" /home/pi/.bashrc;; TX_boot) - sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ - sudo cp $PATHCONFIGS"/autologin.conf" /etc/systemd/system/getty@tty1.service.d/ - sudo systemctl enable getty@tty1.service + sudo ln -fs /etc/systemd/system/autologin@.service \ + /etc/systemd/system/getty.target.wants/getty@tty1.service cp $PATHCONFIGS"/console_tx.bashrc" /home/pi/.bashrc;; Display_boot) - sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ - sudo cp $PATHCONFIGS"/autologin.conf" /etc/systemd/system/getty@tty1.service.d/ - sudo systemctl enable getty@tty1.service + sudo ln -fs /etc/systemd/system/autologin@.service \ + /etc/systemd/system/getty.target.wants/getty@tty1.service MODE_DISPLAY=$(get_config_var display $CONFIGFILE) case "$MODE_DISPLAY" in Waveshare) @@ -748,9 +746,8 @@ do_autostart_setup() cp $PATHCONFIGS"/display.bashrc" /home/pi/.bashrc;; #>/dev/null 2>/dev/null;; esac;; Button_boot) - sudo mkdir -pv /etc/systemd/system/getty@tty1.service.d/ - sudo cp $PATHCONFIGS"/autologin.conf" /etc/systemd/system/getty@tty1.service.d/ - sudo systemctl enable getty@tty1.service + sudo ln -fs /etc/systemd/system/autologin@.service \ + /etc/systemd/system/getty.target.wants/getty@tty1.service cp $PATHCONFIGS"/button.bashrc" /home/pi/.bashrc;; esac set_config_var startup "$chstartup" $CONFIGFILE