2024-05-05 06:16:56 +07:00
|
|
|
#!/usr/bin/env ash
|
|
|
|
#
|
|
|
|
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
|
|
|
#
|
|
|
|
# This is free software, licensed under the MIT License.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ "${1}" = "late" ]; then
|
|
|
|
echo "Installing addon acpid - ${1}"
|
|
|
|
mkdir -p "/tmpRoot/usr/arc/addons/"
|
2024-11-09 01:34:54 +07:00
|
|
|
cp -pf "${0}" "/tmpRoot/usr/arc/addons/"
|
2024-05-05 06:16:56 +07:00
|
|
|
|
2024-07-06 04:21:54 +07:00
|
|
|
tar -zxf /addons/acpid-7.1.tgz -C /tmpRoot/usr/ ./bin ./sbin ./lib
|
|
|
|
tar -zxf /addons/acpid-7.1.tgz -C /tmpRoot/ ./etc
|
2024-08-24 00:40:58 +07:00
|
|
|
sed -i '/^Exec/s|=/|=/|g' /tmpRoot/usr/lib/systemd/system/acpid.service
|
2024-05-05 06:16:56 +07:00
|
|
|
if [ -f /usr/lib/modules/button.ko ]; then
|
2024-11-09 01:34:54 +07:00
|
|
|
cp -pf /usr/lib/modules/button.ko /tmpRoot/usr/lib/modules/button.ko
|
2024-05-05 06:16:56 +07:00
|
|
|
else
|
|
|
|
echo "No button.ko found"
|
|
|
|
fi
|
|
|
|
|
2024-06-30 15:55:03 +07:00
|
|
|
# mkdir -p "/tmpRoot/usr/lib/systemd/system"
|
|
|
|
# DEST="/tmpRoot/usr/lib/systemd/system/acpid.service"
|
2024-11-20 16:51:12 +07:00
|
|
|
# {
|
|
|
|
# echo "[Unit]"
|
|
|
|
# echo "Description=ACPI Daemon"
|
|
|
|
# echo "DefaultDependencies=no"
|
|
|
|
# echo "IgnoreOnIsolate=true"
|
|
|
|
# echo "After=multi-user.target"
|
|
|
|
# echo
|
|
|
|
# echo "[Service]"
|
|
|
|
# echo "Type=forking"
|
|
|
|
# echo "Restart=always"
|
|
|
|
# echo "RestartSec=30"
|
|
|
|
# echo "PIDFile=/var/run/acpid.pid"
|
|
|
|
# echo "ExecStartPre=/usr/sbin/modprobe button"
|
|
|
|
# echo "ExecStart=/usr/sbin/acpid"
|
|
|
|
# echo "ExecStopPost=/usr/sbin/modprobe -r button"
|
|
|
|
# echo
|
|
|
|
# echo "[X-Synology]"
|
|
|
|
# echo "Author=Virtualization Team"
|
|
|
|
# } >"${DEST}"
|
2024-06-30 15:55:03 +07:00
|
|
|
# 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
|
2024-05-05 06:16:56 +07:00
|
|
|
|
|
|
|
elif [ "${1}" = "uninstall" ]; then
|
|
|
|
echo "Installing addon acpid - ${1}"
|
|
|
|
|
|
|
|
rm -f "/tmpRoot/usr/lib/systemd/system/multi-user.target.wants/acpid.service"
|
|
|
|
rm -f "/tmpRoot/usr/lib/systemd/system/acpid.service"
|
|
|
|
|
2024-06-30 15:55:03 +07:00
|
|
|
rm -rf /tmpRoot/etc/acpi
|
2024-06-19 21:58:30 +07:00
|
|
|
rm -f /tmpRoot/usr/bin/acpi_listen
|
2024-05-05 06:16:56 +07:00
|
|
|
rm -f /tmpRoot/usr/sbin/acpid
|
2024-06-19 21:58:30 +07:00
|
|
|
rm -f /tmpRoot/usr/sbin/kacpimon
|
2024-05-19 21:48:40 +07:00
|
|
|
fi
|