From c3379bb9abb7afbf3d0b9c518695554c10c4bf2b Mon Sep 17 00:00:00 2001 From: Ing Date: Thu, 8 Aug 2024 22:33:19 +0800 Subject: [PATCH] remove pstore logs --- files/initrd/opt/rr/boot.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/files/initrd/opt/rr/boot.sh b/files/initrd/opt/rr/boot.sh index 36fa3d70..00ff8815 100755 --- a/files/initrd/opt/rr/boot.sh +++ b/files/initrd/opt/rr/boot.sh @@ -9,6 +9,10 @@ set -e # Sanity check loaderIsConfigured || die "$(TEXT "Loader is not configured!")" +# Clear logs for dbgutils addons +rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true +rm -rf /sys/fs/pstore/* >/dev/null 2>&1 || true + # Check if machine has EFI [ -d /sys/firmware/efi ] && EFI=1 || EFI=0 @@ -311,10 +315,10 @@ else fi # Executes DSM kernel via KEXEC - KEXECARGS="" + KEXECARGS="-a" if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 4 ] && [ ${EFI} -eq 1 ]; then echo -e "\033[1;33m$(TEXT "Warning, running kexec with --noefi param, strange things will happen!!")\033[0m" - KEXECARGS="--noefi" + KEXECARGS+=" --noefi" fi kexec ${KEXECARGS} -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || dieLog @@ -324,9 +328,6 @@ else [ -w "/dev/${T}" ] && 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 - # Unload all network interfaces for D in $(readlink /sys/class/net/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done @@ -339,6 +340,6 @@ else # Reboot KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")" - [ "${KERNELWAY}" = "kexec" ] && kexec -a -e || poweroff + [ "${KERNELWAY}" = "kexec" ] && kexec -e || poweroff exit 0 fi