forked from plbossart/acpi-scripts
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
duplicate scripts to add support for Fedora's different way of handling initramfs. Signed-off-by: Pierre-Louis Bossart <[email protected]>
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/usr/bin/env bash | ||
# Author: Nicola Lunghi | ||
# script to compile and add acpi hooks | ||
# use like this: acpi-add-fedora 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 dracut --regenerate-all -f | ||
echo -e "\nDone\n" | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT=`realpath $0` | ||
SCRIPTPATH=`dirname $SCRIPT` | ||
|
||
# Initial setup | ||
# On the target Fedora system (e.g. UP Board): | ||
if ! (hash iasl 2>/dev/null) ; then | ||
sudo dnf update | ||
sudo dnf -y install acpica-tools | ||
else | ||
echo "acpica-tools already installed skipping" | ||
fi | ||
|
||
sudo mkdir -p /lib/firmware/acpi-upgrades | ||
|
||
sudo echo 'acpi_override="yes"' | sudo tee /etc/dracut.conf.d/01-acpi-override.conf | ||
|
||
sudo echo 'acpi_table_dir="/lib/firmware/acpi-upgrades"' | sudo tee -a /etc/dracut.conf.d/01-acpi-override.conf | ||
|
||
sudo cp ${SCRIPTPATH}/acpi-add-fedora /usr/local/bin/ | ||
|