-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathchroot-setup.sh
130 lines (106 loc) · 3.16 KB
/
chroot-setup.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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
#!/bin/bash
echo "Setting up the chroot system..."
# update pacman mirrorlist
rm -f /etc/pacman.d/mirrorlist
echo "Server = https://mirror.osbeck.com/archlinux/\$repo/os/\$arch" | tee -a /etc/pacman.d/mirrorlist
# enable parallel downloads and colored output
sed -i '/^\s*#\(ParallelDownloads\|Color\)/ s/#//' /etc/pacman.conf
# Set the timezone to Asia/Kolkata
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime
hwclock --systohc --utc
# Generate the locale
sed -i '/^#en_US.UTF-8 UTF-8/s/^#//' /etc/locale.gen
locale-gen
# Set the system locale and keymap
echo "LANG=en_US.UTF-8" >/etc/locale.conf
echo "KEYMAP=us" >/etc/vconsole.conf
# Set the hostname and update the hosts file
echo "arch" >/etc/hostname
echo "127.0.0.1 localhost" >>/etc/hosts
echo "::1 localhost" >>/etc/hosts
echo "127.0.1.1 arch" >>/etc/hosts
# Set the root password
printf "Enter root password: \n"
passwd
# Add a new user "shaquibimdad" and set their password
useradd -m -g users -G wheel,audio,video -s /bin/bash shaquibimdad
printf "Enter user password: \n"
passwd shaquibimdad
# Grant sudo privileges to the user "shaquibimdad"
echo "shaquibimdad ALL=(ALL) ALL" >>/etc/sudoers.d/shaquibimdad
# install kde and packages
pacman -Syyu --needed --noconfirm \
networkmanager \
gnome \
gdm \
bluez \
alacritty \
expac \
exfatprogs \
sysfsutils \
fish \
wget \
git \
android-udev \
docker \
docker-buildx \
docker-compose \
fuse-overlayfs \
noto-fonts \
noto-fonts-emoji \
ttf-hack-nerd
usermod -a -G docker shaquibimdad
# change shell to fish
usermod -s /usr/bin/fish shaquibimdad
systemctl enable NetworkManager
systemctl enable bluetooth
systemctl enable gdm
systemctl enable power-profiles-daemon
systemctl enable docker
# systemctl enable nvidia-hibernate.service
# systemctl enable nvidia-resume.service
# systemctl enable nvidia-suspend.service
# systemctl enable nvidia-persistenced.service
# systemctl enable nvidia-powerd.service
# mkdir -p /etc/modprobe.d/
# cat >/etc/modprobe.d/nvidia.conf <<EOF
# options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp
# EOF
mkdir -p /etc/docker/
cat >/etc/docker/daemon.json <<EOF
{
"data-root": "/media/shaquib/linuxcore/docker"
}
EOF
# systemctl enable [email protected]
# cat >/etc/systemd/zram-generator.conf <<EOF
# [zram0]
# zram-size = 16000
# compression-algorithm = lz4
# swap-priority = 100
# fs-type = swap
# EOF
echo "/dev/nvme0n1p1 /media/shaquib auto nosuid,nodev,nofail,x-gvfs-show 0 0" | tee -a /etc/fstab
# nvidia configs
# ln -s /dev/null /etc/udev/rules.d/61-gdm.rules
mkinitcpio -P
# Install the boot loader
bootctl --path=/boot install
# Create a boot loader entry for Arch Linuxpp
cat >/boot/loader/entries/arch.conf <<EOF
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options root=/dev/nvme0n1p3 rw
EOF
# Fallback entry
cat >/boot/loader/entries/arch-fallback.conf <<EOF
title Arch Linux FALLBACK
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux-fallback.img
options root=/dev/nvme0n1p3 rw
EOF
# exit the chroot environment properly
exit