From c55b20de200d03cc4df26fd8859bec6447904c00 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Sun, 1 Sep 2019 16:39:09 +0200 Subject: Work advencing well --- arch_install-UEFI.sh | 175 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 161 insertions(+), 14 deletions(-) diff --git a/arch_install-UEFI.sh b/arch_install-UEFI.sh index 7e608b9..57ff6d3 100755 --- a/arch_install-UEFI.sh +++ b/arch_install-UEFI.sh @@ -8,6 +8,7 @@ rtpwd="" rtrtpwd="walk" usrpwd="" usrusrpwd="fade" +hstnm="" clear echo "#============ WELCOME ============#" @@ -78,6 +79,9 @@ fi # ================================================================================================ # while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr != YES ]]; do + drvnm="" + swps="" + rts="" clear echo "#========= I. DISK SETUP =========#" echo "# #" @@ -91,6 +95,10 @@ while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr echo "/dev/sd_" echo -n "~> " read -n 1 drvnm + if [[ $drvnm == "" ]]; then + echo && echo + echo "Can't be empty, retrying..." + fi done clear echo "#========= I. DISK SETUP =========#" @@ -105,6 +113,10 @@ while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr echo "_G" echo -n "~> " read swps + if [[ $swps == "" ]]; then + echo && echo + echo "Can't be empty, retrying..." + fi done clear echo "#========= I. DISK SETUP =========#" @@ -119,6 +131,10 @@ while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr echo "__G" echo -n "~> " read rts + if [[ $rts == "" ]]; then + echo && echo + echo "Can't be empty, retrying..." + fi done drv="/dev/sd$drvnm" @@ -127,19 +143,22 @@ while [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr swpsze=$swps"G" clear - echo "#=========================== CONFIRM THIS IS EXACT ==============================#" - echo "# #" - echo "# DRIVE TO USE: $drv #" - echo "# #" - echo "# /boot/efi > BOOT partiton size > $btsze / > ROOT partition size > $rtsze #" - echo "# SWAP partiton size > $swpsze /home > HOME partition size > all that remains #" - echo "# #" - echo "#================================================================================#" + echo "#============= CONFIRM THIS IS CORRECT ===============#" + echo "# #" + echo "# DRIVE TO USE: $drv #" + echo "# #" + echo "# /boot/efi > BOOT partition size: $btsze #" + echo "# SWAP partition size: $swpsze #" + echo "# / > ROOT partition size: $rtsze #" + echo "# /home > HOME partition size: all that remains #" + echo "# #" + echo "#=====================================================#" echo && echo echo "Is that correct? [y/N]" echo -n "~> " read answr if [[ $answr != y && $answr != Y && $answr != yes && $answr != Yes && $answr != YES ]]; then + echo && echo echo "Retrying..." echo echo "Press [retrun] key to continue" @@ -183,7 +202,7 @@ done clear echo "#======= II. USERS SETUP =========#" echo "# #" -echo "# 2. user add #" +echo "# 2. User add #" echo "# #" echo "#=================================#" echo && echo @@ -216,13 +235,141 @@ if [[ $answr == y || $answr == Y || $answr == yes || $answr == Yes || $answr == fi done fi +clear +echo "#======= II. USERS SETUP =========#" +echo "# #" +echo "# 3. hostname #" +echo "# #" +echo "#=================================#" +while [[ $hstnm == "" ]]; do + echo && echo + echo "Enter your disired hostname for this maching (can't be empty):" + echo -n "~> " + read hstnm + if [[ $hstnm == "" ]]; then + echo && echo + echo "Hostname is empty, retrying..." + sleep 2 + fi +done +# ================================================================================================ # +# ===================================== THE ACTUAL INSTALL ======================================= # +# ================================================================================================ # -#timedatectl set-ntp true +# ============================================================== # +# ========================== NTP DATE ========================== # +# ============================================================== # + + +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 1. Setting date #" +echo "# via ntp #" +echo "# #" +echo "#=================================#" +timedatectl set-ntp true +sleep 2 + +# ============================================================== # +# ==================== PARTITIONING DISK ======================= # +# ============================================================== # -# ================================================================================================ # -# ===================================== PARTITIONING DISK ======================================== # -# ================================================================================================ # -#echo "2048, $btsze, , *" | sfdisk $drv +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 2. Partitionning #" +echo "# disk $drv #" +echo "# #" +echo "#=================================#" +sed -e 's/\s*\([\+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk $drv + g # create a new GPT partition table + n # new partition (/dev/sdx1) + 1 # partition number 1 + # first sector (2048) + +$btsze # boot size partition + n # new partition (/dev/sdx2) + 2 # partition number 2 + # default start block + +$swpsze # swap size partition + n # new partition (/dev/sdx3) + 3 # partition number 3 + # default start block + +$rtsze # root size partition + n # new partition (/dev/sdx4) + 4 # partition number 4 + # default start block + # all that remains + w # write the partition table and quit +EOF +mkswap $drv"2" +mkfs.ext2 $drv"1" +mkfs.ext4 $drv"3" +mkfs.ext4 $drv"4" +sleep 2 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 3. Mounting partitions #" +echo "# #" +echo "#=================================#" +swapon $drv"2" +mkdir /mnt/arch +mount $drv"3" /mnt/arch +mkdir /mnt/arch/boot +mkdir /mnt/arch/boot/efi +mount $drv"1" /mnt/arch/boot/efi +mkdir /mnt/arch/home +mount $drv"4" /mnt/arch/home +sleep 2 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 4. Installing base system #" +echo "# #" +echo "#=================================#" +pacstrap /mnt base base-devel +sleep 1 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 5. Generating fstab #" +echo "# #" +echo "#=================================#" +genfstab -U /mnt >> /mnt/arch/etc/fstab +sleep 2 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 6. Now changing root #" +echo "# #" +echo "#=================================#" +arch-chroot /mnt/arch +sleep 1 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 7. Setting time zone #" +echo "# to Paris, France, #" +echo "# for this is my time zone. #" +echo "# Change this later accordingly #" +echo "# to your own time zone #" +echo "# (Joe didn't find a quick #" +echo "# and easy way to ask you #" +echo "# about your time zone, #" +echo "# Joe hopes your can understand) #" +echo "# #" +echo "#=================================#" +ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime +sleep 8 +clear +echo "#===== III. INSTALLING LINUX =====#" +echo "# #" +echo "# 8. setting hardware clock #" +echo "# #" +echo "#=================================#" +hwclock --systohc +sleep 2 -- cgit v1.2.3