Skip to content

Instantly share code, notes, and snippets.

@Kamillaova
Created October 18, 2023 00:03
Show Gist options
  • Save Kamillaova/2e106d17bf81540427cf0df2fd169cfe to your computer and use it in GitHub Desktop.
Save Kamillaova/2e106d17bf81540427cf0df2fd169cfe to your computer and use it in GitHub Desktop.
/etc/initcpio/install/custom_acpi. Add the patched acpi tables to /etc/custom_acpi, for example: /etc/custom_acpi/DSDT
#!/usr/bin/env bash
__basename() {
local tmp
tmp=${1%"${1##*[!/]}"}
tmp=${tmp##*/}
tmp=${tmp%"${2/"$tmp"}"}
printf '%s\n' "${tmp:-/}"
}
tables_directory="/etc/custom_acpi"
build() {
find "${tables_directory}" -type f -print0 | while IFS= read -r -d $'\0' table; do
local table_name=$(__basename "${table}")
add_file "${table}" "/kernel/firmware/acpi/${table_name,,}.aml"
done
}
help() {
echo "This hook adds acpi table patches from ${tables_directory}."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment