mirror of
https://github.com/RROrg/rr.git
synced 2025-06-21 05:51:05 +08:00
修复 resp 的引用问题
This commit is contained in:
parent
4f0a4b1a9b
commit
5a1ff80670
2
.github/workflows/issues.yml
vendored
2
.github/workflows/issues.yml
vendored
@ -268,7 +268,7 @@ jobs:
|
||||
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
|
||||
{
|
||||
echo "RR: "
|
||||
echo " VERSION: $(cat ${RR_VERSION_FILE} 2>/dev/null | head -1)"
|
||||
echo " VERSION: $(cat "${RR_VERSION_FILE}" 2>/dev/null | head -1)"
|
||||
echo " CUSTOM: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
echo
|
||||
echo "DSM:"
|
||||
|
@ -41,7 +41,7 @@ BTITLE+="$([ ${EFI} -eq 1 ] && echo " [UEFI]" || echo " [BIOS]")"
|
||||
BTITLE+="$([ "${BUS}" = "usb" ] && echo " [${BUS^^} flashdisk]" || echo " [${BUS^^} DoM]")"
|
||||
printf "\033[1;33m%*s\033[0m\n" $(((${#BTITLE} + ${COLUMNS}) / 2)) "${BTITLE}"
|
||||
|
||||
if [ -f ${PART1_PATH}/.upgraded ]; then
|
||||
if [ -f "${PART1_PATH}/.upgraded" ]; then
|
||||
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
|
||||
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
|
||||
if [ -n "${MODEL}" ] && [ -n "${PLATFORM}" ]; then
|
||||
@ -60,11 +60,11 @@ if [ -f ${PART1_PATH}/.upgraded ]; then
|
||||
}
|
||||
fi
|
||||
fi
|
||||
rm -f ${PART1_PATH}/.upgraded
|
||||
rm -f "${PART1_PATH}/.upgraded"
|
||||
fi
|
||||
# Check if DSM zImage changed, patch it if necessary
|
||||
ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"
|
||||
if [ -f ${PART1_PATH}/.build ] || [ "$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')" != "${ZIMAGE_HASH}" ]; then
|
||||
if [ -f "${PART1_PATH}/.build" ] || [ "$(sha256sum "${ORI_ZIMAGE_FILE}" | awk '{print $1}')" != "${ZIMAGE_HASH}" ]; then
|
||||
printf "\033[1;43m%s\033[0m\n" "$(TEXT "DSM zImage changed")"
|
||||
${WORK_PATH}/zimage-patch.sh || {
|
||||
printf "\033[1;43m%s\n%s\n%s:\n%s\033[0m\n" "$(TEXT "DSM zImage not patched")" "$(TEXT "Please upgrade the bootloader version and try again.")" "$(TEXT "Error")" "$(cat "${LOG_FILE}")"
|
||||
@ -74,14 +74,14 @@ fi
|
||||
|
||||
# Check if DSM ramdisk changed, patch it if necessary
|
||||
RAMDISK_HASH="$(readConfigKey "ramdisk-hash" "${USER_CONFIG_FILE}")"
|
||||
if [ -f ${PART1_PATH}/.build ] || [ "$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')" != "${RAMDISK_HASH}" ]; then
|
||||
if [ -f "${PART1_PATH}/.build" ] || [ "$(sha256sum "${ORI_RDGZ_FILE}" | awk '{print $1}')" != "${RAMDISK_HASH}" ]; then
|
||||
printf "\033[1;43m%s\033[0m\n" "$(TEXT "DSM ramdisk changed")"
|
||||
${WORK_PATH}/ramdisk-patch.sh || {
|
||||
printf "\033[1;43m%s\n%s\n%s:\n%s\033[0m\n" "$(TEXT "DSM ramdisk not patched")" "$(TEXT "Please upgrade the bootloader version and try again.")" "$(TEXT "Error")" "$(cat "${LOG_FILE}")"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
[ -f ${PART1_PATH}/.build ] && rm -f ${PART1_PATH}/.build
|
||||
[ -f "${PART1_PATH}/.build" ] && rm -f "${PART1_PATH}/.build"
|
||||
|
||||
# Load necessary variables
|
||||
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
|
||||
@ -317,21 +317,21 @@ function _bootwait() {
|
||||
DIRECT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
|
||||
if [ "${DIRECT}" = "true" ] || [ "${MEV:-physical}" = "parallels" ]; then
|
||||
# grubenv file limit is 1024 bytes.
|
||||
grub-editenv ${USER_RSYSENVFILE} create
|
||||
grub-editenv ${USER_RSYSENVFILE} set rr_version="${WTITLE}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set rr_booting="${BTITLE}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set dsm_model="${MODEL}(${PLATFORM})"
|
||||
grub-editenv ${USER_RSYSENVFILE} set dsm_version="${PRODUCTVER}(${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))"
|
||||
grub-editenv ${USER_RSYSENVFILE} set dsm_kernel="${KERNEL}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set dsm_lkm="${LKM}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set sys_mev="${MEV:-physical}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set sys_dmi="${DMI}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set sys_cpu="${CPU}"
|
||||
grub-editenv ${USER_RSYSENVFILE} set sys_mem="${MEM}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" create
|
||||
grub-editenv "${USER_RSYSENVFILE}" set rr_version="${WTITLE}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set rr_booting="${BTITLE}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set dsm_model="${MODEL}(${PLATFORM})"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set dsm_version="${PRODUCTVER}(${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set dsm_kernel="${KERNEL}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set dsm_lkm="${LKM}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set sys_mev="${MEV:-physical}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set sys_dmi="${DMI}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set sys_cpu="${CPU}"
|
||||
grub-editenv "${USER_RSYSENVFILE}" set sys_mem="${MEM}"
|
||||
|
||||
CMDLINE_DIRECT=$(echo ${CMDLINE_LINE} | sed 's/>/\\\\>/g') # Escape special chars
|
||||
grub-editenv ${USER_GRUBENVFILE} set dsm_cmdline="${CMDLINE_DIRECT}"
|
||||
grub-editenv ${USER_GRUBENVFILE} set next_entry="direct"
|
||||
CMDLINE_DIRECT=$(echo "${CMDLINE_LINE}" | sed 's/>/\\\\>/g') # Escape special chars
|
||||
grub-editenv "${USER_GRUBENVFILE}" set dsm_cmdline="${CMDLINE_DIRECT}"
|
||||
grub-editenv "${USER_GRUBENVFILE}" set next_entry="direct"
|
||||
|
||||
_bootwait || exit 0
|
||||
|
||||
@ -339,9 +339,9 @@ if [ "${DIRECT}" = "true" ] || [ "${MEV:-physical}" = "parallels" ]; then
|
||||
reboot
|
||||
exit 0
|
||||
else
|
||||
rm -f ${USER_RSYSENVFILE} 2>/dev/null || true
|
||||
grub-editenv ${USER_GRUBENVFILE} unset dsm_cmdline
|
||||
grub-editenv ${USER_GRUBENVFILE} unset next_entry
|
||||
rm -f "${USER_RSYSENVFILE}" 2>/dev/null || true
|
||||
grub-editenv "${USER_GRUBENVFILE}" unset dsm_cmdline
|
||||
grub-editenv "${USER_GRUBENVFILE}" unset next_entry
|
||||
ETHX="$(find /sys/class/net/ -mindepth 1 -maxdepth 1 ! -name lo -exec basename {} \; | sort)"
|
||||
printf "$(TEXT "Detected %s network cards.\n")" "$(echo "${ETHX}" | wc -w)"
|
||||
printf "$(TEXT "Checking Connect.")"
|
||||
@ -444,7 +444,7 @@ else
|
||||
# Unload all graphics drivers
|
||||
# for D in $(lsmod | grep -E '^(nouveau|amdgpu|radeon|i915)' | awk '{print $1}'); do rmmod -f "${D}" 2>/dev/null || true; done
|
||||
# for I in $(find /sys/devices -name uevent -exec bash -c 'cat {} 2>/dev/null | grep -Eq "PCI_CLASS=0?30[0|1|2]00" && dirname {}' \;); do
|
||||
# [ -e ${I}/reset ] && cat ${I}/vendor >/dev/null | grep -iq 0x10de && echo 1 >${I}/reset || true # Proc open nvidia driver when booting
|
||||
# [ -e ${I}/reset ] && cat "${I}/vendor" >/dev/null | grep -iq 0x10de && echo 1 >${I}/reset || true # Proc open nvidia driver when booting
|
||||
# done
|
||||
|
||||
# Reboot
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# Copyright (C) 2022 Ing <https://github.com/wjz304>
|
||||
#
|
||||
# This is free software, licensed under the MIT License.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# Calculate the amount of space needed to run the kernel, including room for
|
||||
# the .bss and .brk sections.
|
||||
#
|
||||
# Usage:
|
||||
# objdump -h a.out | sh calc_run_size.sh
|
||||
|
||||
NUM='\([0-9a-fA-F]*[ \t]*\)'
|
||||
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/0x\1 0x\4/p')
|
||||
|
||||
if [ -z "${OUT}" ]; then
|
||||
echo "Never found .bss or .brk file offset" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -r sizeA offsetA sizeB offsetB <<<"$(echo ${OUT} | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')"
|
||||
|
||||
runSize=$((offsetA + sizeA + sizeB))
|
||||
|
||||
# BFD linker shows the same file offset in ELF.
|
||||
if [ "${offsetA}" -ne "${offsetB}" ]; then
|
||||
# Gold linker shows them as consecutive.
|
||||
endSize=$((offsetB + sizeB))
|
||||
if [ "${endSize}" -ne "${runSize}" ]; then
|
||||
printf "sizeA: 0x%x\n" ${sizeA} >&2
|
||||
printf "offsetA: 0x%x\n" ${offsetA} >&2
|
||||
printf "sizeB: 0x%x\n" ${sizeB} >&2
|
||||
printf "offsetB: 0x%x\n" ${offsetB} >&2
|
||||
echo ".bss and .brk are non-contiguous" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
printf "%d\n" ${runSize}
|
||||
exit 0
|
File diff suppressed because it is too large
Load Diff
@ -9,7 +9,7 @@
|
||||
|
||||
[ -z "${WORK_PATH}" ] || [ ! -d "${WORK_PATH}/include" ] && WORK_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
calculate_run_size() {
|
||||
calc_run_size() {
|
||||
NUM='\([0-9a-fA-F]*[ \t]*\)'
|
||||
OUT=$(sed -n 's/^[ \t0-9]*.b[sr][sk][ \t]*'"${NUM}${NUM}${NUM}${NUM}"'.*/0x\1 0x\4/p')
|
||||
|
||||
@ -18,7 +18,7 @@ calculate_run_size() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
read -r sizeA offsetA sizeB offsetB <<<"$(echo ${OUT} | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')"
|
||||
read -r sizeA offsetA sizeB offsetB <<<"$(echo "${OUT}" | awk '{printf "%d %d %d %d", strtonum($1), strtonum($2), strtonum($3), strtonum($4)}')"
|
||||
|
||||
runSize=$((offsetA + sizeA + sizeB))
|
||||
|
||||
@ -27,10 +27,10 @@ calculate_run_size() {
|
||||
# Gold linker shows them as consecutive.
|
||||
endSize=$((offsetB + sizeB))
|
||||
if [ "${endSize}" -ne "${runSize}" ]; then
|
||||
printf "sizeA: 0x%x\n" ${sizeA} >&2
|
||||
printf "offsetA: 0x%x\n" ${offsetA} >&2
|
||||
printf "sizeB: 0x%x\n" ${sizeB} >&2
|
||||
printf "offsetB: 0x%x\n" ${offsetB} >&2
|
||||
printf "sizeA: 0x%x\n" "${sizeA}" >&2
|
||||
printf "offsetA: 0x%x\n" "${offsetA}" >&2
|
||||
printf "sizeB: 0x%x\n" "${sizeB}" >&2
|
||||
printf "offsetB: 0x%x\n" "${offsetB}" >&2
|
||||
echo ".bss and .brk are non-contiguous" >&2
|
||||
return 1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user