Initial Zephyrus G14 support

This commit is contained in:
2022-09-22 22:01:33 -04:00
parent fcaa1bf28e
commit 0c52343dcf
4 changed files with 74 additions and 11 deletions
+2 -2
View File
@@ -28,6 +28,6 @@ Generic:
- Most x86_64 desktops, laptops, and servers
Coming soon:
Special:
- ASUS laptops (2020-2022) via a built-in script in /etc/local.d and [supergfxctl](https://gitlab.com/asus-linux/supergfxctl) (running under OpenRC, of course)
- ASUS Zephyrus G14 (2020)
+55 -1
View File
@@ -101,7 +101,7 @@ fi
# disable kernel watchdog
echo 'blacklist iTCO_wdt' > /etc/modprobe.d/blacklist.conf
if [ "$formfactor" == 2 ]; then
if [ "$formfactor" == 2 ] || [ "$formfactor" == 1 ]; then
pacman -S powertop acpid-openrc acpilight --needed --noconfirm
rc-update add acpid
echo 'SUBSYSTEM=="backlight", ACTION=="add", \
@@ -125,6 +125,60 @@ if [ "$formfactor" -lt 4 ]; then
chown -R root /usr/local/bin /etc/local.d
fi
# asus g14 2020 configuration
if [ "$formfactor" == 1 ]; then
echo 'options snd_hda_intel power_save=1' > /etc/modprobe.d/audio_powersave.conf
echo 'vm.dirty_writeback_centisecs = 6000' > /etc/sysctl.d/dirty.conf
echo 'RUN+="/bin/chgrp classmod /sys/class/leds/asus::kbd_backlight/brightness"
RUN+="/bin/chmod g+w /sys/class/leds/asus::kbd_backlight/brightness"
' > /etc/udev/rules.d/asuskbdbacklight.rules
echo '# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"
# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"
' > /etc/udev/rules.d/90-asusd-nvidia-pm.rules
echo 'evdev:input:b0003v0B05p1866*
KEYBOARD_KEY_c00b6=home # Fn+F2
KEYBOARD_KEY_c00b5=end # Fn+F4
KEYBOARD_KEY_ff31007c=f20 # x11 mic-mute' > /etc/udev/hwdb.d/90-zephyrus-kbd.hwdb
systemd-hwdb update
udevadm trigger
# xbindkeys config
echo '#ScreenBrightUp
"xbacklight -inc 10"
m:0x0 + c:210
XF86Launch3
#ScreenBrightDown
"xbacklight -dec 10"
m:0x0 + c:157
XF86Launch2
#G14KeyBrightUp
"xbacklight -ctrl asus::kbd_backlight -inc 30"
m:0x0 + c:238
XF86KbdBrightnessUp
#G14KeyBrightDown
"xbacklight -ctrl asus::kbd_backlight -dec 30"
m:0x0 + c:237
XF86KbdBrightnessDown
#G14IntegratedGPU
"supergfxctl -m integrated; pkill -KILL -u '"$username"'"
m:0x0 + c:232
XF86MonBrightnessDown
#G14DedicatedGPU
"supergfxctl -m dedicated; pkill -KILL -u '"$username"'"
m:0x0 + c:233
XF86MonBrightnessUp' > /home/"$username"/.xbindkeysrc
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/bashpower-g14/bashpower.start -o /etc/local.d/bashpower.start
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/bashpower-g14/bashpower.stop -o /etc/local.d/bashpower.stop
curl https://raw.githubusercontent.com/rwinkhart/artix-install-script/main/programs/supergfxd-openrc/supergfxd -o /etc/init.d/supergfxd
pacman -S supergfxctl mesa vulkan-icd-loader vulkan-radeon libva-mesa-driver libva-utils --needed --noconfirm
chmod 755 /etc/local.d/bashpower.start /etc/local.d/bashpower.stop /etc/init.d/supergfxd
rc-add supergfxd
rc-service supergfxd start
supergfxctl -m integrated
# ssh configuration
pacman -S openssh --needed --noconfirm
mkdir /home/"$username"/.ssh
+5 -8
View File
@@ -3,15 +3,14 @@
loadkeys us
echo ----------------------------------------------------------------------------------------------
echo rwinkhart\'s artix install script
echo last updated september 21, 2022
echo last updated september 22, 2022
echo ----------------------------------------------------------------------------------------------
echo You will be asked some questions before installation.
echo -e "----------------------------------------------------------------------------------------------\n"
read -n 1 -s -r -p 'Press any key to continue'
# start questions
echo Special Devices:
echo -e '\nspecial devices:\n1. asus rog zephyrus g14 2020 (not yet supported)\ngeneric:\n2. laptop\n3. desktop\n4. server\n'
echo -e '\nspecial devices:\n1. asus zephyrus g14 (2020)\ngeneric:\n2. laptop\n3. desktop\n4. server\n'
read -n 1 -r -p "formfactor: " formfactor
fdisk -l
@@ -54,15 +53,13 @@ username=$(echo "$username" | tr '[:upper:]' '[:lower:]')
hostname=$(echo "$hostname" | tr '[:upper:]' '[:lower:]')
disk0=$disk
if [[ "$disk" == /dev/nvme0n* ]]; then
disk="$disk"'p'
fi
if [[ "$disk" == /dev/mmcblk* ]]; then
if [[ "$disk" == /dev/nvme0n* ]] || [[ "$disk" == /dev/mmcblk* ]]; then
disk="$disk"'p'
fi
if [ "$formfactor" == 1 ]; then
device='g14-'
gpu=NVIDIA
else
device=''
fi
@@ -169,7 +166,7 @@ echo "$hostname" > /mnt/etc/hostname
echo "hostname=\'"$hostname"\'" > /mnt/etc/conf.d/hostname
# installing base packages
base_devel='db diffutils gc guile libisl libmpc perl autoconf automake binutils bison esysusers etmpfiles fakeroot file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman patch pkgconf python sed opendoas texinfo which'
base_devel='db diffutils gc guile libisl libmpc perl autoconf automake binutils bison esysusers etmpfiles fakeroot file findutils flex gawk gcc gettext grep groff gzip libtool m4 make pacman patch pkgconf python sed opendoas texinfo which bc'
basestrap /mnt base $base_devel openrc elogind-openrc linux linux-firmware git micro man-db
# exporting variables
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/openrc-run
description="supergfx daemon"
command="/usr/bin/supergfxd"
command_background=true
pidfile="/run/${RC_SVCNAME}.pid"
supervisor=supervise-daemon
supervise_daemon_args="-e IS_SUPERGFX_SERVICE=1"
depend() {
after logger modules
}