fix sonething

This commit is contained in:
Ing 2024-01-18 13:28:47 +08:00
parent 75b08bf6c8
commit 55b7cb1f7e
11 changed files with 2734 additions and 1721 deletions

View File

@ -1,3 +1,11 @@
/*
* Copyright (C) 2022 Ing <https://github.com/wjz304>
*
* This is free software, licensed under the MIT License.
* See /LICENSE for more information.
*
*/
#include <stdio.h>
#include <string.h>
#include <fcntl.h>

View File

@ -268,6 +268,10 @@ else
for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do
echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational. Please wait a few minutes.\nFind DSM via http://find.synology.com/ or Synology Assistant and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true
done
# Clear logs for dbgutils addons
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
[ "${KERNELWAY}" = "kexec" ] && kexec -i -a -e || poweroff
exit 0

View File

@ -3,6 +3,10 @@
# 1 - Platform
# 2 - Kernel Version
function availableAddons() {
if [ -z "${1}" -o -z "${2}" ]; then
echo ""
return 1
fi
while read D; do
[ ! -f "${D}/manifest.yml" ] && continue
ADDON=$(basename ${D})
@ -21,6 +25,9 @@ function availableAddons() {
# 3 - Kernel Version
# Return ERROR if not exists
function checkAddonExist() {
if [ -z "${1}" -o -z "${2}" -o -z "${3}" ]; then
return 1 # ERROR
fi
# First check generic files
if [ -f "${ADDONS_PATH}/${1}/all.tgz" ]; then
return 0 # OK
@ -36,6 +43,9 @@ function checkAddonExist() {
# Install Addon into ramdisk image
# 1 - Addon id
function installAddon() {
if [ -z "${1}" ]; then
return 1
fi
ADDON="${1}"
mkdir -p "${TMP_PATH}/${ADDON}"
HAS_FILES=0
@ -63,6 +73,10 @@ function installAddon() {
# 1 - Addon file path
# Return name of addon on sucess or empty on error
function untarAddon() {
if [ -z "${1}" ]; then
echo ""
return 1
fi
rm -rf "${TMP_PATH}/addon"
mkdir -p "${TMP_PATH}/addon"
tar -xaf "${1}" -C "${TMP_PATH}/addon" || return

View File

@ -5,6 +5,11 @@
function getAllModules() {
PLATFORM=${1}
KVER=${2}
if [ -z "${PLATFORM}" -o -z "${KVER}" ]; then
echo ""
return 1
fi
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
@ -29,6 +34,11 @@ function addToModules() {
PLATFORM=${1}
KVER=${2}
KOFILE=${3}
if [ -z "${PLATFORM}" -o -z "${KVER}" -o -z "${KOFILE}" ]; then
echo ""
return 1
fi
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
@ -46,6 +56,11 @@ function delToModules() {
PLATFORM=${1}
KVER=${2}
KONAME=${3}
if [ -z "${PLATFORM}" -o -z "${KVER}" -o -z "${KONAME}" ]; then
echo ""
return 1
fi
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"
@ -74,6 +89,11 @@ function getdepends() {
PLATFORM=${1}
KVER=${2}
KONAME=${3}
if [ -z "${PLATFORM}" -o -z "${KVER}" -o -z "${KONAME}" ]; then
echo ""
return 1
fi
# Unzip modules for temporary folder
rm -rf "${TMP_PATH}/modules"
mkdir -p "${TMP_PATH}/modules"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -789,6 +789,7 @@ function cmdlineMenu() {
MSG+="$(TEXT "Commonly used cmdlines:\n")"
MSG+="$(TEXT " * \Z4disable_mtrr_trim=\Zn\n disables kernel trim any uncacheable memory out.\n")"
MSG+="$(TEXT " * \Z4intel_idle.max_cstate=1\Zn\n Set the maximum C-state depth allowed by the intel_idle driver.\n")"
MSG+="$(TEXT " * \Z4pcie_port_pm=off\Zn\n Turn off the power management of the PCIe port.\n")"
MSG+="$(TEXT " * \Z4libata.force=noncq\Zn\n Disable NCQ for all SATA ports.\n")"
MSG+="$(TEXT " * \Z4SataPortMap=??\Zn\n Sata Port Map.\n")"
MSG+="$(TEXT " * \Z4DiskIdxMap=??\Zn\n Disk Index Map, Modify disk name sequence.\n")"
@ -1287,6 +1288,7 @@ function advancedMenu() {
echo "g \"$(TEXT "Show QR logo:") \Z4${DSMLOGO}\Zn\"" >>"${TMP_PATH}/menu"
echo "1 \"$(TEXT "Set global proxy")\"" >>"${TMP_PATH}/menu"
echo "2 \"$(TEXT "Set github proxy")\"" >>"${TMP_PATH}/menu"
echo "! \"$(TEXT "Vigorously miracle")\"" >>"${TMP_PATH}/menu"
echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu"
DIALOG --title "$(TEXT "Advanced")" \
@ -1966,6 +1968,13 @@ function advancedMenu() {
writeConfigKey "github_proxy" "${PROXY}" "${USER_CONFIG_FILE}"
fi
;;
!)
MSG=""
MSG+="$(TEXT "It is expected that all restrictions on DSM will be lifted,\n")"
MSG+="$(TEXT "But since upgrading is not supported, I don not want to implement it for the time being.\n")"
DIALOG --title "$(TEXT "Advanced")" \
--msgbox "${MSG}" 0 0
;;
e) break ;;
esac
done