add "Switch way of switching kernel"

This commit is contained in:
Ing 2023-07-17 00:00:41 +08:00
parent e365ddcf5b
commit 4a06b5ec1e
7 changed files with 541 additions and 525 deletions

View File

@ -230,6 +230,6 @@ echo -e "\033[1;37m$(TEXT "Booting...")\033[0m"
for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do for T in $(w | grep -v "TTY" | awk -F' ' '{print $2}'); do
echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational. Please use the http://find.synology.com/ find DSM and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true echo -e "\n\033[1;43m$(TEXT "[This interface will not be operational. Please use the http://find.synology.com/ find DSM and connect.]")\033[0m\n" >"/dev/${T}" 2>/dev/null || true
done done
#poweroff KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
kexec -f -e [ "${KERNELWAY}" = "kexec" ] && kexec -f -e || poweroff
exit 0 exit 0

View File

@ -78,6 +78,7 @@ if [ ! -f "${USER_CONFIG_FILE}" ]; then
writeConfigKey "directboot" "false" "${USER_CONFIG_FILE}" writeConfigKey "directboot" "false" "${USER_CONFIG_FILE}"
writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}" writeConfigKey "notsetmacs" "false" "${USER_CONFIG_FILE}"
writeConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}" writeConfigKey "bootipwait" "10" "${USER_CONFIG_FILE}"
writeConfigKey "kernelway" "power" "${USER_CONFIG_FILE}"
writeConfigKey "model" "" "${USER_CONFIG_FILE}" writeConfigKey "model" "" "${USER_CONFIG_FILE}"
writeConfigKey "productver" "" "${USER_CONFIG_FILE}" writeConfigKey "productver" "" "${USER_CONFIG_FILE}"
writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}" writeConfigKey "buildnum" "" "${USER_CONFIG_FILE}"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,7 @@ LKM="$(readConfigKey "lkm" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")" DIRECTBOOT="$(readConfigKey "directboot" "${USER_CONFIG_FILE}")"
NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")" NOTSETMACS="$(readConfigKey "notsetmacs" "${USER_CONFIG_FILE}")"
BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")" BOOTIPWAIT="$(readConfigKey "bootipwait" "${USER_CONFIG_FILE}")"
KERNELWAY="$(readConfigKey "kernelway" "${USER_CONFIG_FILE}")"
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
############################################################################### ###############################################################################
@ -973,6 +974,7 @@ function advancedMenu() {
echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu" echo "q \"$(TEXT "Switch direct boot:") \Z4${DIRECTBOOT}\Zn\"" >>"${TMP_PATH}/menu"
if [ "${DIRECTBOOT}" = "false" ]; then if [ "${DIRECTBOOT}" = "false" ]; then
echo "w \"$(TEXT "boot IPs wait time:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu" echo "w \"$(TEXT "boot IPs wait time:") \Z4${BOOTIPWAIT}\Zn\"" >>"${TMP_PATH}/menu"
echo "k \"$(TEXT "Switch way of switching kernel:") \Z4${KERNELWAY}\Zn\"" >>"${TMP_PATH}/menu"
fi fi
fi fi
echo "m \"$(TEXT "Switch 'not set MACs':") \Z4${NOTSETMACS}\Zn\"" >>"${TMP_PATH}/menu" echo "m \"$(TEXT "Switch 'not set MACs':") \Z4${NOTSETMACS}\Zn\"" >>"${TMP_PATH}/menu"
@ -980,7 +982,7 @@ function advancedMenu() {
echo "t \"$(TEXT "Try to recovery a DSM installed system")\"" >>"${TMP_PATH}/menu" echo "t \"$(TEXT "Try to recovery a DSM installed system")\"" >>"${TMP_PATH}/menu"
echo "s \"$(TEXT "Show SATA(s) # ports and drives")\"" >>"${TMP_PATH}/menu" echo "s \"$(TEXT "Show SATA(s) # ports and drives")\"" >>"${TMP_PATH}/menu"
if [ -n "${MODEL}" -a -n "${PRODUCTVER}" ]; then if [ -n "${MODEL}" -a -n "${PRODUCTVER}" ]; then
echo "k \"$(TEXT "show/modify the current pat data")\"" >>"${TMP_PATH}/menu" echo "c \"$(TEXT "show/modify the current pat data")\"" >>"${TMP_PATH}/menu"
fi fi
echo "a \"$(TEXT "Allow downgrade installation")\"" >>"${TMP_PATH}/menu" echo "a \"$(TEXT "Allow downgrade installation")\"" >>"${TMP_PATH}/menu"
echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" >>"${TMP_PATH}/menu" echo "f \"$(TEXT "Format disk(s) # Without loader disk")\"" >>"${TMP_PATH}/menu"
@ -1024,6 +1026,11 @@ function advancedMenu() {
writeConfigKey "bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}" writeConfigKey "bootipwait" "${BOOTIPWAIT}" "${USER_CONFIG_FILE}"
NEXT="e" NEXT="e"
;; ;;
k)
[ "${KERNELWAY}" = "kexec" ] && KERNELWAY='power' || KERNELWAY='kexec'
writeConfigKey "kernelway" "${KERNELWAY}" "${USER_CONFIG_FILE}"
NEXT="e"
;;
m) m)
[ "${NOTSETMACS}" = "false" ] && NOTSETMACS='true' || NOTSETMACS='false' [ "${NOTSETMACS}" = "false" ] && NOTSETMACS='true' || NOTSETMACS='false'
writeConfigKey "notsetmacs" "${NOTSETMACS}" "${USER_CONFIG_FILE}" writeConfigKey "notsetmacs" "${NOTSETMACS}" "${USER_CONFIG_FILE}"
@ -1077,7 +1084,7 @@ function advancedMenu() {
dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \ dialog --backtitle "$(backtitle)" --colors --title "$(TEXT "Advanced")" \
--msgbox "${MSG}" 0 0 --msgbox "${MSG}" 0 0
;; ;;
k) c)
PATURL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" PATURL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PATSUM="$(readConfigKey "patsum" "${USER_CONFIG_FILE}")" PATSUM="$(readConfigKey "patsum" "${USER_CONFIG_FILE}")"
MSG="$(TEXT "pat: (editable)")" MSG="$(TEXT "pat: (editable)")"

View File

@ -12,8 +12,6 @@ cmdline: &cmdline
synoboot2: synoboot2:
SMBusHddDynamicPower: 1 SMBusHddDynamicPower: 1
vender_format_version: 2 vender_format_version: 2
syno_ttyS0: "serial,0x3f8"
syno_ttyS1: "serial,0x2f8"
elevator: elevator elevator: elevator
platform: "grantley" platform: "grantley"
unique: "synology_grantley_fs3017" unique: "synology_grantley_fs3017"
@ -22,8 +20,8 @@ serial:
- "0000" - "0000"
middle: "XXX" middle: "XXX"
suffix: "numeric" suffix: "numeric"
dom: 2 dom: 1
dt: true dt: false
disks: 24 disks: 24
beta: true beta: true
productvers: productvers: