-
Notifications
You must be signed in to change notification settings - Fork 0
/
ai.sh.2Nov22
executable file
·147 lines (114 loc) · 3.45 KB
/
ai.sh.2Nov22
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
echo Freeing System
umount /dev/vda1
sleep 2
umount /dev/vda3
sleep 2
umount /dev/vda3
sleep 2
umount /dev/vda4
sleep 2
swapoff /dev/vda2
sleep 2
echo Setting vi
ln -s /usr/bin/vim /usr/bin/vi
echo Mirrors
reflector -c NL > /etc/pacman.d/mirrorlist
pacman -Syy
echo Partitioning disk
sgdisk --zap-all /dev/vda
sleep 2
sfdisk --delete /dev/vda
sleep 2
cat << EOF > vda.layout
label: gpt
label-id: F5D68989-9C99-F243-BF28-BFC9C596949D
device: /dev/vda
unit: sectors
first-lba: 2048
last-lba: 104857566
sector-size: 512
/dev/vda1 : start= 2048, size= 409600, type=U
/dev/vda2 : start= 411648, size= 4194304, type=S
/dev/vda3 : start= 4605952, size= 52428800, type=L
/dev/vda4 : start= 57034752, size= 47822815, type=H
EOF
sfdisk /dev/vda < vda.layout
fdisk -l
echo Swap
mkswap /dev/vda2
swapon /dev/vda2
echo Formatting disks
mkfs.fat -F 32 /dev/vda1
mkfs.ext4 -F -F /dev/vda3
mkfs.ext4 -F -F /dev/vda4
echo Mounting
mount /dev/vda3 /mnt
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/vda1 /mnt/boot
sleep 2
mount /dev/vda4 /mnt/home
echo Pacstrap
pacstrap /mnt base base-devel linux linux-firmware vim grub efibootmgr os-prober openssh dhclient networkmanager
echo FSTAB
genfstab -U /mnt >> /mnt/etc/fstab
cat /mnt/etc/fstab
echo CHROOT
arch-chroot /mnt /bin/bash <<EOF
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
mkinitcpio -p linux
echo "root:qazwsx12" | chpasswd
echo Installing Bootloader
pacman --noconfirm -S grub
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB-EFI
grub-mkconfig -o /boot/grub/grub.cfg
echo INSTALLING Window Manager DUSK offcourse
pacman -Syy
pacman -S xorg xorg-server xorg-apps xorg-xinit --noconfirm --needed
pacman -S noto-fonts ttf-ubuntu-font-family ttf-dejavu ttf-freefont terminus-font ttf-font-awesome --noconfirm --needed
pacman -S variety feh --noconfirm --needed
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
echo Installing needed tools
pacman -S gparted git zsh chromium vivaldi bash-completion zsh-completions --noconfirm --needed
echo INstalling AUR packages
#su ray -c "yay -S jotta-cli alias-tips-git autojump autokey-common autokey-gtk downgrade gconf gitahead-bin gtk-theme-config insync nerd-fonts-hack otf-font-awesome-4 p7zip-gui pamac-all pcloud-drive pkgbrowser snapd snapd-glib spice-vdagent wttr --noconfirm"
#echo Preparing Jotta & Rclone
#cp /root/ai.sh /mnt
#mkdir -p /DATA/cloud/Jotta
#mkdir -p /home/ray/.config
#pacman -S rclone --noconfirm
##cp -r /FILES/rclone /home/ray/.config/rclone
#mkdir JOTTA
#cd JOTTA
#tar xvf /FILES/jotta-cli-0.8.36055_linux_x86.tar
#cp -r usr/* /usr
#cp -r etc/* /etc
#cd ..
#cp /FILES/jottad.service /etc/systemd/system/
#systemctl enable --now jottad.service
#cp /FILES/rclone-mount.service /etc/systemd/system/
#systemctl enable --now rclone-mount.service
#systemctl enable --now sshd.service
#echo Setting autologin
#cp /FILES/lightdm.conf /etc/lightdm
#cp /FILES/picom.conf /home/ray/.config
#picom --config /home/ray/.config/picom.conf -b
#ln -s /usr/bin/vim /usr/bin/vi
chown -R ray:ray /home/ray
#mkdir -p /DATA/cloud/Jotta
#chown -R ray:ray /DATA/
EOF