add switch of logo

This commit is contained in:
Ing 2023-08-24 20:25:50 +08:00
parent 9caca6c7c2
commit acbfe3e9f9
10 changed files with 1140 additions and 1113 deletions

View File

@ -27,7 +27,10 @@ TITLE="BOOTING:"
[ "${BUS}" = "usb" ] && TITLE+=" [${BUS^^} flashdisk]" || TITLE+=" [${BUS^^} DoM]"
printf "\033[1;33m%*s\033[0m\n" $(((${#TITLE} + ${COLUMNS}) / 2)) "${TITLE}"
[ -c "/dev/fb0" -a -f "${CACHE_PATH}/logo.png" ] && echo | fbv -acuf "${CACHE_PATH}/logo.png" >/dev/null
DSMLOGO="$(readConfigKey "dsmlogo" "${USER_CONFIG_FILE}")"
if [ ${DSMLOGO} = "true" -a -c "/dev/fb0" -a -f "${CACHE_PATH}/logo.png" ]; then
echo | fbv -acuf "${CACHE_PATH}/logo.png" >/dev/null 2>/dev/null
fi
# Check if DSM zImage changed, patch it if necessary
ZIMAGE_HASH="$(readConfigKey "zimage-hash" "${USER_CONFIG_FILE}")"

View File

@ -75,6 +75,7 @@ ETHX=($(ls /sys/class/net/ | grep eth)) # real network cards list
if [ ! -f "${USER_CONFIG_FILE}" ]; then
touch "${USER_CONFIG_FILE}"
writeConfigKey "lkm" "prod" "${USER_CONFIG_FILE}"
writeConfigKey "dsmlogo" "true" "${USER_CONFIG_FILE}"
writeConfigKey "directboot" "false" "${USER_CONFIG_FILE}"
writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}"
writeConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -27,6 +27,7 @@ SMALLNUM="$(readConfigKey "smallnum" "${USER_CONFIG_FILE}")"
LAYOUT="$(readConfigKey "layout" "${USER_CONFIG_FILE}")"
KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
DSMLOGO="$(readConfigKey "dsmlogo" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
@ -294,7 +295,7 @@ function addonMenu() {
ADDON="$(<"${TMP_PATH}/resp")"
[ -z "${ADDON}" ] && continue
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Addons")" \
--inputbox "$(TEXT "Type a opcional params to addon")" 0 0 \
--inputbox "$(TEXT "Type a optional params to addon")" 0 0 \
2>${TMP_PATH}/resp
[ $? -ne 0 ] && continue
VALUE="$(<"${TMP_PATH}/resp")"
@ -1018,6 +1019,7 @@ function advancedMenu() {
echo "r \"$(TEXT "Restore bootloader disk # test")\"" >>"${TMP_PATH}/menu"
fi
echo "o \"$(TEXT "Install development tools")\"" >>"${TMP_PATH}/menu"
echo "g \"$(TEXT "Show dsm logo:") \Z4${DSMLOGO}\Zn\"" >>"${TMP_PATH}/menu"
echo "e \"$(TEXT "Exit")\"" >>"${TMP_PATH}/menu"
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
@ -1393,6 +1395,11 @@ function advancedMenu() {
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
--msgbox "$(TEXT "opkg install is complete. Please reconnect to SSH/web, or execute 'source ~/.bashrc'")" 0 0
;;
g)
[ "${DSMLOGO}" = "true" ] && DSMLOGO='false' || DSMLOGO='true'
writeConfigKey "dsmlogo" "${DSMLOGO}" "${USER_CONFIG_FILE}"
NEXT="e"
;;
e) break ;;
esac
done