mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
tree: rework
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
parent
efb4f03d47
commit
41ca53236f
@ -17,12 +17,11 @@ if [ "${1}" = "late" ]; then
|
|||||||
cat <<EOF >${DEST}
|
cat <<EOF >${DEST}
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=addon amepatch
|
Description=addon amepatch
|
||||||
After=multi-user.target
|
After=syno-volume.target syno-space.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=oneshot
|
||||||
Restart=on-failure
|
RemainAfterExit=yes
|
||||||
RestartSec=10
|
|
||||||
ExecStart=/usr/bin/amepatch.sh
|
ExecStart=/usr/bin/amepatch.sh
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -18,7 +18,7 @@ if [ "${1}" = "late" ]; then
|
|||||||
cat <<EOF >${DEST}
|
cat <<EOF >${DEST}
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=addon codecpatch
|
Description=addon codecpatch
|
||||||
After=multi-user.target
|
echo "After=syno-volume.target syno-space.target"
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -24,7 +24,7 @@ After=smpkg-custom-install.service
|
|||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
RemainAfterExit=yes
|
RemainAfterExit=yes
|
||||||
ExecStart=/usr/bin/hdddb.sh -nfreS
|
ExecStart=/usr/bin/hdddb.sh -nrwpeS
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
@ -94,11 +94,11 @@ MSG="\${MSG}\n"
|
|||||||
MSG="\${MSG}Warning: Data should only be stored in shared folders. Data stored elsewhere\n"
|
MSG="\${MSG}Warning: Data should only be stored in shared folders. Data stored elsewhere\n"
|
||||||
MSG="\${MSG}may be deleted when the system is updated/restarted.\n"
|
MSG="\${MSG}may be deleted when the system is updated/restarted.\n"
|
||||||
MSG="\${MSG}\n"
|
MSG="\${MSG}\n"
|
||||||
|
MSG="\${MSG}'System partition(/dev/md0) mounted to': /tmpRoot\n"
|
||||||
MSG="\${MSG}To 'Force re-install DSM': http://<ip>:5000/web_install.html\n"
|
MSG="\${MSG}To 'Force re-install DSM': http://<ip>:5000/web_install.html\n"
|
||||||
MSG="\${MSG}To 'Reboot to Config Mode': http://<ip>:5000/webman/reboot_to_loader.cgi\n"
|
MSG="\${MSG}To 'Reboot to Config Mode': http://<ip>:5000/webman/reboot_to_loader.cgi\n"
|
||||||
MSG="\${MSG}To 'Show Boot Log': http://<ip>:5000/webman/get_logs.cgi\n"
|
MSG="\${MSG}To 'Show Boot Log': http://<ip>:5000/webman/get_logs.cgi\n"
|
||||||
MSG="\${MSG}To 'Reboot Loader' : exec reboot\n"
|
MSG="\${MSG}To 'Reboot Loader' : exec reboot\n"
|
||||||
MSG="\${MSG}To 'Modify system files' : mount /dev/md0\n"
|
|
||||||
echo -e "\${MSG}" > /etc/motd
|
echo -e "\${MSG}" > /etc/motd
|
||||||
|
|
||||||
/usr/bin/killall ttyd 2>/dev/null || true
|
/usr/bin/killall ttyd 2>/dev/null || true
|
||||||
@ -110,6 +110,8 @@ echo "Starting dufs ..."
|
|||||||
|
|
||||||
cp -f /usr/syno/web/web_index.html /usr/syno/web/web_install.html
|
cp -f /usr/syno/web/web_index.html /usr/syno/web/web_install.html
|
||||||
cp -f /addons/web_index.html /usr/syno/web/web_index.html
|
cp -f /addons/web_index.html /usr/syno/web/web_index.html
|
||||||
|
mkdir -p /tmpRoot
|
||||||
|
mount /dev/md0 /tmpRoot
|
||||||
echo "Arc Recovery mode is ready"
|
echo "Arc Recovery mode is ready"
|
||||||
EOF
|
EOF
|
||||||
chmod +x /usr/syno/web/webman/recovery.cgi
|
chmod +x /usr/syno/web/webman/recovery.cgi
|
||||||
|
@ -30,6 +30,8 @@ fi
|
|||||||
|
|
||||||
gzip -dc "${FILE_GZ}" >"${FILE_JS}"
|
gzip -dc "${FILE_GZ}" >"${FILE_JS}"
|
||||||
sed -i "s/e.portType||e.isCacheTray()/e.portType||false/" "${FILE_JS}"
|
sed -i "s/e.portType||e.isCacheTray()/e.portType||false/" "${FILE_JS}"
|
||||||
|
sed -i 's/notSupportM2Pool_addOnCard:this.T("disk_info","disk_reason_m2_add_on_card"),//g' "${FILE_JS}"
|
||||||
|
sed -i 's/},{isConditionInvalid:0<this.pciSlot,invalidReason:"notSupportM2Pool_addOnCard"//g' "${FILE_JS}"
|
||||||
gzip -c "${FILE_JS}" >"${FILE_GZ}"
|
gzip -c "${FILE_JS}" >"${FILE_GZ}"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
@ -20,7 +20,9 @@ if [ "${1}" = "late" ]; then
|
|||||||
[ ! -f "${SO_FILE}.bak" ] && cp -vf "${SO_FILE}" "${SO_FILE}.bak"
|
[ ! -f "${SO_FILE}.bak" ] && cp -vf "${SO_FILE}" "${SO_FILE}.bak"
|
||||||
|
|
||||||
cp -f "${SO_FILE}" "${SO_FILE}.tmp"
|
cp -f "${SO_FILE}" "${SO_FILE}.tmp"
|
||||||
xxd -c $(xxd -p "${SO_FILE}.tmp" | wc -c) -p "${SO_FILE}.tmp" | sed "s/803e00b801000000752.488b/803e00b8010000009090488b/" | xxd -r -p > "${SO_FILE}"
|
xxd -c $(xxd -p "${SO_FILE}.tmp" 2>/dev/null | wc -c) -p "${SO_FILE}.tmp" 2>/dev/null |
|
||||||
|
sed "s/803e00b801000000752.488b/803e00b8010000009090488b/"
|
||||||
|
| xxd -r -p > "${SO_FILE}" 2>/dev/null
|
||||||
rm -f "${SO_FILE}.tmp"
|
rm -f "${SO_FILE}.tmp"
|
||||||
elif [ "${1}" = "uninstall" ]; then
|
elif [ "${1}" = "uninstall" ]; then
|
||||||
echo "Installing addon nvmevolume - ${1}"
|
echo "Installing addon nvmevolume - ${1}"
|
||||||
|
@ -1,58 +1,28 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium>
|
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the MIT License.
|
# This is free software, licensed under the MIT License.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
#
|
#
|
||||||
|
|
||||||
SO_FILE1="/var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-platform.so"
|
SO_FILE=$(find / -name "libsynophoto-plugin-platform.so.1.0" 2>/dev/null | head -1)
|
||||||
SO_FILE2="/var/packages/SynologyPhotos/target/usr/lib/libsynophoto-plugin-platform.so.1.0"
|
|
||||||
if [ ! -f "${SO_FILE1}" ] && [ ! -f "${SO_FILE2}" ]; then
|
if [ -z "${SO_FILE}" ] || [ ! -f "${SO_FILE}" ]; then
|
||||||
echo "SynologyPhotos not installed -> Exit"
|
echo "SynologyPhotos not install"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${SO_FILE1}" ]; then
|
if [ "${1}" = "-r" ]; then
|
||||||
if [ "${1}" = "-r" ]; then
|
[ -f "${SO_FILE}.bak" ] && mv -f "${SO_FILE}.bak" "${SO_FILE}"
|
||||||
if [ -f "${SO_FILE1}.bak" ]; then
|
exit
|
||||||
mv -f "${SO_FILE1}.bak" "${SO_FILE1}"
|
|
||||||
fi
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f "${SO_FILE1}.bak" ]; then
|
|
||||||
echo "Backup ${SO_FILE1}"
|
|
||||||
cp -vfp "${SO_FILE1}" "${SO_FILE1}.bak"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Patching ${SO_FILE1}"
|
|
||||||
# support face and concept
|
|
||||||
PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3"
|
|
||||||
# force to support concept
|
|
||||||
PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3"
|
|
||||||
# force no Gpu
|
|
||||||
PatchELFSharp "${SO_FILE1}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "${SO_FILE2}" ]; then
|
echo "Patching ${SO_FILE}"
|
||||||
if [ "${1}" = "-r" ]; then
|
[ ! -f "${SO_FILE}.bak" ] && cp -f "${SO_FILE}" "${SO_FILE}.bak"
|
||||||
if [ -f "${SO_FILE2}.bak" ]; then
|
# support face and concept
|
||||||
mv -f "${SO_FILE2}.bak" "${SO_FILE2}"
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3"
|
||||||
fi
|
# force to support concept
|
||||||
exit
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3"
|
||||||
fi
|
# force no Gpu
|
||||||
|
PatchELFSharp "${SO_FILE}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3"
|
||||||
if [ ! -f "${SO_FILE2}.bak" ]; then
|
|
||||||
echo "Backup ${SO_FILE2}"
|
|
||||||
cp -vfp "${SO_FILE2}" "${SO_FILE2}.bak"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Patching ${SO_FILE2}"
|
|
||||||
# support face and concept
|
|
||||||
PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform20IsSupportedIENetworkEv" "B8 00 00 00 00 C3"
|
|
||||||
# force to support concept
|
|
||||||
PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform18IsSupportedConceptEv" "B8 01 00 00 00 C3"
|
|
||||||
# force no Gpu
|
|
||||||
PatchELFSharp "${SO_FILE2}" "_ZN9synophoto6plugin8platform23IsSupportedIENetworkGpuEv" "B8 00 00 00 00 C3"
|
|
||||||
fi
|
|
@ -19,7 +19,7 @@ if [ "${1}" = "late" ]; then
|
|||||||
cat <<EOF >${DEST}
|
cat <<EOF >${DEST}
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Enable face recognition in Synology Photos
|
Description=Enable face recognition in Synology Photos
|
||||||
After=multi-user.target
|
After=syno-volume.target syno-space.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env ash
|
#!/usr/bin/env ash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium>
|
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the MIT License.
|
# This is free software, licensed under the MIT License.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -13,38 +13,16 @@ if [ "${1}" = "late" ]; then
|
|||||||
|
|
||||||
SO_FILE="/tmpRoot/usr/lib/libsynosdk.so.7"
|
SO_FILE="/tmpRoot/usr/lib/libsynosdk.so.7"
|
||||||
if [ -f "${SO_FILE}" ]; then
|
if [ -f "${SO_FILE}" ]; then
|
||||||
if [ ! -f "${SO_FILE}.bak" ]; then
|
|
||||||
echo "Backup ${SO_FILE}"
|
|
||||||
cp -vfp "${SO_FILE}" "${SO_FILE}.bak"
|
|
||||||
fi
|
|
||||||
echo "Patching libsynosdk.so.7"
|
echo "Patching libsynosdk.so.7"
|
||||||
|
[ ! -f "${SO_FILE}.bak" ] && cp -f "${SO_FILE}" "${SO_FILE}.bak"
|
||||||
|
# force to support remote fs
|
||||||
PatchELFSharp "${SO_FILE}" "SYNOFSIsRemoteFS" "B8 00 00 00 00 C3"
|
PatchELFSharp "${SO_FILE}" "SYNOFSIsRemoteFS" "B8 00 00 00 00 C3"
|
||||||
else
|
else
|
||||||
echo "libsynosdk.so.7 not found"
|
echo "libsynosdk.so.7 not found"
|
||||||
fi
|
fi
|
||||||
SO_FILE="/tmpRoot/usr/lib/libmediaindex.so"
|
|
||||||
if [ -f "${SO_FILE}" ]; then
|
|
||||||
if [ ! -f "${SO_FILE}.bak" ]; then
|
|
||||||
echo "Backup ${SO_FILE}"
|
|
||||||
cp -vfp "${SO_FILE}" "${SO_FILE}.bak"
|
|
||||||
fi
|
|
||||||
echo "Patching libmediaindex.so"
|
|
||||||
PatchELFSharp "${SO_FILE}" "IndexIsPathRemoteMount" "B8 00 00 00 00 C3"
|
|
||||||
PatchELFSharp "${SO_FILE}" "IndexIsPathRemoteOrImageMount" "B8 00 00 00 00 C3"
|
|
||||||
else
|
|
||||||
echo "libmediaindex.so not found"
|
|
||||||
fi
|
|
||||||
elif [ "${1}" = "uninstall" ]; then
|
elif [ "${1}" = "uninstall" ]; then
|
||||||
echo "Installing addon remotefs - ${1}"
|
echo "Installing addon remotefs - ${1}"
|
||||||
|
|
||||||
SO_FILE="/tmpRoot/usr/lib/libsynosdk.so.7"
|
SO_FILE="/tmpRoot/usr/lib/libsynosdk.so.7"
|
||||||
if [ -f "${SO_FILE}.bak" ]; then
|
[ -f "${SO_FILE}.bak" ] && mv -f "${SO_FILE}.bak" "${SO_FILE}"
|
||||||
echo "Restore ${SO_FILE}"
|
|
||||||
mv -f "${SO_FILE}.bak" "${SO_FILE}"
|
|
||||||
fi
|
|
||||||
SO_FILE="/tmpRoot/usr/lib/libmediaindex.so"
|
|
||||||
if [ -f "${SO_FILE}.bak" ]; then
|
|
||||||
echo "Restore ${SO_FILE}"
|
|
||||||
mv -f "${SO_FILE}.bak" "${SO_FILE}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env ash
|
#!/usr/bin/env ash
|
||||||
#
|
#
|
||||||
# Copyright (C) 2023 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
# Copyright (C) 2024 AuxXxilium <https://github.com/AuxXxilium> and Ing <https://github.com/wjz304>
|
||||||
#
|
#
|
||||||
# This is free software, licensed under the MIT License.
|
# This is free software, licensed under the MIT License.
|
||||||
# See /LICENSE for more information.
|
# See /LICENSE for more information.
|
||||||
@ -14,11 +14,36 @@ if [ "${1}" = "late" ]; then
|
|||||||
FILE="/tmpRoot/usr/syno/bin/synoups"
|
FILE="/tmpRoot/usr/syno/bin/synoups"
|
||||||
[ ! -f "${FILE}.bak" ] && cp -f "${FILE}" "${FILE}.bak"
|
[ ! -f "${FILE}.bak" ] && cp -f "${FILE}" "${FILE}.bak"
|
||||||
|
|
||||||
sed -i 's|/usr/syno/sbin/synopoweroff.*$|/usr/syno/sbin/synopoweroff|g' "${FILE}"
|
cp -f "${FILE}.bak" "${FILE}"
|
||||||
|
if [ -z "${2}" ] || [ "${2}" = "-f" ]; then
|
||||||
|
sed -i "s|/usr/syno/sbin/synopoweroff.*$|/usr/syno/sbin/synopoweroff|g" "${FILE}"
|
||||||
|
fi
|
||||||
|
if [ "${2}" = "-e" ] || [ "${2}" = "-f" ]; then
|
||||||
|
EVENT_POWEROFF="/usr/syno/sbin/esynoscheduler --fireEvent event=shutdown"
|
||||||
|
if ! grep -q "${EVENT_POWEROFF}" "${FILE}"; then
|
||||||
|
sed -i "/\/usr\/syno\/sbin\/synopoweroff/i\ \ \ \ ${EVENT_POWEROFF}" "${FILE}"
|
||||||
|
fi
|
||||||
|
echo "insert start/stop ScsiTarget task to esynoscheduler.db"
|
||||||
|
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
|
||||||
|
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF
|
||||||
|
DELETE FROM task WHERE task_name LIKE 'StartScsiTarget';
|
||||||
|
INSERT INTO task VALUES('StartScsiTarget', '', 'bootup', '', 1, 0, 0, 0, '', 0, "synopkg start ScsiTarget", 'script', '{}', '', '', '{}', '{}');
|
||||||
|
DELETE FROM task WHERE task_name LIKE 'StopScsiTarget';
|
||||||
|
INSERT INTO task VALUES('StopScsiTarget', '', 'shutdown', '', 1, 0, 0, 0, '', 0, "synopkg stop ScsiTarget", 'script', '{}', '', '', '{}', '{}');
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
elif [ "${1}" = "uninstall" ]; then
|
elif [ "${1}" = "uninstall" ]; then
|
||||||
echo "Installing addon ups - ${1}"
|
echo "Installing addon ups - ${1}"
|
||||||
|
|
||||||
FILE="/tmpRoot/usr/syno/bin/synoups"
|
FILE="/tmpRoot/usr/syno/bin/synoups"
|
||||||
[ -f "${FILE}.bak" ] && mv -f "${FILE}.bak" "${FILE}"
|
[ -f "${FILE}.bak" ] && mv -f "${FILE}.bak" "${FILE}"
|
||||||
|
|
||||||
|
if [ -f /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db ]; then
|
||||||
|
echo "delete synoconfbkp task from esynoscheduler.db"
|
||||||
|
export LD_LIBRARY_PATH=/tmpRoot/bin:/tmpRoot/lib
|
||||||
|
/tmpRoot/bin/sqlite3 /tmpRoot/usr/syno/etc/esynoscheduler/esynoscheduler.db <<EOF
|
||||||
|
DELETE FROM task WHERE task_name LIKE 'StartScsiTarget';
|
||||||
|
DELETE FROM task WHERE task_name LIKE 'StopScsiTarget';
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user