Update install.sh

This commit is contained in:
proledatarian 2022-12-12 20:30:55 +00:00
parent 2adeadfbfc
commit f74ac33aef
1 changed files with 6 additions and 21 deletions

View File

@ -1,19 +1,5 @@
#!/bin/bash #!/bin/bash
### Variables:
# $dsks = whole lsblk output (e.g. "sda 1,0T, sdb ..")
# $disk = only selected disk (e.g. "sdc 500G")
# $dev = selected disk without size (e.g. "sdd")
# $main = main partition (e.g. "sde2")
# $szmn = size of the main partition (e.g. "50")
# szrt = size of root LVM volume
# $boot = boot partition (e.g. "sdf1")
# $host = hostname
# $user = username
# $pwur = user password
# $pwrt = root password
# $pwcr = encryption password
exec >> >(tee -i /tmp/install.log) exec >> >(tee -i /tmp/install.log)
exec 2>&1 exec 2>&1
@ -24,7 +10,7 @@ echo "Welcome to the Arch Linux installation script!"
echo "This script will ERASE ALL DATA on the partition you will choose next!" echo "This script will ERASE ALL DATA on the partition you will choose next!"
echo echo
read -p "Do you want to continue? Type [Y]es or [N]o. " -n 1 -r read -p "Do you want to continue? Type [Y]es or [N]o. " -n 1 -r
echo # (optional) move to a new line echo
if [[ ! $REPLY =~ ^[Yy]$ ]] if [[ ! $REPLY =~ ^[Yy]$ ]]
then then
exit 1 exit 1
@ -208,9 +194,9 @@ umount /mnt &&
echo echo
echo "Mounting.." && echo "Mounting.." &&
mount -o compress=zstd,subvol=root /dev/mapper/main /mnt && mount -o autodefrag,compress=zstd:3,subvol=root /dev/mapper/main /mnt &&
mkdir /mnt/home && mkdir /mnt/home &&
mount -o compress=zstd,subvol=home /dev/mapper/main /mnt/home && mount -o autodefrag,compress=zstd:3,subvol=home /dev/mapper/main /mnt/home &&
mkdir /mnt/boot && mkdir /mnt/boot &&
mount /dev/$boot /mnt/boot && mount /dev/$boot /mnt/boot &&
echo "Mounting complete." && echo "Mounting complete." &&
@ -222,7 +208,6 @@ echo
# Updating mirrors using reflector. # Updating mirrors using reflector.
echo "Updating mirrors.." echo "Updating mirrors.."
reflector --verbose --latest 10 --country Germany --age 24 --protocol https --sort rate --save /etc/pacman.d/mirrorlist && 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 "Done." echo "Done."
echo echo
@ -251,16 +236,13 @@ echo
# Setting locale. # Setting locale.
echo "Setting and generating locale.." echo "Setting and generating locale.."
#localegen=$(cat /mnt/etc/locale.gen)
cat << EOF >/mnt/etc/locale.gen cat << EOF >/mnt/etc/locale.gen
en_US.UTF-8 UTF-8 en_US.UTF-8 UTF-8
#de_DE.UTF-8 UTF-8
EOF EOF
#echo "${localegen}" >>/mnt/etc/locale.gen #echo "${localegen}" >>/mnt/etc/locale.gen
arch-chroot /mnt locale-gen arch-chroot /mnt locale-gen
echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf && echo "LANG=en_US.UTF-8" > /mnt/etc/locale.conf &&
#echo "LANG=de_DE.UTF-8" >/mnt/etc/locale.conf
echo "KEYMAP=de-latin1" > /mnt/etc/vconsole.conf && echo "KEYMAP=de-latin1" > /mnt/etc/vconsole.conf &&
echo "Done." echo "Done."
echo echo
@ -317,6 +299,9 @@ arch-chroot /mnt bootctl --path=/boot install &&
echo "Done." echo "Done."
echo echo
# Check if installed on SSD
# Get UUID for primary partition # Get UUID for primary partition
uuid=$(ls -l /dev/disk/by-uuid | grep $main | awk '{print $9}') uuid=$(ls -l /dev/disk/by-uuid | grep $main | awk '{print $9}')