chore: Update jupiter-hw-support packages

This commit is contained in:
Kyle Gospodnetich 2024-06-30 00:34:08 -07:00
parent 10e334aa13
commit ac53c8bd6c
12 changed files with 74 additions and 117 deletions

View File

@ -1,53 +1,13 @@
diff --git a/usr/lib/hwsupport/format-device.sh b/usr/lib/hwsupport/format-device.sh
index 58d66d3..768a6fc 100755
--- a/usr/lib/hwsupport/format-device.sh
+++ b/usr/lib/hwsupport/format-device.sh
@@ -2,7 +2,9 @@
set -e
-. /usr/libexec/hwsupport/common-functions
+source /etc/default/steamos-btrfs
+
+. /usr/libexec/common-functions
# If the script is not run from a tty then send a copy of stdout and
# stderr to the journal. In this case stderr is also redirected to stdout.
diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 366bef3..f627175 100755
index a9408dd..b5a0e6b 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -2,6 +2,8 @@
set -euo pipefail
+source /etc/default/steamos-btrfs
+
. /usr/libexec/hwsupport/common-functions
# Originally from https://serverfault.com/a/767079
@@ -60,6 +62,7 @@ do_mount()
dev_json=$(lsblk -o PATH,LABEL,FSTYPE --json -- "$DEVICE" | jq '.blockdevices[0]')
ID_FS_LABEL=$(jq -r '.label | select(type == "string")' <<< "$dev_json")
ID_FS_TYPE=$(jq -r '.fstype | select(type == "string")' <<< "$dev_json")
+ FSTYPE_PREFIX=""
#### SteamOS Btrfs Begin ####
if [[ -f /etc/default/steamos-btrfs ]]; then
@@ -103,6 +106,7 @@ do_mount()
UDISKS2_ALLOW='uid=$UID,gid=$GID,umask,dmask,fmask,locale,norecover,ignore_case,windows_names,compression,nocompression,big_writes,nls,nohidden,sys_immutable,sparse,showmeta,prealloc'
OPTS="${STEAMOS_BTRFS_SDCARD_NTFS_MOUNT_OPTS:-rw,noatime,lazytime,uid=1000,gid=1000,big_writes,umask=0022,ignore_case,windows_names}"
FSTYPE="lowntfs-3g"
+ FSTYPE_PREFIX="ntfs:"
if [[ ! -f /etc/filesystems ]] || ! grep -q '\b'"${FSTYPE}"'\b' /etc/filesystems; then
echo "${FSTYPE}" >> /etc/filesystems
fi
@@ -115,7 +119,7 @@ do_mount()
if [[ -f "${udisks2_mount_options_conf}" && ! -f "${udisks2_mount_options_conf}.orig" ]]; then
mv -f "${udisks2_mount_options_conf}"{,.orig}
fi
- echo -e "[defaults]\n${FSTYPE}_allow=${UDISKS2_ALLOW},${OPTS}" > "${udisks2_mount_options_conf}"
+ echo -e "[defaults]\n${FSTYPE_PREFIX}${FSTYPE}_allow=${UDISKS2_ALLOW},${OPTS}" > "${udisks2_mount_options_conf}"
trap 'rm -f "${udisks2_mount_options_conf}" ; [[ -f "${udisks2_mount_options_conf}.orig" ]] && mv -f "${udisks2_mount_options_conf}"{.orig,}' EXIT
#### SteamOS Btrfs End ####
@@ -36,7 +36,7 @@ send_steam_url()
if pgrep -x "steam" > /dev/null; then
# TODO use -ifrunning and check return value - if there was a steam process and it returns -1, the message wasn't sent
# need to retry until either steam process is gone or -ifrunning returns 0, or timeout i guess
- systemd-run -M ${DECK_UID}@ --user --collect --wait sh -c "./.steam/root/ubuntu12_32/steam steam://${command}/${encoded@Q}"
+ systemd-run --uid=${DECK_UID} --collect --wait sh -c "/usr/bin/steam steam://${command}/${encoded@Q}"
echo "Sent URL to steam: steam://${command}/${arg} (steam://${command}/${encoded})"
else
echo "Could not send steam URL steam://${command}/${arg} (steam://${command}/${encoded}) -- steam not running"

View File

@ -1,8 +1,8 @@
diff --git a/usr/bin/jupiter-biosupdate b/usr/bin/jupiter-biosupdate
index 1f89423..ee3abd4 100755
index a8d6059..7dfac37 100755
--- a/usr/bin/jupiter-biosupdate
+++ b/usr/bin/jupiter-biosupdate
@@ -185,6 +185,10 @@ fi
@@ -187,6 +187,10 @@ fi
# Die early if inhibited
[[ ! -f $BIOS_INHIBIT_FILE ]] || die "Bios updates inhibited, no action ($BIOS_INHIBIT_FILE)"

View File

@ -1,5 +1,5 @@
diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 908c31f..3f34ee8 100755
index 67c6ec1..e5ba74b 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -19,6 +19,9 @@ if [[ $# -ne 2 ]]; then

View File

@ -1,5 +1,5 @@
diff --git a/usr/lib/hwsupport/format-device.sh b/usr/lib/hwsupport/format-device.sh
index b4839d3..a1e3310 100755
index 3a4098d..58d66d3 100755
--- a/usr/lib/hwsupport/format-device.sh
+++ b/usr/lib/hwsupport/format-device.sh
@@ -133,7 +133,37 @@ echo "stage=formatting"

View File

@ -9,7 +9,7 @@ index ada6104..e40e82a 100755
# script from AMD to use when reporting bugs to them
diff --git a/usr/bin/jupiter-biosupdate b/usr/bin/jupiter-biosupdate
index 26bcd14..1f89423 100755
index c0665c4..a8d6059 100755
--- a/usr/bin/jupiter-biosupdate
+++ b/usr/bin/jupiter-biosupdate
@@ -1,4 +1,4 @@
@ -179,15 +179,15 @@ index 1841ce0..9cfa9a6 100755
set -eu
diff --git a/usr/bin/steamos-polkit-helpers/steamos-priv-write b/usr/bin/steamos-polkit-helpers/steamos-priv-write
index e307823..d78a81d 100755
index d1456c8..8fcd1d4 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-priv-write
+++ b/usr/bin/steamos-polkit-helpers/steamos-priv-write
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/bash
set -eu
set -euo pipefail
shopt -s nullglob
diff --git a/usr/bin/steamos-polkit-helpers/steamos-reboot-now b/usr/bin/steamos-polkit-helpers/steamos-reboot-now
index b4dcc81..5ff87b5 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-reboot-now

View File

@ -1,8 +1,8 @@
diff --git a/usr/lib/hwsupport/trim-devices.sh b/usr/lib/hwsupport/trim-devices.sh
index 84897df..0f22352 100755
index 84897df..bd203ab 100755
--- a/usr/lib/hwsupport/trim-devices.sh
+++ b/usr/lib/hwsupport/trim-devices.sh
@@ -78,6 +78,18 @@ function is_known_bad_device()
@@ -78,12 +78,23 @@ function is_known_bad_device()
return;
}
@ -21,3 +21,9 @@ index 84897df..0f22352 100755
# In some cases it is unsafe to trim an sdcard. When we detect this case
# lets just trim the partitions on the internal drive which we know are
# safe to trim/discard
if is_known_bad_device; then
_fstrim /var
- _fstrim /home
exit
fi

View File

@ -1,17 +1,18 @@
diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 0f31509..1c64336 100755
index b5a0e6b..39fb11f 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -3,6 +3,8 @@
@@ -2,6 +2,9 @@
set -euo pipefail
source /etc/default/steamos-btrfs
+IMAGE_INFO="/usr/share/ublue-os/image-info.json"
+BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
+
. /usr/libexec/hwsupport/common-functions
@@ -174,6 +176,10 @@ do_mount()
# Originally from https://serverfault.com/a/767079
@@ -170,6 +173,10 @@ do_mount()
;;
esac

View File

@ -1,5 +1,5 @@
%define packagename jupiter-hw-support
%define packagever jupiter-20240416.1
%define packagever jupiter-3.6-20240624.1
%global _default_patch_fuzz 2
Name: %{packagename}-btrfs
@ -17,12 +17,11 @@ Patch2: btrfs-automount.patch
Patch3: btrfs-format.patch
Patch4: user.patch
Patch5: bazzite-btrfs.patch
Patch6: systemd-run.patch
Patch7: priv-write.patch
Patch8: biosupdate.patch
Patch9: gnome.patch
Patch10: fstrim.patch
Patch11: cursor-path.patch
Patch6: priv-write.patch
Patch7: biosupdate.patch
Patch8: gnome.patch
Patch9: fstrim.patch
Patch10: cursor-path.patch
Requires: python3
Requires: python3-evdev

View File

@ -19,11 +19,10 @@ Patch2: btrfs-automount.patch
Patch3: btrfs-format.patch
Patch4: user.patch
Patch5: bazzite-btrfs.patch
Patch6: systemd-run.patch
Patch7: priv-write.patch
Patch8: biosupdate.patch
Patch9: gnome.patch
Patch10: fstrim.patch
Patch6: priv-write.patch
Patch7: biosupdate.patch
Patch8: gnome.patch
Patch9: fstrim.patch
Requires: jq

View File

@ -1,10 +1,10 @@
diff --git a/usr/bin/steamos-polkit-helpers/steamos-priv-write b/usr/bin/steamos-polkit-helpers/steamos-priv-write
index d78a81d..c7e1434 100755
index 8fcd1d4..4b47d21 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-priv-write
+++ b/usr/bin/steamos-polkit-helpers/steamos-priv-write
@@ -2,6 +2,9 @@
set -eu
@@ -3,6 +3,9 @@
set -euo pipefail
shopt -s nullglob
+source /etc/default/steam-hardware-control
+SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
@ -12,36 +12,28 @@ index d78a81d..c7e1434 100755
if [[ $EUID -ne 0 ]];
then
exec pkexec --disable-internal-agent "$0" "$@"
@@ -12,21 +15,21 @@ WRITE_VALUE="$2"
@@ -37,13 +40,14 @@ function MatchFilenamePattern()
function CommitWrite()
{
+ chmod a+w "$WRITE_PATH"
+ echo "chmod a+w: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
+ chmod a+w "$WRITE_PATH"
+ echo "chmod a+w: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
+
if [ ! -z "$WRITE_VALUE" ]
then
echo "commit: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
echo "$WRITE_VALUE" > "$WRITE_PATH"
fi
if [ -n "$WRITE_VALUE" ]; then
Log "commit: $WRITE_VALUE -> $WRITE_PATH"
printf "%s" "$WRITE_VALUE" > "$WRITE_PATH"
fi
- chmod a+w "$WRITE_PATH"
- echo "chmod a+w: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
exit 0
- chgrp deck "$WRITE_PATH"
- chmod g+w "$WRITE_PATH"
exit 0
}
function DeclineWrite()
{
echo "decline: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p err
- echo "$WRITE_VALUE" > "$WRITE_PATH"
exit 1
}
@@ -40,15 +43,35 @@ if [[ "$WRITE_PATH" == /dev/drm_dp_aux0 ]]; then
@@ -65,15 +69,35 @@ if MatchFilenamePattern "$WRITE_PATH" "/dev/drm_dp_aux0"; then
fi
if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then
- CommitWrite
if MatchFilenamePattern "$WRITE_PATH" "/sys/class/drm/card*/device/power_dpm_force_performance_level"; then
- CommitWrite
+ if /usr/libexec/hwsupport/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
@ -53,8 +45,8 @@ index d78a81d..c7e1434 100755
+ fi
fi
if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/pp_od_clk_voltage ]]; then
- CommitWrite
if MatchFilenamePattern "$WRITE_PATH" "/sys/class/drm/card*/device/pp_od_clk_voltage"; then
- CommitWrite
+ if /usr/libexec/hwsupport/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
@ -66,8 +58,8 @@ index d78a81d..c7e1434 100755
+ fi
fi
if [[ "$WRITE_PATH" == /sys/class/hwmon/hwmon*/power*_cap ]]; then
- CommitWrite
if MatchFilenamePattern "$WRITE_PATH" "/sys/class/hwmon/hwmon*/power*_cap"; then
- CommitWrite
+ if /usr/libexec/hwsupport/valve-hardware || [[ "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
+ CommitWrite
+ else
@ -75,4 +67,4 @@ index d78a81d..c7e1434 100755
+ fi
fi
if [[ "$WRITE_PATH" == /sys/devices/platform/*/*/*/iio:device*/in_illuminance_integration_time ]]; then
if MatchFilenamePattern "$WRITE_PATH" "/sys/devices/platform/*/*/*/iio:device*/in_illuminance_integration_time"; then

View File

@ -19,7 +19,7 @@ index ef206ba..04ba88a 100755
-exec /usr/lib/jupiter-dock-updater/jupiter-dock-updater.sh "$@"
+exec /usr/libexec/jupiter-dock-updater/jupiter-dock-updater.sh "$@"
diff --git a/usr/bin/steamos-polkit-helpers/steamos-format-device b/usr/bin/steamos-polkit-helpers/steamos-format-device
index a133624..2c2480b 100755
index a133624..63fe3bc 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-format-device
+++ b/usr/bin/steamos-polkit-helpers/steamos-format-device
@@ -8,4 +8,4 @@ then
@ -29,7 +29,7 @@ index a133624..2c2480b 100755
-exec /usr/lib/hwsupport/format-device.sh "$@"
+exec /usr/libexec/hwsupport/format-device.sh "$@"
diff --git a/usr/bin/steamos-polkit-helpers/steamos-format-sdcard b/usr/bin/steamos-polkit-helpers/steamos-format-sdcard
index e43e952..c0f8034 100755
index e43e952..1898244 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-format-sdcard
+++ b/usr/bin/steamos-polkit-helpers/steamos-format-sdcard
@@ -8,4 +8,4 @@ then
@ -39,7 +39,7 @@ index e43e952..c0f8034 100755
-exec /usr/lib/hwsupport/format-sdcard.sh "$@"
+exec /usr/libexec/hwsupport/format-sdcard.sh "$@"
diff --git a/usr/bin/steamos-polkit-helpers/steamos-trim-devices b/usr/bin/steamos-polkit-helpers/steamos-trim-devices
index 296d5d6..e8d0ded 100755
index 296d5d6..c8a31ef 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-trim-devices
+++ b/usr/bin/steamos-polkit-helpers/steamos-trim-devices
@@ -7,4 +7,4 @@ then
@ -49,7 +49,7 @@ index 296d5d6..e8d0ded 100755
-exec /usr/lib/hwsupport/trim-devices.sh "$@"
+exec /usr/libexec/hwsupport/trim-devices.sh "$@"
diff --git a/usr/lib/hwsupport/block-device-event.sh b/usr/lib/hwsupport/block-device-event.sh
index 6ff1eb4..4c65aa1 100755
index 6ff1eb4..132d94c 100755
--- a/usr/lib/hwsupport/block-device-event.sh
+++ b/usr/lib/hwsupport/block-device-event.sh
@@ -2,7 +2,7 @@
@ -77,7 +77,7 @@ index 6ff1eb4..4c65aa1 100755
case "${ACTION}" in
diff --git a/usr/lib/hwsupport/format-device.sh b/usr/lib/hwsupport/format-device.sh
index 315c588..87a8e7d 100755
index 315c588..3a4098d 100755
--- a/usr/lib/hwsupport/format-device.sh
+++ b/usr/lib/hwsupport/format-device.sh
@@ -2,7 +2,7 @@
@ -108,7 +108,7 @@ index 315c588..87a8e7d 100755
exit 5
fi
diff --git a/usr/lib/hwsupport/format-sdcard.sh b/usr/lib/hwsupport/format-sdcard.sh
index 99ed89a..19c307c 100755
index 99ed89a..d608ff3 100755
--- a/usr/lib/hwsupport/format-sdcard.sh
+++ b/usr/lib/hwsupport/format-sdcard.sh
@@ -1,3 +1,3 @@
@ -130,7 +130,7 @@ index 60bbc93..67c6ec1 100755
# Originally from https://serverfault.com/a/767079
diff --git a/usr/lib/udev/rules.d/99-sdcard-rescan.rules b/usr/lib/udev/rules.d/99-sdcard-rescan.rules
index f184d9e..0f8c791 100644
index f184d9e..da1ecf0 100644
--- a/usr/lib/udev/rules.d/99-sdcard-rescan.rules
+++ b/usr/lib/udev/rules.d/99-sdcard-rescan.rules
@@ -1,3 +1,3 @@
@ -139,7 +139,7 @@ index f184d9e..0f8c791 100644
-ACTION=="add", SUBSYSTEM=="mmc", ENV{MMC_NAME}=="SD032", RUN+="/usr/bin/systemd-run --no-block --collect /usr/lib/hwsupport/sdcard-rescan.sh %k"
+ACTION=="add", SUBSYSTEM=="mmc", ENV{MMC_NAME}=="SD032", RUN+="/usr/bin/systemd-run --no-block --collect /usr/libexec/hwsupport/sdcard-rescan.sh %k"
diff --git a/usr/lib/udev/rules.d/99-steamos-automount.rules b/usr/lib/udev/rules.d/99-steamos-automount.rules
index 18b5149..c68abf0 100644
index 18b5149..fb69a18 100644
--- a/usr/lib/udev/rules.d/99-steamos-automount.rules
+++ b/usr/lib/udev/rules.d/99-steamos-automount.rules
@@ -5,7 +5,7 @@ KERNEL!="mmcblk*|sd*", GOTO="steamos_automount_end"

View File

@ -1,5 +1,5 @@
diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 3f34ee8..4a78916 100755
index e5ba74b..a9408dd 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -25,8 +25,8 @@ if [[ "${FLOCKER:-}" != "$0" ]] ; then exec env FLOCKER="$0" flock -e -w 20 "$0"
@ -32,7 +32,7 @@ index 3f34ee8..4a78916 100755
[[ "${ID_FS_TYPE}" == "vfat" || "${ID_FS_TYPE}" == "exfat" || "${ID_FS_TYPE}" == "ntfs" ]]; then
# bind mount compatdata folder from internal disk
- DECK_HOME="$(getent passwd deck | cut -d: -f6)"
+ DECK_HOME="/home/${USER}"
+ DECK_HOME="/var/home/${USER}"
mkdir -p "${mount_point}"/steamapps/compatdata
chown "${DECK_UID}:${DECK_GID}" "${mount_point}"/steamapps{,/compatdata}
mkdir -p "${DECK_HOME}"/.local/share/Steam/steamapps/compatdata