a1ive / nwinfo

Hardware information utility for Windows
https://a1ive.github.io/nwinfo/
The Unlicense
65 stars 12 forks source link

help #27

Closed Tnctr-altay-24 closed 11 months ago

Tnctr-altay-24 commented 11 months ago

I'm so sorry master A1ive; Please I need help at 2 points in the ventoy_browser.c code of ventoyun, can you help me please?

1st one https://github.com/ventoy/Ventoy/blob/d0e10f8e48d4550cd484a2d114ef97f8a3dacaea/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c#L203C5-L208C6

I edited this part as follows

{
    browser_ssprintf(mbuf, "menuentry \"%s\" --class=vtoydisk {\n"
        "  set browser_dir=0x%lx \n"
        "  vt_browser_dir %s,%d $browser_dir /\n"
        "}\n",
        title, disk->name, partition->number + 1, (ulong)fs);
}

2nd one https://github.com/ventoy/Ventoy/blob/d0e10f8e48d4550cd484a2d114ef97f8a3dacaea/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c#L370C9-L384C10

    {
        grub_snprintf(node->menuentry, sizeof(node->menuentry),
            "menuentry \"%-10s [%s]\" --class=vtoydir {\n"
            "  set browser_dir=0x%lx \n"
            "  vt_browser_dir %s $browser_dir \"%s/%s\"\n"
            "}\n",
            "DIR", filename, g_menu_device, (ulong)g_menu_fs, g_menu_path_buf, filename);
    }
    else
    {
        grub_snprintf(node->menuentry, sizeof(node->menuentry),
            "menuentry \"[%s]\" --class=vtoydir {\n"
            "  set browser_dir=0x%lx \n"
            "  vt_browser_dir %s $browser_dir \"%s/%s\"\n"
            "}\n",
            filename, g_menu_device, (ulong)g_menu_fs, g_menu_path_buf, filename);
    }

Is this change suitable for the code structure? If not, can you write the correct one? Please, I'm sorry I couldn't find any other way to contact you.

Tnctr-altay-24 commented 11 months ago

https://forums.ventoy.net/showthread.php?tid=2604 I opened a topic here in the ventoy forum, but I couldn't make any progress on the help.

a1ive commented 11 months ago
{
    browser_ssprintf(mbuf, "menuentry \"%s\" --class=vtoydisk {\n"
        "  set browser_dir=0x%lx \n"
        "  vt_browser_dir %s,%d $browser_dir /\n"
        "}\n",
        title, (ulong)fs, disk->name, partition->number + 1);
}
    {
        grub_snprintf(node->menuentry, sizeof(node->menuentry),
            "menuentry \"%-10s [%s]\" --class=vtoydir {\n"
            "  set browser_dir=0x%lx \n"
            "  vt_browser_dir %s $browser_dir \"%s/%s\"\n"
            "}\n",
            "DIR", filename, (ulong)g_menu_fs, g_menu_device, g_menu_path_buf, filename);
    }
    else
    {
        grub_snprintf(node->menuentry, sizeof(node->menuentry),
            "menuentry \"[%s]\" --class=vtoydir {\n"
            "  set browser_dir=0x%lx \n"
            "  vt_browser_dir %s $browser_dir \"%s/%s\"\n"
            "}\n",
            filename, (ulong)g_menu_fs, g_menu_device, g_menu_path_buf, filename);
    }

Why not use chatGPT?

Tnctr-altay-24 commented 11 months ago

Thank you very much, great master. I can't move freely because my computer is limited.

Tnctr-altay-24 commented 10 months ago

sorry @a1ive master we compiled ventoy with the code you edited but With the expression here, set browser_dir=0x%lx does not bring the value of 0x%lx to $browser_dir, please what should I do?

%s -->g_menu_device 0x%lx -->(ulong)g_menu_fs $browser_dir --> ? how should this be named %s/%s -->g_menu_path_buf

Is the match correct?

Tnctr-altay-24 commented 4 months ago

Hello respected master a1ive; Please help me with the following project. https://github.com/Tnctr-altay-24/VentoyFM/blob/5c140fb09290ac04737e9107202a0e819e3c2d36/GRUB2/MOD_SRC/grub-2.04/grub-core/ventoy/ventoy_browser.c#L179C5-L212C6

I am sharing the picture of the edit I made.

https://github.com/a1ive/nwinfo/assets/72962883/5ec9780c-4ee1-4dd6-ac73-50630f49a88f

But the edit I made doesn't work.

0x%lx value, which indicates the address path used by Ventoy in the vt_browser_dir command.

In the configuration file Filemanager.cfg

submenu "(${device}) - [${vollabel}] - [${fstype}]" $device --class=${thu} { vt_browser_dir ${2} ${bs} / }

I want to use it by writing it like this, can you please help me?