Skip to content

Commit

Permalink
fix(hardware-setup): Load modules needed by Surface devices
Browse files Browse the repository at this point in the history
Also addresses unlocking encrypted devices with the Surface keyboard
AFTER the second reboot

Signed-off-by: RJ Sampson <[email protected]>
  • Loading branch information
EyeCantCU committed Jan 2, 2025
1 parent dae934d commit bb8c573
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion system_files/desktop/shared/usr/libexec/bazzite-hardware-setup
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ IMAGE_FLAVOR=$(jq -r '."image-flavor"' < $IMAGE_INFO)
FEDORA_VERSION=$(jq -r '."fedora-version"' < $IMAGE_INFO)

# SCRIPT VERSION
HWS_VER=51
HWS_VER=52
HWS_VER_FILE="/etc/bazzite/hws_version"
HWS_VER_RAN=$(cat $HWS_VER_FILE)

Expand Down Expand Up @@ -253,6 +253,50 @@ if [[ ":Framework:" =~ ":$VEN_ID:" ]]; then
fi
fi

# SURFACE FIXES
if [[ ":Microsoft:" =~ ":$VEN_ID:" ]]; then
if ! [[ -f "/etc/modules-load.d/surface.conf" ]]; then
sed 's/^ *//' > "/etc/modules-load.d/surface.conf" << EOF
# Add modules necessary for Disk Encryption via keyboard
surface_aggregator
surface_aggregator_registry
surface_aggregator_hub
surface_hid_core
8250_dw
# Surface Laptop 3/Surface Book 3 and later
surface_hid
surface_kbd
EOF
if [[ "AuthenticAMD" == "$CPU_VENDOR" ]]; then
printf "# Support GPIO pins on AMD Surfaces\npinctrl_amd\n" >> "/etc/modules-load.d/surface.conf"
elif [[ "GenuineIntel" == "$CPU_VENDOR" ]]; then
sed 's/^ *//' >> "/etc/modules-load.d/surface.conf" << EOF
# Support LPSS on Intel Surfaces
intel_lpss
intel_lpss_pci
# Support GPIO pins on Intel Surfaces
# Surface Book 2
pinctrl_sunrisepoint
# For Surface Laptop 3/Surface Book 3
pinctrl_icelake
# For Surface Laptop 4/Surface Laptop Studio
pinctrl_tigerlake
# For Surface Pro 9/Surface Laptop 5
pinctrl_alderlake
# For Surface Pro 10/Surface Laptop 6
pinctrl_meteorlake
EOF
fi
fi
fi

# WAYDROID FIX
if [[ -f "/var/lib/waydroid/lxc/waydroid/config" ]]; then
echo "Removing unneeded apparmor entry from Waydroid LXC"
Expand Down

0 comments on commit bb8c573

Please sign in to comment.