Update install.sh

This commit is contained in:
proledatarian 2022-02-14 15:10:49 +00:00
parent 31cc977a64
commit 1423b82aa4
1 changed files with 17 additions and 29 deletions

View File

@ -75,9 +75,9 @@ else
echo
echo "You have entered different passwords. Try again.."
fi
break
done
echo
# Setting hostname.
echo "Before installing the system, please enter a hostname:"
@ -86,7 +86,7 @@ read host
echo
# Setting root password.
echo "Please enter a password for the root account:"
echo "Choose a password for the root account:"
while [ -z "$pwr" ]; do
echo "Please enter a password: "
read -s pwfr
@ -100,9 +100,9 @@ else
echo
echo "You have entered different passwords. Try again.."
fi
break
done
echo
# Setting username
echo "And please enter a username:"
@ -110,7 +110,7 @@ read user
echo
# Setting user password.
echo "Also please enter a password for your user:"
echo "Also please choose a password for your user:"
while [ -z "$pwu" ]; do
echo "Please enter a password: "
read -s pwfr
@ -160,20 +160,20 @@ lsblk | grep "$dev"
echo
# Get new variable.
main=$(dev)2
main=${dev}2
# Encrypting partition.
echo "Encrypting system partition. This might take a while."
echo
echo -en "&pwcr\n$pwcr" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$main &&
echo -en "$pwcr\n$pwcr" | cryptsetup -c aes-xts-plain -s 512 luksFormat /dev/$main &&
echo "Partition successfully encrypted."
echo
# Opening encrypted partition and mounting at /dev/mapper/lvm.
echo "Decrypting.. This also might take a while."
echo
echo -en "&pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main lvm &&
echo -en "$pwcr\n$pwcr" | cryptsetup luksOpen /dev/$main lvm &&
echo "Partition successfully opened."
echo
@ -207,7 +207,7 @@ echo
echo "Creating the filesystem."
echo
boot=$(dev)1
boot=${dev}1
mkfs.fat -F 32 -n UEFI /dev/$boot &&
echo "Filesystem for boot successfully created."
@ -259,8 +259,6 @@ genfstab -Up /mnt > /mnt/etc/fstab &&
echo "Installed fstab."
# Setting hostname.
echo "Please enter a hostname:"
read host &&
echo $host > /mnt/etc/hostname
echo "Hostname set."
@ -300,41 +298,28 @@ arch-chroot /mnt systemctl enable NetworkManager sddm &&
echo
echo "Done."
# Set root password
echo "Setting root password:"
echo -en "&pwrt\n$pwrt" | arch-chroot /mnt passwd
echo -en "$pwrt\n$pwrt" | arch-chroot /mnt passwd
# Install bootloader.
arch-chroot /mnt bootctl install
# Set bootloader entry.
cat << EOF > /mnt/boot/loader/entries/arch.conf
# The title of your systemd-boot entry.
title Arch Linux
# Change only when using different kernel, e. g. /vmlinuz-linux-zen.
linux /vmlinuz-linux-zen
# Uncomment if you have installed the respective Microcode.
#initrd /amd-ucode.img
#initrd /intel-ucode.img
# Change only when using different kernel, e. g. /vmlinuz-linux-zen.
initrd /initramfs-linux-zen.img
# Change to the correct device like /dev/sda2.
options cryptdevice=/dev/$main:lvm:allow-discards
# Change to correct LVM device.
options root=/dev/mapper/main-root rw
# Localization options.
options lang=de locale=de_DE.UTF-8
# Default init is systemd.
options init=/usr/lib/systemd/systemd
# Prints only kernel errors and above on boot.
#options loglevel=3
EOF
# Set bootloader fallback entry.
cat << EOF > /mnt/boot/loader/entries/arch-fallback.conf
title Arch Linux Fallback
linux /vmlinuz-linux
@ -345,13 +330,16 @@ options lang=de locale=de_DE.UTF-8
options init=/usr/lib/systemd/systemd
EOF
# Set bootloader.
echo "timeout 1" >> /mnt/boot/loader/loader.conf
echo "default arch.conf" >> /mnt/boot/loader/loader.conf
# Set X locale.
arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys
# Set username, password and group.
arch-chroot /mnt useradd -m $user &&
echo -en "&pwur\n$pwur" | arch-chroot /mnt passwd $user &&
echo -en "$pwur\n$pwur" | arch-chroot /mnt passwd $user &&
arch-chroot /mnt gpasswd -a $user wheel
cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf