summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO41
-rw-r--r--.gitignore5
-rw-r--r--PKGBUILD101
-rw-r--r--cli.patch19
-rw-r--r--galu1.patch20
-rw-r--r--gtk.patch14
-rw-r--r--system76-driver-git.install87
-rw-r--r--wayland.patch27
8 files changed, 314 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..0b12f4c4c8e8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,41 @@
+pkgbase = system76-driver-git
+ pkgdesc = System76 Driver for System76 computers
+ pkgver = 19.04.7.r3.gd5d0ae7
+ pkgrel = 1
+ url = https://github.com/pop-os/system76-driver
+ install = system76-driver-git.install
+ arch = any
+ license = GPL
+ depends = python>=3.6
+ depends = python-cffi
+ depends = python-dbus
+ depends = python-evdev
+ depends = python-gobject
+ depends = python-pynacl
+ depends = python-systemd
+ depends = python-xlib
+ depends = dmidecode
+ depends = at
+ depends = system76-dkms
+ depends = system76-io-dkms
+ depends = system76-firmware-daemon
+ optdepends = pm-utils: For power management features
+ optdepends = gtk3: To launch System76 driver and firmware GUI
+ optdepends = grub: To apply kernel boot time parameters
+ optdepends = polkit: Run System76 Driver GUI from application menu
+ optdepends = pulseaudio: To apply microphone fix
+ optdepends = xorg-xhost: To enable GUI applications on Wayland
+ optdepends = xorg-xbacklight: To use the backlight service
+ source = system76-driver-git::git+https://github.com/pop-os/system76-driver.git
+ source = galu1.patch
+ source = gtk.patch
+ source = cli.patch
+ source = wayland.patch
+ sha256sums = SKIP
+ sha256sums = 2ccf53ec0ffdeea00930d218253f5b3db2bdc7d3405e8353caabc36107f3ab26
+ sha256sums = 14c6d669b5a4a5b4a306978ebdad7e26d939e8e559de52274aec26cd5b2ea853
+ sha256sums = ef027346c439561dc01f906ae7bd961100aedf9125fd86bb0eb89a87b683fdc3
+ sha256sums = fc3cccb25c7b570c69db987f4ed6a0558db7fd0046d5dbd46dbd243d8e85e611
+
+pkgname = system76-driver-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..46f213a103ea
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+src
+pkg
+system76-driver-git
+*pkg.tar.xz
+tags
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6135b70ae32c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,101 @@
+# Maintainer: Tony Lambiris <tony@criticalstack.com>
+
+pkgname=system76-driver-git
+pkgver=19.04.7.r3.gd5d0ae7
+pkgrel=1
+pkgdesc="System76 Driver for System76 computers"
+arch=('any')
+url="https://github.com/pop-os/system76-driver"
+license=('GPL')
+install=system76-driver-git.install
+depends=(
+ 'python>=3.6'
+ 'python-cffi'
+ 'python-dbus'
+ 'python-evdev'
+ 'python-gobject'
+ 'python-pynacl'
+ 'python-systemd'
+ 'python-xlib'
+ 'dmidecode'
+ 'at'
+ 'system76-dkms'
+ 'system76-io-dkms'
+ 'system76-firmware-daemon')
+makepdepends=('python-pyflakes')
+optdepends=(
+ 'pm-utils: For power management features'
+ 'gtk3: To launch System76 driver and firmware GUI'
+ 'grub: To apply kernel boot time parameters'
+ 'polkit: Run System76 Driver GUI from application menu'
+ 'pulseaudio: To apply microphone fix'
+ 'xorg-xhost: To enable GUI applications on Wayland'
+ 'xorg-xbacklight: To use the backlight service')
+source=("${pkgname}::git+https://github.com/pop-os/system76-driver.git"
+ 'galu1.patch'
+ 'gtk.patch'
+ 'cli.patch'
+ 'wayland.patch')
+sha256sums=('SKIP'
+ '2ccf53ec0ffdeea00930d218253f5b3db2bdc7d3405e8353caabc36107f3ab26'
+ '14c6d669b5a4a5b4a306978ebdad7e26d939e8e559de52274aec26cd5b2ea853'
+ 'ef027346c439561dc01f906ae7bd961100aedf9125fd86bb0eb89a87b683fdc3'
+ 'fc3cccb25c7b570c69db987f4ed6a0558db7fd0046d5dbd46dbd243d8e85e611')
+
+pkgver() {
+ cd ${pkgname}
+
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd ${pkgname}
+
+ # patch for cli version - enable override vendor/model via /etc/system76-daemon.json
+ patch --no-backup-if-mismatch -Np1 -i ${srcdir}/cli.patch
+
+ # galu1 model-specific patch
+ patch --no-backup-if-mismatch -Np1 -i ${srcdir}/galu1.patch
+
+ # enabling "Restore System" button if all changes applied
+ patch --no-backup-if-mismatch -Np1 -i ${srcdir}/gtk.patch
+
+ # Use xhost for GUI apps on Wayland
+ patch --no-backup-if-mismatch -Np1 -i ${srcdir}/wayland.patch
+}
+
+package() {
+ cd ${pkgname}
+
+ # Build and install base package
+ python setup.py install --prefix=/usr --root=${pkgdir} --optimize=1
+
+ # Install daemons and executables
+ install -m755 -D system76-daemon ${pkgdir}/usr/lib/${pkgname}/system76-daemon
+ install -m755 -D system76-backlight-daemon ${pkgdir}/usr/lib/${pkgname}/system76-backlight-daemon
+ install -m755 -D system76-firmware-dialog ${pkgdir}/usr/lib/${pkgname}/system76-firmware-dialog
+ install -m755 -D system76-driver-pkexec ${pkgdir}/usr/bin/system76-driver-pkexec
+ install -m755 -D system76-firmware ${pkgdir}/usr/bin/system76-firmware
+ install -m755 -D system76-firmware-pkexec ${pkgdir}/usr/bin/system76-firmware-pkexec
+
+ # Install systemd unit files
+ # Note: system76-driver* service files shortened to system76*
+ install -m644 -D debian/system76-driver.service ${pkgdir}/usr/lib/systemd/system/system76.service
+ install -m644 -D debian/system76-driver-backlight.service ${pkgdir}/usr/lib/systemd/user/system76-backlight.service
+
+ # Install scripts and configuration
+ install -m755 -D system76-nm-restart ${pkgdir}/usr/lib/${pkgname}/system76-nm-restart
+ install -m644 -D com.system76.pkexec.system76-driver.policy ${pkgdir}/usr/share/polkit-1/actions/com.system76.pkexec.system76-driver.policy
+ install -m644 -D com.system76.pkexec.system76-firmware.policy ${pkgdir}/usr/share/polkit-1/actions/com.system76.pkexec.system76-firmware.policy
+
+ # Install desktop shortcuts
+ install -m644 -D system76-driver-backlight.desktop ${pkgdir}/usr/share/applications/system76-backlight.desktop
+ install -m644 -D system76-firmware.desktop ${pkgdir}/usr/share/applications/system76-firmware.desktop
+
+ # Create /var/lib/system76-driver directory for brightness settings saving
+ install -m755 -d ${pkgdir}/var/lib/${pkgname}
+
+ # Clean up
+ rm -rf ${pkgdir}/usr/lib/python*/site-packages/system76driver/{__pycache__,tests}
+}
+
diff --git a/cli.patch b/cli.patch
new file mode 100644
index 000000000000..22f351d6b7f9
--- /dev/null
+++ b/cli.patch
@@ -0,0 +1,19 @@
+--- a/system76-driver-cli 2016-03-05 15:53:48.000000000 -0500
++++ b/system76-driver-cli 2016-03-05 18:03:49.068840665 -0500
+@@ -27,6 +27,7 @@
+ import logging
+
+ import system76driver
++from system76driver import daemon
+ from system76driver.products import PRODUCTS
+ from system76driver.actions import ActionRunner
+
+@@ -55,7 +56,7 @@
+ sys.exit(0)
+
+
+-product_version = args.model or system76driver.get_product_version()
++product_version = args.model or daemon.load_json_conf('/etc/system76-daemon.json').get('model') or system76driver.get_product_version()
+ try:
+ product = PRODUCTS[product_version]
+ log.info('product_version: %r', product_version)
diff --git a/galu1.patch b/galu1.patch
new file mode 100644
index 000000000000..6e82a01bd705
--- /dev/null
+++ b/galu1.patch
@@ -0,0 +1,20 @@
+--- a/system76driver/daemon.py 2014-12-21 15:51:54.899761693 -0500
++++ b/system76driver/daemon.py 2014-12-21 15:52:43.496397059 -0500
+@@ -58,7 +58,6 @@
+ 'bonx7',
+ 'bonx8',
+ 'daru4',
+- 'galu1',
+ 'gazp9',
+ 'gazp9b',
+ 'kudp1',
+--- a/system76driver/model.py 2014-04-21 12:43:25.000000000 -0400
++++ b/system76driver/model.py 2014-05-03 23:20:20.837535955 -0400
+@@ -85,6 +85,7 @@
+ 'K8N-DL': 'wilp2',
+ 'KFN5-D SLI': 'wilp3',
+ 'DP35DP': 'wilp5',
++ 'W740SU': 'galu1',
+ },
+ 'system-product-name': {
+ 'MS-1012': 'gazv1',
diff --git a/gtk.patch b/gtk.patch
new file mode 100644
index 000000000000..a98af62eeda7
--- /dev/null
+++ b/gtk.patch
@@ -0,0 +1,14 @@
+--- a/system76driver/gtk.py 2014-05-10 00:19:43.755367421 -0400
++++ b/system76driver/gtk.py 2014-05-10 00:19:48.515363743 -0400
+@@ -100,10 +100,10 @@
+ self.details.set_text('\n'.join(lines))
+ if self.action_runner.needed:
+ self.enabled['driverInstall'] = True
+- self.enabled['driverRestore'] = True
+ else:
+ msg = _('All drivers have been applied, nothing to do.')
+ self.set_notify('gtk-ok', msg)
++ self.enabled['driverRestore'] = True
+ self.set_sensitive(True)
+
+ def set_sensitive(self, sensitive):
diff --git a/system76-driver-git.install b/system76-driver-git.install
new file mode 100644
index 000000000000..79820fab8e0f
--- /dev/null
+++ b/system76-driver-git.install
@@ -0,0 +1,87 @@
+_services="system76.service"
+
+_stop_services() {
+ /usr/bin/systemctl stop $_services >/dev/null 2>&1
+}
+
+_disable_services() {
+ /usr/bin/systemctl disable $_services >/dev/null 2>&1
+ /usr/bin/systemctl reset-failed $_services >/dev/null 2>&1
+}
+
+_restore_services() {
+ for service in $_services; do
+ if /usr/bin/systemctl -q is-enabled $service >/dev/null 2>&1; then
+ /usr/bin/systemctl start $service > /dev/null 2>&1
+ fi
+ done
+}
+
+_remove_symlink() {
+ if [ -L $1 ] && [ "$(readlink -f $1)" = "$2" ]; then
+ rm $1
+ fi
+}
+
+post_install() {
+cat << EOF
+
+ The System76 Driver package provides the following system services:
+
+ system76.service System76 airplane-mode hotkey and LED support
+
+ And the following user services:
+
+ system76-backlight.service Backlight Daemon for NVIDIA 9 Series on GNOME
+
+ The backlight service can (optionally) be started automatically:
+
+ ln -s /usr/share/applications/system76-driver-backlight.desktop /etc/xdg/autostart/system76-driver-backlight.desktop
+
+ GUI applications are provided to install drivers, patches, and firmware updates.
+
+ (!) To use system76.service, you must add "ec_sys.write_support=1" to your kernel command line
+
+ (!) If you do not use the Grub bootloader, please check output for possible manual actions required for
+ your model related to bootloader modifications.
+
+ (!) For Clevo W740SU BIOS/Firmware users on Galago UltraPro: your will need to create /etc/system76-daemon.json
+ file with following content:
+
+ { "vendor": "System76, Inc", "model": "galu1" }
+
+ (!) If you experience Wifi issues after resuming from suspend, consider using the included network
+ restart script:
+
+ ln -s /usr/lib/system76-driver/system76-nm-restart /lib/systemd/system-sleep/system76-nm-restart
+
+EOF
+}
+
+pre_upgrade() {
+ _stop_services
+}
+
+post_upgrade() {
+ /usr/bin/systemctl daemon-reload >/dev/null 2>&1
+ _restore_services
+ post_install
+}
+
+pre_remove() {
+ _stop_services
+ _disable_services
+
+ # Remove symlinks if target points to package files
+ _remove_symlink /etc/xdg/autostart/system76-driver-backlight.desktop /usr/share/applications/system76-driver-backlight.desktop
+ _remove_symlink /lib/systemd/system-sleep/system76-nm-restart /usr/lib/system76-driver/system76-nm-restart
+}
+
+post_remove() {
+ /usr/bin/systemctl daemon-reload >/dev/null 2>&1
+ cat << EOF
+
+ Be sure to stop and disable all running System76 user services.
+
+EOF
+}
diff --git a/wayland.patch b/wayland.patch
new file mode 100644
index 000000000000..a62dc78b02e2
--- /dev/null
+++ b/wayland.patch
@@ -0,0 +1,27 @@
+--- a/system76-driver-pkexec 2018-10-18 14:55:38.000000000 -0400
++++ b/system76-driver-pkexec 2018-11-05 20:58:58.839653271 -0500
+@@ -1,2 +1,10 @@
+ #!/bin/sh
++if [ "$XDG_SESSION_TYPE" == "wayland" ] && command -v xhost; then
++ xhost +si:localuser:root
++fi
++
+ pkexec "/usr/bin/system76-driver" --home $HOME
++
++if [ "$XDG_SESSION_TYPE" == "wayland" ] && command -v xhost; then
++ xhost -si:localuser:root
++fi
+diff -Naur system76-driver-18.10.2/system76-firmware-pkexec system76-driver-18.10.2.patched/system76-firmware-pkexec
+--- a/system76-firmware-pkexec 2018-10-18 14:55:38.000000000 -0400
++++ b/system76-firmware-pkexec 2018-11-05 21:00:02.253796899 -0500
+@@ -1,2 +1,10 @@
+ #!/bin/sh
++if [ "$XDG_SESSION_TYPE" == "wayland" ] && command -v xhost; then
++ xhost +si:localuser:root
++fi
++
+ pkexec "/usr/bin/system76-firmware" --reinstall
++
++if [ "$XDG_SESSION_TYPE" == "wayland" ] && command -v xhost; then
++ xhost -si:localuser:root
++fi