forked from plbossart/acpi-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
acpi-add
executable file
·37 lines (29 loc) · 829 Bytes
/
acpi-add
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# Author: Nicola Lunghi
# script to compile and add acpi hooks
# use like this: acpi-add file1.asl file2.asl
BASEHOOKSDIR="/lib/firmware/acpi-upgrades"
count=0
for arg in "$@"
do
pathname=$(dirname "$arg")
fullname=$(basename "$arg")
extension="${fullname##*.}"
filename="${fullname%.*}"
if [ -f "$pathname/$fullname" ] && [ "$extension" == "asl" ]
then
((count++))
echo "-- generating ${fullname}"
iasl ${pathname}/${filename}.asl > /dev/null
sudo mv ${pathname}/$filename.aml $BASEHOOKSDIR
fi
done
echo -e "\nAdded ${count} asl files\n"
if [ "$count" -ne "0" ]
then
echo -e "\nUpdate initramfs...\n"
# update initramfs
#sudo update-initramfs -u -k all
sudo update-initramfs -u -t -k `uname -r`
echo -e "\nDone\n"
fi