diff --git a/acpid/install.sh b/acpid/install.sh index 611f648..4ff4d77 100755 --- a/acpid/install.sh +++ b/acpid/install.sh @@ -22,21 +22,25 @@ if [ "${1}" = "late" ]; then # 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 "[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}" # 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 diff --git a/allowdowngrade/install.sh b/allowdowngrade/install.sh index e7ec7ac..2ef7dc3 100755 --- a/allowdowngrade/install.sh +++ b/allowdowngrade/install.sh @@ -15,21 +15,20 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/allowdowngrade.service" - cat <${DEST} -[Unit] -Description=addon allowdowngrade -After=multi-user.target - -[Service] -User=root -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/allowdowngrade.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=addon allowdowngrade" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "User=root" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/allowdowngrade.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/amepatch/install.sh b/amepatch/install.sh index 1a9e4b5..14bfbf9 100755 --- a/amepatch/install.sh +++ b/amepatch/install.sh @@ -15,19 +15,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/amepatch.service" - cat <${DEST} -[Unit] -Description=addon amepatch -After=syno-volume.target syno-space.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/amepatch.sh - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=addon amepatch" + echo "After=syno-volume.target syno-space.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/amepatch.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/arcdns/install.sh b/arcdns/install.sh index 3620631..d98dd46 100755 --- a/arcdns/install.sh +++ b/arcdns/install.sh @@ -13,22 +13,22 @@ if [ "${1}" = "late" ]; then cp -pf /usr/bin/arcdns.php /tmpRoot/usr/bin/arcdns.php cp -pf /usr/bin/arcdns.sh /tmpRoot/usr/bin/arcdns.sh - + mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/arcdns.service" - cat <${DEST} -[Unit] -Description=addon arcdns -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/arcdns.sh - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=addon arcdns" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/arcdns.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/beep/install.sh b/beep/install.sh new file mode 100755 index 0000000..77002c2 --- /dev/null +++ b/beep/install.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env ash +# +# Copyright (C) 2024 AuxXxilium and Ing +# +# 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}" <${DEST} -[Unit] -Description=addon codecpatch -After=syno-volume.target syno-space.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/codecpatch.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=addon codecpatch" + echo "After=syno-volume.target syno-space.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/codecpatch.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 fi diff --git a/cpufreqscaling/install.sh b/cpufreqscaling/install.sh index faa8e98..c747917 100755 --- a/cpufreqscaling/install.sh +++ b/cpufreqscaling/install.sh @@ -18,23 +18,23 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/cpufreqscaling.service" - cat <${DEST} -[Unit] -Description=Enable CPU Freq scaling -After=syno-volume.target syno-space.target - -[Service] -User=root -Type=simple -Restart=on-failure -RestartSec=10 -ExecStart=/usr/sbin/scaling.sh ${2} - -[Install] -WantedBy=multi-user.target -EOF - 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 + { + echo "[Unit]" + echo "Description=Enable CPU Freq scaling" + echo "After=syno-volume.target syno-space.target" + echo + echo "[Service]" + echo "User=root" + echo "Type=simple" + echo "Restart=on-failure" + echo "RestartSec=10" + echo "ExecStart=/usr/sbin/scaling.sh ${2}" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" + 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 if [ ! -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then echo "copy esynoscheduler.db" diff --git a/cpuinfo/all/usr/bin/cpuinfo.sh b/cpuinfo/all/usr/bin/cpuinfo.sh index e93eff9..2105df5 100755 --- a/cpuinfo/all/usr/bin/cpuinfo.sh +++ b/cpuinfo/all/usr/bin/cpuinfo.sh @@ -7,20 +7,23 @@ # TEMP="on" -VENDOR="" # str -FAMILY="" # str -SERIES="$(echo $(grep 'model name' /proc/cpuinfo 2>/dev/null | head -1 | cut -d: -f2))" # str -CORES="$(grep 'cpu cores' /proc/cpuinfo 2>/dev/null | wc -l)" # str +VENDOR="" # str +FAMILY="" # str +SERIES="$(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | xargs)" # 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 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 FILE_JS="/usr/syno/synoman/webman/modules/AdminCenter/admin_center.js" 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() { 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) 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/.*: //")" # LABLE="$(cat "/sys/class/drm/card0/device/label" 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}" fi -if [ -f "${FILE_GZ}.bak" ]; then - gzip -c "${FILE_JS}" >"${FILE_GZ}" -fi +[ -f "${FILE_GZ}.bak" ] && gzip -c "${FILE_JS}" >"${FILE_GZ}" exit 0 \ No newline at end of file diff --git a/cpuinfo/install.sh b/cpuinfo/install.sh index 89eb855..8f5f423 100755 --- a/cpuinfo/install.sh +++ b/cpuinfo/install.sh @@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then shift mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/cpuinfo.service" - cat <${DEST} -[Unit] -Description=Adds correct CPU Info -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/cpuinfo.sh $@ - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Adds correct CPU Info" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/cpuinfo.sh $@" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/dbgutils/install.sh b/dbgutils/install.sh index 466ffdd..a22422c 100755 --- a/dbgutils/install.sh +++ b/dbgutils/install.sh @@ -7,15 +7,23 @@ # 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" mkdir -p "${WORK_PATH}" if ! mount | grep -q "${WORK_PATH}"; then LOADER_DISK_PART1="$(blkid -L ARC1)" - [ -z "${LOADER_DISK_PART1}" -a -b "/dev/synoboot1" ] && LOADER_DISK_PART1="/dev/synoboot1" - [ -z "${LOADER_DISK_PART1}" ] && echo "Boot disk not found" && exit 1 + if [ -z "${LOADER_DISK_PART1}" ] && [ -b "/dev/synoboot1" ]; then + LOADER_DISK_PART1="/dev/synoboot1" + fi + if [ -z "${LOADER_DISK_PART1}" ]; then + echo "Boot disk not found" + exit 1 + fi modprobe vfat echo 1 >/proc/sys/kernel/syno_install_flag diff --git a/deduplication/install.sh b/deduplication/install.sh index 7432db1..bab30f8 100755 --- a/deduplication/install.sh +++ b/deduplication/install.sh @@ -15,20 +15,20 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/deduplication.service" - cat <${DEST} -[Unit] -Description=Enable Deduplication -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/deduplication.sh -s -e --hdd - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=Enable Deduplication" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/deduplication.sh -s -e --hdd" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/eudev/all/addons/eudev-7.1.tgz b/eudev/all/addons/eudev-7.1.tgz index 9aac123..844eb0a 100644 Binary files a/eudev/all/addons/eudev-7.1.tgz and b/eudev/all/addons/eudev-7.1.tgz differ diff --git a/eudev/install.sh b/eudev/install.sh index 967075d..4812832 100755 --- a/eudev/install.sh +++ b/eudev/install.sh @@ -95,20 +95,19 @@ elif [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/udevrules.service" - cat <${DEST} -[Unit] -Description=Reload udev rules - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/udevadm hwdb --update -ExecStart=/usr/bin/udevadm control --reload-rules - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Reload udev rules" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/udevadm hwdb --update" + echo "ExecStart=/usr/bin/udevadm control --reload-rules" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 fi \ No newline at end of file diff --git a/expands/install.sh b/expands/install.sh index 4acd593..1946cad 100755 --- a/expands/install.sh +++ b/expands/install.sh @@ -15,20 +15,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/expands.service" - cat <${DEST} -[Unit] -Description=Expanded miscellaneous -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/expands.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Expanded miscellaneous" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/expands.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/hdddb/install.sh b/hdddb/install.sh index 2f77033..907179d 100755 --- a/hdddb/install.sh +++ b/hdddb/install.sh @@ -15,20 +15,20 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/hdddb.service" - cat <${DEST} -[Unit] -Description=HDDs/SSDs drives databases -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/hdddb.sh -nrwpeS - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=HDDs/SSDs drives databases" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/hdddb.sh -nrwpeS" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/ledcontrol/install.sh b/ledcontrol/install.sh index e4d8780..86ff196 100755 --- a/ledcontrol/install.sh +++ b/ledcontrol/install.sh @@ -31,21 +31,21 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" # All on DEST="/tmpRoot/usr/lib/systemd/system/ledcontrol.service" - cat <${DEST} -[Unit] -Description=Adds uGreen LED control -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service - -[Service] -User=root -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/ledcontrol.sh - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=Adds uGreen LED control" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo + echo "[Service]" + echo "User=root" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/ledcontrol.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/misc/all/usr/bin/awk b/misc/all/usr/bin/awk index bab090d..91a4baf 100755 Binary files a/misc/all/usr/bin/awk and b/misc/all/usr/bin/awk differ diff --git a/misc/all/usr/bin/beep b/misc/all/usr/bin/beep new file mode 100755 index 0000000..8fe4f16 Binary files /dev/null and b/misc/all/usr/bin/beep differ diff --git a/misc/all/usr/bin/diff b/misc/all/usr/bin/diff deleted file mode 100755 index a0670bf..0000000 Binary files a/misc/all/usr/bin/diff and /dev/null differ diff --git a/misc/all/usr/bin/dtc b/misc/all/usr/bin/dtc index 02f0918..85ed683 100755 Binary files a/misc/all/usr/bin/dtc and b/misc/all/usr/bin/dtc differ diff --git a/misc/all/usr/bin/echo b/misc/all/usr/bin/echo deleted file mode 100755 index 30bbf93..0000000 Binary files a/misc/all/usr/bin/echo and /dev/null differ diff --git a/misc/all/usr/bin/gawk b/misc/all/usr/bin/gawk index bab090d..91a4baf 100755 Binary files a/misc/all/usr/bin/gawk and b/misc/all/usr/bin/gawk differ diff --git a/misc/all/usr/bin/grep b/misc/all/usr/bin/grep new file mode 100755 index 0000000..2383e33 Binary files /dev/null and b/misc/all/usr/bin/grep differ diff --git a/misc/all/usr/bin/grub-editenv b/misc/all/usr/bin/grub-editenv deleted file mode 100755 index 77a42e7..0000000 Binary files a/misc/all/usr/bin/grub-editenv and /dev/null differ diff --git a/misc/all/usr/bin/jq b/misc/all/usr/bin/jq deleted file mode 100755 index 4dc02a9..0000000 Binary files a/misc/all/usr/bin/jq and /dev/null differ diff --git a/misc/all/usr/bin/loader-reboot.sh b/misc/all/usr/bin/loader-reboot.sh deleted file mode 100755 index 5a2e970..0000000 --- a/misc/all/usr/bin/loader-reboot.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env ash -# -# Copyright (C) 2023 AuxXxilium and Ing -# -# 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 \ No newline at end of file diff --git a/misc/all/usr/bin/lsof b/misc/all/usr/bin/lsof index 39b0f74..732b315 100755 Binary files a/misc/all/usr/bin/lsof and b/misc/all/usr/bin/lsof differ diff --git a/misc/all/usr/bin/lspci b/misc/all/usr/bin/lspci index c456325..a4d7f16 100755 Binary files a/misc/all/usr/bin/lspci and b/misc/all/usr/bin/lspci differ diff --git a/misc/all/usr/bin/readlink b/misc/all/usr/bin/readlink deleted file mode 100755 index 1be125c..0000000 Binary files a/misc/all/usr/bin/readlink and /dev/null differ diff --git a/misc/all/usr/bin/realpath b/misc/all/usr/bin/realpath deleted file mode 100755 index 7cc890c..0000000 Binary files a/misc/all/usr/bin/realpath and /dev/null differ diff --git a/misc/all/usr/bin/unzip b/misc/all/usr/bin/unzip index 1583dd9..327a1e7 100755 Binary files a/misc/all/usr/bin/unzip and b/misc/all/usr/bin/unzip differ diff --git a/misc/all/usr/lib/libattr.so.1 b/misc/all/usr/lib/libattr.so.1 deleted file mode 100755 index 94fbcb9..0000000 Binary files a/misc/all/usr/lib/libattr.so.1 and /dev/null differ diff --git a/misc/all/usr/lib/libblkid.so b/misc/all/usr/lib/libblkid.so index fe600c4..c7edbd9 100755 Binary files a/misc/all/usr/lib/libblkid.so and b/misc/all/usr/lib/libblkid.so differ diff --git a/misc/all/usr/lib/libblkid.so.1 b/misc/all/usr/lib/libblkid.so.1 index fe600c4..c7edbd9 100755 Binary files a/misc/all/usr/lib/libblkid.so.1 and b/misc/all/usr/lib/libblkid.so.1 differ diff --git a/misc/all/usr/lib/libblkid.so.1.1.0 b/misc/all/usr/lib/libblkid.so.1.1.0 index fe600c4..c7edbd9 100755 Binary files a/misc/all/usr/lib/libblkid.so.1.1.0 and b/misc/all/usr/lib/libblkid.so.1.1.0 differ diff --git a/misc/all/usr/lib/libcap.so.2 b/misc/all/usr/lib/libcap.so.2 deleted file mode 100755 index 964bdae..0000000 Binary files a/misc/all/usr/lib/libcap.so.2 and /dev/null differ diff --git a/misc/all/usr/lib/libcrypto.so.1.0.0 b/misc/all/usr/lib/libcrypto.so.1.0.0 deleted file mode 100755 index 1542ebc..0000000 Binary files a/misc/all/usr/lib/libcrypto.so.1.0.0 and /dev/null differ diff --git a/misc/all/usr/lib/libdevmapper.so.1.02 b/misc/all/usr/lib/libdevmapper.so.1.02 deleted file mode 100755 index f22a03f..0000000 Binary files a/misc/all/usr/lib/libdevmapper.so.1.02 and /dev/null differ diff --git a/misc/all/usr/lib/libgmp.so.10 b/misc/all/usr/lib/libgmp.so.10 deleted file mode 100755 index c98346f..0000000 Binary files a/misc/all/usr/lib/libgmp.so.10 and /dev/null differ diff --git a/misc/all/usr/lib/liblzma.so.5 b/misc/all/usr/lib/liblzma.so.5 deleted file mode 100755 index 06b850e..0000000 Binary files a/misc/all/usr/lib/liblzma.so.5 and /dev/null differ diff --git a/misc/all/usr/lib/libmpfr.so.6 b/misc/all/usr/lib/libmpfr.so.6 deleted file mode 100755 index 7eaf015..0000000 Binary files a/misc/all/usr/lib/libmpfr.so.6 and /dev/null differ diff --git a/misc/all/usr/lib/libncursesw.so.6 b/misc/all/usr/lib/libncursesw.so.6 deleted file mode 100755 index fbe09a2..0000000 Binary files a/misc/all/usr/lib/libncursesw.so.6 and /dev/null differ diff --git a/misc/all/usr/lib/libonig.so.5 b/misc/all/usr/lib/libonig.so.5 deleted file mode 100755 index fcdef1d..0000000 Binary files a/misc/all/usr/lib/libonig.so.5 and /dev/null differ diff --git a/misc/all/usr/lib/libreadline.so.8 b/misc/all/usr/lib/libreadline.so.8 deleted file mode 100755 index 6b6f8cd..0000000 Binary files a/misc/all/usr/lib/libreadline.so.8 and /dev/null differ diff --git a/misc/all/usr/lib/libubsan.so b/misc/all/usr/lib/libubsan.so new file mode 100644 index 0000000..6f3bf7d Binary files /dev/null and b/misc/all/usr/lib/libubsan.so differ diff --git a/misc/all/usr/lib/libubsan.so.1 b/misc/all/usr/lib/libubsan.so.1 new file mode 100644 index 0000000..6f3bf7d Binary files /dev/null and b/misc/all/usr/lib/libubsan.so.1 differ diff --git a/misc/all/usr/lib/libubsan.so.1.0.0 b/misc/all/usr/lib/libubsan.so.1.0.0 new file mode 100644 index 0000000..6f3bf7d Binary files /dev/null and b/misc/all/usr/lib/libubsan.so.1.0.0 differ diff --git a/misc/all/usr/lib/libudev.so.1 b/misc/all/usr/lib/libudev.so.1 deleted file mode 100755 index 3bf82ac..0000000 Binary files a/misc/all/usr/lib/libudev.so.1 and /dev/null differ diff --git a/misc/all/usr/lib/libz.so.1 b/misc/all/usr/lib/libz.so.1 deleted file mode 100755 index 8d114f1..0000000 Binary files a/misc/all/usr/lib/libz.so.1 and /dev/null differ diff --git a/misc/all/usr/sbin/blkid b/misc/all/usr/sbin/blkid index e923c94..289c252 100755 Binary files a/misc/all/usr/sbin/blkid and b/misc/all/usr/sbin/blkid differ diff --git a/misc/all/usr/sbin/dufs b/misc/all/usr/sbin/dufs index 6f463cf..0e42475 100755 Binary files a/misc/all/usr/sbin/dufs and b/misc/all/usr/sbin/dufs differ diff --git a/misc/all/usr/sbin/inb b/misc/all/usr/sbin/inb new file mode 100755 index 0000000..67206ce Binary files /dev/null and b/misc/all/usr/sbin/inb differ diff --git a/misc/all/usr/sbin/ioperm b/misc/all/usr/sbin/ioperm new file mode 100755 index 0000000..b5b9e51 Binary files /dev/null and b/misc/all/usr/sbin/ioperm differ diff --git a/misc/all/usr/sbin/outb b/misc/all/usr/sbin/outb new file mode 100755 index 0000000..41b431c Binary files /dev/null and b/misc/all/usr/sbin/outb differ diff --git a/notify/install.sh b/notify/install.sh index 97d1128..cf3cc0a 100755 --- a/notify/install.sh +++ b/notify/install.sh @@ -14,20 +14,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/notify.service" - cat <${DEST} -[Unit] -Description=arc notify -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/notify.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=arc notify" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/notify.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/nvmesystem/install.sh b/nvmesystem/install.sh index 6cc4e64..b4211b7 100755 --- a/nvmesystem/install.sh +++ b/nvmesystem/install.sh @@ -35,8 +35,8 @@ if [ "${1}" = "early" ]; then elif [ "${1}" = "late" ]; then echo "Installing addon nvmesystem - ${1}" - mkdir -p "/tmpRoot/usr/arc/addons/" - cp -pf "${0}" "/tmpRoot/usr/arc/addons/" + mkdir -p "/tmpRoot/usr/rr/addons/" + cp -pf "${0}" "/tmpRoot/usr/rr/addons/" # disk/shared_disk_info_enum.c::84 Failed to allocate list in SharedDiskInfoEnum, errno=0x900. SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1" @@ -49,26 +49,27 @@ elif [ "${1}" = "late" ]; then rm -f "${SO_FILE}.tmp" # Create storage pool page without RAID type. - cp -pf /usr/bin/nvmesystem.sh /tmpRoot/usr/bin/nvmesystem.sh - [ ! -f "/tmpRoot/usr/bin/gzip" ] && cp -pf /usr/bin/gzip /tmpRoot/usr/bin/gzip + cp -vpf /usr/bin/nvmesystem.sh /tmpRoot/usr/bin/nvmesystem.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/nvmesystem.service" - cat <${DEST} -[Unit] -Description=Modify storage panel -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service -After=storagepanel.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/nvmesystem.sh - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=Modify storage panel(nvmesystem)" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo "After=storagepanel.service" # storagepanel + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/nvmesystem.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 @@ -77,12 +78,19 @@ EOF if cat /proc/version 2>/dev/null | grep -q 'RR@RR'; then ONBOOTUP="" 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" - echo "insert ARCONBOOTUPARC_UDEV task to esynoscheduler.db" + ONBOOTUP="${ONBOOTUP}echo \"DELETE FROM task WHERE task_name LIKE ''RRONBOOTUPRR_UDEV'';\" | sqlite3 /usr/syno/etc/esynoscheduler/esynoscheduler.db\n" + export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib - /tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db </dev/null | wc -c) -p "${SO_FILE}.tmp" 2>/dev/null | - sed "s/803e00b801000000752.488b/803e00b8010000009090488b/" - | xxd -r -p > "${SO_FILE}" 2>/dev/null + sed "s/803e00b801000000752.488b/803e00b8010000009090488b/" | + xxd -r -p >"${SO_FILE}" 2>/dev/null 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 echo "Installing addon nvmevolume - ${1}" SO_FILE="/tmpRoot/usr/lib/libhwcontrol.so.1" [ -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 \ No newline at end of file diff --git a/photosfacepatch/install.sh b/photosfacepatch/install.sh index 9dccaef..48b2e7f 100755 --- a/photosfacepatch/install.sh +++ b/photosfacepatch/install.sh @@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/photosfacepatch.service" - cat <${DEST} -[Unit] -Description=Enable face recognition in Synology Photos -After=syno-volume.target syno-space.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/photosfacepatch.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Enable face recognition in Synology Photos" + echo "After=syno-volume.target syno-space.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/photosfacepatch.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/revert/install.sh b/revert/install.sh index 29a468f..433b8dc 100755 --- a/revert/install.sh +++ b/revert/install.sh @@ -24,20 +24,19 @@ if [ "${1}" = "late" ]; then if [ ! "$(cat "/tmpRoot/usr/arc/revert.sh")" = '#!/usr/bin/env bash' ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/revert.service" - cat <${DEST} -[Unit] -Description=revert -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/arc/revert.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=revert" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/arc/revert.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 else diff --git a/rndis/install.sh b/rndis/install.sh index 8d2c91e..c08065a 100755 --- a/rndis/install.sh +++ b/rndis/install.sh @@ -23,21 +23,20 @@ elif [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/rndis.service" - cat <${DEST} -[Unit] -Description=Android USB Network Adapter -After=multi-user.target -ConditionPathExists=/sys/class/net/usb0 - -[Service] -Type=simple -Restart=always -ExecStart=/usr/bin/rndis.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Android USB Network Adapter" + echo "After=multi-user.target" + echo "ConditionPathExists=/sys/class/net/usb0" + echo + echo "[Service]" + echo "Type=simple" + echo "Restart=always" + echo "ExecStart=/usr/bin/rndis.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/sensors/all/addons/sensors-7.1.tgz b/sensors/all/addons/sensors-7.1.tgz index fec66b7..d674828 100644 Binary files a/sensors/all/addons/sensors-7.1.tgz and b/sensors/all/addons/sensors-7.1.tgz differ diff --git a/sensors/all/usr/bin/arc-sensors.sh b/sensors/all/usr/bin/arc-sensors.sh index 7c9fde6..d99cf3f 100755 --- a/sensors/all/usr/bin/arc-sensors.sh +++ b/sensors/all/usr/bin/arc-sensors.sh @@ -6,12 +6,12 @@ # See /LICENSE for more information. # -if [[ ! -x $(which perl) ]]; then +if ! command -v perl &>/dev/null; then echo "install Perl ..." synopkg install_from_server Perl fi -if [[ ! -x $(which perl) ]]; then +if ! command -v perl &>/dev/null; then echo "Perl not found" exit 1 fi @@ -25,30 +25,23 @@ modprobe -q nct6775 modprobe -q coretemp modprobe -q k10temp -echo 'Y' | sensors-detect --auto >/tmp/sensors.log -cat /tmp/sensors.log | grep Driver | awk '{print $2}' +echo 'Y' | sensors-detect --auto >"/tmp/sensors.log" +grep -oE 'Driver\s*:\s*\w+' "/tmp/sensors.log" | awk -F': ' '{print $2}' sensors echo "$@" | grep -qw "\-f" && rm -f /etc/fancontrol if [ ! -f /etc/fancontrol ]; then # Or use pwmconfig to generate /etc/fancontrol interactively. - DEVPATH="" - DEVNAME="" - FCTEMPS="" - FCFANS="" - MINTEMP="" - 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')" + local DEVPATH DEVNAME FCTEMPS FCFANS MINTEMP MAXTEMP MINSTART MINSTOP + local 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}" DEVNAME="${DEVNAME} hwmon${I}=$(cat /sys/${D}/*/*/name)" 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}" FCFANS="${FCFANS} hwmon${I}/pwm${IDX}=hwmon${I}/fan${IDX}_input" MINTEMP="${MINTEMP} hwmon${I}/pwm${IDX}=30" @@ -59,17 +52,19 @@ if [ ! -f /etc/fancontrol ]; then i=$((i + 1)) done - DEST=/etc/fancontrol - echo "# Configuration file generated by pwmconfig, changes will be lost" >${DEST} - echo "INTERVAL=10" >>${DEST} - echo "DEVPATH=$(echo ${DEVPATH})" >>${DEST} - echo "DEVNAME=$(echo ${DEVNAME})" >>${DEST} - echo "FCTEMPS=$(echo ${FCTEMPS})" >>${DEST} - echo "FCFANS=$(echo ${FCFANS})" >>${DEST} - echo "MINTEMP=$(echo ${MINTEMP})" >>${DEST} - echo "MAXTEMP=$(echo ${MAXTEMP})" >>${DEST} - echo "MINSTART=$(echo ${MINSTART})" >>${DEST} - echo "MINSTOP=$(echo ${MINSTOP})" >>${DEST} + DEST="/etc/fancontrol" + { + echo "# Configuration file generated by pwmconfig, changes will be lost" + echo "INTERVAL=10" + echo "DEVPATH=$(echo ${DEVPATH})" + echo "DEVNAME=$(echo ${DEVNAME})" + echo "FCTEMPS=$(echo ${FCTEMPS})" + echo "FCFANS=$(echo ${FCFANS})" + echo "MINTEMP=$(echo ${MINTEMP})" + echo "MAXTEMP=$(echo ${MAXTEMP})" + echo "MINSTART=$(echo ${MINSTART})" + echo "MINSTOP=$(echo ${MINSTOP})" + } >"${DEST}" fi killall fancontrol diff --git a/sequentialio/install.sh b/sequentialio/install.sh index 114e750..84977de 100755 --- a/sequentialio/install.sh +++ b/sequentialio/install.sh @@ -15,21 +15,20 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/sequentialio.service" - cat <${DEST} -[Unit] -Description=Sequential I/O SSD caches -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/sequentialio.sh $@ - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Sequential I/O SSD caches" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/sequentialio.sh \$@" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/smartctl/all/usr/bin/smartctl.sh b/smartctl/all/usr/bin/smartctl.sh new file mode 100755 index 0000000..428a588 --- /dev/null +++ b/smartctl/all/usr/bin/smartctl.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# +# Copyright (C) 2024 AuxXxilium and Ing +# +# 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[@]}" diff --git a/smartctl/install.sh b/smartctl/install.sh new file mode 100755 index 0000000..599fc9f --- /dev/null +++ b/smartctl/install.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env ash +# +# Copyright (C) 2024 AuxXxilium and Ing +# +# 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 diff --git a/smartctl/manifest.yml b/smartctl/manifest.yml new file mode 100644 index 0000000..c632168 --- /dev/null +++ b/smartctl/manifest.yml @@ -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 \ No newline at end of file diff --git a/sspatch/install.sh b/sspatch/install.sh index cec6986..127faef 100755 --- a/sspatch/install.sh +++ b/sspatch/install.sh @@ -19,19 +19,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/sspatch.service" - cat <${DEST} -[Unit] -Description=addon sspatch -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/sspatch.sh - -[Install] -WantedBy=multi-user.target -EOF + { + echo "[Unit]" + echo "Description=addon sspatch" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/sspatch.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/storagepanel/install.sh b/storagepanel/install.sh index 0d1729d..ef547c5 100755 --- a/storagepanel/install.sh +++ b/storagepanel/install.sh @@ -17,21 +17,20 @@ if [ "${1}" = "late" ]; then shift mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/storagepanel.service" - cat <${DEST} -[Unit] -Description=Modify storage panel -Wants=smpkg-custom-install.service pkgctl-StorageManager.service -After=smpkg-custom-install.service - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/storagepanel.sh $@ - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Modify storage panel" + echo "Wants=smpkg-custom-install.service pkgctl-StorageManager.service" + echo "After=smpkg-custom-install.service" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/storagepanel.sh $@" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/updatenotify/install.sh b/updatenotify/install.sh index 844b9eb..ab7e6d6 100755 --- a/updatenotify/install.sh +++ b/updatenotify/install.sh @@ -16,20 +16,19 @@ if [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/arc-updatenotify.service" - cat <${DEST} -[Unit] -Description=addon arc-updatenotify -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/arc-updatenotify.sh create - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=addon arc-updatenotify" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/arc-updatenotify.sh create" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then diff --git a/wol/install.sh b/wol/install.sh index b15d795..4908981 100755 --- a/wol/install.sh +++ b/wol/install.sh @@ -21,20 +21,19 @@ elif [ "${1}" = "late" ]; then mkdir -p "/tmpRoot/usr/lib/systemd/system" DEST="/tmpRoot/usr/lib/systemd/system/wol.service" - cat <${DEST} -[Unit] -Description=Force WOL on ethN -After=multi-user.target - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=/usr/bin/wol.sh - -[Install] -WantedBy=multi-user.target -EOF - + { + echo "[Unit]" + echo "Description=Force WOL on ethN" + echo "After=multi-user.target" + echo + echo "[Service]" + echo "Type=oneshot" + echo "RemainAfterExit=yes" + echo "ExecStart=/usr/bin/wol.sh" + echo + echo "[Install]" + echo "WantedBy=multi-user.target" + } >"${DEST}" 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 elif [ "${1}" = "uninstall" ]; then