-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchISO.sh
More file actions
609 lines (368 loc) · 16.4 KB
/
Copy pathArchISO.sh
File metadata and controls
609 lines (368 loc) · 16.4 KB
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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
#!/usr/bin/env bash
clear
echo -e "\033[32m" # Start green text
# ==================================================================================
# [[ START :: header]]
# ==================================================================================
installArchLicenseKey="
====================================================================================================================================================
[[ 1. install key ]]
====================================================================================================================================================
"
createPartitions="
====================================================================================================================================================
[[ 3. CREATE-PARTITIONS ]]
====================================================================================================================================================
"
userInput="
====================================================================================================================================================
[[ 2. USER-INPUT ]]
====================================================================================================================================================
"
formatPartitions="
====================================================================================================================================================
[[ 4. FORMAT-PARTITIONS ]]
====================================================================================================================================================
"
mountFileSystem="
====================================================================================================================================================
[[ 5. MOUNT-FILE-SYSTEM ]]
====================================================================================================================================================
"
installKernalBaseApp="
====================================================================================================================================================
[[ 6. INSTALL-KERNAL-BASE-PACKAGES ]]
====================================================================================================================================================
"
storingMount="
====================================================================================================================================================
[[ 7. STORING-MOUNT]]
====================================================================================================================================================
"
ArchChroot="
====================================================================================================================================================
[[ 8. ARCH-CHROOT]]
====================================================================================================================================================
"
createChrootScript="
====================================================================================================================================================
[[ 9. CREATE-CHROOT-SCRIPT ]]
====================================================================================================================================================
"
changeUserPermission="
====================================================================================================================================================
[[ 10. USER-PERMISSION ]]
====================================================================================================================================================
"
setDateAndTime="
====================================================================================================================================================
[[ 11. GENERATE-LANG-AND-TIME ]]
====================================================================================================================================================
"
createUser="
====================================================================================================================================================
[[ 12. CREATE-USER ]]
====================================================================================================================================================
"
configHost="
====================================================================================================================================================
[[ 13. HOST-CONFIG ]]
====================================================================================================================================================
"
installGrubAndDependancy="
====================================================================================================================================================
[[ 14. INSTALL-GRUB-AND-DEPENDANCY ]]
====================================================================================================================================================
"
installGrubBootloader="
====================================================================================================================================================
[[ 15. INSTALL-GRUB-BOOTLOADER ]]
====================================================================================================================================================
"
EnablingSystemApps="
====================================================================================================================================================
[[ 16. ENABLING-SYSTEMES ]]
====================================================================================================================================================
"
# ==================================================================================
# [[ END :: header]]
# ==================================================================================
clear
echo -e "\033[32m" # Start green text
echo "$installArchLicenseKey"
echo -e "\nkey_activation for arch linux && updating.....\n"
pacman-key --init && pacman-key --populate
echo -e "\033[32m" # Start green text
echo -e "================================================="
echo -e ""
echo -e "\nInstalling keys....\n"
echo -e ""
pacman -Syy archlinux-keyring --needed --noconfirm
echo -e "================================================="
echo -e ""
echo -e "\033[32m" # Start green text
echo -e "\nSuccessfully archlinux keyring attached....!!!!!\n"
echo -e ""
echo -e "\033[32m" # Start green text
echo -e "================================================="
time sleep 3
# ==================================================================================
# [[ 2. CREATE-PARTITIONS ]]
# ==================================================================================
clear
echo -e "\033[32m" # Start green text
echo "$createPartitions"
echo -e "\nCheck and configured Partiion....\n"
sudo cfdisk
clear
time sleep 3
# ==================================================================================
# [[ 3. USER-INPUT ]]
# ==================================================================================
clear
echo -e "\033[32m" # Start green text
echo "$userInput"
echo -e ""
echo "Please enter EFI paritition: (example /dev/sda1 or /dev/nvme0n1p1)"
read EFI
echo "Please enter SWAP paritition: (example /dev/sda2)"
read SWAP
echo "Please enter Root(/) paritition: (example /dev/sda3)"
read ROOT
echo "Please enter your username"
read USER
echo "Please enter your password"
read PASSWORD
echo "Please enter your HostName"
read HostName
echo -e "\nSuccessfully Store user input....\n"
time sleep 3
clear
# ==================================================================================
# [[ 4. FORMAT-PARTITIONS ]]
# ==================================================================================
# make filesystems
clear
echo -e "\033[32m" # Start green text
echo "$formatPartitions"
echo -e "\nCreating Filesystems...\n"
echo -e "\nFormatting Desks\n"
mkfs.fat -F32 /dev/"${EFI}"
mkswap /dev/"${SWAP}"
swapon /dev/"${SWAP}"
mkfs.ext4 /dev/"${ROOT}"
echo -e "\nSuccessfully Formatted\n"
time sleep 3
# ==================================================================================
# [[ 5. MOUNT-FILE-SYSTEM ]]
# ==================================================================================
clear
echo -e "\033[32m" # Start green text
echo "$installKernalBaseApp"
echo -e "\nstarted Mounting\n"
mount /dev/"${ROOT}" /mnt
mkdir /boot/efi
mount /dev/"${EFI}" /boot/efi
echo -e "\nSuccessfully Mounted\n"
time sleep 3
clear
# ==========================================================================
# [[ 6. INSTALL-KERNAL-BASE-PACKAGES ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$installKernalBaseApp"
echo -e ""
echo -e "Installing Base system into Linux kernal ..."
echo -e ""
echo -e ""
echo -e "Installing Arch Linux base..."
pacstrap -K /mnt base linux linux-firmware sudo nano
echo -e "\033[32m" # Start green text
echo "Installed successsfly Base system into Linux kernal !!!!"
time sleep 3
# ==========================================================================
# [[ 7. STORING-MOUNT]]
# ==========================================================================
echo -e "\033[32m" # Start green text
echo "$storingMount"
# Generate Mount
echo " Storring mount"
genfstab -U /mnt >> /mnt/etc/fstab
echo "Successfly storred all mount"
time sleep 3
clear
# ==========================================================================
# ==========================================================================
# [[ 8. ARCH-CHROOT ]]
# ==========================================================================
echo -e "\033[32m" # Start green text
echo "$ArchChroot"
echo "copy arch-chroot scripts"
# curl https://raw.githubusercontent.com/xconfcode/scritp2/main/archControlPanel.sh -o /mnt/archControlPanel.sh && chmod +x /mnt/archControlPanel.sh
echo
time sleep 3
# ============================================
# copy arch-chroot
# ============================================
clear
echo -e "\033[32m" # Start green text
echo "$createChrootScript"
cat <<REALEND > /mnt/archControlPanel.sh
#!/usr/bin/env bash
clear
# ============================================
# copy arch-chroot
# ============================================
echo -e "\033[32m" # Start green text
echo "$changeUserPermission"
echo "uncomment for profile wheels"
#
echo -e "\n changing Permission"
sudo sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers.tmp
echo -e "\nUncommented s/^# %wheel ALL=(ALL:ALL) successfully \n"
time sleep 5
echo -e "\nCheck if Uncommented s/^# %wheel ALL=(ALL:ALL) successfully \n"
time sleep 3
EDITOR=nano visudo
echo -e "\n Storred succefully\n"
time sleep 3
#pacman -Syy archlinux-keyring --needed --noconfirm
clear
# ==========================================================================
# [[ 11. GENERATE-LANG-AND-TIME ]]
# ==========================================================================
# Time
clear
echo -e "\033[32m" # Start green text
echo "$setDateAndTime"
echo -e "\nSetting Times...\n"
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
clear
echo -e "\nSuccessfly configure Times....\n"
time sleep 3
clear
echo -e "\033[32m" # Start green text
sudo sed -i 's/^#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sudo sed -i 's/^#en_US ISO-8859-1/en_US ISO-8859-1/' /etc/locale.gen
echo -e "\nSuccessfly Uncomment for locale-gen....\n"
time sleep 3
clear
echo -e "\033[32m" # Start green text
locale-gen
hwclock --systohc
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
echo arch-pc > /etc/hostname
echo -e "\nSuccessfly Uncomment for locale-gen....\n"
time sleep 3
clear
# ==========================================================================
# [[ 12. CREATE-USER ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$createUser"
echo -e "\nEnter root password" # Newline with echo -e
passwd
echo -e "\nstart creating user...\n"
useradd -m -s /bin/bash "$USER"
echo "$USER:$PASSWORD" | chpasswd
usermod -aG wheel "$USER"
echo -e "\nSuccessfly user created...\n "
clear
# ==========================================================================
# [[ 13. HOST-CONFIG ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$configHost"
echo -e "\nConfigure hostname...\n"
# Configure hostname and hosts file
echo "$HostName" > /etc/hostname
cat << EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 $HostName
EOF
echo -e "\nHostName successfully Configure...\n"
time sleep 3
clear
# ==========================================================================
# [[ 14. INSTALL-GRUB-AND-DEPENDANCY ]]
# ==========================================================================
echo -e "\033[32m" # Start green text
echo "$installGrubAndDependancy"
# Create boot dir and mount in it
echo -e "\nInstalling grub and dependencies...\n"
# pacman -S grub efibootmgr os-prober mtools networkmanager network-manager-applet wpa_supplicant dialog base-devel linux-headers cups openssh blueman git intel-ucode nano vim neovim --noconfirm
pacman -S grub efibootmgr os-prober mtools networkmanager --noconfirm
echo -e "\nSuccessfly installed grub & dependancy....\n"
time sleep 3
clear
echo "Creating boot directory"
mkdir /boot/efi
mount /dev/sda1 /boot/efi
echo "Successfly Mounted & created /boot/efi directory !!!!"
time sleep 3
clear
# installing grub and dependency by pacman
echo "installing grub and dependancy"
time sleep 3
# ==========================================================================
# [[ 15. INSTALL-GRUB-BOOTLOADER ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$installGrubBootloader"
# Bootloader installation (UEFI systems)
echo -e "\n install by grub...\n"
grub-install --target=x86_64-efi --bootloader-id=grub_uefi
echo -e "\nggrub install bootloader !!!!....\n"
time sleep 3
clear
echo -e "\033[32m" # Start green text
echo -e "\nget grub confinguration...\n"
grub-mkconfig -o /boot/grub/grub.cfg
echo -e "\ngrub take configuration !!!!....\n"
time sleep 3
clear
# ==========================================================================
# [[ 15. INSTALL-GRAPHIC ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$installGrubBootloader"
pacman -S nvidia nvidia-utils xf86-video-intel --needed --noconfirm
echo -e "\ninstalled video driver !!!!....\n"
time sleep 3
clear
# ==========================================================================
# [[ 16. ENABLING-SYSTEMES ]]
# ==========================================================================
clear
echo -e "\033[32m" # Start green text
echo "$EnablingSystemApps"
# Enable essential services
systemctl enable NetworkManager bluetooth cups sshd
clear
echo -e "\nenabled NetworkManager !!!!....\n"
echo -e "\nenabled bluetooth !!!!....\n"
echo -e "\nenabled cups !!!!....\n"
echo -e "\nenabled sshd !!!!....\n"
echo -e "\nAll system enabled !!!!....\n"
echo -e "\nInstallation complete. Reboot using 'reboot' !!!!....\n"
echo -e "\nDont forget typr umount -R /mnt.....!!!!....\n"
time sleep 3
EOF
REALEND
# =========================================
# END-CHROOT
# =========================================
# Chroot and execute configuration script
echo -e "\033[32m" # Start green text
chmod +x /mnt/archControlPanel.sh
echo -e "\narch-chroot scipt excuteded successfully !!!!....\n"
time sleep 3
arch-chroot /mnt /bin/bash /archControlPanel.sh
time sleep 3