mirror of https://github.com/ventoy/Ventoy.git
Add Temporary Control Settings menu.
Refer https://www.ventoy.net/en/doc_ctrl_settings.html for details.
This commit is contained in:
parent
23f8bc8aeb
commit
f434d1f5d0
|
@ -1133,6 +1133,7 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
|
|||
|
||||
while (1)
|
||||
{
|
||||
int ndown;
|
||||
int boot_entry;
|
||||
grub_menu_entry_t e;
|
||||
int auto_boot;
|
||||
|
@ -1175,6 +1176,16 @@ show_menu (grub_menu_t menu, int nested, int autobooted)
|
|||
|
||||
if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_RET", 12) == 0)
|
||||
break;
|
||||
else if (2 == e->argc && e->args && e->args[1] && grub_strncmp(e->args[1], "VTOY_RUN_SET", 12) == 0) {
|
||||
ndown = (int)grub_strtol(e->args[1] + 12, NULL, 10);
|
||||
while (ndown > 0)
|
||||
{
|
||||
ventoy_menu_push_key(GRUB_TERM_KEY_DOWN);
|
||||
ndown--;
|
||||
}
|
||||
ventoy_menu_push_key('\n');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
|
|
@ -6227,6 +6227,66 @@ static char * ventoy_gfxmode_write_hook(struct grub_env_var *var, const char *va
|
|||
return grub_strdup(val);
|
||||
}
|
||||
|
||||
static ctrl_var_cfg g_ctrl_vars[] =
|
||||
{
|
||||
{ "VTOY_WIN11_BYPASS_CHECK", 0 },
|
||||
{ "VTOY_LINUX_REMOUNT", 0 },
|
||||
{ "VTOY_SECONDARY_BOOT_MENU", 1 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
||||
static const char * ventoy_ctrl_var_read_hook(struct grub_env_var *var, const char *val)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; g_ctrl_vars[i].name; i++)
|
||||
{
|
||||
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
|
||||
{
|
||||
return g_ctrl_vars[i].value ? "1" : "0";
|
||||
}
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static char * ventoy_ctrl_var_write_hook(struct grub_env_var *var, const char *val)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; g_ctrl_vars[i].name; i++)
|
||||
{
|
||||
if (grub_strcmp(g_ctrl_vars[i].name, var->name) == 0)
|
||||
{
|
||||
if (val && val[0] == '1' && val[1] == 0)
|
||||
{
|
||||
g_ctrl_vars[i].value = 1;
|
||||
return grub_strdup("1");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ctrl_vars[i].value = 0;
|
||||
return grub_strdup("0");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return grub_strdup(val);
|
||||
}
|
||||
|
||||
static int ventoy_ctrl_var_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; g_ctrl_vars[i].name; i++)
|
||||
{
|
||||
ventoy_env_export(g_ctrl_vars[i].name, g_ctrl_vars[i].value ? "1" : "0");
|
||||
grub_register_variable_hook(g_ctrl_vars[i].name, ventoy_ctrl_var_read_hook, ventoy_ctrl_var_write_hook);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ventoy_env_init(void)
|
||||
{
|
||||
int i;
|
||||
|
@ -6237,6 +6297,8 @@ int ventoy_env_init(void)
|
|||
grub_register_variable_hook("gfxmode", ventoy_gfxmode_read_hook, ventoy_gfxmode_write_hook);
|
||||
grub_register_vtoy_menu_lang_hook(ventoy_menu_lang_read_hook);
|
||||
|
||||
ventoy_ctrl_var_init();
|
||||
|
||||
g_part_list_buf = grub_malloc(VTOY_PART_BUF_LEN);
|
||||
g_tree_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
|
||||
g_list_script_buf = grub_malloc(VTOY_MAX_SCRIPT_BUF);
|
||||
|
|
|
@ -1256,6 +1256,12 @@ typedef struct systemd_menu_ctx
|
|||
int len;
|
||||
}systemd_menu_ctx;
|
||||
|
||||
typedef struct ctrl_var_cfg
|
||||
{
|
||||
const char *name;
|
||||
int value;
|
||||
}ctrl_var_cfg;
|
||||
|
||||
#define vtoy_check_goto_out(p) if (!p) goto out
|
||||
|
||||
extern char *g_tree_script_buf;
|
||||
|
|
|
@ -1,7 +1,45 @@
|
|||
#
|
||||
# VTLANG_TEMP_SETTING must be the first
|
||||
# And the inside item order can not be changed
|
||||
#
|
||||
submenu "$VTLANG_CTRL_TEMP_SET" --class=debug_temp_set --class=F5tool {
|
||||
menuentry "[ $VTOY_WIN11_BYPASS_CHECK ] $VTLANG_WIN11_BYPASS_CHECK" --class=debug_temp_win11_bypass --class=debug_temp_set --class=F5tool \
|
||||
VTOY_RUN_SET0 {
|
||||
if [ "$VTOY_WIN11_BYPASS_CHECK" = "0" ]; then
|
||||
set VTOY_WIN11_BYPASS_CHECK=1
|
||||
else
|
||||
set VTOY_WIN11_BYPASS_CHECK=0
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "[ $VTOY_LINUX_REMOUNT ] $VTLANG_LINUX_REMOUNT" --class=debug_temp_linux_remount --class=debug_temp_set --class=F5tool \
|
||||
VTOY_RUN_SET1 {
|
||||
if [ "$VTOY_LINUX_REMOUNT" = "0" ]; then
|
||||
set VTOY_LINUX_REMOUNT=1
|
||||
else
|
||||
set VTOY_LINUX_REMOUNT=0
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "[ $VTOY_SECONDARY_BOOT_MENU ] $VTLANG_SECONDARY_BOOT_MENU" --class=debug_temp_second_menu --class=debug_temp_set --class=F5tool \
|
||||
VTOY_RUN_SET2 {
|
||||
if [ "$VTOY_SECONDARY_BOOT_MENU" = "0" ]; then
|
||||
set VTOY_SECONDARY_BOOT_MENU=1
|
||||
else
|
||||
set VTOY_SECONDARY_BOOT_MENU=0
|
||||
fi
|
||||
}
|
||||
|
||||
menuentry "$VTLANG_RETURN_PREVIOUS" --class=vtoyret VTOY_RET {
|
||||
echo "Return ..."
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
submenu "$VTLANG_MENU_LANG" --class=debug_menu_lang --class=F5tool {
|
||||
source $prefix/menulang.cfg
|
||||
}
|
||||
|
||||
source $prefix/power.cfg
|
||||
source $prefix/hwinfo.cfg
|
||||
source $prefix/keyboard.cfg
|
||||
|
|
|
@ -68,5 +68,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "اضغط على مفتاح Enter لإعادة التشغيل",
|
||||
"VTLANG_ENTER_CONTINUE": "اضغط على مفتاح Enter للمتابعة",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "রিবুট করতে এন্টার কী টিপুন",
|
||||
"VTLANG_ENTER_CONTINUE": "চালিয়ে যেতে এন্টার কী টিপুন",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "Drücken Sie die Eingabetaste, um neu zu starten",
|
||||
"VTLANG_ENTER_CONTINUE": "Drücken Sie die Eingabetaste, um fortzufahren",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "press Enter key to reboot",
|
||||
"VTLANG_ENTER_CONTINUE": "press Enter key to continue",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "appuyez sur la touche Entrée pour redémarrer",
|
||||
"VTLANG_ENTER_CONTINUE": "appuyez sur la touche Entrée pour continuer",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "रिबूट करने के लिए एंटर कुंजी दबाएं",
|
||||
"VTLANG_ENTER_CONTINUE": "जारी रखने के लिए एंटर कुंजी दबाएं",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "pritisnite tipku Enter za ponovno pokretanje",
|
||||
"VTLANG_ENTER_CONTINUE": "pritisnite tipku Enter za nastavak",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "nyomja meg az Enter billentyűt az újraindításhoz",
|
||||
"VTLANG_ENTER_CONTINUE": "a folytatáshoz nyomja meg az Enter billentyűt",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "tekan tombol Enter untuk reboot",
|
||||
"VTLANG_ENTER_CONTINUE": "tekan tombol Enter untuk melanjutkan",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "[Enter]を押して再起動します",
|
||||
"VTLANG_ENTER_CONTINUE": "[Enter]を押して続行します",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "დააჭირეთ Enter ღილაკს გადატვირთვისთვის",
|
||||
"VTLANG_ENTER_CONTINUE": "გასაგრძელებლად დააჭირეთ Enter ღილაკს",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "Enter 키를 눌러 재부팅",
|
||||
"VTLANG_ENTER_CONTINUE": "계속하려면 Enter 키를 누르십시오",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "naciśnij klawisz Enter, aby ponownie uruchomić",
|
||||
"VTLANG_ENTER_CONTINUE": "naciśnij klawisz Enter, aby kontynuować",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "pressione a tecla Enter para reiniciar",
|
||||
"VTLANG_ENTER_CONTINUE": "pressione a tecla Enter para continuar",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "нажмите клавишу Enter для перезагрузки",
|
||||
"VTLANG_ENTER_CONTINUE": "нажмите клавишу Enter, чтобы продолжить",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
|
||||
"VTLANG_LANGUAGE_NAME": "Serbian Latin (Srpski)",
|
||||
|
||||
"VTLANG_STR_HOTKEY_LIST": "L:Језик F1:Help F2:Browse F3:ListView F4:Localboot F5:Tools F6:ExMenu",
|
||||
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "press Enter key to reboot",
|
||||
"VTLANG_ENTER_CONTINUE": "press Enter key to continue",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "மறுதொடக்கம் செய்ய Enter விசையை அழுத்தவும்",
|
||||
"VTLANG_ENTER_CONTINUE": "தொடர Enter விசையை அழுத்தவும்",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "yeniden başlatmak için ENTER'a basın",
|
||||
"VTLANG_ENTER_CONTINUE": "devam etmek için ENTER'a basın",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "Temporary Control Settings",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "Bypass check when install Windows 11",
|
||||
"VTLANG_LINUX_REMOUNT": "Mount Ventoy partition after boot Linux",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "Show secondary boot menu",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "按回车键重启",
|
||||
"VTLANG_ENTER_CONTINUE": "按回车键继续",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "控制变量设置",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "安装 Windows 11 时绕过硬件检查",
|
||||
"VTLANG_LINUX_REMOUNT": "启动 Linux 系统后挂载 Ventoy 分区",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "显示二级启动菜单",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
|
@ -82,5 +82,10 @@
|
|||
"VTLANG_ENTER_REBOOT": "按回車鍵重啟",
|
||||
"VTLANG_ENTER_CONTINUE": "按回車鍵繼續",
|
||||
|
||||
"VTLANG_CTRL_TEMP_SET": "控制變量設置",
|
||||
"VTLANG_WIN11_BYPASS_CHECK": "安裝 Windows 11 時繞過硬件檢查",
|
||||
"VTLANG_LINUX_REMOUNT": "啟動 Linux 系統後掛載 Ventoy 分區",
|
||||
"VTLANG_SECONDARY_BOOT_MENU": "顯示二級啟動菜單",
|
||||
|
||||
"MENU_STR_XXX": ""
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue