Update install.sh
This commit is contained in:
parent
95c84238ed
commit
00c4d49a97
108
install.sh
108
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=$(</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
|
||||
#main=$(</tmp/dev)2 && i=( $(lsblk | grep "$main" | tail -n+1 | awk '{print $4}') ) && szmn="${i%?}"
|
||||
|
||||
# Creating physical volume.
|
||||
echo "Creating physical volume."
|
||||
|
@ -175,7 +201,7 @@ echo
|
|||
echo "Creating the filesystem."
|
||||
echo
|
||||
|
||||
boot=$(</tmp/dev)1
|
||||
boot=$(dev)1
|
||||
|
||||
mkfs.fat -F 32 -n UEFI /dev/$boot &&
|
||||
echo "Filesystem for boot successfully created."
|
||||
|
@ -207,8 +233,8 @@ echo
|
|||
# Updating mirrors using reflector.
|
||||
echo "Updating mirrors.."
|
||||
echo
|
||||
#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 --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
|
||||
echo "Done."
|
||||
|
||||
|
@ -269,7 +295,7 @@ echo
|
|||
echo "Done."
|
||||
|
||||
echo "Setting root password:"
|
||||
arch-chroot /mnt passwd
|
||||
echo -en "&pwrt\n$pwrt" | arch-chroot /mnt passwd
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue