commit 2e6bdd0e637cf29c8f848d80b79d3eff817f9356 Author: Silvan Calarco Date: Mon Apr 10 15:30:25 2017 +0200 Initial commit diff --git a/ALASKA_A_M_I_0x01072009.patch b/ALASKA_A_M_I_0x01072009.patch new file mode 100644 index 0000000..5d901eb --- /dev/null +++ b/ALASKA_A_M_I_0x01072009.patch @@ -0,0 +1,42 @@ +--- ../dsdt.dsl 2017-04-09 19:06:01.681324614 +0100 ++++ dsdt.dsl 2017-04-09 20:12:04.437622315 +0100 +@@ -17,7 +17,7 @@ + * Compiler Version 0x20120913 (538052883) + */ + +-DefinitionBlock ("dsdt.aml", "DSDT", 2, "ALASKA", "A M I ", 0x01072009) ++DefinitionBlock ("dsdt.aml", "DSDT", 2, "ALASKA", "A M I ", 0x0107200A) + { + External (UBTC) + External (NDN3, MethodObj) // 1 Arguments +@@ -8863,12 +8863,12 @@ + { + If (LOr (LEqual (P10A, Zero), LEqual (L11D, One))) + { +- Return (Zero) ++ Return (0x0F) + } + + If (LEqual (OSID, One)) + { +- Return (Zero) ++ Return (0x0F) + } + + Return (0x0F) +@@ -8932,13 +8932,13 @@ + { + If (LOr (LEqual (P20A, Zero), LEqual (L12D, One))) + { +- Return (Zero) ++ Return (0x0F) + } + + If (LOr (LOr (LEqual (BDID, 0x08), LEqual (BDID, 0x0A)), LEqual ( + OSID, One))) + { +- Return (Zero) ++ Return (0x0F) + } + + Return (0x0F) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d9d6478 --- /dev/null +++ b/Makefile @@ -0,0 +1,61 @@ +# Makefile for acpi_tables_patch +# Copyright (C) 2017 by Silvan Calarco + +include VERSION + +PACKAGE = acpi_tables_patch + +prefix = /usr +exec_prefix = $(prefix) +sysconfdir = /etc +bindir = $(exec_prefix)/bin +libdir := $(prefix)/lib +sbindir = $(exec_prefix)/sbin +sbin = /sbin +mandir = $(prefix)/share/man +datadir = $(prefix)/share +initrddir = $(sysconfdir)/rc.d/init.d +logrotatedir = $(sysconfdir)/logrotate.d/ +sysconfigdir= $(sysconfdir)/sysconfig +systemdunitdir = /lib/systemd/system +localesdir = $(datadir)/locale + +srcdir = . + +DESTDIR = +INSTALL = /usr/bin/install -c +INSTALL_PROGRAM = ${INSTALL} -m 755 +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_DIR = ${INSTALL} -d -m 755 +INSTALL_SCRIPT = ${INSTALL_PROGRAM} + +# package related variables +distdir = $(PACKAGE)-$(VERSION) +dist_archive = $(distdir).tar.bz2 + +install: + $(INSTALL_DIR) $(DESTDIR)$(sbindir) + $(INSTALL_SCRIPT) acpi_tables_patch $(DESTDIR)$(sbindir) + $(INSTALL_DIR) $(DESTDIR)$(datadir)/acpi_tables_patch/patches/ + cp *.patch $(DESTDIR)$(datadir)/acpi_tables_patch/patches/ + $(INSTALL_DIR) $(DESTDIR)$(systemdunitdir) + $(INSTALL_DATA) acpi_tables_patch@.service $(DESTDIR)$(systemdunitdir) + +dist: clean + @mkdir /tmp/$(distdir) + @cp -a * /tmp/$(distdir)/ + @rm -f $(dist_archive);\ + tar cf - -C /tmp $(distdir) | bzip2 -9 -c > $(dist_archive) + @rm -rf /tmp/$(distdir) + @echo "file \`$(dist_archive)' created" + +dist-rpm: dist + @rpm_sourcedir=`rpm --eval=%{_sourcedir}`;\ + mv -f $(dist_archive) $$rpm_sourcedir && \ + echo "and saved as \`$$rpm_sourcedir/$(dist_archive)'" + +clean: + find . -name *~ -exec rm {} \; + rm -f $(dist_archive) + rm -f $(pck_catalogs:.po=.mo) + rm -f $(PACKAGE).lang diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..eb1786c --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +VERSION = 0.1 diff --git a/acpi_tables_patch b/acpi_tables_patch new file mode 100755 index 0000000..b522a7f --- /dev/null +++ b/acpi_tables_patch @@ -0,0 +1,20 @@ +#!/bin/bash +[ -e /boot/dsdt.aml ] && exit 0 +[ "$1" ] || { + echo "Usage: $0 patch" + exit 1 +} +output_dir=`mktemp -d` +input_patch=$1 +cat /sys/firmware/acpi/tables/DSDT > ${output_dir}/dsdt.dat +cd ${output_dir} +iasl -d dsdt.dat +patch -p1 dsdt.dsl < /usr/share/acpi_tables_patch/patches/${input_patch}.patch || { + echo "ERROR: unable to apply patch $input_patch; aborting." + exit 1 +} +iasl -tc dsdt.dsl +cd - > /dev/null +cp ${output_dir}/dsdt.aml /boot/ +[ "${output_dir}" ] && rm -rf ${output_dir} +mkinitrd /boot/initramfs-`uname -r`.img diff --git a/acpi_tables_patch@.service b/acpi_tables_patch@.service new file mode 100644 index 0000000..20d3b94 --- /dev/null +++ b/acpi_tables_patch@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Create ACPI DSDT table patched with %I patch +DefaultDependencies=no +ConditionPathExists=!/boot/dsdt.aml + +[Service] +Type=oneshot +ExecStart=/usr/sbin/acpi_tables_patch %I + +[Install] +WantedBy=sysinit.target