Compare commits

..

No commits in common. "2b592cf227b4d73f048b4e272d888511ebd489aa" and "002c6417e3cb0c5481a9d88a736f758c04f8d820" have entirely different histories.

12 changed files with 1298 additions and 77 deletions

View File

@ -149,10 +149,6 @@ jobs:
# 累了, 毁灭吧!
# yq need sudo !!!
function deleteConfigKey() {
sudo yq eval "del(.${1})" --inplace "${2}" 2>/dev/null
}
function writeConfigKey() {
local value="${2}"
[ "${value}" = "{}" ] && sudo yq eval ".${1} = {}" --inplace "${3}" 2>/dev/null || sudo yq eval ".${1} = \"${value}\"" --inplace "${3}" 2>/dev/null
@ -163,15 +159,10 @@ jobs:
[ "${result}" = "null" ] && echo "" || echo "${result}"
}
function mergeConfigModules() {
# Error: bad file '-': cannot index array with '8139cp' (strconv.ParseInt: parsing "8139cp": invalid syntax)
# When the first key is a pure number, yq will not process it as a string by default. The current solution is to insert a placeholder key.
local MS="RRORG\n${1// /\\n}"
local L="$(echo -en "${MS}" | awk '{print "modules."$1":"}')"
function mergeConfigStr() {
local xmlfile=$(mktemp)
echo -en "${L}" | sudo yq -p p -o y >"${xmlfile}"
deleteConfigKey "modules.\"RRORG\"" "${xmlfile}"
sudo yq eval-all --inplace '. as $item ireduce ({}; . * $item)' --inplace "${2}" "${xmlfile}" 2>/dev/null
echo "${2}" | sudo yq -p "${1}" -o y >"${xmlfile}"
sudo yq eval-all --inplace '. as $item ireduce ({}; . * $item)' --inplace "${3}" "${xmlfile}" 2>/dev/null
rm -f "${xmlfile}"
}
@ -242,7 +233,8 @@ jobs:
echo "set modules: ${{ env.modules }}"
USER_CONFIG_FILE="rr/ws/mnt/p1/user-config.yml"
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(echo "${{ env.modules }}" | sed 's/,/\n/g')" "${USER_CONFIG_FILE}"
L="$(for I in $(echo "${{ env.modules }}" | sed 's/,/ /g'); do echo "modules.${I}:"; done)"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
# for M in $(echo "${{ env.modules }}" | sed 's/,/ /g'); do
# writeConfigKey "modules.\"${M}\"" "" "${USER_CONFIG_FILE}"
# done

View File

@ -1 +1 @@
24.12.1
24.12.0

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -174,7 +174,7 @@ CMDLINE['log_buf_len']="32M"
CMDLINE['rootwait']=""
CMDLINE['panic']="${KERNELPANIC:-0}"
# CMDLINE['nointremap']="" # no need
# CMDLINE['split_lock_detect']="off" # check KVER
# CMDLINE['split_lock_detect']="off" # no need
CMDLINE['pcie_aspm']="off"
# CMDLINE['intel_pstate']="disable"
# CMDLINE['nox2apic']="" # check platform

View File

@ -28,17 +28,13 @@ function readConfigKey() {
###############################################################################
# Write to yaml config file
# 1 - Modules
# 2 - Path of yaml config file
function mergeConfigModules() {
# Error: bad file '-': cannot index array with '8139cp' (strconv.ParseInt: parsing "8139cp": invalid syntax)
# When the first key is a pure number, yq will not process it as a string by default. The current solution is to insert a placeholder key.
local MS="RRORG\n${1// /\\n}"
local L="$(echo -en "${MS}" | awk '{print "modules."$1":"}')"
# 1 - format
# 2 - string
# 3 - Path of yaml config file
function mergeConfigStr() {
local xmlfile=$(mktemp)
echo -en "${L}" | yq -p p -o y >"${xmlfile}"
deleteConfigKey "modules.\"RRORG\"" "${xmlfile}"
yq eval-all --inplace '. as $item ireduce ({}; . * $item)' --inplace "${2}" "${xmlfile}" 2>/dev/null
echo "${2}" | yq -p "${1}" -o y >"${xmlfile}"
yq eval-all --inplace '. as $item ireduce ({}; . * $item)' --inplace "${3}" "${xmlfile}" 2>/dev/null
rm -f "${xmlfile}"
}

View File

@ -1,4 +1,4 @@
RR_VERSION="24.12.1"
RR_VERSION="24.12.0"
RR_RELEASE=""
RR_TITLE="RR v${RR_VERSION}"

View File

@ -329,7 +329,8 @@ function productversMenu() {
done <<<$(readConfigMap "addons" "${USER_CONFIG_FILE}")
# Rewrite modules
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
# Remove old files
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" >/dev/null 2>&1 || true
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true
@ -408,7 +409,8 @@ function setConfigFromDSM() {
done <<<$(readConfigMap "addons" "${USER_CONFIG_FILE}")
# Rebuild modules
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
touch ${PART1_PATH}/.build
return 0
}
@ -690,14 +692,16 @@ function moduleMenu() {
0)
# ok-button
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(cat "${TMP_PATH}/resp" 2>/dev/null)" "${USER_CONFIG_FILE}"
L="$(for I in $(cat ${TMP_PATH}/resp 2>/dev/null); do echo "modules.${I}:"; done)"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
touch ${PART1_PATH}/.build
break
;;
3)
# extra-button
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(echo "${ALLMODULES}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "${ALLMODULES}" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
touch ${PART1_PATH}/.build
;;
2)
@ -2137,7 +2141,7 @@ function tryRecoveryDSM() {
--msgbox "$(TEXT "No DSM system partition(md0) found!\nPlease insert all disks before continuing.")" 0 0
return
fi
mkdir -p "${TMP_PATH}/mdX"
fixDSMRootPart "${DSMROOTPART}"
mount -t ext4 "${DSMROOTPART}" "${TMP_PATH}/mdX"
@ -3446,7 +3450,8 @@ function updateRR() {
KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")"
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
fi
fi
fi
@ -3583,7 +3588,8 @@ function updateModules() {
KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")"
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
fi
fi
rm -rf "${TMP_PATH}/update"
@ -3705,7 +3711,8 @@ function updateCKs() {
KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")"
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
fi
fi
rm -rf "${TMP_PATH}/update"
@ -3998,7 +4005,8 @@ else
fi
if [ -n "${PLATFORM}" ] && [ -n "${KVER}" ]; then
writeConfigKey "modules" "{}" "${USER_CONFIG_FILE}"
mergeConfigModules "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}" | awk '{print $1}')" "${USER_CONFIG_FILE}"
L="$(echo "$(getAllModules "${PLATFORM}" "$([ -n "${KPRE}" ] && echo "${KPRE}-")${KVER}")" | awk '{print "modules."$1":"}')"
mergeConfigStr p "${L}" "${USER_CONFIG_FILE}"
fi
touch ${PART1_PATH}/.build

View File

@ -1 +1 @@
24.12.1
24.12.0