-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbasebuild
101 lines (94 loc) · 3.17 KB
/
basebuild
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
clear
/bin/echo -e '\n\n\e[1;36mRUNNING ARCH ACETATE as in TRENBOLONE ACETATE... :)\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;36mDOWNLOADING REQUIRED SCRIPTS, PLEASE WAIT..!!\e[0m'
sleep 1
curl https://raw.githubusercontent.com/z399/arch-acetate/master/chrootbuild > chrootbuild
clear
# Function to gather partition information
PART_INT() {
# Display initial messages and gather necessary partition information
ping -c 1 archlinux.org
/bin/echo -e '\n\n\e[1;36mSTARTING SCRIPT...\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;36mSETTING FONT...\e[0m'
setfont ter-132b
clear
/bin/echo -e '\n\n\e[1;36mENTER THE FOLLOWING PARAMETERS...\e[0m'
timedatectl set-ntp true
echo -e '\n'
lsblk
echo -e '\n'
/bin/echo -e '\n\n\e[1;36mCREATE THREE PARTITIONS IN CFDISK (EFI,ROOT,HOME)\e[0m'
read -p "Drive name (eg: sda, vda, nvme0): " DRIVE
cfdisk "/dev/$DRIVE"
clear
echo -e '\n'
lsblk "/dev/$DRIVE"
echo -e '\n'
read -p "EFI partition: " EFI
echo -e '\n'
read -p "Root partition: " ROOT
echo -e '\n'
read -p "Home partition: " HOME
}
# Function to format drives
FRT_MAIN() {
# Format specified drives with appropriate file systems and mount points
clear && /bin/echo -e '\n\n\e[1;32mFormatting Drives...\e[0m'
echo -e '\n'
mkfs.fat -F32 "/dev/$EFI"
mkfs.ext4 "/dev/$ROOT"
mkfs.ext4 "/dev/$HOME"
mount "/dev/$ROOT" /mnt
mkdir -p /mnt/boot/efi
mkdir /mnt/home
mount "/dev/$EFI" /mnt/boot/efi
mount "/dev/$HOME" /mnt/home
}
# Function to set up system configurations
SYS_GRD() {
# Identify CPU type and update keyring, install essential packages
model=$(lscpu | grep 'Model name')
case "$model" in
*Intel*) CPUUCODE="intel-ucode" ;;
*AMD*) CPUUCODE="amd-ucode" ;;
esac
echo -e '\n'
printf "$CPUUCODE"
echo -e '\n'
/bin/echo -e '\n\n\e[1;36mUPDATING KEYRING...\e[0m'
pacman -Sy archlinux-keyring --noconfirm
pacstrap -K /mnt base base-devel linux-lts linux-firmware vim git "$CPUUCODE"
genfstab -U /mnt >> /mnt/etc/fstab
}
# Function to execute operations within the chroot environment
CHR_CRY() {
# Perform operations within the chroot environment
cp chrootbuild /mnt/chrootbuild
chmod +x /mnt/chrootbuild
arch-chroot /mnt bash chrootbuild && rm /mnt/chrootbuild
}
# Function to close and finalize installation
CLOSG(){
# Unmount and display final installation message before rebooting
umount -R /mnt
clear
/bin/echo -e '\n\n\e[1;32mINSTALLATION COMPLETED!\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;32mREBOOTING IN 3...\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;32mREBOOTING IN 2...\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;32mREBOOTING IN 1...\e[0m'
sleep 1
/bin/echo -e '\n\n\e[1;31mREBOOTING NOW...\e[0m'
reboot
}
# Starting point
PART_INT
FRT_MAIN
SYS_GRD
CHR_CRY
CLOSG