From 15e3e02d1203f5c3153b9ec1e3a73183cabd1fa3 Mon Sep 17 00:00:00 2001 From: Uri Herrera Date: Wed, 6 Nov 2024 05:24:45 -0600 Subject: [PATCH] create pkg --- .github/ISSUE_TEMPLATE/bug_report.md | 26 ++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 42 +++++++++++++++++++++++ .github/workflows/build.yml | 28 +++++++++++++++ .gitignore | 8 +++++ README.md | 10 ++++-- debian/changelog | 5 +++ debian/compat | 1 + debian/control | 17 +++++++++ debian/copyright | 29 ++++++++++++++++ debian/install | 1 + debian/postinst | 12 +++++++ debian/postrm | 3 ++ debian/preinst | 3 ++ debian/rules | 5 +++ debian/source/format | 1 + etc/init.d/nvidia-hibernate | 10 ++++++ etc/init.d/nvidia-powerd | 11 ++++++ etc/init.d/nvidia-resume | 10 ++++++ etc/init.d/nvidia-suspend | 10 ++++++ gh-build.sh | 17 +++++++++ nvidia-suspend | 14 ++++++++ 21 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 debian/changelog create mode 100644 debian/compat create mode 100644 debian/control create mode 100644 debian/copyright create mode 100644 debian/install create mode 100755 debian/postinst create mode 100755 debian/postrm create mode 100755 debian/preinst create mode 100644 debian/rules create mode 100644 debian/source/format create mode 100755 etc/init.d/nvidia-hibernate create mode 100644 etc/init.d/nvidia-powerd create mode 100755 etc/init.d/nvidia-resume create mode 100755 etc/init.d/nvidia-suspend create mode 100755 gh-build.sh create mode 100755 nvidia-suspend diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..b0db006 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,26 @@ +--- +name: 🐞 Bug report +about: Create a report to help us improve + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..2291880 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,42 @@ +--- +name: "🚀 Feature request" +about: Suggest an idea for improving this software +title: '' +labels: 'type:Enhancement' +assignees: '' + +--- + +### Is your proposal related to a problem? + + + +(Write your answer here.) + +### Describe the solution you'd like + + + +(Describe your proposed solution here.) + +### Describe alternatives you've considered + + + +(Write your answer here.) + +### Additional context + + + +(Write your answer here.) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..529d007 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build and push packages to PackageCloud. + +on: + push: + branches: + - 'main' + paths-ignore: + - 'README.md' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install dependencies. + run: | + sudo gem install package_cloud + + - name: Build. + run: | + sudo ./gh-build.sh + + - name: Push package. + env: + PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }} + run: | + package_cloud push nitrux/testing/debian/trixie $(pwd)/*.deb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1acacd5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Compiled source # +################### +*.directory +*.DS_Store +*.bak +/.project +*.db +*.qmlc diff --git a/README.md b/README.md index d813def..4866acb 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,8 @@ -# nvidia-openrc - OpenRC service scripts used by the NVIDIA proprietary driver. +# NVIDIA Services for OpenRC + +Service files to enable stuff needed by the NVIDIA proprietary driver with Nitrux. + +# Issues +If you find problems with the contents of this repository please create an issue. + +©2024 Nitrux Latinoamericana S.C. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..ff86f76 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +nvidia-openrc (0.0.1) nitrux; urgency=medium + + * Create package. + + -- Uri Herrera Wed, 06 Nov 2024 04:46:00 -0500 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..ec63514 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +9 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..206acc8 --- /dev/null +++ b/debian/control @@ -0,0 +1,17 @@ +Source: nvidia-openrc +Section: misc +Priority: important +Maintainer: Uri Herrera +Build-Depends: debhelper (>=9) +Standards-Version: 3.9.6 +Homepage: http://nxos.org + + +Package: nvidia-openrc +Architecture: all +Depends: ${shlibs:Depends}, ${misc:Depends}, openrc +Conflicts: systemd, systemd-sysv +Description: Package to add NVIDIA services configuration for OpenRC. + This package will add the boot scripts to use NVIDIA services + with OpenRC in Nitrux. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..72d79e2 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: debugfs-openrc +Source: https://github.com/Nitrux/debugfs-openrc.git + +Files: * +Copyright: 2022 Uri Herrera +License: GPL-3.0+ + +Files: debian/* +Copyright: 2022 Uri Herrera +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..72298d3 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +etc / diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..cb8ad34 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# -- Add service to runlevel. + +rc-update add nvidia-suspend async +rc-update add nvidia-resume async +rc-update add nvidia-hibernate async +rc-update add nvidia-powerd async + +# -- Update services list. + +rc-update -u diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 0000000..8c3cbfc --- /dev/null +++ b/debian/postrm @@ -0,0 +1,3 @@ +#!/bin/bash + +exit 0 diff --git a/debian/preinst b/debian/preinst new file mode 100755 index 0000000..809da30 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,3 @@ +#! /bin/bash + +exit 0 diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..8f2a305 --- /dev/null +++ b/debian/rules @@ -0,0 +1,5 @@ +#!/usr/bin/make -f + + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/etc/init.d/nvidia-hibernate b/etc/init.d/nvidia-hibernate new file mode 100755 index 0000000..8284e1e --- /dev/null +++ b/etc/init.d/nvidia-hibernate @@ -0,0 +1,10 @@ +#!/sbin/openrc-run + +description="NVIDIA system hibernate actions" + +start() { + ebegin "Running NVIDIA system hibernate actions" + /usr/bin/logger -t hibernate -s "nvidia-hibernate.service" + /usr/bin/nvidia-sleep.sh "hibernate" + eend $? +} diff --git a/etc/init.d/nvidia-powerd b/etc/init.d/nvidia-powerd new file mode 100644 index 0000000..aa55e8a --- /dev/null +++ b/etc/init.d/nvidia-powerd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run + +description="nvidia-powerd service" +command="/usr/bin/nvidia-powerd" +command_background="yes" + +depend() { + need localmount + after bootmisc + use logger +} diff --git a/etc/init.d/nvidia-resume b/etc/init.d/nvidia-resume new file mode 100755 index 0000000..dc3224f --- /dev/null +++ b/etc/init.d/nvidia-resume @@ -0,0 +1,10 @@ +#!/sbin/openrc-run + +description="NVIDIA system resume actions" + +start() { + ebegin "Running NVIDIA system resume actions" + /usr/bin/logger -t resume -s "nvidia-resume.service" + /usr/bin/nvidia-sleep.sh "resume" + eend $? +} diff --git a/etc/init.d/nvidia-suspend b/etc/init.d/nvidia-suspend new file mode 100755 index 0000000..b29fc9e --- /dev/null +++ b/etc/init.d/nvidia-suspend @@ -0,0 +1,10 @@ +#!/sbin/openrc-run + +description="NVIDIA system suspend actions" + +start() { + ebegin "Running NVIDIA system suspend actions" + /usr/bin/logger -t suspend -s "nvidia-suspend.service" + /usr/bin/nvidia-sleep.sh "suspend" + eend $? +} diff --git a/gh-build.sh b/gh-build.sh new file mode 100755 index 0000000..2633c16 --- /dev/null +++ b/gh-build.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +set -x + +### Basic Packages +apt -qq update +apt -qq -yy install equivs git devscripts lintian --no-install-recommends + +### Install Dependencies +mk-build-deps -i -t "apt-get --yes" -r + +### Build Deb +debuild -b -uc -us + +### Move Deb to current directory because debuild decided +### that it was a GREAT IDEA TO PUT THE FILE ONE LEVEL ABOVE +mv ../*.deb . diff --git a/nvidia-suspend b/nvidia-suspend new file mode 100755 index 0000000..b435df2 --- /dev/null +++ b/nvidia-suspend @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +description="NVIDIA system suspend actions" + +depend() { + before suspend +} + +start() { + ebegin "Running NVIDIA system suspend actions" + /usr/bin/logger -t suspend -s "nvidia-suspend.service" + /usr/bin/nvidia-sleep.sh "suspend" + eend $? +}