acpid: update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-29 16:57:25 +02:00
parent daac791eeb
commit b2cc28366c
7 changed files with 26 additions and 47 deletions

Binary file not shown.

View File

@ -1,13 +0,0 @@
# /etc/acpi/events/powerbtn
# This is called when the user presses the power button and calls
# /etc/acpi/powerbtn.sh for further processing.
# Optionally you can specify the placeholder %e. It will pass
# through the whole kernel event message to the program you've
# specified.
# We need to react on "button power.*" and "button/power.*" because
# of kernel changes.
event=button[ /]power
action=/etc/acpi/power.sh

View File

@ -1,6 +0,0 @@
#!/bin/sh
logger -p err "Shutdown from ACPI"
[ -x /usr/syno/sbin/synopoweroff ] && \
/usr/syno/sbin/synopoweroff ||
/usr/sbin/poweroff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -11,38 +11,37 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/arc/addons/"
cp -vf "${0}" "/tmpRoot/usr/arc/addons/"
mkdir -p /tmpRoot/etc/acpi/events/
cp -vf /etc/acpi/events/power /tmpRoot/etc/acpi/events/power
cp -vf /etc/acpi/power.sh /tmpRoot/etc/acpi/power.sh
cp -vf /usr/bin/acpi_listen /tmpRoot/usr/bin/acpi_listen
cp -vf /usr/sbin/acpid /tmpRoot/usr/sbin/acpid
cp -vf /usr/sbin/kacpimon /tmpRoot/usr/sbin/kacpimon
tar zxf /addons/acpid-7.1.tgz -C /tmpRoot/usr/
[ -d /tmpRoot/etc/acpi ] && rm -rf /tmpRoot/etc/acpi
mv -f /tmpRoot/usr/etc/acpi /tmpRoot/etc/
if [ -f /usr/lib/modules/button.ko ]; then
cp -vf /usr/lib/modules/button.ko /tmpRoot/usr/lib/modules/button.ko
else
echo "No button.ko found"
fi
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/acpid.service"
echo "[Unit]" >${DEST}
echo "Description=addon acpid" >>${DEST}
echo "DefaultDependencies=no" >>${DEST}
echo "IgnoreOnIsolate=true" >>${DEST}
echo "After=multi-user.target" >>${DEST}
echo >>${DEST}
echo "[Service]" >>${DEST}
echo "Restart=always" >>${DEST}
echo "RestartSec=30" >>${DEST}
echo "ExecStartPre=-/usr/sbin/modprobe button" >>${DEST}
echo "ExecStart=/usr/sbin/acpid -f" >>${DEST}
echo "ExecStopPost=-/usr/sbin/modprobe -r button" >>${DEST}
echo >>${DEST}
echo "[X-Synology]" >>${DEST}
echo "Author=Virtualization Team" >>${DEST}
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/acpid.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/acpid.service
# mkdir -p "/tmpRoot/usr/lib/systemd/system"
# DEST="/tmpRoot/usr/lib/systemd/system/acpid.service"
# echo "[Unit]" >${DEST}
# echo "Description=ACPI Daemon" >>${DEST}
# echo "DefaultDependencies=no" >>${DEST}
# echo "IgnoreOnIsolate=true" >>${DEST}
# echo "After=multi-user.target" >>${DEST}
# echo >>${DEST}
# echo "[Service]" >>${DEST}
# echo "Type=forking" >>${DEST}
# echo "Restart=always" >>${DEST}
# echo "RestartSec=30" >>${DEST}
# echo "PIDFile=/var/run/acpid.pid" >>${DEST}
# echo "ExecStartPre=-/usr/sbin/modprobe button" >>${DEST}
# echo "ExecStart=/usr/sbin/acpid" >>${DEST}
# echo "ExecStopPost=-/usr/sbin/modprobe -r button" >>${DEST}
# echo >>${DEST}
# echo "[X-Synology]" >>${DEST}
# echo "Author=Virtualization Team" >>${DEST}
#
# mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
# ln -vsf /usr/lib/systemd/system/acpid.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/acpid.service
elif [ "${1}" = "uninstall" ]; then
echo "Installing addon acpid - ${1}"
@ -50,8 +49,7 @@ elif [ "${1}" = "uninstall" ]; then
rm -f "/tmpRoot/usr/lib/systemd/system/multi-user.target.wants/acpid.service"
rm -f "/tmpRoot/usr/lib/systemd/system/acpid.service"
rm -f /tmpRoot/etc/acpi/events/power
rm -f /tmpRoot/etc/acpi/power.sh
rm -rf /tmpRoot/etc/acpi
rm -f /tmpRoot/usr/bin/acpi_listen
rm -f /tmpRoot/usr/sbin/acpid
rm -f /tmpRoot/usr/sbin/kacpimon