-
Notifications
You must be signed in to change notification settings - Fork 0
/
basebuild
86 lines (68 loc) · 1.93 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
#!/bin/bash
PART_INT() {
ping -c 1 voidlinux.org
/bin/echo -e '\n\n' "\e[1;36mSTARTING SCRIPT...\e[0m"
sleep 1
clear
/bin/echo -e '\n\n' "\e[1;36mENTER THE FOLLOWING PARAMETERS...\e[0m"
echo -e '\n'
lsblk
echo -e '\n'
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
}
FRT_MAIN() {
clear && /bin/echo -e '\n\n' "\e[1;32mFormating 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
}
SYS_GRD() {
curl https://mirrors.dotsrc.org/voidlinux/live/current/void-x86_64-ROOTFS-20230628.tar.xz > void-x86_64-ROOTFS-20230628.tar.xz
tar xvf void-x86_64-ROOTFS-20230628.tar.xz -C /mnt
mount --rbind /sys /mnt/sys && mount --make-rslave /mnt/sys
mount --rbind /dev /mnt/dev && mount --make-rslave /mnt/dev
mount --rbind /proc /mnt/proc && mount --make-rslave /mnt/proc
cp /etc/resolv.conf /mnt/etc/
}
CHR_CRY() {
cp chrootbuild /mnt/chrootbuild
chmod +x /mnt/chrootbuild
chroot /mnt bash chrootbuild && rm /mnt/chrootbuild
}
CLOSG(){
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