Skip to content

Commit

Permalink
added autologin
Browse files Browse the repository at this point in the history
  • Loading branch information
builderjer committed Nov 27, 2024
1 parent bd83c7e commit 2764c25
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions autologin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin ovos --noclear %I 38400 linux
10 changes: 9 additions & 1 deletion build_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ if [ "$USER" != "pi" ]; then
# 7. Add the new user to the sudo group
echo "Adding $USER to the sudo group..."
sed -i "/^sudo:/s/pi/$USER/" /etc/group

# 8. Allow autologin of user
echo "Creating autologin for $USER"
# NOTE: Not sure that the link is needed
ln -fs /lib/systemd/system/[email protected] /etc/systemd/system/getty.target.wants/[email protected]
cp -v /mounted-github-repo/autologin.conf /etc/systemd/system/[email protected]/autologin.conf
sed -i "s/\bovos\b/${USER}/g" /etc/systemd/system/[email protected]/autologin.conf


echo "User has been renamed, added to sudo group, and password updated."
fi
Expand Down Expand Up @@ -89,4 +97,4 @@ chown root:root /var/lib/systemd/linger/$USER
chmod 644 /var/lib/systemd/linger/$USER

echo "Cleaning up apt packages..."
apt-get --purge autoremove -y && apt-get clean
apt-get --purge autoremove -y && apt-get clean

0 comments on commit 2764c25

Please sign in to comment.