added some tui in install-arch.sh

This commit is contained in:
wt committed 2024-06-10 15:24:31 +07:00
1 parent c2dcdfd1b1
commit cf23958791
1 file changed
+36 -2
+36 -2
View File
@@ -14,15 +14,36 @@ swap_size=1024
hostname="arch" hostname="arch"
normal_user="tola" normal_user="tola"
rootfstype="btrfs" rootfstype="btrfs"
answer=n
# ------------------- # -------------------
# -------------- cheking system ----------------- # -------------- cheking system -----------------
printf "$YELLOW ::$GREEN Cheking system$RESET "
if [[ $(uname) != "Linux" ]]; then if [[ $(uname) != "Linux" ]]; then
printf "$RED This is working only on Linux systems (only Arch Linux)\n$RESET" printf "$RED This is working only on Linux systems (only Arch Linux)\n$RESET"
exit 1 exit 1
fi fi
printf "[$GREEN OK $RESET]\n"
# ---------------------------------------------- # ----------------------------------------------
# ---------- cheking root ----------------------
printf "$YELLOW ::$GREEN Cheking permissions$RESET "
if [[ "$(id -u)" != "0" ]]; then
printf "$RED ERROR:$RESET You must be root\n"
exit 1
fi
printf "[$GREEN OK $RESET]\n"
# ---------------------------------------------
# --------------- cheking disk ---------------
printf "$YELLOW Your disk is $disk?$RESET ($(echo $GREEN)y$RESET/$(echo $RED)n$RESET): "
read answer
if [[ "$answer" != "y" ]];then
printf "$RED ERROR:$RESET Please Write your disk name in this script.\n"
exit 1
fi
# -------------------------------------------
# ---- umounting disks ---- # ---- umounting disks ----
umount ${disk}* umount ${disk}*
# ------------------------- # -------------------------
@@ -48,60 +69,73 @@ swapon ${disk}3
# ------------------------------------------------- # -------------------------------------------------
# ------------ installing the system -------------- # ------------ installing the system --------------
pacstrap /mnt base linux linux-firmware vim printf "$YELLOW ::$GREEN Installing the system$RESET\n"
pacstrap /mnt base base-devel linux linux-firmware vim
# ------------------------------------------------- # -------------------------------------------------
# ---------------- system configuration -------------------- # ---------------- system configuration --------------------
printf "$YELLOW ::$GREEN System configuration$RESET\n"
# ----- generating fstab ------------------- # ----- generating fstab -------------------
printf "$YELLOW ::$GREEN Geerating fstab$RESET\n"
genfstab -U /mnt > /mnt/etc/fstab genfstab -U /mnt > /mnt/etc/fstab
# ------------------------------------------ # ------------------------------------------
# ----- installing timezone ---------------- # ----- installing timezone ----------------
printf "$YELLOW ::$GREEN Installing timezone$RESET\n"
arch-chroot /mnt bash -c 'ln -svf /usr/share/zoneinfo/Asia/Novosibirsk /etc/localtime' arch-chroot /mnt bash -c 'ln -svf /usr/share/zoneinfo/Asia/Novosibirsk /etc/localtime'
# ------------------------------------------ # ------------------------------------------
# ------ configuring system clock --------------- # ------ configuring system clock ---------------
printf "$YELLOW ::$GREEN Configuring system clock$RESET\n"
arch-chroot /mnt bash -c 'hwclock --systohc --utc' arch-chroot /mnt bash -c 'hwclock --systohc --utc'
# ----------------------------------------------- # -----------------------------------------------
# ------- installing locale ------------------ # ------- installing locale ------------------
printf "$YELLOW ::$GREEN Installing locale$RESET\n"
arch-chroot /mnt bash -c 'printf "en_US.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8" >> /etc/locale.gen;locale-gen' arch-chroot /mnt bash -c 'printf "en_US.UTF-8 UTF-8\nru_RU.UTF-8 UTF-8" >> /etc/locale.gen;locale-gen'
arch-chroot /mnt bash -c 'printf "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8" > /etc/locale.conf' arch-chroot /mnt bash -c 'printf "LC_ALL=en_US.UTF-8\nLANG=en_US.UTF-8" > /etc/locale.conf'
# -------------------------------------------- # --------------------------------------------
# -------- configuring console ---------------------- # -------- configuring console ----------------------
printf "$YELLOW ::$GREEN Configuring console$RESET\n"
arch-chroot /mnt bash -c 'printf "FONT=Lat2-Terminus16\nKEYMAP=ruwin_alt_sh-UTF-8" > /etc/vconsole.conf' arch-chroot /mnt bash -c 'printf "FONT=Lat2-Terminus16\nKEYMAP=ruwin_alt_sh-UTF-8" > /etc/vconsole.conf'
# --------------------------------------------------- # ---------------------------------------------------
# ----- configuring networking hostname and hosts ------- # ----- configuring networking hostname and hosts -------
printf "$YELLOW ::$GREEN Installing hostname and hosts$RESET\n"
arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'echo $hostname > /etc/hostname' arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'echo $hostname > /etc/hostname'
arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'printf "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 ${hostname}.localdomain ${hostname}" >> /etc/hosts' arch-chroot /mnt /usr/bin/env -i hostname=$hostname bash -c 'printf "127.0.0.1 localhost\n::1 localhost\n127.0.1.1 ${hostname}.localdomain ${hostname}" >> /etc/hosts'
# ------------------------------------------------------- # -------------------------------------------------------
# ----- installing root password and normal user ----------------------- # ----- installing root password and normal user -----------------------
printf "$YELLOW ::$GREEN Installing root password and normal user$RESET\n"
arch-chroot /mnt /usr/bin/env -i arch_user=$normal_user bash -c 'passwd;useradd -m -g users -G wheel -s /bin/bash $arch_user;passwd $arch_user' arch-chroot /mnt /usr/bin/env -i arch_user=$normal_user bash -c 'passwd;useradd -m -g users -G wheel -s /bin/bash $arch_user;passwd $arch_user'
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# ------------ installing and configuring sudo ------------------- # ------------ installing and configuring sudo -------------------
printf "$YELLOW ::$GREEN Installing and configuring sudo$RESET\n"
arch-chroot /mnt bash -c 'pacman -S sudo;echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers' arch-chroot /mnt bash -c 'pacman -S sudo;echo "%wheel ALL=(ALL:ALL) ALL" >> /etc/sudoers'
# ------------------------------------------------- # -------------------------------------------------
# ----------- installing and configuring grub ---------- # ----------- installing and configuring grub ----------
printf "$YELLOW ::$GREEN Installing and configuring grub$RESET\n"
arch-chroot /mnt /usr/bin/env -i grubdisk=$disk bash -c 'pacman -S grub efibootmgr os-prober;grub-install $grubdisk;grub-mkconfig -o /boot/grub/grub.cfg' arch-chroot /mnt /usr/bin/env -i grubdisk=$disk bash -c 'pacman -S grub efibootmgr os-prober;grub-install $grubdisk;grub-mkconfig -o /boot/grub/grub.cfg'
# ------------------------------------------------------ # ------------------------------------------------------
# --------- installing and enabling networkmanager -------------------- # --------- installing and enabling networkmanager --------------------
printf "$YELLOW ::$GREEN Installing and configuring NetworkManager$RESET\n"
arch-chroot /mnt bash -c 'pacman -S netctl dhcpcd networkmanager network-manager-applet;systemctl enable NetworkManager' arch-chroot /mnt bash -c 'pacman -S netctl dhcpcd networkmanager network-manager-applet;systemctl enable NetworkManager'
# -------------------------------------------------------- # --------------------------------------------------------
# ------ deps for connecting iphone ---------------------- # ------ deps for connecting iphone ----------------------
printf "$YELLOW ::$GREEN Installing dependencies for connecting iphone$RESET\n"
arch-chroot /mnt bash -c 'pacman -S libimobiledevice usbmuxd' arch-chroot /mnt bash -c 'pacman -S libimobiledevice usbmuxd'
# ------------------------------------------------------- # -------------------------------------------------------
# ---------------------------------------------------------- # ----------------------------------------------------------
# -- umounting filesystem --- # -- umounting filesystem ---
# printf "$YELLOW ::$GREEN Unmounting filesystem$RESET\n"
#umount -R /mnt #umount -R /mnt
# --------------------------- # ---------------------------