Update install.sh

This commit is contained in:
proledatarian 2022-02-14 14:37:22 +00:00
parent 95c84238ed
commit 00c4d49a97
1 changed files with 66 additions and 42 deletions

View File

@ -24,9 +24,9 @@ if [[ ! $REPLY =~ ^[Yy]$ ]]
then then
exit 1 exit 1
fi fi
# Partitioning.
echo echo
# Selecting disk.
echo "Please select a disk to partition:" echo "Please select a disk to partition:"
echo echo
@ -43,6 +43,21 @@ declare -a dsks
select dev in ${dsks[*]} select dev in ${dsks[*]}
do do
# Separate values by spaces.
IFS=' '
# Create new variable of selection.
array=($dev)
dev="${array[0]}"
szmn="${array[1]%?}"
# Setting partition size.
echo "Your system partition has a size of $szmn GB."
echo "What size should your root partition have?"
read szrt
echo
# Setting encryption password.
echo "Choose a strong password for encrypting the primary partition:" echo "Choose a strong password for encrypting the primary partition:"
while [ -z "$pwcr" ]; do while [ -z "$pwcr" ]; do
echo "Please enter a password: " echo "Please enter a password: "
@ -58,33 +73,52 @@ else
echo "You have entered different passwords. Try again.." echo "You have entered different passwords. Try again.."
fi fi
# Ask for everything that is necessary later. # Setting hostname.
#echo "Before installing the system, please enter a hostname:" echo "Before installing the system, please enter a hostname:"
#echo echo
#read host read host
#echo echo
#echo "Please enter a password for the root account:" # Setting root password.
#read pwr echo "Please enter a password for the root account:"
#echo while [ -z "$pwr" ]; do
echo "Please enter a password: "
read -s pwfr
read -s -p "Retype a password: " pwsc
if [ $pwfr == $pwsc ];
then
pwrt=$pwfr
echo
echo "Both passwords are the same. Continuing.."
else
echo
echo "You have entered different passwords. Try again.."
fi
echo
#echo "And please enter a username:" # Setting username
#read user echo "And please enter a username:"
#echo read user
# echo
#echo "Also please enter a password for your user:"
#read pwu
#echo
#
#echo "System is getting installed.."
#echo
# Separate values by spaces. # Setting user password.
IFS=' ' echo "Also please enter a password for your user:"
while [ -z "$pwu" ]; do
echo "Please enter a password: "
read -s pwfr
read -s -p "Retype a password: " pwsc
if [ $pwfr == $pwsc ];
then
pwur=$pwfr
echo
echo "Both passwords are the same. Continuing.."
else
echo
echo "You have entered different passwords. Try again.."
fi
echo
# Create new variable of selection. echo "System is getting installed.."
array=($dev)
dev="${array[0]}"
echo echo
# Starting partitioning. # Starting partitioning.
@ -97,7 +131,7 @@ sgdisk -Z /dev/$dev &&
echo echo
# Creating boot partition. # Creating boot partition.
szmn="${array[1]%?}" #szmn="${array[1]%?}"
echo "Creating boot partition of 256 MB." echo "Creating boot partition of 256 MB."
sgdisk -n 1:0:+256M /dev/$dev && sgdisk -n 1:0:+256M /dev/$dev &&
echo echo
@ -113,7 +147,6 @@ echo
# Print partitions. # Print partitions.
echo "This is your new partition table:" echo "This is your new partition table:"
lsblk | grep "$dev" lsblk | grep "$dev"
sleep 1
echo echo
# Exit. # Exit.
@ -141,15 +174,8 @@ echo
lsblk | grep "$dev" lsblk | grep "$dev"
echo echo
# Lol, this part: # Lol, this part:
main=$(</tmp/dev)2 && i=( $(lsblk | grep "$main" | tail -n+1 | awk '{print $4}') ) && szmn="${i%?}" #main=$(</tmp/dev)2 && i=( $(lsblk | grep "$main" | tail -n+1 | awk '{print $4}') ) && szmn="${i%?}"
echo "Your system partition has a size of $szmn GB."
echo "What size should your root partition have?"
read szrt
echo "Creating a $szrt GB root volume.."
echo
# Creating physical volume. # Creating physical volume.
echo "Creating physical volume." echo "Creating physical volume."
@ -175,7 +201,7 @@ echo
echo "Creating the filesystem." echo "Creating the filesystem."
echo echo
boot=$(</tmp/dev)1 boot=$(dev)1
mkfs.fat -F 32 -n UEFI /dev/$boot && mkfs.fat -F 32 -n UEFI /dev/$boot &&
echo "Filesystem for boot successfully created." echo "Filesystem for boot successfully created."
@ -207,8 +233,8 @@ echo
# Updating mirrors using reflector. # Updating mirrors using reflector.
echo "Updating mirrors.." echo "Updating mirrors.."
echo echo
#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 && #reflector --verbose --latest 10 --age 24 --protocol https --sort rate --save /etc/pacman.d/mirrorlist &&
echo echo
echo "Done." echo "Done."
@ -269,7 +295,7 @@ echo
echo "Done." echo "Done."
echo "Setting root password:" echo "Setting root password:"
arch-chroot /mnt passwd echo -en "&pwrt\n$pwrt" | arch-chroot /mnt passwd
arch-chroot /mnt bootctl install arch-chroot /mnt bootctl install
@ -318,10 +344,8 @@ echo "default arch.conf" >> /mnt/boot/loader/loader.conf
arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys
echo "Username?"
read user
arch-chroot /mnt useradd -m $user && arch-chroot /mnt useradd -m $user &&
arch-chroot /mnt passwd $user && echo -en "&pwur\n$pwur" | arch-chroot /mnt passwd $user &&
arch-chroot /mnt gpasswd -a $user wheel arch-chroot /mnt gpasswd -a $user wheel
cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf