From 69b390bc406a20a0e7e9a8337756bd558f284034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20K=C3=B6rber?= Date: Mon, 22 Apr 2024 16:28:45 +0200 Subject: [PATCH] Update ares install script --- install_scripts/ares.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/install_scripts/ares.sh b/install_scripts/ares.sh index ed7ae99..f43338b 100755 --- a/install_scripts/ares.sh +++ b/install_scripts/ares.sh @@ -1,14 +1,10 @@ #!/usr/bin/env bash -# Parameters: -# -# $1: Device - set -o xtrace set -o nounset set -o errexit -DEVICE="${1:?}" +DEVICE="/dev/sda" if [[ ! -b "${DEVICE}" ]] ; then printf '%s does not look like a device' "${DEVICE}" @@ -106,6 +102,28 @@ grub-mkconfig -o /boot/grub/grub.cfg systemctl enable NetworkManager passwd + +# enable root autologin on first boot + +mkdir /etc/systemd/system/getty@tty1.service.d/ +cat << EOF > /etc/systemd/system/getty@tty1.service.d/autologin.conf +[Service] +ExecStart= +ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin root %I $TERM +EOF +# ExecStartPost=/bin/rm /etc/systemd/system/getty@tty1.service.d/autologin.conf +# ExecStartPost=/bin/rmdir /etc/systemd/system/getty@tty1.service.d/ + +# Run +cat << 'EOF' > /root/.bash_profile + if [[ "\$(tty)" == "/dev/tty1" ]] ; then + rm -rf /etc/systemd/system/getty@tty1.service.d/ + if /var/lib/dotfiles/install.sh ; then + rm -f /root/.bash_profile + reboot + fi + fi +EOF CHROOTSCRIPT chmod +x /mnt/chroot-script.sh