From dd5b312c319901ba817a9a184bcf07cc2be49783 Mon Sep 17 00:00:00 2001 From: Ing Date: Fri, 6 Dec 2024 23:00:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=B4=E6=8E=A5=E5=8A=A8?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=8C=89=E9=94=AE=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=AC=A2=E8=BF=8E=E4=BF=A1=E6=81=AF=E5=92=8C?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E7=B1=BB=E5=9E=8B=E8=BE=93=E5=87=BA=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/initrd/opt/rr/boot.sh | 16 +++++++++------- files/mnt/p1/boot/grub/grub.cfg | 6 ++++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/files/initrd/opt/rr/boot.sh b/files/initrd/opt/rr/boot.sh index 91efa72b..2060df26 100755 --- a/files/initrd/opt/rr/boot.sh +++ b/files/initrd/opt/rr/boot.sh @@ -20,18 +20,18 @@ BUS=$(getBus "${LOADER_DISK}") clear COLUMNS=$(ttysize 2>/dev/null | awk '{print $1}') COLUMNS=${COLUMNS:-80} -TITLE="$(printf "$(TEXT "Welcome to %s")" "$([ -z "${RR_RELEASE}" ] && echo "${RR_TITLE}" || echo "${RR_TITLE}(${RR_RELEASE})")")" +WTITLE="$(printf "$(TEXT "Welcome to %s")" "$([ -z "${RR_RELEASE}" ] && echo "${RR_TITLE}" || echo "${RR_TITLE}(${RR_RELEASE})")")" DATE="$(date)" printf "\033[1;44m%*s\n" "${COLUMNS}" "" printf "\033[1;44m%*s\033[A\n" "${COLUMNS}" "" -printf "\033[1;31m%*s\033[0m\n" "$(((${#TITLE} + ${COLUMNS}) / 2))" "${TITLE}" +printf "\033[1;31m%*s\033[0m\n" "$(((${#WTITLE} + ${COLUMNS}) / 2))" "${WTITLE}" printf "\033[1;44m%*s\033[A\n" "${COLUMNS}" "" printf "\033[1;32m%*s\033[0m\n" "${COLUMNS}" "${DATE}" -TITLE="BOOTING:" -TITLE+="$([ ${EFI} -eq 1 ] && echo " [UEFI]" || echo " [BIOS]")" -TITLE+="$([ "${BUS}" = "usb" ] && echo " [${BUS^^} flashdisk]" || echo " [${BUS^^} DoM]")" -printf "\033[1;33m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}" +BTITLE="Boot Type:" +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}" # Check if DSM zImage changed, patch it if necessary ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")" @@ -264,7 +264,8 @@ function _bootwait() { DIRECT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" if [ "${DIRECT}" = "true" ] || [ "${MEV:-physical}" = "parallels" ]; then - grub-editenv ${USER_GRUBENVFILE} set rr_version="$([ -z "${RR_RELEASE}" ] && echo "${RR_TITLE}" || echo "${RR_TITLE}(${RR_RELEASE})")" + grub-editenv ${USER_GRUBENVFILE} set rr_version="${WTITLE}" + grub-editenv ${USER_GRUBENVFILE} set rr_booting="${BTITLE}" grub-editenv ${USER_GRUBENVFILE} set dsm_model="${MODEL}(${PLATFORM})" grub-editenv ${USER_GRUBENVFILE} set dsm_version="${PRODUCTVER}(${BUILDNUM}$([ ${SMALLNUM:-0} -ne 0 ] && echo "u${SMALLNUM}"))" grub-editenv ${USER_GRUBENVFILE} set dsm_kernel="${KERNEL}" @@ -285,6 +286,7 @@ if [ "${DIRECT}" = "true" ] || [ "${MEV:-physical}" = "parallels" ]; then exit 0 else grub-editenv ${USER_GRUBENVFILE} unset rr_version + grub-editenv ${USER_GRUBENVFILE} unset rr_booting grub-editenv ${USER_GRUBENVFILE} unset dsm_model grub-editenv ${USER_GRUBENVFILE} unset dsm_version grub-editenv ${USER_GRUBENVFILE} unset dsm_kernel diff --git a/files/mnt/p1/boot/grub/grub.cfg b/files/mnt/p1/boot/grub/grub.cfg index b074205a..20b82b5e 100644 --- a/files/mnt/p1/boot/grub/grub.cfg +++ b/files/mnt/p1/boot/grub/grub.cfg @@ -64,10 +64,12 @@ search --set=root --label "RR3" if [ -s /zImage-dsm -a -s /initrd-dsm ]; then if [ "${default}" = "direct" ]; then set timeout="1" + set pager=0 menuentry 'Boot DSM kernel directly' --id direct { set_gfxpayload - echo "RR-version: ${rr_version}" - echo -n "bootuptime: "; date + echo "RRVersion: ${rr_version}" + echo "${rr_booting}" + echo -n "Boot Time: "; date echo "" echo "Model: ${dsm_model}" echo "version: ${dsm_version}"