Arch Setup for Zephyrus G14
Table of contents
- Table of contents
- Arch Linux on Asus ROG Zephyrus G14 (GA401I)
- Basic Install
- Prepare and Booting ISO
- Networking
- Format Disk
- Create encrypted filesystem
- Create and Mount btrfs Subvolumes
- Create a btrfs swapfile and remount subvols
- Install the system using pacstrap
- Chroot into the new system and change language settings
- Add btrfs and encrypt to Initramfs
- Install Systemd Bootloader
- Set nvidia-nouveau onto blacklist
- Leave Chroot and Reboot
- Finetuning after first Reboot
- Install Desktop Environment
- Nvidia
- Useful Customizations
- KDE Tweaks
- Fixing Audio on Linux
- Miscellaneous
Arch Linux on Asus ROG Zephyrus G14 (GA401I)
Guide to install Arch Linux with btrfs, disc encryption, auto-snapshots, no-noise fan-curves on Asus ROG Zephyrus G14. Credits to asus-zephyrus and Unim8rix, this guide is a fork of their guide with some variation.
Basic Install
Prepare and Booting ISO
Boot Arch Linux using a prepared USB stick. Rufus can be used on windows, Etcher can be used on Windows or Linux.
Networking
For Network i use wireless, if you need wired please check the Arch WiKi.
Launch iwctl
and connect to your AP like this:
station wlan0 scan
station wlan0 get-networks
station wlan0 connect YOURSSID
Type exit
to leave.
Update System clock with timedatectl set-ntp true
Format Disk
- My Disk is
nvme0n1
, check withlsblk
-
Format Disk using
cfdisk /dev/nvme0n1
with this simple layout:Mount Point Partition Partition type Size /mnt/boot /dev/boot_partition EFI system partition At least 300MB (Would suggest more if planning to run multiple kernels) /mnt /dev/root_partition Linux Filesystem Remainder of device
After partitioning, run lsblk
to identify your partitions:
Sample lsblk
output:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 476.9G 0 disk
├─nvme0n1p1 259:1 0 300M 0 part // This is our EFI partition
└─nvme0n1p2 259:2 0 476.6G 0 part // This is our Home partition
Identify your EFI partition, in this case /dev/nvme0n1p1
, and format it like this:
mkfs.vfat -F 32 -n EFI /dev/nvme0n1p1
Create encrypted filesystem
Note: This step is optional. If you do not want to use encryption, you can skip this step. Just remember that you need to replace any lines that contain /dev/mapper/luks
with your “Linux Filesystem” partition (/dev/nvme0n1p2
in this case).
cryptsetup luksFormat /dev/nvme0n1p2
cryptsetup open /dev/nvme0n1p2 luks
Create and Mount btrfs Subvolumes
mkfs.btrfs -f -L ROOTFS /dev/mapper/luks
btrfs filesystem for root partition
Mount Partitions und create Subvol for btrfs. I dont want home, etc in my snapshots, so create subvol for them.
mount -t btrfs LABEL=ROOTFS /mnt
Mount root filesystem to /mntbtrfs sub create /mnt/@
btrfs sub create /mnt/@home
btrfs sub create /mnt/@snapshots
btrfs sub create /mnt/@swap
Create a btrfs swapfile and remount subvols
truncate -s 0 /mnt/@swap/swapfile
chattr +C /mnt/@swap/swapfile
btrfs property set /mnt/@swap/swapfile compression none
fallocate -l ${SWAP_SIZE} /mnt/@swap/swapfile
chmod 600 /mnt/@swap/swapfile
mkswap /mnt/@swap/swapfile
mkdir /mnt/@/swap
Replace ${SWAP_SIZE}
with the amount of swap space you want. Typically you should have the same amount of swap as RAM. So if you have 16GB of ram, you should have 16GB of swap space. For example, a 16GB swap would be created like this:
fallocate -l 16G /mnt/@swap/swapfile
. Notice that the size in GB is denoted with a G as a suffix and NOT GB.
Just unmount with umount /mnt/
and remount with subvolumes
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@ /dev/mapper/luks /mnt
mkdir -p /mnt/boot
mkdir -p /mnt/home
mkdir -p /mnt/.snapshots
mkdir -p /mnt/btrfs
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@home /dev/mapper/luks /mnt/home/
mount -o noatime,compress=zstd,space_cache,commit=120,subvol=@snapshots /dev/mapper/luks /mnt/.snapshots/
mount -o noatime,space_cache,commit=120,subvol=@swap /dev/mapper/luks /mnt/swap/
mount /dev/nvme0n1p1 /mnt/boot/
mount -o noatime,compress=zstd,space_cache,commit=120,subvolid=5 /dev/mapper/luks /mnt/btrfs/
Check mountpoints with df -Th
Install the system using pacstrap
pacstrap /mnt base base-devel linux linux-firmware btrfs-progs nano networkmanager amd-ucode
After this, generate the filesystem table using
genfstab -Lp /mnt >> /mnt/etc/fstab
Add swapfile
echo "/swap/swapfile none swap defaults 0 0" >> /mnt/etc/fstab
Chroot into the new system and change language settings
You can use a hostname of your choice, I have gone with zephyrus-g14.
arch-chroot /mnt
echo zephyrus-g14 > /etc/hostname
echo LANG=en_US.UTF-8 > /etc/locale.conf
echo LANGUAGE=en_US >> /etc/locale.conf
ln -sf /usr/share/zoneinfo/Asia/Karachi /etc/localtime
hwclock --systohc
Modify nano /etc/hosts
with these entries. For static IPs, remove 127.0.1.1. Replace zephyrus-g14 with your hostname.
127.0.0.1 localhost
::1 localhost
127.0.1.1 zephyrus-g14.localdomain zephyrus-g14
nano /etc/locale.gen
to uncomment the following line
en_US.UTF-8
Execute locale-gen
to create the locales now
Add a password for root using passwd root
Add btrfs and encrypt to Initramfs
nano /etc/mkinitcpio.conf
and add encrypt btrfs
to hooks between block/filesystems. NOTE: If you chose to not encrypt your home partition, do not add encrypt
to HOOKS
.
HOOKS="base udev autodetect modconf block encrypt btrfs filesystems keyboard fsck
Also include amdgpu
in the MODULES section
create Initramfs using mkinitcpio -P
Install Systemd Bootloader
bootctl --path=/boot install
installs bootloader
nano /boot/loader/loader.conf
delete everything and add these few lines and save
default arch.conf
timeout 3
editor 0
` nano /boot/loader/entries/arch.conf` with these lines and save.
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
copy boot-options with ` echo “options cryptdevice=UUID=$(blkid -s UUID -o value /dev/nvme0n1p2):luks root=/dev/mapper/luks rootflags=subvol=@ rw” » /boot/loader/entries/arch.conf` NOTE: If you chose to not encrypt your home partition, use this command:
ROOT_PARTITION=<!!!YOUR_ROOT_PARTITION_HERE!!!> && echo "options root=UUID=$(blkid -s UUID -o value ${ROOT_PARTITION}) rootflags=subvol=@ rw" >> /boot/loader/entries/arch.conf
Set nvidia-nouveau onto blacklist
using nano /etc/modprobe.d/blacklist-nvidia-nouveau.conf
with these lines
blacklist nouveau
options nouveau modeset=0
Leave Chroot and Reboot
Type exit
to exit chroot
umount -R /mnt/
to unmount all volumes
Now its time to reboot
into the new system!
Finetuning after first Reboot
Enable Networkmanager
Configure WiFi Connection.
systemctl enable NetworkManager
systemctl start NetworkManager
nmcli device wifi connect YOURSSID password SSIDPASSWORD
Create a new user
First create my new local user and point it to zsh
useradd -m -g users -G wheel,power,audio -s /usr/bin/zsh MYUSERNAME
passwd MYUSERNAME
Edit nano /etc/sudoers
and uncomment %wheel ALL=(ALL) ALL
Now exit
and relogin with the new MYUSERNAME
Update your system
The first thing you should do after installing is to update your system. Open a commandd line and run:
sudo pacman -Syu
Install some Deamons before we reboot
sudo pacman -S acpid dbus
sudo systemctl enable acpid
Setup Automatic Snapshots for pacman:
To setup automatic snapshots everytime system updates, follow the section from Unim8rix’s guide
Install Desktop Environment
Get X.Org and KDE Plasma
Install xorg and kde packages
pacman -S xorg
sudo pacman -S plasma kde-applications pulseaudio
SDDM Loginmanager
sudo pacman -S sddm
sudo systemctl enable sddm
Reboot and login to your new Desktop.
Remove extra KDE Packages
kde-applications
installs a bunch of packages that I do not need so I removed them. First remove the following groups of applications.
sudo pacman -Rns kdepim kde-games kde-education kde-multimedia
Then, remove some apps from other groups too.
sudo pacman -R kwrite kcharselect yakuake kdebugsettings kfloppy filelight kteatime konqueror konversation kopete
To see what various applications do, check out the kde-applications group on Arch website.
For KDE Theming you could check this nice Youtube Video from Linux Scoop
Nvidia
Install nvidia
package from official repos. Double check to see if linux-headers are installed to avoid blackscreen on reboot. Do NOT run nvidia-xconfig
on Arch as it results in black screen. Install the following packages:
sudo pacman -S nvidia-dkms nvidia-settings nvidia-prime acpi_call
Useful Customizations
Install asusctl tool
NOTE: asusctl
and optimus-manager
may conflinct with eachother. If using asusctl
, it is recommended to uninstall optimus-manager
with sudo pacman -Rns optimus-manager optimus-manager-qt
Add Luke Jones’s Repo to pacman.conf
sudo bash -c "echo -e '\r[g14]\nSigLevel = DatabaseNever Optional TrustAll\nServer = https://arch.asus-linux.org\n' >> /etc/pacman.conf"
sudo pacman -S asusctl
Activate DBUS Messaging for the new asus deamon to get asus notifications upon changing fan profile etc.
systemctl --user enable asus-notify
systemctl --user start asus-notify
Run the following commands for charge limit and fan speed:
asusctl -c 85 # Sets charge limit to 85% if you do not want this, do not execute this line
asusctl fan-curve -m Quiet -f cpu -e true
asusctl fan-curve -m Quiet -f gpu -e true
asusctl fan-curve -m Performance -f cpu -e true
asusctl fan-curve -m Performance -f gpu -e true
asusctl fan-curve -m Balanced -f cpu -e true
asusctl fan-curve -m Balanced -f gpu -e true
For fine-tuning read the Arch Linux Wiki or the Repository from Luke. asusctl requires kernel 5.15+, which at the time of writing has not been released. Install the ROG kernel instead.
Install ROG Kernel
After adding the above repo, install the ROG kernel by running
sudo pacman -S linux-g14 linux-g14-headers
#kernel headers are very important otherwise nvidia module will not load, resulting in black screen.
After installing the kernel, edit /boot/loader/loader.conf
and add the following to it:
default arch-g14.conf
timeout 3
editor 0
Then run sudo cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-g14.conf && sudo nano /boot/loader/entries/arch-g14.conf
Replace the lines that start with title
, linux
, and initrd
with this:
title Arch Linux (g14)
linux /vmlinuz-linux-g14
initrd /amd-ucode.img
initrd /initramfs-linux-g14.img
and finally do
sudo mkinitcpio -P
Switch Profile On Charger Connect
To automatically turn Performance profile on charger connect and Quiet profile on charger disconnect, run the following
echo "#\!/bin/bash\nasusctl profile -P Performance\n" > ~/.local/share/scripts/switch_performance.sh && echo "#\!/bin/bash\nasusctl profile -P Quiet\n" > ~/.local/share/scripts/switch_quiet.sh
Make the scripts executable by running
chmod +x ~/.local/share/scripts/switch_performance.sh ~/.local/share/scripts/switch_quiet.sh
Go to Settings -> Power Management -> Energy Saving -> On AC Power. enable Run Script, select switch_performance script from ~/.local/share/scripts/ using open file dialogue button. Go to On Battery Tab, enable Run Script and select switch_quiet script from ~/.local/.local/share/scripts/ using open file dialogue button. Manually giving path does not appear to work for some reason.
Optional: Enable battery full charge notification. Go to KDE Settings -> Notifications -> Application Settings -> Configure Events. Select Charge Complete and Select Show a message in popup
ROG Key Map
Go to KDE Settings->Shortcuts->Custom Shortcuts. Click Edit->New->Global Shortcut->Command/URL. Name it NvidiaSettings
. Set trigger to ROG Key
and set action to nvidia-settings
Change Fan Profile
Go to KDE Settings->Shortcuts->Custom Shortcuts. Click Edit->New->Global Shortcut->Command/URL. Name it ChangeFanProfile
, set trigger to fn + f5
and action to asusctl profile -n
KDE Tweaks
Gamma Correction
In display and monitor -> gamma, change gamma to 0.9 for better colors
Touchpad Gestures
Use fusuma to get touchpad gestures. Create ~/.local/share/scripts/fusuma.sh
and add
#!/bin/bash
fusuma -d #for running in daemon mode
Add this scrpit to autostart in KDE settings. For macOS like gestures use this config. 4 finger gestures are not working. My config is in the repo.
Yet Another Magic Lamp
A better magic lamp effect. In latest plasma versions, exclude “disable unsupported effects” next to the search bar in settings for the effect to appear.
Maximize to new desktop
In Kwin scripts, install “kwin-maximize-to-new-desktop” and run:
mkdir -p ~/.local/share/kservices5
ln -s ~/.local/share/kwin/scripts/max2NewVirtualDesktop/metadata.desktop ~/.local/share/kservices5/max2NewVirtualDesktop.desktop
Then install kdesignerplugin through pacman -S kdesignerplugin
. Logout and login again after configuration changes. My config:
Trigger: Maximize only
Position: Next to current
(git)
Fixing Audio on Linux
Audio was exceptionally low on linux. To fix, first remove everything pulseaudio related by running:
sudo pacman -Rdd pulseaudio pulseaudio-alsa pulseaudio-bluetooth pulseaudio-ctl pulseaudio-equalizer pulseaudio-jack pulseaudio-lirc pulseaudio-rtp pulseaudio-zeroconf pulseaudio-equalizer-ladspa
Most of this may not be installed already so remove it from the command. Then, install pipewire and its related packages.
sudo pacman -S pipewire pipewire-pulse gst-plugin-pipewire pipewire-alsa pipewire-media-session
Install bluetooth related packages
sudo pacman -S bluez bluez-utils
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
Install pulseaudio-equalizer-ladspa
sudo pacman -S pulseaudio-equalizer-ladspa
Then for autostart the equalizer do this
pulseaudio-equalizer enable-config
Miscellaneous
Key delay
Reduce key input delay to 250 ms for a better keyboard experience.
Chaotic AUR
First, install the primary key - it can then be used to install our keyring and mirrorlist.
pacman-key --recv-key FBA220DFC880C036 --keyserver keyserver.ubuntu.com
pacman-key --lsign-key FBA220DFC880C036
pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
sudo bash -c "echo -e '\r[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' >> /etc/pacman.conf"
yay AUR Helper
This needs to be installed after chaotic aur.
sudo pacman -S yay
Now to search a package and install just type yay <package name or keyword>
and it will bring you some result. Choose the right option and follow further prompts
Alternatively, you can use pamac, which also has a gui.
Reference: https://github.com/asus-zephyrus/archinstall