From 9aeb7e66036d066514f65d641f8b16718e1e25f0 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman Date: Sat, 5 Oct 2024 21:00:42 -0500 Subject: [PATCH 1/9] initial package for surface-dtz-daemon --- anda/system/surface-dtx-daemon/anda.hcl | 5 ++ .../surface-dtx-daemon.spec | 70 +++++++++++++++++++ anda/system/surface-dtx-daemon/update.rhai | 1 + 3 files changed, 76 insertions(+) create mode 100644 anda/system/surface-dtx-daemon/anda.hcl create mode 100644 anda/system/surface-dtx-daemon/surface-dtx-daemon.spec create mode 100644 anda/system/surface-dtx-daemon/update.rhai diff --git a/anda/system/surface-dtx-daemon/anda.hcl b/anda/system/surface-dtx-daemon/anda.hcl new file mode 100644 index 0000000000..e12a1bd632 --- /dev/null +++ b/anda/system/surface-dtx-daemon/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "surface-dtx-daemon.spec" + } +} \ No newline at end of file diff --git a/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec b/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec new file mode 100644 index 0000000000..1b61999433 --- /dev/null +++ b/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec @@ -0,0 +1,70 @@ +%global debug_package %{nil} + +Name: surface-dtx-daemon +Version: 0.3.8 +Release: 1%{?dist} +Summary: Surface Detachment System (DTX) Daemon +License: MIT +URL: https://github.com/linux-surface/surface-dtx-daemon +Source: %url/archive/refs/tags/v%version.tar.gz +Requires: dbus libgcc +BuildRequires: rust cargo dbus-devel + +%description +Linux User-Space Detachment System (DTX) Daemon for the Surface ACPI Driver +(and Surface Books). Currently only the Surface Book 2 is supported, due to +lack of driver-support on the Surface Book 1. This may change in the future. + +%prep +%autosetup -n %name-%version + +%build +export CARGO_TARGET_DIR="$PWD/target" +export CARGO_INCREMENTAL=0 + +cargo build --release --locked +strip --strip-all "target/release/surface-dtx-daemon" +strip --strip-all "target/release/surface-dtx-userd" + +%install + +# binary files +install -D -m755 "target/release/surface-dtx-daemon" "%{buildroot}/usr/bin/surface-dtx-daemon" +install -D -m755 "target/release/surface-dtx-userd" "%{buildroot}/usr/bin/surface-dtx-userd" + +# application files +install -D -m644 "target/etc/dtx/surface-dtx-daemon.conf" "%{buildroot}/etc/surface-dtx/surface-dtx-daemon.conf" +install -D -m644 "target/etc/dtx/surface-dtx-userd.conf" "%{buildroot}/etc/surface-dtx/surface-dtx-userd.conf" +install -D -m755 "target/etc/dtx/attach.sh" "%{buildroot}/etc/surface-dtx/attach.sh" +install -D -m755 "target/etc/dtx/detach.sh" "%{buildroot}/etc/surface-dtx/detach.sh" +install -D -m644 "target/etc/systemd/surface-dtx-daemon.service" "%{buildroot}/usr/lib/systemd/system/surface-dtx-daemon.service" +install -D -m644 "target/etc/systemd/surface-dtx-userd.service" "%{buildroot}/usr/lib/systemd/user/surface-dtx-userd.service" +install -D -m644 "target/etc/dbus/org.surface.dtx.conf" "%{buildroot}/etc/dbus-1/system.d/org.surface.dtx.conf" +install -D -m644 "target/etc/udev/40-surface_dtx.rules" "%{buildroot}/etc/udev/rules.d/40-surface_dtx.rules" + +# completion files +install -D -m644 "target/surface-dtx-daemon.bash" "%{buildroot}/usr/share/bash-completion/completions/surface-dtx-daemon" +install -D -m644 "target/surface-dtx-userd.bash" "%{buildroot}/usr/share/bash-completion/completions/surface-dtx-userd" +install -D -m644 "target/_surface-dtx-daemon" "%{buildroot}/usr/share/zsh/site-functions/_surface-dtx-daemon" +install -D -m644 "target/_surface-dtx-userd" "%{buildroot}/usr/share/zsh/site-functions/_surface-dtx-userd" +install -D -m644 "target/surface-dtx-daemon.fish" "%{buildroot}/usr/share/fish/vendor_completions.d/surface-dtx-daemon.fish" +install -D -m644 "target/surface-dtx-userd.fish" "%{buildroot}/usr/share/fish/vendor_completions.d/surface-dtx-userd.fish" + +%files +%config /etc/dbus-1/system.d/org.surface.dtx.conf +%config /etc/udev/rules.d/40-surface_dtx.rules +%config(noreplace) /etc/surface-dtx/* +/usr/bin/surface-dtx-daemon +/usr/bin/surface-dtx-userd +/usr/lib/systemd/system/surface-dtx-daemon.service +/usr/lib/systemd/user/surface-dtx-userd.service +/usr/share/bash-completion/completions/surface-dtx-daemon +/usr/share/bash-completion/completions/surface-dtx-userd +/usr/share/zsh/site-functions/_surface-dtx-daemon +/usr/share/zsh/site-functions/_surface-dtx-userd +/usr/share/fish/vendor_completions.d/surface-dtx-daemon.fish +/usr/share/fish/vendor_completions.d/surface-dtx-userd.fish + +%changelog +* Sat Oct 5 2024 Owen Zimmerman +- Package surface-dtx-daemon \ No newline at end of file diff --git a/anda/system/surface-dtx-daemon/update.rhai b/anda/system/surface-dtx-daemon/update.rhai new file mode 100644 index 0000000000..1a455045f4 --- /dev/null +++ b/anda/system/surface-dtx-daemon/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("linux-surface/surface-dtx-daemon")); \ No newline at end of file From e99e74ae097b1433d760ad4d8a57b0ef0314dfab Mon Sep 17 00:00:00 2001 From: Owen Zimmerman Date: Sat, 5 Oct 2024 22:36:10 -0500 Subject: [PATCH 2/9] add: chromebook-usbc-fix --- anda/system/chromebook-usbc-fix/anda.hcl | 8 +++ .../chromebook-usbc-fix.spec | 49 +++++++++++++++++++ anda/system/chromebook-usbc-fix/update.rhai | 8 +++ 3 files changed, 65 insertions(+) create mode 100644 anda/system/chromebook-usbc-fix/anda.hcl create mode 100644 anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec create mode 100644 anda/system/chromebook-usbc-fix/update.rhai diff --git a/anda/system/chromebook-usbc-fix/anda.hcl b/anda/system/chromebook-usbc-fix/anda.hcl new file mode 100644 index 0000000000..c1c46b66d7 --- /dev/null +++ b/anda/system/chromebook-usbc-fix/anda.hcl @@ -0,0 +1,8 @@ +project pkg { + rpm { + spec = "chromebook-usbc-fix.spec" + } + labels { + nightly = "1" + } +} \ No newline at end of file diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec new file mode 100644 index 0000000000..f1d3370606 --- /dev/null +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -0,0 +1,49 @@ +%global commit_date 20241005 + +%global commit c357dc068583795f0500cf77926f75da4597d59b +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +%global debug_package %{nil} +%define __os_install_post %{nil} + +Name: chromebook-usbc-fix +Version: %commit_date.%shortcommit +Release: 1%?dist + +License: CCO +Summary: Fixes usbc on TigerLake and AlderLake Chromebooks +URL: https://github.com/Ultramarine-Linux/chromebook-usbc-fix +Source: %url/archive/%{commit}/chromebook-usbc-fix-%{commit}.tar.gz + +%{?systemd_requires} +BuildRequires: systemd-rpm-macros + +%description +%summary + +%prep +%autosetup -n chromebook-usbc-fix-%commit + +%install +mkdir -p %buildroot%{_sysconfdir}/chromebook-usbc-fix/ +install -Dm755 chromebook-usbc.service %buildroot%{_sysconfdir}/chromebook-usbc-fix/chromebook-usbc.service + +%post +%systemd_post chromebook-usbc.service + +%preun +%systemd_preun chromebook-usbc.service + +%postun +%systemd_postun_with_restart chromebook-usbc.service + +%files +%doc README.md +%license LICENSE +%{_sysconfdir}/chromebook-usbc-fix/* +%{_unitdir}/chromebook-usbc.service +%{_bindir}/chromebook-usbc-fix + +%changelog +* Sat Oct 5 2024 Owen-sz +- Initial package. diff --git a/anda/system/chromebook-usbc-fix/update.rhai b/anda/system/chromebook-usbc-fix/update.rhai new file mode 100644 index 0000000000..f8cb3cac66 --- /dev/null +++ b/anda/system/chromebook-usbc-fix/update.rhai @@ -0,0 +1,8 @@ +if filters.contains("nightly") { + rpm.global("commit", gh_commit("Ultramarine-Linux/chromebook-usbc-fix")); + if rpm.changed() { + rpm.release(); + rpm.global("commit_date", date()); + } + } + \ No newline at end of file From 9161db5ca760a967f7a2b9ddb281d2b151f66115 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman Date: Sun, 6 Oct 2024 00:55:03 -0500 Subject: [PATCH 3/9] remove other folder --- anda/system/surface-dtx-daemon/anda.hcl | 5 -- .../surface-dtx-daemon.spec | 70 ------------------- anda/system/surface-dtx-daemon/update.rhai | 1 - 3 files changed, 76 deletions(-) delete mode 100644 anda/system/surface-dtx-daemon/anda.hcl delete mode 100644 anda/system/surface-dtx-daemon/surface-dtx-daemon.spec delete mode 100644 anda/system/surface-dtx-daemon/update.rhai diff --git a/anda/system/surface-dtx-daemon/anda.hcl b/anda/system/surface-dtx-daemon/anda.hcl deleted file mode 100644 index e12a1bd632..0000000000 --- a/anda/system/surface-dtx-daemon/anda.hcl +++ /dev/null @@ -1,5 +0,0 @@ -project pkg { - rpm { - spec = "surface-dtx-daemon.spec" - } -} \ No newline at end of file diff --git a/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec b/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec deleted file mode 100644 index 1b61999433..0000000000 --- a/anda/system/surface-dtx-daemon/surface-dtx-daemon.spec +++ /dev/null @@ -1,70 +0,0 @@ -%global debug_package %{nil} - -Name: surface-dtx-daemon -Version: 0.3.8 -Release: 1%{?dist} -Summary: Surface Detachment System (DTX) Daemon -License: MIT -URL: https://github.com/linux-surface/surface-dtx-daemon -Source: %url/archive/refs/tags/v%version.tar.gz -Requires: dbus libgcc -BuildRequires: rust cargo dbus-devel - -%description -Linux User-Space Detachment System (DTX) Daemon for the Surface ACPI Driver -(and Surface Books). Currently only the Surface Book 2 is supported, due to -lack of driver-support on the Surface Book 1. This may change in the future. - -%prep -%autosetup -n %name-%version - -%build -export CARGO_TARGET_DIR="$PWD/target" -export CARGO_INCREMENTAL=0 - -cargo build --release --locked -strip --strip-all "target/release/surface-dtx-daemon" -strip --strip-all "target/release/surface-dtx-userd" - -%install - -# binary files -install -D -m755 "target/release/surface-dtx-daemon" "%{buildroot}/usr/bin/surface-dtx-daemon" -install -D -m755 "target/release/surface-dtx-userd" "%{buildroot}/usr/bin/surface-dtx-userd" - -# application files -install -D -m644 "target/etc/dtx/surface-dtx-daemon.conf" "%{buildroot}/etc/surface-dtx/surface-dtx-daemon.conf" -install -D -m644 "target/etc/dtx/surface-dtx-userd.conf" "%{buildroot}/etc/surface-dtx/surface-dtx-userd.conf" -install -D -m755 "target/etc/dtx/attach.sh" "%{buildroot}/etc/surface-dtx/attach.sh" -install -D -m755 "target/etc/dtx/detach.sh" "%{buildroot}/etc/surface-dtx/detach.sh" -install -D -m644 "target/etc/systemd/surface-dtx-daemon.service" "%{buildroot}/usr/lib/systemd/system/surface-dtx-daemon.service" -install -D -m644 "target/etc/systemd/surface-dtx-userd.service" "%{buildroot}/usr/lib/systemd/user/surface-dtx-userd.service" -install -D -m644 "target/etc/dbus/org.surface.dtx.conf" "%{buildroot}/etc/dbus-1/system.d/org.surface.dtx.conf" -install -D -m644 "target/etc/udev/40-surface_dtx.rules" "%{buildroot}/etc/udev/rules.d/40-surface_dtx.rules" - -# completion files -install -D -m644 "target/surface-dtx-daemon.bash" "%{buildroot}/usr/share/bash-completion/completions/surface-dtx-daemon" -install -D -m644 "target/surface-dtx-userd.bash" "%{buildroot}/usr/share/bash-completion/completions/surface-dtx-userd" -install -D -m644 "target/_surface-dtx-daemon" "%{buildroot}/usr/share/zsh/site-functions/_surface-dtx-daemon" -install -D -m644 "target/_surface-dtx-userd" "%{buildroot}/usr/share/zsh/site-functions/_surface-dtx-userd" -install -D -m644 "target/surface-dtx-daemon.fish" "%{buildroot}/usr/share/fish/vendor_completions.d/surface-dtx-daemon.fish" -install -D -m644 "target/surface-dtx-userd.fish" "%{buildroot}/usr/share/fish/vendor_completions.d/surface-dtx-userd.fish" - -%files -%config /etc/dbus-1/system.d/org.surface.dtx.conf -%config /etc/udev/rules.d/40-surface_dtx.rules -%config(noreplace) /etc/surface-dtx/* -/usr/bin/surface-dtx-daemon -/usr/bin/surface-dtx-userd -/usr/lib/systemd/system/surface-dtx-daemon.service -/usr/lib/systemd/user/surface-dtx-userd.service -/usr/share/bash-completion/completions/surface-dtx-daemon -/usr/share/bash-completion/completions/surface-dtx-userd -/usr/share/zsh/site-functions/_surface-dtx-daemon -/usr/share/zsh/site-functions/_surface-dtx-userd -/usr/share/fish/vendor_completions.d/surface-dtx-daemon.fish -/usr/share/fish/vendor_completions.d/surface-dtx-userd.fish - -%changelog -* Sat Oct 5 2024 Owen Zimmerman -- Package surface-dtx-daemon \ No newline at end of file diff --git a/anda/system/surface-dtx-daemon/update.rhai b/anda/system/surface-dtx-daemon/update.rhai deleted file mode 100644 index 1a455045f4..0000000000 --- a/anda/system/surface-dtx-daemon/update.rhai +++ /dev/null @@ -1 +0,0 @@ -rpm.version(gh("linux-surface/surface-dtx-daemon")); \ No newline at end of file From 16d51ac2e4590aaea60877082bb776b90d52530e Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:20:01 -0500 Subject: [PATCH 4/9] Update chromebook-usbc-fix.spec Fix commit Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index f1d3370606..7affa34f4b 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -1,6 +1,6 @@ %global commit_date 20241005 -%global commit c357dc068583795f0500cf77926f75da4597d59b +%global commit cef28b120a39fd459c5864d51c4ad52ecaaf25a0 %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global debug_package %{nil} From ddb28f3ba5b1a493033d0c1a496da33719530499 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:41:16 -0500 Subject: [PATCH 5/9] Update chromebook-usbc-fix.spec Add packager Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index 7affa34f4b..72ada1ac7c 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -14,6 +14,7 @@ License: CCO Summary: Fixes usbc on TigerLake and AlderLake Chromebooks URL: https://github.com/Ultramarine-Linux/chromebook-usbc-fix Source: %url/archive/%{commit}/chromebook-usbc-fix-%{commit}.tar.gz +Packager: Owen Zimmerman %{?systemd_requires} BuildRequires: systemd-rpm-macros From 97e3b10dbb00d65c77f67ae9301112730ae6cc15 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:05:08 -0500 Subject: [PATCH 6/9] Update anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec Co-authored-by: madomado Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index 72ada1ac7c..3a4c2f9be5 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -27,7 +27,7 @@ BuildRequires: systemd-rpm-macros %install mkdir -p %buildroot%{_sysconfdir}/chromebook-usbc-fix/ -install -Dm755 chromebook-usbc.service %buildroot%{_sysconfdir}/chromebook-usbc-fix/chromebook-usbc.service +install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.service %post %systemd_post chromebook-usbc.service From 350e13dc74d41d1c5994b1b10ced7ff920caadd0 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:26:49 -0500 Subject: [PATCH 7/9] Update chromebook-usbc-fix.spec Remove %bindir Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index 3a4c2f9be5..a88ea0b70d 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -43,7 +43,6 @@ install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.ser %license LICENSE %{_sysconfdir}/chromebook-usbc-fix/* %{_unitdir}/chromebook-usbc.service -%{_bindir}/chromebook-usbc-fix %changelog * Sat Oct 5 2024 Owen-sz From b7565a561392ee63e4e382bf0d524074ae2b3c6a Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Tue, 8 Oct 2024 20:04:58 -0500 Subject: [PATCH 8/9] Update chromebook-usbc-fix.spec Delete file directory stuff Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index a88ea0b70d..7d9d4e66ba 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -26,7 +26,6 @@ BuildRequires: systemd-rpm-macros %autosetup -n chromebook-usbc-fix-%commit %install -mkdir -p %buildroot%{_sysconfdir}/chromebook-usbc-fix/ install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.service %post @@ -41,7 +40,6 @@ install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.ser %files %doc README.md %license LICENSE -%{_sysconfdir}/chromebook-usbc-fix/* %{_unitdir}/chromebook-usbc.service %changelog From 26c1c4d4ec22889434d8538c157345796882d043 Mon Sep 17 00:00:00 2001 From: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> Date: Sat, 12 Oct 2024 17:46:45 -0500 Subject: [PATCH 9/9] Fix systemd preset application Signed-off-by: Owen Zimmerman <123591347+Owen-sz@users.noreply.github.com> --- anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec index 7d9d4e66ba..f0a3b01fe2 100644 --- a/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec +++ b/anda/system/chromebook-usbc-fix/chromebook-usbc-fix.spec @@ -29,13 +29,13 @@ BuildRequires: systemd-rpm-macros install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.service %post -%systemd_post chromebook-usbc.service +%systemd_post 88-ultramarine-chromebook-default.preset %preun -%systemd_preun chromebook-usbc.service +%systemd_preun 88-ultramarine-chromebook-default.preset %postun -%systemd_postun_with_restart chromebook-usbc.service +%systemd_postun_with_restart 88-ultramarine-chromebook-default.preset %files %doc README.md @@ -43,5 +43,7 @@ install -Dm755 chromebook-usbc.service %buildroot%{_unitdir}/chromebook-usbc.ser %{_unitdir}/chromebook-usbc.service %changelog +* Sat Oct 12 2024 Owen-sz +- Fix the systemd preset application * Sat Oct 5 2024 Owen-sz - Initial package.