]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Show the directory path in the return menu for TreeView mode and Browser mode.
authorlongpanda <admin@ventoy.net>
Tue, 19 Apr 2022 07:34:31 +0000 (15:34 +0800)
committerlongpanda <admin@ventoy.net>
Tue, 19 Apr 2022 07:34:31 +0000 (15:34 +0800)
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_cmd.c
GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_def.h
GRUB2/MOD_SRC/grub-2.04/install.sh

index 01c7248e7d4c56bb6eb139b212a39521b3e5c317..7b4cf966c38c5a8a73f7c41d4880b311ccdbff89 100644 (file)
@@ -520,13 +520,13 @@ grub_err_t ventoy_cmd_browser_dir(grub_extcmd_context_t ctxt, int argc, char **a
 
     if (g_tree_view_menu_style == 0)
     {
 
     if (g_tree_view_menu_style == 0)
     {
-        browser_ssprintf(&mbuf, "menuentry \"%-10s [../]\" --class=\"vtoyret\" VTOY_RET {\n  "
-                         "  echo 'return ...' \n}\n", "<--");        
+        browser_ssprintf(&mbuf, "menuentry \"%-10s [(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n  "
+                         "  echo 'return ...' \n}\n", "<--", args[0], g_menu_path_buf);        
     }
     else
     {
     }
     else
     {
-        browser_ssprintf(&mbuf, "menuentry \"[../]\" --class=\"vtoyret\" VTOY_RET {\n  "
-                         "  echo 'return ...' \n}\n");        
+        browser_ssprintf(&mbuf, "menuentry \"[(%s)%s/..]\" --class=\"vtoyret\" VTOY_RET {\n  "
+                         "  echo 'return ...' \n}\n", args[0], g_menu_path_buf);        
     }
 
     for (i = 1; i >= 0; i--)
     }
 
     for (i = 1; i >= 0; i--)
index 7e4ffc044ac29b46e0a5c7474b947906df213b98..711c3fdd4cb1584e00357822e52f8276f0123dc1 100644 (file)
@@ -2295,8 +2295,8 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
             {
                 vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
                               "menuentry \"[Return to ListView]\" --class=\"vtoyret\" VTOY_RET {\n  "
             {
                 vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
                               "menuentry \"[Return to ListView]\" --class=\"vtoyret\" VTOY_RET {\n  "
-                              "  echo '%s ...' \n"
-                              "}\n", "return");
+                              "  echo 'return ...' \n"
+                              "}\n");
             }
         }
 
             }
         }
 
@@ -2350,16 +2350,16 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
         if (g_tree_view_menu_style == 0)
         {
             vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
         if (g_tree_view_menu_style == 0)
         {
             vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
-                          "menuentry \"%-10s [../]\" --class=\"vtoyret\" VTOY_RET {\n  "
+                          "menuentry \"%-10s [%s/..]\" --class=\"vtoyret\" VTOY_RET {\n  "
                           "  echo 'return ...' \n"
                           "  echo 'return ...' \n"
-                          "}\n", "<--");
+                          "}\n", "<--", node->dir);
         }
         else
         {
             vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
         }
         else
         {
             vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, 
-                          "menuentry \"[../]\" --class=\"vtoyret\" VTOY_RET {\n  "
-                          "  echo '%s ...' \n"
-                          "}\n", "return");
+                          "menuentry \"[%s/..]\" --class=\"vtoyret\" VTOY_RET {\n  "
+                          "  echo 'return ...' \n"
+                          "}\n", node->dir);
         }
     }
 
         }
     }
 
@@ -2397,7 +2397,7 @@ static int ventoy_dynamic_tree_menu(img_iterator_node *node)
 
     if (node != &g_img_iterator_head)
     {
 
     if (node != &g_img_iterator_head)
     {
-        vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "%s", "}\n");
+        vtoy_ssprintf(g_tree_script_buf, g_tree_script_pos, "}\n");
     }
 
     node->done = 1;
     }
 
     node->done = 1;
index f57670804fbf40ed0f929b4f801026a4dd4ef64d..5f90ba7aed1232f848182129c344f0839e6ee718 100644 (file)
@@ -313,8 +313,8 @@ extern int g_ventoy_debug;
 void ventoy_debug(const char *fmt, ...);
 #define debug(fmt, args...) if (g_ventoy_debug) ventoy_debug("[VTOY]: "fmt, ##args)
 
 void ventoy_debug(const char *fmt, ...);
 #define debug(fmt, args...) if (g_ventoy_debug) ventoy_debug("[VTOY]: "fmt, ##args)
 
-#define vtoy_ssprintf(buf, pos, fmt, ...) \
-    pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, __VA_ARGS__)
+#define vtoy_ssprintf(buf, pos, fmt, args...) \
+    pos += grub_snprintf(buf + pos, VTOY_MAX_SCRIPT_BUF - pos, fmt, ##args)
 
 #define browser_ssprintf(mbuf, fmt, args...) \
     (mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
 
 #define browser_ssprintf(mbuf, fmt, args...) \
     (mbuf)->pos += grub_snprintf((mbuf)->buf + (mbuf)->pos, (mbuf)->max - (mbuf)->pos, fmt, ##args)
index 35830c26fe85cc21015411df7833abd103f7eca7..c95ca4c73b9c3b54bff0c0852ec9b3c1f5af8ade 100644 (file)
@@ -9,7 +9,7 @@ mkdir -p $VT_DIR/GRUB2/PXE
 
 make install
 
 
 make install
 
-PATH=$PATH:$VT_DIR/GRUB2/INSTALL/bin/:$VT_DIR/GRUB2/INSTALL/sbin/
+PATH=$VT_DIR/GRUB2/INSTALL/bin/:$VT_DIR/GRUB2/INSTALL/sbin/:$PATH
 
 net_modules_legacy="net tftp http"
 all_modules_legacy="file setkey date drivemap blocklist regexp newc vga_text ntldr search at_keyboard usb_keyboard  gcry_md5 hashsum gzio xzio lzopio lspci pci ext2 xfs ventoy chain read halt iso9660 linux16 test true sleep reboot echo videotest videoinfo videotest_checksum video_colors video_cirrus video_bochs vga vbe video_fb font video gettext extcmd terminal  linux minicmd help configfile tr trig boot biosdisk disk ls tar squash4 password_pbkdf2 all_video png jpeg part_gpt part_msdos fat exfat ntfs loopback gzio normal  udf gfxmenu gfxterm gfxterm_background gfxterm_menu smbios"
 
 net_modules_legacy="net tftp http"
 all_modules_legacy="file setkey date drivemap blocklist regexp newc vga_text ntldr search at_keyboard usb_keyboard  gcry_md5 hashsum gzio xzio lzopio lspci pci ext2 xfs ventoy chain read halt iso9660 linux16 test true sleep reboot echo videotest videoinfo videotest_checksum video_colors video_cirrus video_bochs vga vbe video_fb font video gettext extcmd terminal  linux minicmd help configfile tr trig boot biosdisk disk ls tar squash4 password_pbkdf2 all_video png jpeg part_gpt part_msdos fat exfat ntfs loopback gzio normal  udf gfxmenu gfxterm gfxterm_background gfxterm_menu smbios"