-
Notifications
You must be signed in to change notification settings - Fork 2
/
base-chroot.sh
113 lines (43 loc) · 1.74 KB
/
base-chroot.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
#!/bin/bash
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime
echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
echo en_US ISO-8859-1 >> /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 >> /etc/locale.conf
echo host >> /etc/hostname
root_pass () {
passwd
[[ $? != 0 ]] && root_pass
}
printf "Enter the password for root:\n" && root_pass
pacman -Sy grub efibootmgr networkmanager --needed --noconfirm
sed -i 's/base udev autodetect modconf block filesystems keyboard fsck/base udev autodetect modconf block encrypt filesystems keyboard fsck/g' /etc/mkinitcpio.conf
#vim /etc/mkinitcpio.conf
mkinitcpio -p linux-lts
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
luks_bid=$(blkid | grep "crypto_LUKS" | grep -o -P '(?<=UUID=").*(?="\sTYPE)')
grublno=$(grep -Fn 'GRUB_CMDLINE_LINUX=' /etc/default/grub | cut -f1 -d":")
sed -i -e "${grublno}d" /etc/default/grub
varg="cryptdevice=UUID=${luks_bid}:cryptroot root=/dev/mapper/cryptroot"
varq=$(echo $varg | sed 's/^/"/;s/$/"/')
sed -i "${grublno}i GRUB_CMDLINE_LINUX=${varq}" /etc/default/grub
grub-mkconfig -o /boot/grub/grub.cfg
systemctl enable NetworkManager
useradd -mG wheel user
user_pass () {
passwd user
[[ $? != 0 ]] && user_pass
}
printf "Enter password for user:\n" && user_pass
echo "root ALL=(ALL) ALL
%wheel ALL=(ALL) ALL
@includedir /etc/sudoers.d" > /etc/sudoers
echo -e "printf '
The base installation has been completed
Before proceeding, make sure you are connected to the internet
To continue the post installation clone the main repo
ie, git clone https://github.com/Space-Legion/Capella and run sway.sh
'" >> /home/user/.bashrc
echo "rm .bashrc" >> /home/user/.bashrc
exit