Skip to content

Commit

Permalink
fix(deck): Update jupiter-hw-support package
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Nov 23, 2023
1 parent 460f111 commit 0b35eda
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 27 deletions.
21 changes: 10 additions & 11 deletions spec_files/jupiter-hw-support/bazzite-btrfs.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
diff --git a/etc/systemd/system/steamos-automount@.service b/etc/systemd/system/steamos-automount@.service
index dd700da..152e231 100644
index 96e8818..33038bc 100644
--- a/etc/systemd/system/steamos-automount@.service
+++ b/etc/systemd/system/steamos-automount@.service
@@ -14,6 +14,7 @@
@@ -14,5 +14,6 @@ Description=Mount removable drive %i
[Service]
Type=oneshot
RemainAfterExit=true
+EnvironmentFile=/etc/default/steamos-btrfs
ExecStart=-/usr/libexec/steamos-automount add %i
ExecStop=-/usr/libexec/steamos-automount remove %i
ExecReload=-/usr/libexec/steamos-automount retrigger %i

ExecStart=/usr/lib/hwsupport/steamos-automount.sh add %i
ExecStop=/usr/lib/hwsupport/steamos-automount.sh remove %i
diff --git a/usr/lib/hwsupport/format-device.sh b/usr/lib/hwsupport/format-device.sh
index b136413..d3cbb16 100755
index 566eea2..d6803ff 100755
--- a/usr/lib/hwsupport/format-device.sh
+++ b/usr/lib/hwsupport/format-device.sh
@@ -2,6 +2,8 @@
Expand All @@ -24,26 +22,27 @@ index b136413..d3cbb16 100755
# 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.
if ! tty -s; then

diff --git a/usr/lib/hwsupport/steamos-automount.sh b/usr/lib/hwsupport/steamos-automount.sh
index 6dd3a2f..ca1c5ca 100755
--- a/usr/lib/hwsupport/steamos-automount.sh
+++ b/usr/lib/hwsupport/steamos-automount.sh
@@ -77,6 +77,7 @@
@@ -66,6 +66,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
@@ -120,6 +121,7 @@
@@ -109,6 +110,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
@@ -132,7 +134,7 @@
@@ -121,7 +123,7 @@ do_mount()
if [[ -f "${udisks2_mount_options_conf}" && ! -f "${udisks2_mount_options_conf}.orig" ]]; then
mv -f "${udisks2_mount_options_conf}"{,.orig}
fi
Expand Down
10 changes: 5 additions & 5 deletions spec_files/jupiter-hw-support/jupiter-hw-support-btrfs.spec
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
%define packagename jupiter-hw-support
%define packagever jupiter-20231115.1
%define packagever jupiter-3.5-20231115.1
Name: %{packagename}-btrfs
Version: {{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Steam Deck Hardware Support Package
License: GPLv3
URL: https://github.com/ublue-os/bazzite

Source: https://gitlab.com/evlaV/%{packagename}/-/archive/jupiter-20230927.2/%{packagename}-%{packagever}.tar.gz
Source: https://gitlab.com/evlaV/%{packagename}/-/archive/%{packagever}/%{packagename}-%{packagever}.tar.gz
Patch0: fedora.patch
Patch1: selinux.patch
Patch2: https://gitlab.com/popsulfr/steamos-btrfs/-/raw/main/files/usr/lib/hwsupport/steamos-automount.sh.patch.old.20231104103824.20231031.1000
Patch3: https://gitlab.com/popsulfr/steamos-btrfs/-/raw/main/files/usr/lib/hwsupport/format-device.sh.patch.old.20230922091429.20230915.100
Patch2: https://gitlab.com/popsulfr/steamos-btrfs/-/raw/v1.2.6.20231104/files/usr/lib/hwsupport/steamos-automount.sh.patch.old.20231104103824.20231031.1000
Patch3: https://gitlab.com/popsulfr/steamos-btrfs/-/raw/v1.2.6.20231104/files/usr/lib/hwsupport/format-device.sh.patch.old.20230922091429.20230915.100
Patch4: user.patch
Patch5: bazzite-btrfs.patch
Patch6: systemd-run.patch
Expand Down Expand Up @@ -41,7 +41,7 @@ SteamOS 3.0 Steam Deck Hardware Support Package
%define debug_package %{nil}

%prep
%autosetup -p1 -n jupiter-hw-support-jupiter-20230927.2-faaccd721214cbb705bdcba8d3eddfdec1ef4e3b
%autosetup -p1 -n %{packagename}-%{packagever}

%build

Expand Down
34 changes: 23 additions & 11 deletions spec_files/jupiter-hw-support/priv-write.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/usr/bin/steamos-polkit-helpers/steamos-priv-write b/usr/bin/steamos-polkit-helpers/steamos-priv-write
index 907133b..6ba1dd8 100755
index 296996e..ae0ae3e 100755
--- a/usr/bin/steamos-polkit-helpers/steamos-priv-write
+++ b/usr/bin/steamos-polkit-helpers/steamos-priv-write
@@ -2,6 +2,9 @@
Expand All @@ -12,19 +12,31 @@ index 907133b..6ba1dd8 100755
if [[ $EUID -ne 0 ]];
then
exec pkexec --disable-internal-agent "$0" "$@"
@@ -12,16 +15,19 @@
@@ -12,21 +15,25 @@ WRITE_VALUE="$2"

function CommitWrite()
{
- 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"
+ if [[ ":Jupiter:" =~ ":$SYS_ID:" || ":Galileo:" =~ ":$SYS_ID:" || "$ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE" = 1 ]]; then
echo "commit: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
- echo "$WRITE_VALUE" > "$WRITE_PATH"
chmod a+w "$WRITE_PATH"
+ echo "$WRITE_VALUE" > "$WRITE_PATH"
+ if [ ! -z "$WRITE_VALUE" ]
+ then
+ echo "commit: $WRITE_VALUE -> $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
+ chmod a+w "$WRITE_PATH"
+ echo "$WRITE_VALUE" > "$WRITE_PATH"
+ fi
+
+ echo "chmod a+w: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
+ else
+ echo "commit: Skipped - see /etc/default/steam-hardware-control" | systemd-cat -t p-steamos-priv-write -p warning
+ fi
exit 0
+ echo "commit: Skipped - see /etc/default/steam-hardware-control" | systemd-cat -t p-steamos-priv-write -p warning
fi
-
- chmod a+w "$WRITE_PATH"
- echo "chmod a+w: $WRITE_PATH" | systemd-cat -t p-steamos-priv-write -p warning
+
exit 0
}

function DeclineWrite()
Expand All @@ -34,8 +46,8 @@ index 907133b..6ba1dd8 100755
exit 1
}

@@ -32,15 +38,90 @@

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

if [[ "$WRITE_PATH" == /sys/class/drm/card*/device/power_dpm_force_performance_level ]]; then
- CommitWrite
Expand Down

0 comments on commit 0b35eda

Please sign in to comment.