更新 boot.sh 和 grub.cfg,优化 MEV 变量获取逻辑和输出

This commit is contained in:
Ing 2024-12-01 21:45:56 +08:00
parent 98ddaa3a75
commit 4168b71f42
2 changed files with 3 additions and 2 deletions

View File

@ -68,7 +68,7 @@ DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${WORK_PATH}/platforms.yml")"
KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${WORK_PATH}/platforms.yml")" KVER="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kver" "${WORK_PATH}/platforms.yml")"
KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")" KPRE="$(readConfigKey "platforms.${PLATFORM}.productvers.\"${PRODUCTVER}\".kpre" "${WORK_PATH}/platforms.yml")"
MEV="$(virt-what 2>/dev/null)" MEV="$(virt-what 2>/dev/null | head -1)"
DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')" DMI="$(dmesg 2>/dev/null | grep -i "DMI:" | head -1 | sed 's/\[.*\] DMI: //i')"
CPU="$(awk -F': ' '/model name/ {print $2}' /proc/cpuinfo | uniq)" CPU="$(awk -F': ' '/model name/ {print $2}' /proc/cpuinfo | uniq)"
MEM="$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo) MB" MEM="$(awk '/MemTotal:/ {printf "%.0f", $2 / 1024}' /proc/meminfo) MB"
@ -237,7 +237,7 @@ for KEY in "${!CMDLINE[@]}"; do
[ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}" [ -n "${VALUE}" ] && CMDLINE_LINE+="=${VALUE}"
done done
CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space CMDLINE_LINE=$(echo "${CMDLINE_LINE}" | sed 's/^ //') # Remove leading space
printf "%s:\n \033[1;36m%s\033[0m\n" "$(TEXT "Cmdline")" "${CMDLINE_LINE}" printf "%s:\n\033[1;36m%s\033[0m\n" "$(TEXT "Cmdline")" "${CMDLINE_LINE}"
# Check if user wants to modify at this stage # Check if user wants to modify at this stage
function _bootwait() { function _bootwait() {

View File

@ -90,6 +90,7 @@ if [ -s /zImage-dsm -a -s /initrd-dsm ]; then
echo "version: ${dsm_version}" echo "version: ${dsm_version}"
echo "kernel: ${dsm_kernel}" echo "kernel: ${dsm_kernel}"
echo "LKM: ${dsm_lkm}" echo "LKM: ${dsm_lkm}"
echo "MEV: ${sys_mev}"
echo "DMI: ${sys_dmi}" echo "DMI: ${sys_dmi}"
echo "CPU: ${sys_cpu}" echo "CPU: ${sys_cpu}"
echo "MEM: ${sys_mem}" echo "MEM: ${sys_mem}"