Initial commit

This commit is contained in:
Silvan Calarco 2017-04-10 15:30:25 +02:00
commit 2e6bdd0e63
5 changed files with 135 additions and 0 deletions

View File

@ -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)

61
Makefile Normal file
View File

@ -0,0 +1,61 @@
# Makefile for acpi_tables_patch
# Copyright (C) 2017 by Silvan Calarco <silvan.calarco@qilinux.it>
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

1
VERSION Normal file
View File

@ -0,0 +1 @@
VERSION = 0.1

20
acpi_tables_patch Executable file
View File

@ -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

View File

@ -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