-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
104 lines (77 loc) · 3.53 KB
/
install
File metadata and controls
104 lines (77 loc) · 3.53 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
#!/bin/bash
set -euo pipefail
# Select disk
clear
echo WARNING: Back up data. The entire disk will be wiped.
PS3='Select disk: '
select disk in $(lsblk -do NAME -x SIZE | tac | head -n -2)
do [[ -n $disk ]] && break || echo Invalid selection. Try again.
done
[[ $disk =~ [0-9]$ ]] && separator=p
# Set credentials
clear
read -p 'Set username: ' username
read -p 'Set password: ' password
# Synchronize system clock
timedatectl set-ntp true
# Create partitions
parted -s /dev/$disk mklabel gpt mkpart ESP fat32 1MiB 1025MiB set 1 esp on mkpart ARCH 1025MiB 100%
# Format ESP partition
mkfs.fat -F32 /dev/$disk$separator'1'
# Format root partition
mkfs.xfs -f /dev/$disk$separator'2'
# Mount root partition
mount -t xfs /dev/$disk$separator'2' /mnt
# Mount ESP partition
mount -o umask=0077 -m /dev/$disk$separator'1' /mnt/boot
cp /etc/pacman-more.conf /etc/pacman.conf
sed -i 's/\(ParallelDownloads = \)10$/\1'$[`nproc`-1]'/' /etc/pacman.conf
sed -i 's/#<disabled_v3>//g' /etc/pacman.conf
sed -i '/\[multilib\]/,+1 s/^/#/' /etc/pacman.conf
pacstrap -K /mnt apparmor base bluez booster cachyos-keyring cachyos-mirrorlist cachyos-v3-mirrorlist chromium cosmic-files cosmic-player cosmic-session cuda cups-pdf dbus-broker-units espeak-ng keepassxc libva-nvidia-driver linux-cachyos linux-cachyos-nvidia-open linux-firmware logrotate networkmanager nftables noto-fonts noto-fonts-cjk noto-fonts-emoji obs-studio ollama-cuda openconnect pipewire-alsa pipewire-jack pipewire-pulse qt6-wayland sbctl speech-dispatcher system76-power systemd-resolvconf typst ublock-origin upower vulkan-radeon wgcf wireguard-tools xdg-user-dirs zed zlib-ng-compat zram-generator
#fcitx5-configtool fcitx5-hangul fcitx5-libthai fcitx5-mozc fcitx5-sayura fcitx5-unikey
#fcitx5-chewing fcitx5-m17n fcitx5-pinyin-zhwiki fcitx5-table-other
#aria2 helix hunspell hunspell-en_us hyphen hyphen-en libmythes libreoffice-fresh mythes-en opencl-rusticl-mesa pijul rocm-opencl-runtime
genfstab -U /mnt > /mnt/etc/fstab
arch-chroot /mnt <<EOF
curl -o /etc/pacman.conf https://raw.githubusercontent.com/kojq/gal/main/pacman.conf
ln -s /usr/share/zoneinfo/$(curl https://ipapi.co/timezone) /etc/localtime
hwclock -wu
sed -i 's/#\(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo host > /etc/hostname
useradd -mG wheel $username
echo $username:$password | chpasswd
yes | wgcf register
wgcf generate
cp wgcf-profile.conf /etc/wireguard
rm wgcf-account.toml wgcf-profile.conf
sed -i '/^DNS/ s/.\{1\}$/2/' /etc/wireguard/wgcf-profile.conf
systemctl enable apparmor bluetooth com.system76.PowerDaemon cosmic-greeter cups.socket fstrim.timer NetworkManager nftables systemd-resolved systemd-timesyncd upower wg-quick@wgcf-profile
mkdir -p /boot/loader/entries
echo 'title Linux
linux /vmlinuz-linux-cachyos
initrd /booster-linux-cachyos.img
options lsm=landlock,lockdown,yama,integrity,apparmor,bpf nowatchdog quiet root=PARTLABEL=ARCH rootfstype=xfs rw zswap.enabled=0' > /boot/loader/entries/linux.conf
mkdir /etc/pacman.d/hooks
echo '[Trigger]
Operation = Upgrade
Type = Package
Target = systemd
[Action]
Description = Upgrading systemd-boot...
When = PostTransaction
Exec = /usr/bin/systemctl restart systemd-boot-update' > /etc/pacman.d/hooks/1-systemd-boot.hook
bootctl install
echo '[zram0]
zram-size = ram
compression-algorithm = zstd' > /etc/systemd/zram-generator.conf
sbctl create-keys
sbctl enroll-keys -m
sbctl sign -s /boot/EFI/BOOT/BOOTX64.EFI
sbctl sign -s /boot/EFI/systemd/systemd-bootx64.efi
sbctl sign -s /boot/vmlinuz-linux-cachyos
EOF
umount -lR /mnt
reboot