-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_LEGACY_linux.sh
executable file
·223 lines (157 loc) · 4.17 KB
/
install_LEGACY_linux.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
if [ $(lsblk|grep disk|grep vda|sed 's/ .*$//') == vda ]
then
DISK=vda
else
DISK=sda
fi
echo Freeing System
umount -R /dev/${DISK}2
sleep 2
umount -R /dev/${DISK}3
sleep 2
umount -R /mnt
sleep 2
df
echo Setting vi
ln -s /usr/bin/vim /usr/bin/vi
echo Partitioning disk
sgdisk --zap-all /dev/$DISK
sleep 2
sfdisk --delete /dev/$DISK
sleep 2
MEMTOTAL=$(grep MemTotal /proc/meminfo | awk ' { print $2 }')
fdisk /dev/$DISK <<EOF
o
n
p
+${MEMTOTAL}k
t
82
n
p
+45G
t
83
n
t
83
a
2
w
EOF
fdisk -l
echo Swap
mkswap /dev/${DISK}1
swapon /dev/${DISK}1
echo Formatting disks
mkfs.ext4 -F /dev/${DISK}2
mkfs.ext4 -F /dev/${DISK}3
echo Mounting
mount /dev/${DISK}2 /mnt
mkdir /mnt/home
mount /dev/${DISK}3 /mnt/home
echo Copying files
cp -ax / /mnt
cp mkinitcpio.conf /mnt/etc
cp -vaT /run/archiso/bootmnt/arch/boot/$(uname -m)/vmlinuz-linux /mnt/boot/vmlinuz-linux
genfstab -U /mnt >> /mnt/etc/fstab
cp b43-firmware-6.30.163.46-1-any.pkg.tar.zst /mnt/root
cp sudoers /mnt/etc
cp POST_INSTALL.sh /mnt
echo Going CHROOT
pacman -Syu --noconfirm
cp yay-11.0.2-1-x86_64.pkg.tar.zst /mnt
cp rclone.conf /mnt
arch-chroot /mnt /bin/bash <<EOF >LOG 2>&1
echo LOCALE and stuff
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen
export LANG=en_US.UTF-8
echo "LANG=en_US.UTF-8" >> /etc/locale.conf
ln -s /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime
echo Arch-VM > /etc/hostname
sed -i "/localhost/s/$/ Arch-VM" /etc/hosts
echo "root:qazwsx12" | chpasswd
echo Adding user Ray
groupadd -r autologin
useradd -G autologin,wheel,power -m ray
echo "ray:qazwsx12" | chpasswd
cat <<SU >> /etc/sudoers
## Same thing without a password
ray ALL=(ALL) NOPASSWD: ALL
SU
sudo pacman -Syu --noconfirm
sleep 2
echo Pacman Keys
pacman-key --init && pacman-key --populate archlinux
sleep 3
echo Installing yay
pacman -U yay-11.0.2-1-x86_64.pkg.tar.zst --noconfirm
echo Preparing Jotta and Rclone
pacman -S rclone --noconfirm
sleep 2
mkdir -p /DATA/cloud/Jotta
mkdir -p /home/ray/.config
mkdir -p /home/ray/.config/rclone/
cp /rclone.conf /home/ray/.config/rclone
echo installing Jotta-cli
su ray -c 'yay -S jotta-cli --noconfirm'
sleep 5
mkdir -p /DATA/cloud/Jotta
mkdir -p /MEDIA/Jotta_Photos
chown -R ray:ray /DATA/
chown -R ray:ray /MEDIA/
#echo Copying Jotta files
#mkdir JOTTA
#cd JOTTA
#tar xvf /FILES/jotta-cli-0.8.36055_linux_x86.tar
#cp -r usr/* /usr
#cp -r etc/* /etc
#cd ..
sudo chown -R jottad /var/lib/jottad
cp /FILES/jottad.service /etc/systemd/system/
systemctl enable --now jottad.service
cp /FILES/rclone-mount.service /etc/systemd/system/
cp /FILES/rclone-mount-photos.service /etc/systemd/system/
echo Enabling rclone services
systemctl enable --now rclone-mount.service
systemctl enable --now rclone-mount-photos.service
systemctl enable --now sshd.service
ln -s /usr/bin/vim /usr/bin/vi
echo cleaning up
sed -i 's/Storage=volatile/#Storage=auto/' /etc/systemd/journald.conf
rm /etc/udev/rules.d/81-dhcpcd.rules
systemctl disable pacman-init.service choose-mirror.service
rm -r /etc/systemd/system/{choose-mirror.service,pacman-init.service,etc-pacman.d-gnupg.mount,[email protected]}
rm /etc/systemd/scripts/choose-mirror
rm /etc/systemd/system/[email protected]/autologin.conf
rm /root/{.automated_script.sh,.zlogin}
rm /etc/mkinitcpio-archiso.conf
rm -r /etc/initcpio
echo mkinitcpio
mkinitcpio -P
echo Installing grub
grub-install /dev/$DISK
grub-mkconfig -o /boot/grub/grub.cfg
echo installing paru
su ray -c 'yay -S paru --noconfirm'
echo Installing dusk
su ray -c 'yay --noconfirm -S yajl'
su ray -c 'yay --noconfirm -S imlib2'
git clone https://github.com/bakkeby/dusk
cd dusk
make
sudo make install
echo Installing AUR Packages
/POST_INSTALL.sh
EOF
echo moving dusk
cp mirrorlist /mnt/etc/pacman.d/
cp rclone-mount* /mnt/etc/systemd/system
mkdir /mnt/home/ray/git
mv /mnt/dusk /mnt/home/ray/git
cp get_wallpaper ~/.config/variety/scripts
cp set_wallpaper ~/.config/variety/scripts
echo Copying scripts
cp -rv FILES/scripts /mnt/home/ray
chmod -R 755 /mnt/home/ray/scripts