Skip to content

Commit

Permalink
add support for Fedora
Browse files Browse the repository at this point in the history
duplicate scripts to add support for Fedora's different way of
handling initramfs.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed Mar 26, 2021
1 parent 28f6d74 commit cbdb363
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
36 changes: 36 additions & 0 deletions acpi-add-fedora
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


22 changes: 22 additions & 0 deletions install_hooks_fedora
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/

0 comments on commit cbdb363

Please sign in to comment.