mirror of
https://github.com/mainnika/acpi-wakeup-fixxer.git
synced 2026-06-22 06:54:59 +00:00
Compare commits
12 Commits
3edb64f1ed
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
f344d62a04
|
|||
|
c0eb787ac9
|
|||
|
ed7adc4fd1
|
|||
|
6497f3c442
|
|||
|
75f4ab1d28
|
|||
|
e53eccce0b
|
|||
|
76ba300436
|
|||
|
117fcf3dab
|
|||
|
1dfa53c0af
|
|||
|
135970f695
|
|||
|
42170a1aee
|
|||
|
032729daf1
|
@@ -0,0 +1,44 @@
|
||||
name: Build RPM
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: 'branch or tag ref'
|
||||
required: true
|
||||
default: 'refs/heads/main'
|
||||
push:
|
||||
branches: [ main ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: fedora:40
|
||||
options: --privileged
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
dnf install -y mock rpm-build
|
||||
|
||||
- name: Download sources tar.gz archive
|
||||
run: |
|
||||
curl -LO https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz
|
||||
FILENAME=$(ls)
|
||||
ARCHIVENAME=$(basename $FILENAME .tar.gz)
|
||||
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
|
||||
echo "ARCHIVENAME=$ARCHIVENAME" >> $GITHUB_ENV
|
||||
|
||||
- name: Build RPM
|
||||
run: |
|
||||
tar --strip-components=1 -xvf $FILENAME '*/rpm/golang-code-tokarch-mainnika-acpi-wakeup-fixxer.spec'
|
||||
mock --init
|
||||
mock --buildsrpm --spec rpm/golang-code-tokarch-mainnika-acpi-wakeup-fixxer.spec --sources $FILENAME --rpmbuild-opts="-D'__archivename $ARCHIVENAME' -D'__archiveext tar.gz'" --rebuild --isolation=simple
|
||||
|
||||
- name: Archive RPMs
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: RPMs
|
||||
path: /var/lib/mock/*/result/*.rpm
|
||||
@@ -0,0 +1,19 @@
|
||||
MIT License
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1 +1,41 @@
|
||||
# acpi-wakeup-fixxer
|
||||
|
||||
This repository contains a tool to disable the wakeup ability on your macbook system that runs linux, which can be particularly useful to prevent immediate wakeup from suspend mode. This tool is compatible with various systems, including the MacBook Air 2013/2015.
|
||||
|
||||
# features
|
||||
|
||||
- disables wakeup by echoing a device name to /proc/acpi/wakeup
|
||||
- default list of devices to disable is LID0 XHC1
|
||||
- one can adjust the list by using `-disable` flag
|
||||
- systemd unit runs the app on load and resume
|
||||
|
||||
# installation
|
||||
|
||||
## rhel/fedora systems
|
||||
|
||||
- take latest artifacts from https://github.com/mainnika/acpi-wakeup-fixxer/actions/workflows/build-rpm.yaml
|
||||
- unzip and install `fedora-40-x86_64/result/golang-code-tokarch-mainnika-acpi-wakeup-fixxer-0-0.1.fc40.x86_64.rpm`
|
||||
|
||||
## build from sources
|
||||
- `go build -o acpi-wakeup-fixxer ./cmd/acpi-wakeup-fixxer`
|
||||
|
||||
# systemd
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=Fix ACPI wakeup issues
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=sysinit.target shutdown.target
|
||||
ConditionPathExists=|/proc/acpi/wakeup
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/acpi-wakeup-fixxer $ACPI_WAKEUP_FIXXER_ARGS
|
||||
Type=oneshot
|
||||
TimeoutSec=0
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/acpi-wakeup-fixxer
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
```
|
||||
@@ -15,9 +15,8 @@ var (
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "acpi-wakeup-fixxer",
|
||||
Short: "A CLI tool to fix ACPI wakeup issues",
|
||||
Args: cobra.NoArgs,
|
||||
Use: "acpi-wakeup-fixxer",
|
||||
Long: "acpi-wakeup-fixxer is a command-line tool to fix ACPI wakeup issues on your system.",
|
||||
Run: rootCmdRun,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Generated by go2rpm 1.11.1
|
||||
%bcond_without check
|
||||
|
||||
%global goipath code.tokarch.uk/mainnika/acpi-wakeup-fixxer
|
||||
%global common_description %{expand:
|
||||
This package provides a fix for ACPI wakeup issues on MacBookPro12,x.}
|
||||
|
||||
%global golicenses LICENSE
|
||||
%global godocs README.md
|
||||
|
||||
%global archivename main
|
||||
%global archiveext tar.gz
|
||||
%global topdir acpi-wakeup-fixxer-%{archivename}
|
||||
|
||||
Name: golang-code-tokarch-mainnika-acpi-wakeup-fixxer
|
||||
Version: 0
|
||||
Release: 0.1%{?dist}
|
||||
Summary: None
|
||||
|
||||
License: MIT
|
||||
URL: https://code.tokarch.uk/mainnika/acpi-wakeup-fixxer
|
||||
Source: https://github.com/mainnika/acpi-wakeup-fixxer/archive/refs/heads/%{archivename}.%{archiveext}
|
||||
|
||||
BuildRequires: systemd
|
||||
|
||||
%description %{common_description}
|
||||
|
||||
%gometa
|
||||
%gopkg
|
||||
|
||||
%prep
|
||||
%goprep -A
|
||||
%autopatch -p1
|
||||
|
||||
%generate_buildrequires
|
||||
%go_generate_buildrequires
|
||||
|
||||
%build
|
||||
%gobuild -o %{gobuilddir}/bin/acpi-wakeup-fixxer %{goipath}/cmd/acpi-wakeup-fixxer
|
||||
|
||||
%install
|
||||
%gopkginstall
|
||||
install -m 0755 -vd %{buildroot}%{_bindir}
|
||||
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
|
||||
|
||||
install -m 0755 -vd %{buildroot}%{_unitdir}
|
||||
install -m 0644 -vp systemd/acpi-wakeup-fixxer.service %{buildroot}%{_unitdir}/
|
||||
|
||||
install -m 0755 -vd %{buildroot}%{_sysconfdir}/default
|
||||
install -m 0644 -vp systemd/acpi-wakeup-fixxer %{buildroot}%{_sysconfdir}/default/
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
%gocheck
|
||||
%endif
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc README.md
|
||||
%{_bindir}/*
|
||||
%{_unitdir}/acpi-wakeup-fixxer.service
|
||||
%config(noreplace) %{_sysconfdir}/default/acpi-wakeup-fixxer
|
||||
|
||||
%gopkgfiles
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
@@ -0,0 +1 @@
|
||||
ACPI_WAKEUP_FIXXER_ARGS=""
|
||||
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Fix ACPI wakeup issues
|
||||
DefaultDependencies=no
|
||||
Conflicts=shutdown.target
|
||||
Before=sysinit.target shutdown.target
|
||||
ConditionPathExists=|/proc/acpi/wakeup
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/acpi-wakeup-fixxer $ACPI_WAKEUP_FIXXER_ARGS
|
||||
Type=oneshot
|
||||
TimeoutSec=0
|
||||
RemainAfterExit=yes
|
||||
EnvironmentFile=-/etc/default/acpi-wakeup-fixxer
|
||||
|
||||
[Install]
|
||||
WantedBy=sysinit.target
|
||||
Reference in New Issue
Block a user