This repository was archived by the owner on Apr 29, 2024. It is now read-only.
forked from BlackIkeEagle/archlinux-reinstall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-install.sh
More file actions
executable file
·118 lines (105 loc) · 3.13 KB
/
post-install.sh
File metadata and controls
executable file
·118 lines (105 loc) · 3.13 KB
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
#!/usr/bin/env bash
echo -n "give your default administrator username: "
read user
echo -n "give your full name: "
read fullname
if [[ -z name ]]; then
name=ike
fi
if [[ -z $fullname ]]; then
fullname="Ike Devolder"
fi
# groups
groups="wheel"
if which docker > /dev/null 2>&1; then
groups="$groups,docker"
fi
if which virtualbox > /dev/null 2>&1; then
groups="$groups,vboxusers"
fi
useradd -U -m -c "$fullname" -s /usr/bin/zsh -G "$groups" $user
passwd $user
echo "$user ALL=(ALL) ALL" > /etc/sudoers.d/$user
chmod u=rw,g=r,o= /etc/sudoers.d/$user
timedatectl set-ntp 1
# btrfs related
if which snapper > /dev/null 2>&1; then
snapper -c root create-config /
systemctl enable snapper-cleanup.timer
fi
systemctl enable haveged.service
if which auditctl > /dev/null 2>&1; then
systemctl enable auditd.service
fi
if which aa-status > /dev/null 2>&1; then
systemctl enable apparmor.service
fi
if which firewalld > /dev/null 2>&1; then
systemctl enable firewalld.service
fi
if which NetworkManager > /dev/null 2>&1; then
systemctl enable NetworkManager.service
fi
if which docker > /dev/null 2>&1; then
systemctl enable docker.service
fi
if [ -x /usr/lib/bluetooth/bluetoothd ]; then
systemctl enable bluetooth.service
fi
if which smartd > /dev/null 2>&1; then
systemctl enable smartd.service
fi
if which tlp > /dev/null 2>&1; then
systemctl mask systemd-rfkill.service
systemctl mask systemd-rfkill.socket
systemctl enable tlp.service
systemctl enable tlp-sleep.service
fi
if which sddm > /dev/null 2>&1; then
systemctl enable sddm.service
fi
if which lightdm > /dev/null 2>&1; then
systemctl enable lightdm.service
fi
# nvidia configuration with multiple gpu
if which nvidia-xconfig > /dev/null 2>&1; then
if [[ $(lspci| grep -i '\(3D\|VGA\)' | wc -l) -gt 1 ]]; then
busid=$(nvidia-xconfig --query-gpu-info | grep -i 'BusID' | sed -e 's/.*\(PCI\:.*\)/\1/g')
cat > /etc/X11/xorg.conf.d/15-nvidia.conf <<-EOF
Section "Module"
Load "modesetting"
EndSection
Section "Device"
Identifier "NVIDIA Graphics"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BusID "$busid"
Option "ProbeAllGpus" "false"
Option "NoLogo" "True"
Option "UseEDID" "false"
#Option "RenderAccel" "True"
#Option "AddARGBGLXVisuals" "true"
#Option "AllowGLXWithComposite" "true"
#Option "TripleBuffer" "True"
#Option "DamageEvents" "True"
#Option "UseDisplayDevice" "none"
EndSection
EOF
if which sddm > /dev/null 2>&1; then
cat > /usr/share/sddm/scripts/Xsetup <<-EOF
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
EOF
fi
if which lightdm > /dev/null 2>&1; then
cat > /etc/lightdm/display_setup.sh <<-EOF
#!/bin/sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
EOF
chmod +x /etc/lightdm/display_setup.sh
sed -e 's/.*display-setup-script.*/display-setup-script=\/etc\/lightdm\/display_setup.sh/g' \
-i /etc/lightdm/lightdm.conf
fi
fi
fi