mirror of
https://github.com/RROrg/rr.git
synced 2025-12-18 01:59:31 +08:00
Compare commits
No commits in common. "c3379bb9abb7afbf3d0b9c518695554c10c4bf2b" and "ff7072af9d37e76f24fd20e83f024023ed8f5021" have entirely different histories.
c3379bb9ab
...
ff7072af9d
@ -9,10 +9,6 @@ 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
|
||||||
|
|
||||||
@ -315,10 +311,10 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Executes DSM kernel via KEXEC
|
# Executes DSM kernel via KEXEC
|
||||||
KEXECARGS="-a"
|
KEXECARGS=""
|
||||||
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
|
||||||
|
|
||||||
@ -328,6 +324,9 @@ 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
|
||||||
|
|
||||||
@ -340,6 +339,6 @@ else
|
|||||||
|
|
||||||
# Reboot
|
# Reboot
|
||||||
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
|
||||||
[ "${KERNELWAY}" = "kexec" ] && kexec -e || poweroff
|
[ "${KERNELWAY}" = "kexec" ] && kexec -a -e || poweroff
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -1750,9 +1750,10 @@ 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
|
||||||
[ "${KNAME}" = "N/A" ] && continue
|
[ -z "${KNAME}" ] && 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
|
||||||
@ -2134,7 +2135,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
|
||||||
[ "${KNAME}" = "N/A" ] && continue
|
[ -z "${KNAME}" -o -z "${ID}" ] && 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)
|
||||||
@ -2284,7 +2285,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"
|
||||||
[ -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
|
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