mirror of
https://github.com/RROrg/rr.git
synced 2025-08-23 04:58:33 +08:00
Compare commits
2 Commits
ff7072af9d
...
c3379bb9ab
Author | SHA1 | Date | |
---|---|---|---|
|
c3379bb9ab | ||
|
99eb0d2652 |
@ -9,6 +9,10 @@ set -e
|
|||||||
# Sanity check
|
# Sanity check
|
||||||
loaderIsConfigured || die "$(TEXT "Loader is not configured!")"
|
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
|
# Check if machine has EFI
|
||||||
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
|
[ -d /sys/firmware/efi ] && EFI=1 || EFI=0
|
||||||
|
|
||||||
@ -311,10 +315,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Executes DSM kernel via KEXEC
|
# Executes DSM kernel via KEXEC
|
||||||
KEXECARGS=""
|
KEXECARGS="-a"
|
||||||
if [ $(echo "${KVER:-4}" | cut -d'.' -f1) -lt 4 ] && [ ${EFI} -eq 1 ]; then
|
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"
|
echo -e "\033[1;33m$(TEXT "Warning, running kexec with --noefi param, strange things will happen!!")\033[0m"
|
||||||
KEXECARGS="--noefi"
|
KEXECARGS+=" --noefi"
|
||||||
fi
|
fi
|
||||||
kexec ${KEXECARGS} -l "${MOD_ZIMAGE_FILE}" --initrd "${MOD_RDGZ_FILE}" --command-line="${CMDLINE_LINE}" >"${LOG_FILE}" 2>&1 || dieLog
|
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
|
[ -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
|
done
|
||||||
|
|
||||||
# Clear logs for dbgutils addons
|
|
||||||
rm -rf "${PART1_PATH}/logs" >/dev/null 2>&1 || true
|
|
||||||
|
|
||||||
# Unload all network interfaces
|
# Unload all network interfaces
|
||||||
for D in $(readlink /sys/class/net/*/device/driver); do rmmod -f "$(basename ${D})" 2>/dev/null || true; done
|
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
|
# Reboot
|
||||||
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
||||||
[ "${KERNELWAY}" = "kexec" ] && kexec -a -e || poweroff
|
[ "${KERNELWAY}" = "kexec" ] && kexec -e || poweroff
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -1750,10 +1750,9 @@ function showDisksInfo() {
|
|||||||
function formatDisks() {
|
function formatDisks() {
|
||||||
rm -f "${TMP_PATH}/opts"
|
rm -f "${TMP_PATH}/opts"
|
||||||
while read KNAME ID SIZE TYPE PKNAME; do
|
while read KNAME ID SIZE TYPE PKNAME; do
|
||||||
[ -z "${KNAME}" ] && continue
|
[ "${KNAME}" = "N/A" ] && continue
|
||||||
[[ "${KNAME}" = /dev/md* ]] && continue
|
[[ "${KNAME}" = /dev/md* ]] && continue
|
||||||
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
|
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
|
||||||
[ -z "${ID}" ] && ID="Unknown"
|
|
||||||
printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" "${ID}" >>"${TMP_PATH}/opts"
|
printf "\"%s\" \"%-6s %-4s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${TYPE}" "${ID}" >>"${TMP_PATH}/opts"
|
||||||
done <<<$(lsblk -Jpno KNAME,ID,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.type) \(.pkname)"' 2>/dev/null)
|
done <<<$(lsblk -Jpno KNAME,ID,SIZE,TYPE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.type) \(.pkname)"' 2>/dev/null)
|
||||||
if [ ! -f "${TMP_PATH}/opts" ]; then
|
if [ ! -f "${TMP_PATH}/opts" ]; then
|
||||||
@ -2135,7 +2134,7 @@ function initDSMNetwork {
|
|||||||
function cloneBootloaderDisk() {
|
function cloneBootloaderDisk() {
|
||||||
rm -f "${TMP_PATH}/opts"
|
rm -f "${TMP_PATH}/opts"
|
||||||
while read KNAME ID SIZE PKNAME; do
|
while read KNAME ID SIZE PKNAME; do
|
||||||
[ -z "${KNAME}" -o -z "${ID}" ] && continue
|
[ "${KNAME}" = "N/A" ] && continue
|
||||||
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
|
[ "${KNAME}" = "${LOADER_DISK}" -o "${PKNAME}" = "${LOADER_DISK}" ] && continue
|
||||||
printf "\"%s\" \"%-6s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${ID}" >>"${TMP_PATH}/opts"
|
printf "\"%s\" \"%-6s %s\" \"off\"\n" "${KNAME}" "${SIZE}" "${ID}" >>"${TMP_PATH}/opts"
|
||||||
done <<<$(lsblk -Jpno KNAME,ID,SIZE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.pkname)"' 2>/dev/null)
|
done <<<$(lsblk -Jpno KNAME,ID,SIZE,PKNAME 2>/dev/null | sed 's|null|"N/A"|g' | jq -r '.blockdevices[] | "\(.kname) \(.id) \(.size) \(.pkname)"' 2>/dev/null)
|
||||||
@ -2285,7 +2284,7 @@ function reportBugs() {
|
|||||||
if [ -n "$(ls /sys/fs/pstore 2>/dev/null)" ]; then
|
if [ -n "$(ls /sys/fs/pstore 2>/dev/null)" ]; then
|
||||||
mkdir -p "${TMP_PATH}/logs/pstore"
|
mkdir -p "${TMP_PATH}/logs/pstore"
|
||||||
cp -rf /sys/fs/pstore/* "${TMP_PATH}/logs/pstore"
|
cp -rf /sys/fs/pstore/* "${TMP_PATH}/logs/pstore"
|
||||||
zlib-flate -uncompress </sys/fs/pstore/*.z >"${TMP_PATH}/logs/pstore/ps.log" 2>/dev/null
|
[ -n "$(ls /sys/fs/pstore/*.z 2>/dev/null)" ] && zlib-flate -uncompress </sys/fs/pstore/*.z >"${TMP_PATH}/logs/pstore/ps.log" 2>/dev/null
|
||||||
PSTORE=1
|
PSTORE=1
|
||||||
fi
|
fi
|
||||||
if [ ${PSTORE} -eq 1 ]; then
|
if [ ${PSTORE} -eq 1 ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user