-
Notifications
You must be signed in to change notification settings - Fork 0
/
part1Installer.sh
executable file
·98 lines (91 loc) · 2.06 KB
/
part1Installer.sh
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
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
backtitle="Muh Arch Installer"
title="Installation"
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "\nStart Installer?" 10 30
if [ $? == 0 ]
then
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "Check internet connection?" 10 30
if [ $? == 0 ]
then
ping -c 2 google.com
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "\nAre you connected?" 10 30
if [ $? == 1 ]
then
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "Start wifi-menu?" 10 30
if [ $? == 0 ]
then
wifi-menu
fi
fi
fi
# Time ctl thingy
timedatectl set-ntp true
while : ; do
fdisk -l
echo "${bold}Type drive below with /dev/ included"
read drive
echo $drive
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "\nIs $drive correct?" 10 30
if [ $? == 0 ]
then
break
fi
done
cfdisk $drive
while : ; do
mainDrive=$(dialog --inputbox "Where is your main partition? (e.g. /dev/sda1)" 10 25 --output-fd 1)
fs=$(dialog --inputbox "What filesystem do you want?" 10 25 --output-fd 1)
dialog \
--backtitle "$backtitle" \
--title "$title" \
--yesno "\nDo you have a swap partition?" 10 30
if [ $? == 0 ]
then
swapDrive=$(dialog --inputbox "Where is the swap partition (e.g. /dev/sda2)" 10 25 --output-fd 1)
else
swapDrive="None"
fi
dialog \
--yesno "\nIs this correct?\nMain partition = $mainDrive\nFilesystem = $fs\nSwap = $swapDrive" 10 30
if [ $? == 0 ]
then
break
fi
done
mkfs.$fs $mainDrive
if [ $swapDrive != "None" ]
then
mkswap $swapDrive
swapon $swapDrive
fi
mount $mainDrive /mnt
pacstrap /mnt base base-devel
genfstab -U /mnt >> /mnt/etc/fstab
cp part2Installer.sh /mnt/
arch-chroot /mnt ./part2Installer.sh
dialog \
--yesno "Do you want to reboot?" 10 30
if [ $? == 0 ]
then
reboot
fi
else
exit 1
fi