diff --git a/clone/clone b/clone/clone index f6e0617..a154fc7 100755 --- a/clone/clone +++ b/clone/clone @@ -236,30 +236,15 @@ step8(){ echo "\n>>> [8] Set up automatic login"; - # (1) Copy default login systemd script # - #echo " (.) Copy default getty systemd script"; - #sudo cp /mnt/lib/systemd/system/getty@.service /mnt/etc/systemd/system/autologin@.service; - #sudo chmod 755 /mnt/etc/systemd/system/autologin@.service; + # (1) Create link in order to be handled # + echo " (.) Emulate \`systemctl set-default multi-user.target\`"; + sudo ln -fs /mnt/lib/systemd/system/multi-user.target /mnt/etc/systemd/system/default.target; - # (2) Create link in order to be handled # - echo " (.) Link systemd files to be handled"; + # (2) Link autologin to tty service # + echo " (.) Link autologin script to tty's default"; sudo ln -fs /mnt/etc/systemd/system/autologin@.service /mnt/etc/systemd/system/getty.target.wants/getty@tty1.service; - sudo ln -fs /mnt/lib/systemd/system/multi-user.target /mnt/etc/systemd/system/default.target; - # (3) Update autologin script # - #echo " (.) Update script to autologin as 'sats-user'"; - #sudo cat /mnt/etc/systemd/system/autologin@.service | \ - # sed 's/^ExecStart=-\/sbin\/agetty --noclear/ExecStart=-\/sbin\/agetty --autologin sats-user/' | \ - # sed 's/^Restart=.\+$/Restart=no/' | \ - # sed 's/^Restart=.\+$/Restart=no/' | \ - # sed 's/^\[Service\]$/\[Service\]\nAlias=getty.target.wants\/getty@tty1.service/' | \ - # tee tmp/autologin > /dev/null; - # (4) Updating file from tmp update # - #echo " (.) Copying temporary update to real file"; - #cat tmp/autologin | sudo tee /mnt/etc/systemd/system/autologin@.service > /dev/null; - #rm tmp/autologin; - echo "<<< done"; step9;