Update install.sh

This commit is contained in:
proledatarian 2022-02-13 15:25:31 +00:00
parent 8dbcd4125f
commit c5735e2240
1 changed files with 129 additions and 0 deletions

View File

@ -142,3 +142,132 @@ echo -e
lsblk lsblk
echo -e echo -e
# Updating mirrors using reflector.
echo "Updating mirrors.."
echo -e
#reflector --verbose --latest 10 --country Germany --age 24 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
reflector --verbose --latest 10 --age 24 --protocol https --sort rate --save /etc/pacman.d/mirrorlist &&
echo -e
echo "Done."
# Installing base system.
echo "Installing basic packages.."
echo -e
pacstrap /mnt base base-devel firefox konsole linux linux-firmware linux-zen lvm2 networkmanager nano plasma-desktop sddm sddm-kcm &&
echo -e
echo "Base system installed."
echo -e
# Generating fstab.
echo "Generating fstab."
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."
# Setting locale.
echo "Setting and generating locale."
echo -e
localegen=$(cat /mnt/etc/locale.gen)
cat <<EOF >/mnt/etc/locale.gen
en_US.UTF-8 UTF-8
de_DE.UTF-8 UTF-8
EOF
echo "${localegen}" >>/mnt/etc/locale.gen
arch-chroot /mnt locale-gen
echo "LANG=de_DE.UTF-8" >/mnt/etc/locale.conf
echo -e
echo "Done."
# Editing mkinitcpio.conf.
echo "Editing /etc/mkinitcpio.conf."
echo -e
sed -i '7s/.*/MODULES=(ext4)/' /mnt/etc/mkinitcpio.conf &&
sed -i '52s/.*/HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsck shutdown)/' /mnt/etc/mkinitcpio.conf &&
echo -e
echo "Done."
# Creating inital ramdisk.
echo "Creating inital ramdisk for linux-zen."
echo -e
arch-chroot /mnt mkinitcpio -p linux-zen &&
echo "Done."
# Enable network and display manager.
echo "Enabling Networkmanager and display manager (sddm)."
echo -e
arch-chroot /mnt systemctl enable NetworkManager sddm &&
echo -e
echo "Done."
echo "Setting root password:"
arch-chroot /mnt passwd
arch-chroot /mnt bootctl install
cat << EOF > /mnt/boot/loader/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/$part: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
cat << EOF > /mnt/boot/loader/arch-fallback.conf
title Arch Linux Fallback
linux /vmlinuz-linux
initrd /initramfs-linux-fallback.img
options cryptdevice=/dev/$part:lvm
options root=/dev/mapper/main-root rw
options lang=de locale=de_DE.UTF-8
options init=/usr/lib/systemd/systemd
EOF
echo "timeout 1" >> /mnt/boot/loader/loader.conf
echo "default arch.conf" >> /mnt/boot/loader/loader.conf
localectl --no-convert set-keymap de-latin1-nodeadkeys
echo "Username?"
read user
useradd -m $user &&
passwd $user &&
gpasswd -a $user wheel
sed -i '82s/.*/%wheel ALL=(ALL) ALL/' /mnt/etc/sudoers
mkdir /mnt/etc/sddm.conf.d
echo "[Autologin]" >> /mnt/etc/sddm.conf.d/autologin.conf
echo "User=hans" >> /mnt/etc/sddm.conf.d/autologin.conf
echo "Session=plasma" >> /mnt/etc/sddm.conf.d/autologin.conf
umount /mnt/boot
umount /mnt/home
reboot