diff --git a/install.sh b/install.sh index cc2314d..3f4e5b1 100644 --- a/install.sh +++ b/install.sh @@ -24,9 +24,9 @@ if [[ ! $REPLY =~ ^[Yy]$ ]] then exit 1 fi - -# Partitioning. echo + +# Selecting disk. echo "Please select a disk to partition:" echo @@ -43,6 +43,21 @@ declare -a dsks select dev in ${dsks[*]} 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:" while [ -z "$pwcr" ]; do echo "Please enter a password: " @@ -58,33 +73,52 @@ else echo "You have entered different passwords. Try again.." fi -# Ask for everything that is necessary later. -#echo "Before installing the system, please enter a hostname:" -#echo -#read host -#echo +# Setting hostname. +echo "Before installing the system, please enter a hostname:" +echo +read host +echo -#echo "Please enter a password for the root account:" -#read pwr -#echo +# Setting root password. +echo "Please enter a password for the root account:" +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:" -#read user -#echo -# -#echo "Also please enter a password for your user:" -#read pwu -#echo -# -#echo "System is getting installed.." -#echo +# Setting username +echo "And please enter a username:" +read user +echo -# Separate values by spaces. -IFS=' ' +# Setting user password. +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. -array=($dev) -dev="${array[0]}" +echo "System is getting installed.." echo # Starting partitioning. @@ -97,7 +131,7 @@ sgdisk -Z /dev/$dev && echo # Creating boot partition. -szmn="${array[1]%?}" +#szmn="${array[1]%?}" echo "Creating boot partition of 256 MB." sgdisk -n 1:0:+256M /dev/$dev && echo @@ -113,7 +147,6 @@ echo # Print partitions. echo "This is your new partition table:" lsblk | grep "$dev" -sleep 1 echo # Exit. @@ -141,15 +174,8 @@ echo lsblk | grep "$dev" echo - # Lol, this part: -main=$(> /mnt/boot/loader/loader.conf arch-chroot /mnt localectl --no-convert set-keymap de-latin1-nodeadkeys -echo "Username?" -read 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 cat << EOF > /mnt//etc/X11/xorg.conf.d/00-keyboard.conf