Skip to content

Commit

Permalink
Merge pull request #45 from ublue-os/main
Browse files Browse the repository at this point in the history
[pull] main from ublue-os:main
  • Loading branch information
pull[bot] authored Mar 20, 2024
2 parents 18d4682 + d2594b6 commit 9eeeabf
Show file tree
Hide file tree
Showing 13 changed files with 106 additions and 26 deletions.
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ RUN /tmp/image-info.sh && \
systemctl enable cec-onboot.service && \
systemctl enable cec-onpoweroff.service && \
systemctl enable cec-onsleep.service && \
systemctl enable bazzite-tdpfix.service && \
systemctl --global enable steam-web-debug-portforward.service && \
systemctl --global disable sdgyrodsu.service && \
systemctl disable input-remapper.service && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ConditionEnvironment=|WAYLAND_DISPLAY
ConditionEnvironment=|DISPLAY

[Service]
ExecStart=/usr/bin/distrobox-enter -n arch -- ' /usr/bin/otd-daemon'
ExecStart=/usr/bin/distrobox-enter -n arch -- /usr/bin/otd-daemon
Restart=always
RestartSec=3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/distrobox-enter -n fedora -- ' /usr/bin/rslsync --nodaemon'
ExecStart=/usr/bin/distrobox-enter -n fedora -- /usr/bin/rslsync --nodaemon

[Install]
WantedBy=default.target
10 changes: 5 additions & 5 deletions spec_files/jupiter-hw-support/priv-write.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ index e307823..45946ed 100755
if [[ $EUID -ne 0 ]];
then
exec pkexec --disable-internal-agent "$0" "$@"
@@ -12,21 +15,21 @@ WRITE_VALUE="$2"
@@ -12,21 +15,21 @@

function CommitWrite()
{
Expand All @@ -37,12 +37,12 @@ index e307823..45946ed 100755
exit 1
}

@@ -40,15 +43,35 @@ if [[ "$WRITE_PATH" == /dev/drm_dp_aux0 ]]; then
@@ -40,15 +43,35 @@
fi

if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then
- CommitWrite
+ if [[ /usr/libexec/hardware/valve-hardware || "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ if /usr/libexec/hardware/valve-hardware || [[ "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ for i in $(ls /sys/class/drm/card*/device/power_dpm_force_performance_level)
+ do
+ WRITE_PATH="$i"
Expand All @@ -55,7 +55,7 @@ index e307823..45946ed 100755

if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/pp_od_clk_voltage ]]; then
- CommitWrite
+ if [[ /usr/libexec/hardware/valve-hardware || "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ if /usr/libexec/hardware/valve-hardware || [[ "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ for i in $(ls /sys/class/drm/card*/device/pp_od_clk_voltage)
+ do
+ WRITE_PATH="$i"
Expand All @@ -68,7 +68,7 @@ index e307823..45946ed 100755

if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
- CommitWrite
+ if [[ /usr/libexec/hardware/valve-hardware || "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ if /usr/libexec/hardware/valve-hardware || [[ "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ CommitWrite
+ else
+ echo "commit: Skipped $WRITE_VALUE -> $WRITE_PATH - see /etc/default/steam-hardware-control" | systemd-cat -t p-steamos-priv-write -p warning
Expand Down
2 changes: 1 addition & 1 deletion system_files/deck/kinoite/usr/libexec/bazzite-rotation-fix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
echo $(date '+%Y-%m-%d %H:%M:%S') Fixing desktop orientation... | tee -a /tmp/bazrotfix.log
if [[ ! -z "$IS_GAMEMODE" ]]; then
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
elif [[ ":83E1:Loki Max:" =~ ":$SYS_ID:" ]]; then
elif [[ ":83E1:Loki Max:AIR Plus:" =~ ":$SYS_ID:" ]]; then
kscreen-doctor output.1.rotation.left 2>&1 | tee -a /tmp/bazrotfix.log
else
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ process-scheduler enable=true {
include descends="taskset"
include descends="schedtool"
chrt
coolercontrold
coolercontrol-liqctld
dbus
dbus-broker
ds-inhibit
Expand All @@ -86,6 +88,7 @@ process-scheduler enable=true {
input-remapper-service
ionice
joystickwake
lact
mangoapp
nice
otd-daemon
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
Description=Resets power1_cap permissions to 644 if it is 666 at boot
After=multi-user.target rc-local.service systemd-user-sessions.service
Wants[email protected]

[Service]
Type=oneshot
ExecStart=/usr/libexec/bazzite-tdpfix

[Install]
WantedBy=multi-user.target
17 changes: 17 additions & 0 deletions system_files/deck/shared/usr/libexec/bazzite-tdpfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/bash
# This is a workaround for cards that somehow has their sysfs power1_cap permission set to 666 on boot
# Which in turn makes steam directly set the TDP to 15W
POWER_CAP_PATH=$(find /sys/class/hwmon/*/ -name "power1_cap")

# If the permissions are set to writable
if [ "$(stat -c %a "$POWER_CAP_PATH")" == "666" ]; then
chmod 644 "$POWER_CAP_PATH"
echo "fix: Permissions reset to 644 on $POWER_CAP_PATH" | systemd-cat -t bazzite-tdpfix -p warning
fi

# If TDP is 15W and default TDP is higher than 45W, set card to use default TDP
# This will then be handled by firmware or software afterwards as this is set once
if [ "$(cat "$POWER_CAP_PATH")" == "15000000" ] && [ "$(cat "${POWER_CAP_PATH}_default")" -gt "45000000" ]; then
"$(cat "${POWER_CAP_PATH}_default")" > "$POWER_CAP_PATH"
echo "fix: TDP reset to default on $POWER_CAP_PATH" | systemd-cat -t bazzite-tdpfix -p warning
fi
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,16 @@ process-scheduler enable=true {
include descends="taskset"
include descends="schedtool"
chrt
coolercontrold
coolercontrol-liqctld
dbus
dbus-broker
gamemoderun
gamescope
input-remapper-service
ionice
joystickwake
lact
nice
otd-daemon
oversteer
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# tuned configuration
#
[main]
summary=General tuned profile for CPUs without p-state support

[cpu]
priority=10
governor=schedutil
energy_perf_bias=normal
energy_performance_preference=balance_performance

[acpi]
platform_profile=balanced

[audio]
timeout=10

[video]
radeon_powersave=dpm-balanced,auto

[disk]
# Comma separated list of devices, all devices if commented out.
# devices=sda

[scsi_host]
alpm=medium_power

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/bash
# Returns true for hardware that is supported by SimpleDeckyTDP
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
if [[ ":ROG Ally RC71L_RC71L:ROG Ally RC71L:83E1:G1618-04:G1617-01:G1619-05:AIR Plus:AIR:" =~ ":$SYS_ID:" ]]; then
if [[ ":ROG Ally RC71L_RC71L:ROG Ally RC71L:83E1:G1618-04:G1619-04:G1617-01:G1619-05:AIR Plus:AIR:SLIDE:" =~ ":$SYS_ID:" ]]; then
exit 0
else
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ install-solaar: distrobox-check-fedora

# Install Resilio Sync, a file synchronization utility powered by BitTorrent
install-resilio-sync: distrobox-check-fedora
distrobox-enter -n fedora -- 'sudo rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc' && \
distrobox-enter -n fedora -- 'sudo wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/resilio-sync.repo -O /etc/yum.repos.d/resilio-sync.repo' && \
distrobox-enter -n fedora -- 'sudo dnf install -y resilio-sync' && \
distrobox-enter -n fedora -- bash -c 'sudo rpm --import https://linux-packages.resilio.com/resilio-sync/key.asc' && \
distrobox-enter -n fedora -- bash -c 'sudo wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/resilio-sync.repo -O /etc/yum.repos.d/resilio-sync.repo' && \
distrobox-enter -n fedora -- bash -c 'sudo dnf install -y resilio-sync' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/fedora-resilio-sync.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/resilio_sync/fedora-resilio-sync.service -O ~/.config/systemd/user/fedora-resilio-sync.service && \
Expand All @@ -118,13 +118,13 @@ install-opentabletdriver:
if grep -qvz "arch" <<< $(distrobox list); then \
Assemble noconfirmcreate "" "arch"; \
fi && \
distrobox enter -n arch -- ' paru -S opentabletdriver --noconfirm' && \
distrobox enter -n arch -- bash -c 'paru -S opentabletdriver --noconfirm' && \
mkdir -p ~/.config/systemd/user/ && \
rm -f ~/.config/systemd/user/arch-opentabletdriver.service && \
wget https://raw.githubusercontent.com/ublue-os/bazzite/main/post_install_files/OpenTabletDriver/opentabletdriver.service -O ~/.config/systemd/user/arch-opentabletdriver.service && \
systemctl --user daemon-reload && \
systemctl enable --user --now arch-opentabletdriver.service && \
distrobox enter -n arch -- 'distrobox-export --app otd-gui'
distrobox enter -n arch -- bash -c 'distrobox-export --app otd-gui'

# Create fedora distrobox if it doesn't exist
[private]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ setup-virtualization ACTION="":
source /usr/lib/ujust/ujust.sh
# Check if we are running on a Steam Deck
if /usr/libexec/hardware/valve-hardware; then
echo "Virtualization is not supported on Steam Deck"
exit 0
else
if [ "$(systemctl is-enabled libvirtd.service)" == "disabled" ]; then
echo "${b}libvirtd${n} service is ${red}disabled${n}!"
echo "${green}enabling${n} and starting libvirtd"
echo "If virt-manager says libvirtd.sock is not available after a big update, re-run this command."
sudo systemctl enable --now libvirtd 2> /dev/null
echo "Press ESC if you want to exit and do not need to do anything"
fi
echo "${red}${b}WARNING${n}: Virtualization is not properly supported on Steam Deck by Valve"
echo "Use at your own risk and performance may not be ideal."
fi
if [ "$(systemctl is-enabled libvirtd.service)" == "disabled" ]; then
echo "${b}libvirtd${n} service is ${red}disabled${n}!"
echo "${green}enabling${n} and starting libvirtd"
echo "If virt-manager says libvirtd.sock is not available after a big update, re-run this command."
sudo systemctl enable --now libvirtd 2> /dev/null
echo "Press ESC if you want to exit and do not need to do anything"
fi
OPTION={{ ACTION }}
if [ "$OPTION" == "help" ]; then
Expand All @@ -41,7 +40,7 @@ setup-virtualization ACTION="":
"Autocreate Looking-Glass shm" \
)
fi
if [[ "${OPTION,,}" =~ ^enable[[:space:]]virt ]]; then
if [[ "${OPTION,,}" =~ ^enable(|[[:space:]]virtualization) ]]; then
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ -z ${virt_test} ]]; then
echo "Installing QEMU and virt-manager..."
Expand All @@ -51,7 +50,7 @@ setup-virtualization ACTION="":
--append-if-missing="kvm.report_ignored_msrs=0"
echo 'Please re-run "ujust setup-virtualization" after the reboot to enable libvirtd service'
fi
elif [[ "${OPTION,,}" =~ ^disable[[:space:]]virt ]]; then
elif [[ "${OPTION,,}" =~ ^disable(|[[:space:]]virtualization) ]]; then
virt_test=$(rpm-ostree status | grep -A 4 "●" | grep "virt-manager")
if [[ ${virt_test} ]]; then
if [ "$(systemctl is-enabled libvirtd.service)" == "enabled" ]; then
Expand All @@ -66,6 +65,11 @@ setup-virtualization ACTION="":
echo 'Please re-run "ujust enable-virtualization" after the reboot to finish setup'
fi
elif [[ "${OPTION,,}" =~ (^enable[[:space:]]vfio|vfio-on) ]]; then
# Check if we are running on a Steam Deck
if /usr/libexec/hardware/valve-hardware; then
echo "IOMMU is not supported on Steam Deck"
exit 0
fi
echo "Enabling VFIO..."
VIRT_TEST=$(rpm-ostree kargs)
CPU_VENDOR=$(grep "vendor_id" "/proc/cpuinfo" | uniq | awk -F": " '{ print $2 }')
Expand Down Expand Up @@ -95,6 +99,11 @@ setup-virtualization ACTION="":
fi
fi
elif [[ "${OPTION,,}" =~ (^disable[[:space:]]vfio|vfio-off) ]]; then
# Check if we are running on a Steam Deck
if /usr/libexec/hardware/valve-hardware; then
echo "IOMMU is not supported on Steam Deck"
exit 0
fi
echo ""
echo "Make sure you have ${b}disabled autostart of all VMs using VFIO${n} before continuing!"
CONFIRM=$(Choose Cancel Continue)
Expand Down Expand Up @@ -122,6 +131,11 @@ setup-virtualization ACTION="":
$VFIO_IDS_KARG
fi
elif [[ "${OPTION,,}" =~ shm ]]; then
# Check if we are running on a Steam Deck
if /usr/libexec/hardware/valve-hardware; then
echo "IOMMU is not supported on Steam Deck"
exit 0
fi
echo "Creating tmpfile definition for shm file in /etc/tmpfiles.d/"
sudo bash -c "tee << LOOKING_GLASS_TMP > /etc/tmpfiles.d/10-looking-glass.conf
# Type Path Mode UID GID Age Argument
Expand All @@ -130,5 +144,8 @@ setup-virtualization ACTION="":
echo "Adding SELinux context record for /dev/shm/looking-glass"
sudo semanage fcontext -a -t svirt_tmpfs_t /dev/shm/looking-glass
elif [[ "${OPTION,,}" =~ group ]]; then
if ! grep -q "^libvirt" /etc/group; then
grep '^libvirt' /usr/lib/group | sudo tee -a /etc/group > /dev/null
fi
sudo usermod -aG libvirt $USER
fi

0 comments on commit 9eeeabf

Please sign in to comment.