aboutsummaryrefslogtreecommitdiff
path: root/install.sh
blob: 0f37c8ee68f06badeb431781ff1239fd5fbe1f83 (plain)
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
LIGHTGREEN='\033[1;32m'
LIGHTRED='\033[1;91m'
WHITE='\033[1;97m'
MAGENTA='\033[1;35m'
CYAN='\033[1;96m'
NoColor='\033[0m'

printf ${LIGHTGREEN}"Enter disk label (e.g. sda, nvme0n1p <- p is mandatory in nvme case):${NoColor}\n"
read disk_drive
printf ${LIGHTGREEN}"Enter comma-separated partition numbers (e.g., 5,6 for 5 boot 6 root):${NoColor}\n"
read partitions
IFS=',' read -r -a partition_array <<< "$partitions"
root_drive="$disk_drive${partition_array[1]}"
boot_drive="$disk_drive${partition_array[0]}"

printf ${LIGHTGREEN}"Enter the Hostname you want to use:${NoColor}\n"
read _hostname
printf ${LIGHTGREEN}"Enter the Username you want to use:${NoColor}\n"
read _username
printf ${LIGHTRED}"Enter the password for ROOT:${NoColor}\n"
read -s _rootpasswd
printf ${LIGHTGREEN}"Enter the password for $_username:${NoColor}\n"
read -s _userpasswd

mkfs.fat -F32 /dev/$boot_drive
mkfs.ext4 -F /dev/$root_drive

mount /dev/$root_drive /mnt
mkdir /mnt/boot
mkdir /mnt/home
mkdir /mnt/boot/efi
mount /dev/$boot_drive /mnt/boot/efi

sv up ntpd
pacman -Sy --confirm

basestrap /mnt base runit seatd-runit linux-zen intel-ucode linux-zen-headers 
fstabgen -U /mnt >> /mnt/etc/fstab

cp post_chroot.sh /mnt

export root_drive
export boot_drive
export _hostname
export _username
export _rootpasswd
export _userpasswd

artix-chroot /mnt ./post_chroot.sh