forked from thebiblelover7/install-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
universal-uefi
executable file
·97 lines (81 loc) · 3.07 KB
/
universal-uefi
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
#!/bin/env bash
echo "This is the universal UEFI minimal install."
if lscpu | grep GenuineIntel 1>/dev/null 2>&1 ; then
cpu="intel"
elif lscpu | grep AuthenticAMD 1>/dev/null 2>&1 ; then
cpu="amd"
fi
lsblk
echo "select disk(eg: sda, not sda1): "
read disk
cgdisk /dev/$disk
clear
echo "Press Ctrl+D to skip mountpoint. Order of selection is root, then boot, then home."
echo "Partition names to be selected only. eg: choose sda1 instead of /dev/sda1"
lsblk
echo "select root partition: "
read root && mkfs.ext4 /dev/$root && mount /dev/$root /mnt
lsblk
echo "select boot partition: "
read boot && mkfs.fat -F32 /dev/$boot && mkdir /mnt/boot && mount /dev/$boot /mnt/boot
lsblk
echo "select home partition: "
read home && mkfs.ext4 /dev/$home && mkdir /mnt/home && mount /dev/$home /mnt/home
clear
printf "Enter country code for reflector: " ; read country
reflector -c $country --verbose --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
pacstrap /mnt base base-devel git linux linux-firmware neovim nano sudo man-db man-pages texinfo networkmanager $cpu-ucode
genfstab -U /mnt >> /mnt/etc/fstab
mkdir -p /mnt/boot/loader/entries
arch-chroot /mnt bootctl install
echo "default arch.conf
timeout 0
editor no" > /mnt/boot/loader/loader.conf
uuid="$(blkid /dev/$root -s UUID -o value)"
echo "title Arch Linux (linux)
linux /vmlinuz-linux
initrd /$cpu-ucode.img
initrd /initramfs-linux.img
options root=UUID=$uuid rw" > /mnt/boot/loader/entries/arch.conf
arch-chroot /mnt systemctl enable NetworkManager
timedatectl set-local-rtc 0
timezone=$(tzselect | tail -n 1)
arch-chroot /mnt ln -sf /usr/share/zoneinfo/"$timezone" /etc/localtime
timedatectl set-ntp true
arch-chroot /mnt hwclock --systohc
echo "en_GB.UTF-8 UTF-8" >> /mnt/etc/locale.gen
echo "en_IN UTF-8" >> /mnt/etc/locale.gen
echo "en_US.UTF-8 UTF-8" >> /mnt/etc/locale.gen
arch-chroot /mnt locale-gen
echo "Use Default India setup for locales?(y/n)"
read locale-setup
if [ "$locale-setup" = "y" ] ; then
echo "LANG=en_GB.UTF-8" >> /mnt/etc/locale.conf
echo "LC_TIME=en_IN.UTF-8" >> /mnt/etc/locale.conf
echo "LC_MEASUREMENT=en_IN.UTF-8" >> /mnt/etc/locale.conf
echo "LC_TELEPHONE=en_IN.UTF-8" >> /mnt/etc/locale.conf
echo "LC_MONETARY=en_IN.UTF-8" >> /mnt/etc/locale.conf
echo "LC_NUMERIC=en_IN.UTF-8" >> /mnt/etc/locale.conf
elif [ "$locale-setup" = "n" ] ; then
echo "System Language (follow format followed in Arch Wiki)"
read lang
echo "LANG=$lang" >> /mnt/etc/locale.conf
echo "Local Time Format(follow format followed in Arch Wiki)"
read time
echo "LC_TIME=$time" >> /mnt/etc/locale.conf
echo "You can set other stuff like telephone, money, numeric formats later on if you want." && sleep 10
fi
echo "Set hostname of machine: "
read hostname
echo "$hostname" > /mnt/etc/hostname
echo "127.0.0.1 localhost" >> /mnt/etc/hosts
echo "::1 localhost" >> /mnt/etc/hosts
echo "127.0.1.1 $hostname.localdomain $hostname" >> /mnt/etc/hosts
echo "Set root password"
arch-chroot /mnt passwd
echo "username: "
read username
arch-chroot /mnt useradd -m -G wheel $username
arch-chroot /mnt passwd $username
umount -R /mnt
reboot