This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbios-install
executable file
·70 lines (59 loc) · 2.73 KB
/
bios-install
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
#!/bin/sh
#It is assumed you will need at the most 3 partitions: /, /boot and /home. It is also
#assumed that you want partitions to be mounted at /mnt and so forth. Edit it as you
#see fit. Further it is to be noted that this script assumes a BIOS installation. Edit it if you
#you want, however it would make more sense to use the official installer that is packaged with
#Arch Linux for a UEFI install.
cfdisk
echo "Press Ctrl+D to skip mountpoint. Order 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.ext4 /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
reflector --download-timeout 1 --protocol https --verbose --latest 5 --sort rate --save /etc/pacman.d/mirrorlist
pacstrap /mnt base base-devel linux linux-firmware neovim sudo man-db man-pages texinfo networkmanager
genfstab -U /mnt >> /mnt/etc/fstab
arch-chroot /mnt pacman -Syu grub --noconfirm
lsblk
echo "Bootloader to be installed in whole disk instead of partition."
echo "eg: sda is valid. sda1 is not valid"
echo "enter device to install bootloader to: "
read bootloader
arch-chroot /mnt grub-install --force /dev/"$bootloader"
arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg
arch-chroot /mnt systemctl enable NetworkManager
arch-chroot /mnt timedatectl set-local-rtc 0
arch-chroot /mnt timedatectl set-timezone Asia/Kolkata
arch-chroot /mnt 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 "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
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
arch-chroot /mnt env EDITOR=nvim visudo #Uncomment line about sudo access with visudo as well as entry without password
umount -R /mnt
reboot