-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_ru.sh
299 lines (286 loc) · 10.5 KB
/
install_ru.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
#!/bin/bash
# simple arch-installer
color(){
case $1 in
deepblue)
echo -e "\e[94m$2\033[0m"
;;
green)
echo -e "\033[32m$2\033[0m"
;;
red)
echo -e "\033[31m$2\033[0m"
;;
cyan)
echo -e "\e[36m$2\033[0m"
;;
bold)
echo -e "\e[1m$2\033[0m"
;;
default)
echo -e "\e[39m$2\033[0m"
esac
}
preinstall(){
loadkeys ru
setfont cyr-sun16
locale-gen
export LANG=ru_RU.UTF-8
clear
color cyan " -'" >&2
color cyan " .o+'" >&2
color cyan " 'ooo/" >&2
color cyan " '+oooo:" >&2
color cyan " '+oooooo:" >&2
color cyan " -+oooooo+:" >&2
color cyan " '/:-:++oooo+:" >&2
color cyan " '/++++/+++++++:" >&2
color cyan " '/++++++++++++++:" >&2
color cyan " '/+++ooooooooooooo/'" >&2
color cyan " ./ooosssso++osssssso+'" >&2
color cyan " .oossssso-''''/ossssss+'" >&2
color cyan " -osssssso. :ssssssso." >&2
color cyan " :osssssss/ osssso+++." >&2
color cyan " /ossssssss/ +ssssooo/-" >&2
color cyan " '/ossssso+/:- -:/+osssso+-" >&2
color cyan " '+sso+:-' '.-/+oso:" >&2
color cyan "'++:. '-/+/" >&2
color cyan ".' '" >&2
color deepblue "Добро пожаловать в установщик ArchLinux v0.2, созданный h3xb0y :).">&2
color deepblue "https://github.com/h3xb0y/arch-install" >&2
color bold "Нажмите ENTER для продолжения..."
read startinstall
echo "$startinstall"
clear
color deepblue "Перед установкой создайте 4 раздела:"
color deepblue "1) boot(100m)"
color deepblue "2) swap(RAM)"
color deepblue "3) root(>10G)"
color deepblue "4) home"
color bold "Нажмите ENTER для начала установки..."
read startinstall
echo "$startinstall"
clear
fdisk -l
color default "Добавить раздел? y/n"
read answ
if [ "$answ" == y ];then
color default "Введите диск \e[32m/dev/sdX"
read answ
cfdisk $answ
fi
#boot
color bold "Точка монтирования BOOT:"
read BOOT
#swap
color bold "Точка монтирования SWAP:"
read SWAP
#root
color bold "Точка монтирования ROOT:"
read ROOT
#home
color bold "Точка монтирования HOME:"
read HOME
color default "Введите раздел для форматирования:"
select type in "boot" "swap" "root" "home" "format all" "start installation";do
case $type in
"boot")
umount $BOOT > /dev/null 2>&1
mkfs.ext2 $BOOT -L boot
;;
"swap")
umount $SWAP > /dev/null 2>&1
mkswap $SWAP -L swap
;;
"root")
umount $ROOT > /dev/null 2>&1
mkfs.ext4 $ROOT -L root
;;
"home")
umount $HOME > /dev/null 2>&1
mkfs.ext4 $HOME -L home
;;
"format all")
umount $BOOT > /dev/null 2>&1
mkfs.ext2 $BOOT -L boot
umount $SWAP > /dev/null 2>&1
mkswap $SWAP -L swap
umount $ROOT > /dev/null 2>&1
mkfs.ext4 $ROOT -L root
umount $HOME > /dev/null 2>&1
mkfs.ext4 $HOME -L home
;;
"start installation")
break
;;
*)
color red "Ошибка! Введите еще раз..."
;;
esac
done
color deepblue "монтирование..."
mount $ROOT /mnt
mkdir /mnt/{boot,home}
mount $BOOT /mnt/boot
mount $HOME /mnt/home
swapon $SWAP
clear
}
install(){
#you need to use fresh version of archlinux
color deepblue "скачивание пакетов..."
pacstrap -i /mnt base base-devel
pacstrap -i /mnt netctl dialog wpa_supplicant
genfstab -p /mnt >> /mnt/etc/fstab
}
sysconfig(){
genfstab -p /mnt >> /mnt/etc/fstab
pacman -Syy
#INSTALLING GRUB PACKAGE
color cyan "Установить загрузчик GRUB? y/n"
read grub
if [ "$grub" == y ];then
color default "Способ установки GRUB"
select type in "BIOS" "EFI";do
case $type in
"BIOS")
color cyan "Установить os-prober?(желательно, если у вас установлена Windows) y/n"
read prober
if [ "$prober" == y ];then
arch-chroot /mnt pacman -S --noconfirm os-prober
fi
color deepblue "скачивание GRUB пакетов..."
arch-chroot /mnt pacman -S --noconfirm grub-bios
arch-chroot /mnt grub-install /dev/sda
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
break
;;
"EFI")
color cyan "Установить os-prober?(желательно, если у вас установлена Windows) y/n"
read prober
if [ "$prober" == y ];then
arch-chroot /mnt pacman -S --noconfirm os-prober
fi
color deepblue "скачивание GRUB пакетов..."
arch-chroot /mnt pacman -S --noconfirm grub-efi-x86_64
grub-install /dev/sda
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
mkdir /mnt/boot/EFI/boot
cp /mnt/boot/EFI/arch_grub/grubx64.efi /mnt/boot/EFI/boot/bootx64.efi
break
;;
*)
color red "Ошибка! Введите еще раз..."
;;
esac
done
fi
#PC'S NAME AND PASSWORD
color cyan "Имя хоста"
read host
echo $host > /etc/hostname
color cyan "Пароль root"
passwd
#LOCALTIME CONFIGURATION
color yellow "Локализация"
select localtime in 'ls /usr/share/zoneinfo';do
if [ -d '/usr/share/zoneinfo/$localtime' ];then
select time in 'ls /usr/share/zoneinfo/$localtime';do
ln -sf /usr/share/zoneinfo/$localtime/$time /etc/localtime
break
done
else
ln -sf /usr/share/zoneinfo/$localtime /etc/localtime
break
fi
break
done
#ADDING USER
color cyan "Введите имя пользователя"
read USER
useradd -m -g wheel $USER
usermod -aG root,bin,daemon,tty,disk,network,video,audio $USER
color cyan "И пароль"
passwd $USER
pacman -S --noconfirm sudo
sed -i 's/\# \%wheel ALL=(ALL) ALL/\%wheel ALL=(ALL) ALL/g' /etc/sudoers
sed -i 's/\# \%wheel ALL=(ALL) NOPASSWD: ALL/\%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers
#SETUP A VIDEOGRAPHIC DRIVER
color cyan "Какую видеокарту Вы используете?"
select GPU in "Intel" "Nvidia" "AMD" "driver for VirtuaBox";do
case $GPU in
"Intel")
pacman -S --noconfirm xf86-video-intel -y
break
;;
"Nvidia")
pacman -S --noconfirm xf86-video-nouveau -y
break
;;
"AMD")
pacman -S --noconfirm xf86-video-ati -y
break
;;
"driver for VirtuaBox")
pacman -S --noconfirm xf86-video-vesa -y
break
;;
*)
color red "Ошибка! Введите еще раз..."
;;
esac
done
}
postinstall(){
color cyan "еще немного..."
arch-chroot /mnt mkinitcpio -p linux
arch-chroot /mnt pacman -Syy
arch-chroot /mnt pacman -Su
arch-chroot /mnt pacman -S
arch-chroot /mnt sudo pacman -S --noconfirm xorg-server xorg-xinit xorg-apps mesa-libgl xterm
color cyan "Установить графическую оболочку XFCE4? y/n"
read xfce
if [ "$xfce" == y ];then
arch-chroot /mnt pacman -S xfce4 xfce4-goodies sddm
arch-chroot /mnt systemctl enable sddm.service
fi
arch-chroot /mnt pacman -Sy
arch-chroot /mnt pacman -S --noconfirm archlinuxcn-keyring
arch-chroot /mnt pacman -S --noconfirm yaourt
arch-chroot /mnt sudo pacman -S ttf-liberation ttf-dejavu opendesktop-fonts ttf-bitstream-vera ttf-arphic-ukai ttf-arphic-uming ttf-hanazono
arch-chroot /mnt systemctl enable dhcpcd
color cyan "спасибо за юз .88888888:."
color cyan "моего скрипта 88888888.88888."
color cyan "<3 .8888888888888888."
color cyan " 888888888888888888"
color cyan " 88' _'88'_ '88888"
color cyan " 88 88 88 88 88888"
color cyan " 88_88_::_88_:88888"
color cyan " 88:::,::,:::::8888"
color cyan " 88':::::::::''8888"
color cyan " .88 '::::' 8:88."
color cyan " 8888 '8:888."
color cyan " .8888' '888888."
color cyan " .8888:.. .::. ...:'8888888:."
color cyan " .8888.' :' ''::'88:88888"
color cyan " .8888 ' '.888:8888."
color cyan " 888:8 . 888:88888"
color cyan " .888:88 .: 888:88888:"
color cyan " 8888888. :: 88:888888"
color cyan " '.::.888. :: .88888888"
color cyan " .::::::.888. :: :::'8888'.:."
color cyan " ::::::::::.888 ' .::::::::::::"
color cyan " ::::::::::::.8 ' .:8::::::::::::."
color cyan ".::::::::::::::. .:888:::::::::::::"
color cyan " :::::::::::::::88:.__..:88888:::::::::::'"
color cyan " ''.:::::::::::88888888888.88:::::::::'"
color cyan " '':::_:' -- '' -'-' '':_::::''"
color green "Установка завершена, теперь введите:"
color default "sudo systemctl reboot"
color default "----------------------------------------------------------------------"
color cyan "Если есть какие-нибудь ошибки или предложения, пишите здесь: https://github.com/h3xb0y/arch-installer/issues"
}
preinstall
install
sysconfig
postinstall