tree: update

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-11-20 10:51:12 +01:00
parent 1a86875059
commit 0c9b4f1d9b
71 changed files with 540 additions and 419 deletions

View File

@ -22,21 +22,25 @@ if [ "${1}" = "late" ]; then
# mkdir -p "/tmpRoot/usr/lib/systemd/system" # mkdir -p "/tmpRoot/usr/lib/systemd/system"
# DEST="/tmpRoot/usr/lib/systemd/system/acpid.service" # DEST="/tmpRoot/usr/lib/systemd/system/acpid.service"
# echo "[Unit]" >${DEST} # {
# echo "Description=ACPI Daemon" >>${DEST} # echo "[Unit]"
# echo "DefaultDependencies=no" >>${DEST} # echo "Description=ACPI Daemon"
# echo "IgnoreOnIsolate=true" >>${DEST} # echo "DefaultDependencies=no"
# echo "After=multi-user.target" >>${DEST} # echo "IgnoreOnIsolate=true"
# echo >>${DEST} # echo "After=multi-user.target"
# echo "[Service]" >>${DEST} # echo
# echo "Type=forking" >>${DEST} # echo "[Service]"
# echo "Restart=always" >>${DEST} # echo "Type=forking"
# echo "RestartSec=30" >>${DEST} # echo "Restart=always"
# echo "PIDFile=/var/run/acpid.pid" >>${DEST} # echo "RestartSec=30"
# echo "ExecStartPre=/usr/sbin/modprobe button" >>${DEST} # echo "PIDFile=/var/run/acpid.pid"
# echo "ExecStart=/usr/sbin/acpid" >>${DEST} # echo "ExecStartPre=/usr/sbin/modprobe button"
# echo "ExecStopPost=/usr/sbin/modprobe -r button" >>${DEST} # echo "ExecStart=/usr/sbin/acpid"
# # echo "ExecStopPost=/usr/sbin/modprobe -r button"
# echo
# echo "[X-Synology]"
# echo "Author=Virtualization Team"
# } >"${DEST}"
# mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants # 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 # ln -vsf /usr/lib/systemd/system/acpid.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/acpid.service

View File

@ -15,21 +15,20 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/allowdowngrade.service" DEST="/tmpRoot/usr/lib/systemd/system/allowdowngrade.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon allowdowngrade echo "Description=addon allowdowngrade"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
User=root echo "User=root"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/allowdowngrade.sh echo "ExecStart=/usr/bin/allowdowngrade.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/allowdowngrade.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/allowdowngrade.service ln -vsf /usr/lib/systemd/system/allowdowngrade.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/allowdowngrade.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -15,19 +15,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/amepatch.service" DEST="/tmpRoot/usr/lib/systemd/system/amepatch.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon amepatch echo "Description=addon amepatch"
After=syno-volume.target syno-space.target echo "After=syno-volume.target syno-space.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/amepatch.sh echo "ExecStart=/usr/bin/amepatch.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/amepatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/amepatch.service ln -vsf /usr/lib/systemd/system/amepatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/amepatch.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -16,19 +16,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/arcdns.service" DEST="/tmpRoot/usr/lib/systemd/system/arcdns.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon arcdns echo "Description=addon arcdns"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/arcdns.sh echo "ExecStart=/usr/bin/arcdns.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/arcdns.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/arcdns.service ln -vsf /usr/lib/systemd/system/arcdns.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/arcdns.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

44
beep/install.sh Executable file
View File

@ -0,0 +1,44 @@
#!/usr/bin/env ash
#
# Copyright (C) 2024 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 beep - ${1}"
mkdir -p "/tmpRoot/usr/arc/addons/"
cp -pf "${0}" "/tmpRoot/usr/arc/addons/"
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
ESYNOSCHEDULER_DB="/tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db"
if [ ! -f "${ESYNOSCHEDULER_DB}" ] || ! /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" ".tables" | grep -qw "task"; then
echo "copy esynoscheduler.db"
mkdir -p "$(dirname "${ESYNOSCHEDULER_DB}")"
cp -vpf /addons/esynoscheduler.db "${ESYNOSCHEDULER_DB}"
fi
if echo "SELECT * FROM task;" | /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" | grep -qE "BeepOnBoot|BeepAtShutdown"; then
echo "beep task already exists"
else
echo "insert beep task to esynoscheduler.db"
/tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" <<EOF
DELETE FROM task WHERE task_name LIKE 'BeepOnBoot';
INSERT INTO task VALUES('BeepOnBoot', '', 'bootup', '', 1, 0, 0, 0, '', 0, "beep -f 500 -l 500 -d 500 -r 1", 'script', '{}', '', '', '{}', '{}');
DELETE FROM task WHERE task_name LIKE 'BeepOnShutdown';
INSERT INTO task VALUES('BeepOnShutdown', '', 'shutdown', '', 1, 0, 0, 0, '', 0, "beep -f 500 -l 500 -d 500 -r 1", 'script', '{}', '', '', '{}', '{}');
EOF
fi
elif [ "${1}" = "uninstall" ]; then
echo "Installing addon beep - ${1}"
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
ESYNOSCHEDULER_DB="/tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db"
if [ -f "${ESYNOSCHEDULER_DB}" ]; then
echo "delete beep task from esynoscheduler.db"
/tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" <<EOF
DELETE FROM task WHERE task_name LIKE 'BeepOnBoot';
DELETE FROM task WHERE task_name LIKE 'BeepOnShutdown';
EOF
fi
fi

20
beep/manifest.yml Normal file
View File

@ -0,0 +1,20 @@
version: 1
name: beep
description: "Beep at startup and shutdown (requires motherboard with buzzer)"
system: false
beta: false
target: system
all:
install-script: "install.sh"
copy: "all"
apollolake: true
broadwell: true
broadwellnk: true
broadwellnkv2: true
broadwellntbap: true
denverton: true
geminilake: true
purley: true
v1000: true
r1000: true
epyc7002: true

View File

@ -15,20 +15,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/codecpatch.service" DEST="/tmpRoot/usr/lib/systemd/system/codecpatch.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon codecpatch echo "Description=addon codecpatch"
After=syno-volume.target syno-space.target echo "After=syno-volume.target syno-space.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/codecpatch.sh echo "ExecStart=/usr/bin/codecpatch.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/codecpatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/codecpatch.service ln -vsf /usr/lib/systemd/system/codecpatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/codecpatch.service
fi fi

View File

@ -18,23 +18,23 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service" DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Enable CPU Freq scaling echo "Description=Enable CPU Freq scaling"
After=syno-volume.target syno-space.target echo "After=syno-volume.target syno-space.target"
echo
[Service] echo "[Service]"
User=root echo "User=root"
Type=simple echo "Type=simple"
Restart=on-failure echo "Restart=on-failure"
RestartSec=10 echo "RestartSec=10"
ExecStart=/usr/sbin/scaling.sh ${2} echo "ExecStart=/usr/sbin/scaling.sh ${2}"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/cpufreqscaling.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service ln -vsf /usr/lib/systemd/system/cpufreqscaling.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpufreqscaling.service
if [ ! -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then if [ ! -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then
echo "copy esynoscheduler.db" echo "copy esynoscheduler.db"

View File

@ -7,20 +7,23 @@
# #
TEMP="on" TEMP="on"
VENDOR="" # str VENDOR="" # str
FAMILY="" # str FAMILY="" # str
SERIES="$(echo $(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" # str SERIES="$(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | xargs)" # str
CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" # str CORES="$(grep -c 'cpu cores' /proc/cpuinfo 2>/dev/null)" # str
SPEED="$(dmidecode 2>/dev/null | grep MHz | head -1 | cut -d: -f2 | cut -d ' ' -f2))" # int SPEED="$(dmidecode 2>/dev/null | grep MHz | head -1 | cut -d: -f2 | cut -d ' ' -f2))" # int
if [ -z "${SPEED}" ] || [[ ! "${SPEED}" =~ ^[0-9]+$ ]]; then if [ -z "${SPEED}" ] || [[ ! "${SPEED}" =~ ^[0-9]+$ ]]; then
SPEED="$(echo $(grep 'MHz' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2 | cut -d. -f1))" # int SPEED="$(grep -m1 'MHz' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | cut -d. -f1 | xargs)" # int
fi fi
FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js" FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js"
FILE_GZ="${FILE_JS}.gz" FILE_GZ="${FILE_JS}.gz"
[ ! -f "${FILE_JS}" -a ! -f "${FILE_GZ}" ] && echo "File ${FILE_JS} does not exist" && exit 0 if [ ! -f "${FILE_JS}" ] && [ ! -f "${FILE_GZ}" ]; then
echo "File ${FILE_JS} does not exist"
exit 0
fi
restoreCpuinfo() { restoreCpuinfo() {
if [ -f "${FILE_GZ}.bak" ]; then if [ -f "${FILE_GZ}.bak" ]; then
@ -121,7 +124,7 @@ sed -i "s/\(\(,\)\|\((\)\).\.cpu_clock_speed/\1${SPEED//\"/}/g" "${FILE_JS}"
CARDN=$(ls -d /sys/class/drm/card* 2>/dev/null | head -1) CARDN=$(ls -d /sys/class/drm/card* 2>/dev/null | head -1)
if [ -d "${CARDN}" ]; then if [ -d "${CARDN}" ]; then
PCIDN="$(cat "${CARDN}/device/uevent" 2>/dev/null | grep -oP 'DEVNAME=\K.*')" PCIDN="$(awk -F= '/DEVNAME/ {print $2}' "${CARDN}/device/uevent" 2>/dev/null)"
LNAME="$(lspci -Q -s ${PCIDN:-"99:99.9"} 2>/dev/null | sed "s/.*: //")" LNAME="$(lspci -Q -s ${PCIDN:-"99:99.9"} 2>/dev/null | sed "s/.*: //")"
# LABLE="$(cat "/sys/class/drm/card0/device/label" 2>/dev/null)" # LABLE="$(cat "/sys/class/drm/card0/device/label" 2>/dev/null)"
CLOCK="$(cat "${CARDN}/gt_max_freq_mhz" 2>/dev/null)" CLOCK="$(cat "${CARDN}/gt_max_freq_mhz" 2>/dev/null)"
@ -139,8 +142,6 @@ if [ "${TEMP^^}" = "ON" ]; then
sed -i 's/,C,D);/,C,D+" \| "+t.gpu.temperature_c+" °C");/g' "${FILE_JS}" sed -i 's/,C,D);/,C,D+" \| "+t.gpu.temperature_c+" °C");/g' "${FILE_JS}"
fi fi
if [ -f "${FILE_GZ}.bak" ]; then [ -f "${FILE_GZ}.bak" ] && gzip -c "${FILE_JS}" >"${FILE_GZ}"
gzip -c "${FILE_JS}" >"${FILE_GZ}"
fi
exit 0 exit 0

View File

@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then
shift shift
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/cpuinfo.service" DEST="/tmpRoot/usr/lib/systemd/system/cpuinfo.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Adds correct CPU Info echo "Description=Adds correct CPU Info"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/cpuinfo.sh $@ echo "ExecStart=/usr/bin/cpuinfo.sh $@"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/cpuinfo.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpuinfo.service ln -vsf /usr/lib/systemd/system/cpuinfo.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/cpuinfo.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -7,15 +7,23 @@
# #
function getlog() { function getlog() {
[ -z "${1}" ] && echo "Usage: ${0} {early|jrExit|rcExit|late|dsm}" && exit 1 if [ -z "${1}" ]; then
echo "Usage: ${0} {early|jrExit|rcExit|late|dsm}"
exit 1
fi
WORK_PATH="/mnt/p1" WORK_PATH="/mnt/p1"
mkdir -p "${WORK_PATH}" mkdir -p "${WORK_PATH}"
if ! mount | grep -q "${WORK_PATH}"; then if ! mount | grep -q "${WORK_PATH}"; then
LOADER_DISK_PART1="$(blkid -L ARC1)" LOADER_DISK_PART1="$(blkid -L ARC1)"
[ -z "${LOADER_DISK_PART1}" -a -b "/dev/synoboot1" ] && LOADER_DISK_PART1="/dev/synoboot1" if [ -z "${LOADER_DISK_PART1}" ] && [ -b "/dev/synoboot1" ]; then
[ -z "${LOADER_DISK_PART1}" ] && echo "Boot disk not found" && exit 1 LOADER_DISK_PART1="/dev/synoboot1"
fi
if [ -z "${LOADER_DISK_PART1}" ]; then
echo "Boot disk not found"
exit 1
fi
modprobe vfat modprobe vfat
echo 1 >/proc/sys/kernel/syno_install_flag echo 1 >/proc/sys/kernel/syno_install_flag

View File

@ -15,20 +15,20 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/deduplication.service" DEST="/tmpRoot/usr/lib/systemd/system/deduplication.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Enable Deduplication echo "Description=Enable Deduplication"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/deduplication.sh -s -e --hdd echo "ExecStart=/usr/bin/deduplication.sh -s -e --hdd"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/deduplication.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/deduplication.service ln -vsf /usr/lib/systemd/system/deduplication.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/deduplication.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

Binary file not shown.

View File

@ -95,20 +95,19 @@ elif [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/udevrules.service" DEST="/tmpRoot/usr/lib/systemd/system/udevrules.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Reload udev rules echo "Description=Reload udev rules"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/udevadm hwdb --update echo "ExecStart=/usr/bin/udevadm hwdb --update"
ExecStart=/usr/bin/udevadm control --reload-rules echo "ExecStart=/usr/bin/udevadm control --reload-rules"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/udevrules.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/udevrules.service ln -vsf /usr/lib/systemd/system/udevrules.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/udevrules.service
fi fi

View File

@ -15,20 +15,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/expands.service" DEST="/tmpRoot/usr/lib/systemd/system/expands.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Expanded miscellaneous echo "Description=Expanded miscellaneous"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/expands.sh echo "ExecStart=/usr/bin/expands.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/expands.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/expands.service ln -vsf /usr/lib/systemd/system/expands.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/expands.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -15,20 +15,20 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/hdddb.service" DEST="/tmpRoot/usr/lib/systemd/system/hdddb.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=HDDs/SSDs drives databases echo "Description=HDDs/SSDs drives databases"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/hdddb.sh -nrwpeS echo "ExecStart=/usr/bin/hdddb.sh -nrwpeS"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/hdddb.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/hdddb.service ln -vsf /usr/lib/systemd/system/hdddb.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/hdddb.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -31,21 +31,21 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
# All on # All on
DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol.service" DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Adds uGreen LED control echo "Description=Adds uGreen LED control"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
echo
[Service] echo "[Service]"
User=root echo "User=root"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/ledcontrol.sh echo "ExecStart=/usr/bin/ledcontrol.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/ledcontrol.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol.service ln -vsf /usr/lib/systemd/system/ledcontrol.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/ledcontrol.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

Binary file not shown.

BIN
misc/all/usr/bin/beep Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
misc/all/usr/bin/grep Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,50 +0,0 @@
#!/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.
#
# Sanity checks
if [ ! ${USER} = "root" ]; then
exec sudo $0 $@
fi
MODES="config recovery junior automated update"
function use() {
echo "Use: ${0} [${MODES// /|}]"
exit 1
}
if [ -z "${1}" ] || ! echo "${MODES}" | grep -qw "${1}"; then use; fi
echo "Rebooting to ${1} mode"
echo 1 >/proc/sys/kernel/syno_install_flag 2>/dev/null
mkdir -p /mnt/p1
mount | grep -q /dev/synoboot1 || mount /dev/synoboot1 /mnt/p1 2>/dev/null
GRUBPATH="$(dirname $(find /mnt/p1 -name grub.cfg | head -1))"
if [ -z "${GRUBPATH}" ]; then
echo "Error: GRUB path not found"
umount /mnt/p1 2>/dev/null
exit 1
fi
ENVFILE="${GRUBPATH}/grubenv"
if grub-editenv --help >/dev/null 2>&1; then
[ ! -f "${ENVFILE}" ] && grub-editenv ${ENVFILE} create
grub-editenv ${ENVFILE} set next_entry="${1}"
else
echo "# GRUB Environment Block" >${ENVFILE}
echo "# WARNING: Do not edit this file by tools other than grub-editenv!!!" >>${ENVFILE}
echo "next_entry=${1}" >>${ENVFILE}
printf '%*s' 930 | tr ' ' '#' >>${ENVFILE}
fi
sync
umount /mnt/p1 2>/dev/null
[ -x /usr/syno/sbin/synopoweroff ] && /usr/syno/sbin/synopoweroff -r || reboot

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
misc/all/usr/sbin/inb Executable file

Binary file not shown.

BIN
misc/all/usr/sbin/ioperm Executable file

Binary file not shown.

BIN
misc/all/usr/sbin/outb Executable file

Binary file not shown.

View File

@ -14,20 +14,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/notify.service" DEST="/tmpRoot/usr/lib/systemd/system/notify.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=arc notify echo "Description=arc notify"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/notify.sh echo "ExecStart=/usr/bin/notify.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/notify.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/notify.service ln -vsf /usr/lib/systemd/system/notify.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/notify.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -35,8 +35,8 @@ if [ "${1}" = "early" ]; then
elif [ "${1}" = "late" ]; then elif [ "${1}" = "late" ]; then
echo "Installing addon nvmesystem - ${1}" echo "Installing addon nvmesystem - ${1}"
mkdir -p "/tmpRoot/usr/arc/addons/" mkdir -p "/tmpRoot/usr/rr/addons/"
cp -pf "${0}" "/tmpRoot/usr/arc/addons/" cp -pf "${0}" "/tmpRoot/usr/rr/addons/"
# disk/shared_disk_info_enum.c::84 Failed to allocate list in SharedDiskInfoEnum, errno=0x900. # disk/shared_disk_info_enum.c::84 Failed to allocate list in SharedDiskInfoEnum, errno=0x900.
SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1" SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1"
@ -49,26 +49,27 @@ elif [ "${1}" = "late" ]; then
rm -f "${SO_FILE}.tmp" rm -f "${SO_FILE}.tmp"
# Create storage pool page without RAID type. # Create storage pool page without RAID type.
cp -pf /usr/bin/nvmesystem.sh /tmpRoot/usr/bin/nvmesystem.sh cp -vpf /usr/bin/nvmesystem.sh /tmpRoot/usr/bin/nvmesystem.sh
[ ! -f "/tmpRoot/usr/bin/gzip" ] && cp -pf /usr/bin/gzip /tmpRoot/usr/bin/gzip
[ ! -f "/tmpRoot/usr/bin/gzip" ] && cp -vpf /usr/bin/gzip /tmpRoot/usr/bin/gzip
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/nvmesystem.service" DEST="/tmpRoot/usr/lib/systemd/system/nvmesystem.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Modify storage panel echo "Description=Modify storage panel(nvmesystem)"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
After=storagepanel.service echo "After=storagepanel.service" # storagepanel
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/nvmesystem.sh echo "ExecStart=/usr/bin/nvmesystem.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/nvmesystem.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/nvmesystem.service ln -vsf /usr/lib/systemd/system/nvmesystem.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/nvmesystem.service
@ -77,12 +78,19 @@ EOF
if cat /proc/version 2>/dev/null | grep -q 'RR@RR'; then if cat /proc/version 2>/dev/null | grep -q 'RR@RR'; then
ONBOOTUP="" ONBOOTUP=""
ONBOOTUP="${ONBOOTUP}systemctl restart systemd-udev-trigger.service\n" ONBOOTUP="${ONBOOTUP}systemctl restart systemd-udev-trigger.service\n"
ONBOOTUP="${ONBOOTUP}echo \"DELETE FROM task WHERE task_name LIKE ''ARCONBOOTUPARC_UDEV'';\" | sqlite3 /usr/syno/etc/esynoscheduler/esynoscheduler.db\n" ONBOOTUP="${ONBOOTUP}echo \"DELETE FROM task WHERE task_name LIKE ''RRONBOOTUPRR_UDEV'';\" | sqlite3 /usr/syno/etc/esynoscheduler/esynoscheduler.db\n"
echo "insert ARCONBOOTUPARC_UDEV task to esynoscheduler.db"
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF ESYNOSCHEDULER_DB="/tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db"
DELETE FROM task WHERE task_name LIKE 'ARCONBOOTUPARC_UDEV'; if [ ! -f "${ESYNOSCHEDULER_DB}" ] || ! /tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" ".tables" | grep -qw "task"; then
INSERT INTO task VALUES('ARCONBOOTUPARC_UDEV', '', 'bootup', '', 1, 0, 0, 0, '', 0, '$(echo -e ${ONBOOTUP})', 'script', '{}', '', '', '{}', '{}'); echo "copy esynoscheduler.db"
mkdir -p "$(dirname "${ESYNOSCHEDULER_DB}")"
cp -vpf /addons/esynoscheduler.db "${ESYNOSCHEDULER_DB}"
fi
echo "insert RRONBOOTUPRR_UDEV task to esynoscheduler.db"
/tmpRoot/bin/sqlite3 "${ESYNOSCHEDULER_DB}" <<EOF
DELETE FROM task WHERE task_name LIKE 'RRONBOOTUPRR_UDEV';
INSERT INTO task VALUES('RRONBOOTUPRR_UDEV', '', 'bootup', '', 1, 0, 0, 0, '', 0, '$(echo -e ${ONBOOTUP})', 'script', '{}', '', '', '{}', '{}');
EOF EOF
fi fi

View File

@ -19,14 +19,46 @@ if [ "${1}" = "late" ]; then
SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1" SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1"
[ ! -f "${SO_FILE}.bak" ] && cp -pf "${SO_FILE}" "${SO_FILE}.bak" [ ! -f "${SO_FILE}.bak" ] && cp -pf "${SO_FILE}" "${SO_FILE}.bak"
cp -f "${SO_FILE}" "${SO_FILE}.tmp" cp -pf "${SO_FILE}" "${SO_FILE}.tmp"
xxd -c $(xxd -p "${SO_FILE}.tmp" 2>/dev/null | wc -c) -p "${SO_FILE}.tmp" 2>/dev/null | xxd -c $(xxd -p "${SO_FILE}.tmp" 2>/dev/null | wc -c) -p "${SO_FILE}.tmp" 2>/dev/null |
sed "s/803e00b801000000752.488b/803e00b8010000009090488b/" sed "s/803e00b801000000752.488b/803e00b8010000009090488b/" |
| xxd -r -p > "${SO_FILE}" 2>/dev/null xxd -r -p >"${SO_FILE}" 2>/dev/null
rm -f "${SO_FILE}.tmp" rm -f "${SO_FILE}.tmp"
# Create storage pool page without RAID type.
cp -vpf /usr/bin/nvmevolume.sh /tmpRoot/usr/bin/nvmevolume.sh
[ ! -f "/tmpRoot/usr/bin/gzip" ] && cp -vpf /usr/bin/gzip /tmpRoot/usr/bin/gzip
mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/nvmevolume.service"
{
echo "[Unit]"
echo "Description=Modify storage panel(nvmevolume)"
echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
echo "After=smpkg-custom-install.service"
echo "After=storagepanel.service" # storagepanel
echo "After=nvmesystem.service" # nvmesystem
echo
echo "[Service]"
echo "Type=oneshot"
echo "RemainAfterExit=yes"
echo "ExecStart=/usr/bin/nvmevolume.sh"
echo
echo "[Install]"
echo "WantedBy=multi-user.target"
} >"${DEST}"
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then
echo "Installing addon nvmevolume - ${1}" echo "Installing addon nvmevolume - ${1}"
SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1" SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1"
[ -f "${SO_FILE}.bak" ] && mv -f "${SO_FILE}.bak" "${SO_FILE}" [ -f "${SO_FILE}.bak" ] && mv -f "${SO_FILE}.bak" "${SO_FILE}"
rm -f "/tmpRoot/usr/lib/systemd/system/multi-user.target.wants/nvmevolume.service"
rm -f "/tmpRoot/usr/lib/systemd/system/nvmevolume.service"
# rm -f /tmpRoot/usr/bin/gzip
[ ! -f "/tmpRoot/usr/arc/revert.sh" ] && echo '#!/usr/bin/env bash' >/tmpRoot/usr/arc/revert.sh && chmod +x /tmpRoot/usr/arc/revert.sh
echo "/usr/bin/nvmevolume.sh -r" >>/tmpRoot/usr/arc/revert.sh
echo "rm -f /usr/bin/nvmevolume.sh" >>/tmpRoot/usr/arc/revert.sh
fi fi

View File

@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/photosfacepatch.service" DEST="/tmpRoot/usr/lib/systemd/system/photosfacepatch.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Enable face recognition in Synology Photos echo "Description=Enable face recognition in Synology Photos"
After=syno-volume.target syno-space.target echo "After=syno-volume.target syno-space.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/photosfacepatch.sh echo "ExecStart=/usr/bin/photosfacepatch.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/photosfacepatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/photosfacepatch.service ln -vsf /usr/lib/systemd/system/photosfacepatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/photosfacepatch.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -24,20 +24,19 @@ if [ "${1}" = "late" ]; then
if [ ! "$(cat "/tmpRoot/usr/arc/revert.sh")" = '#!/usr/bin/env bash' ]; then if [ ! "$(cat "/tmpRoot/usr/arc/revert.sh")" = '#!/usr/bin/env bash' ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/revert.service" DEST="/tmpRoot/usr/lib/systemd/system/revert.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=revert echo "Description=revert"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/arc/revert.sh echo "ExecStart=/usr/arc/revert.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/revert.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/revert.service ln -vsf /usr/lib/systemd/system/revert.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/revert.service
else else

View File

@ -23,21 +23,20 @@ elif [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/rndis.service" DEST="/tmpRoot/usr/lib/systemd/system/rndis.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Android USB Network Adapter echo "Description=Android USB Network Adapter"
After=multi-user.target echo "After=multi-user.target"
ConditionPathExists=/sys/class/net/usb0 echo "ConditionPathExists=/sys/class/net/usb0"
echo
[Service] echo "[Service]"
Type=simple echo "Type=simple"
Restart=always echo "Restart=always"
ExecStart=/usr/bin/rndis.sh echo "ExecStart=/usr/bin/rndis.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/rndis.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/rndis.service ln -vsf /usr/lib/systemd/system/rndis.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/rndis.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

Binary file not shown.

View File

@ -6,12 +6,12 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
if [[ ! -x $(which perl) ]]; then if ! command -v perl &>/dev/null; then
echo "install Perl ..." echo "install Perl ..."
synopkg install_from_server Perl synopkg install_from_server Perl
fi fi
if [[ ! -x $(which perl) ]]; then if ! command -v perl &>/dev/null; then
echo "Perl not found" echo "Perl not found"
exit 1 exit 1
fi fi
@ -25,30 +25,23 @@ modprobe -q nct6775
modprobe -q coretemp modprobe -q coretemp
modprobe -q k10temp modprobe -q k10temp
echo 'Y' | sensors-detect --auto >/tmp/sensors.log echo 'Y' | sensors-detect --auto >"/tmp/sensors.log"
cat /tmp/sensors.log | grep Driver | awk '{print $2}' grep -oE 'Driver\s*:\s*\w+' "/tmp/sensors.log" | awk -F': ' '{print $2}'
sensors sensors
echo "$@" | grep -qw "\-f" && rm -f /etc/fancontrol echo "$@" | grep -qw "\-f" && rm -f /etc/fancontrol
if [ ! -f /etc/fancontrol ]; then if [ ! -f /etc/fancontrol ]; then
# Or use pwmconfig to generate /etc/fancontrol interactively. # Or use pwmconfig to generate /etc/fancontrol interactively.
DEVPATH="" local DEVPATH DEVNAME FCTEMPS FCFANS MINTEMP MAXTEMP MINSTART MINSTOP
DEVNAME="" local CORETEMP="$(find "/sys/devices/platform/" -name "temp1_input" | grep -E 'coretemp|k10temp' | sed -n -e 's|.*/\(hwmon.*\/temp1_input\).*|\1|p')"
FCTEMPS="" for P in $(find "/sys/devices/platform/" -name "temp1_input"); do
FCFANS="" D="$(echo "${P}" | sed -n -e 's|.*/\(devices/platform/[^/]*\)/.*|\1|p')"
MINTEMP="" I="$(echo "${P}" | sed -n -e 's|.*hwmon\([0-9]\).*|\1|p')"
MAXTEMP=""
MINSTART=""
MINSTOP=""
CORETEMP="$(find /sys/devices/platform/ -name temp1_input | grep -E 'coretemp|k10temp' | sed -n -e 's|.*/\(hwmon.*\/temp1_input\).*|\1|p')"
for P in $(find /sys/devices/platform/ -name temp1_input); do
D="$(echo ${P} | sed -n -e 's|.*/\(devices/platform/[^/]*\)/.*|\1|p')"
I="$(echo ${P} | sed -n -e 's|.*hwmon\([0-9]\).*|\1|p')"
DEVPATH="${DEVPATH} hwmon${I}=${D}" DEVPATH="${DEVPATH} hwmon${I}=${D}"
DEVNAME="${DEVNAME} hwmon${I}=$(cat /sys/${D}/*/*/name)" DEVNAME="${DEVNAME} hwmon${I}=$(cat /sys/${D}/*/*/name)"
for F in $(find "/sys/${D}" -name "fan[0-9]_input"); do for F in $(find "/sys/${D}" -name "fan[0-9]_input"); do
IDX="$(echo ${F} | sed -n -e 's|.*fan\([0-9]\)_input|\1|p')" local IDX="$(echo "${F}" | sed -n -e 's|.*fan\([0-9]\)_input|\1|p')"
FCTEMPS="${FCTEMPS} hwmon${I}/pwm${IDX}=${CORETEMP}" FCTEMPS="${FCTEMPS} hwmon${I}/pwm${IDX}=${CORETEMP}"
FCFANS="${FCFANS} hwmon${I}/pwm${IDX}=hwmon${I}/fan${IDX}_input" FCFANS="${FCFANS} hwmon${I}/pwm${IDX}=hwmon${I}/fan${IDX}_input"
MINTEMP="${MINTEMP} hwmon${I}/pwm${IDX}=30" MINTEMP="${MINTEMP} hwmon${I}/pwm${IDX}=30"
@ -59,17 +52,19 @@ if [ ! -f /etc/fancontrol ]; then
i=$((i + 1)) i=$((i + 1))
done done
DEST=/etc/fancontrol DEST="/etc/fancontrol"
echo "# Configuration file generated by pwmconfig, changes will be lost" >${DEST} {
echo "INTERVAL=10" >>${DEST} echo "# Configuration file generated by pwmconfig, changes will be lost"
echo "DEVPATH=$(echo ${DEVPATH})" >>${DEST} echo "INTERVAL=10"
echo "DEVNAME=$(echo ${DEVNAME})" >>${DEST} echo "DEVPATH=$(echo ${DEVPATH})"
echo "FCTEMPS=$(echo ${FCTEMPS})" >>${DEST} echo "DEVNAME=$(echo ${DEVNAME})"
echo "FCFANS=$(echo ${FCFANS})" >>${DEST} echo "FCTEMPS=$(echo ${FCTEMPS})"
echo "MINTEMP=$(echo ${MINTEMP})" >>${DEST} echo "FCFANS=$(echo ${FCFANS})"
echo "MAXTEMP=$(echo ${MAXTEMP})" >>${DEST} echo "MINTEMP=$(echo ${MINTEMP})"
echo "MINSTART=$(echo ${MINSTART})" >>${DEST} echo "MAXTEMP=$(echo ${MAXTEMP})"
echo "MINSTOP=$(echo ${MINSTOP})" >>${DEST} echo "MINSTART=$(echo ${MINSTART})"
echo "MINSTOP=$(echo ${MINSTOP})"
} >"${DEST}"
fi fi
killall fancontrol killall fancontrol

View File

@ -15,21 +15,20 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/sequentialio.service" DEST="/tmpRoot/usr/lib/systemd/system/sequentialio.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Sequential I/O SSD caches echo "Description=Sequential I/O SSD caches"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/sequentialio.sh $@ echo "ExecStart=/usr/bin/sequentialio.sh \$@"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/sequentialio.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/sequentialio.service ln -vsf /usr/lib/systemd/system/sequentialio.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/sequentialio.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
#
# Copyright (C) 2024 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.
#
args=()
HBA=false
for argv in "$@"; do
if [ -e "${argv}" ] && readlink -f "/sys/block/$(basename "${argv}")/device" 2>/dev/null | grep -q "expander"; then
HBA=true
fi
done
argp=""
for argv in "$@"; do
if [ "${argp}" = "-d" ] && [ "${argv}" = "ata" ] && [ "${HBA}" = "true" ]; then
args+=("sat")
else
args+=("${argv}")
fi
argp="${argv}"
done
/usr/bin/smartctl.bak "${args[@]}"

24
smartctl/install.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env ash
#
# Copyright (C) 2024 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 smartctl - ${1}"
mkdir -p "/tmpRoot/usr/arc/addons/"
cp -pf "${0}" "/tmpRoot/usr/arc/addons/"
FILE="/tmpRoot/usr/bin/smartctl"
[ ! -f "${FILE}.bak" ] && cp -pf "${FILE}" "${FILE}.bak"
cp -vpf /usr/bin/smartctl.sh "${FILE}"
elif [ "${1}" = "uninstall" ]; then
echo "Installing addon smartctl - ${1}"
FILE="/tmpRoot/usr/bin/smartctl"
[ -f "${FILE}.bak" ] && mv -f "${FILE}.bak" "${FILE}"
fi

20
smartctl/manifest.yml Normal file
View File

@ -0,0 +1,20 @@
version: 1
name: smartctl
description: "Fix SMART information for HBA devices. @Phachd"
system: false
beta: true
target: system
all:
install-script: "install.sh"
copy: "all"
apollolake: true
broadwell: true
broadwellnk: true
broadwellnkv2: true
broadwellntbap: true
denverton: true
geminilake: true
purley: true
v1000: true
r1000: true
epyc7002: true

View File

@ -19,19 +19,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/sspatch.service" DEST="/tmpRoot/usr/lib/systemd/system/sspatch.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon sspatch echo "Description=addon sspatch"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/sspatch.sh echo "ExecStart=/usr/bin/sspatch.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/sspatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/sspatch.service ln -vsf /usr/lib/systemd/system/sspatch.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/sspatch.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -17,21 +17,20 @@ if [ "${1}" = "late" ]; then
shift shift
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/storagepanel.service" DEST="/tmpRoot/usr/lib/systemd/system/storagepanel.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Modify storage panel echo "Description=Modify storage panel"
Wants=smpkg-custom-install.service pkgctl-StorageManager.service echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service"
After=smpkg-custom-install.service echo "After=smpkg-custom-install.service"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/storagepanel.sh $@ echo "ExecStart=/usr/bin/storagepanel.sh $@"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -vp /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/storagepanel.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/storagepanel.service ln -vsf /usr/lib/systemd/system/storagepanel.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/storagepanel.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/arc-updatenotify.service" DEST="/tmpRoot/usr/lib/systemd/system/arc-updatenotify.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=addon arc-updatenotify echo "Description=addon arc-updatenotify"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/arc-updatenotify.sh create echo "ExecStart=/usr/bin/arc-updatenotify.sh create"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/arc-updatenotify.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/arc-updatenotify.service ln -vsf /usr/lib/systemd/system/arc-updatenotify.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/arc-updatenotify.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then

View File

@ -21,20 +21,19 @@ elif [ "${1}" = "late" ]; then
mkdir -p "/tmpRoot/usr/lib/systemd/system" mkdir -p "/tmpRoot/usr/lib/systemd/system"
DEST="/tmpRoot/usr/lib/systemd/system/wol.service" DEST="/tmpRoot/usr/lib/systemd/system/wol.service"
cat <<EOF >${DEST} {
[Unit] echo "[Unit]"
Description=Force WOL on ethN echo "Description=Force WOL on ethN"
After=multi-user.target echo "After=multi-user.target"
echo
[Service] echo "[Service]"
Type=oneshot echo "Type=oneshot"
RemainAfterExit=yes echo "RemainAfterExit=yes"
ExecStart=/usr/bin/wol.sh echo "ExecStart=/usr/bin/wol.sh"
echo
[Install] echo "[Install]"
WantedBy=multi-user.target echo "WantedBy=multi-user.target"
EOF } >"${DEST}"
mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants mkdir -p /tmpRoot/usr/lib/systemd/system/multi-user.target.wants
ln -vsf /usr/lib/systemd/system/wol.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/wol.service ln -vsf /usr/lib/systemd/system/wol.service /tmpRoot/usr/lib/systemd/system/multi-user.target.wants/wol.service
elif [ "${1}" = "uninstall" ]; then elif [ "${1}" = "uninstall" ]; then