Skip to content

Commit

Permalink
remove pstore logs
Browse files Browse the repository at this point in the history
  • Loading branch information
wjz304 committed Aug 8, 2024
1 parent 99eb0d2 commit c3379bb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions files/initrd/opt/rr/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

0 comments on commit c3379bb

Please sign in to comment.