Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find the flash drive in GRUB for a cat command?
#1
solved 
Hi, I'm using Ventoy for a new recovery disk at my workplace's IT department.
On the extra GRUB menu (/ventoy/ventoy_grub.cfg), I have a menu item that runs a cat command to display what software versions are used on the disk. Currently the menu item entry is programmed like this: (some parts I've pulled from Ventoy's other partition under Linux, like vtInputKey)
Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat (hd0,gpt1)/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}
This works on a majority of machines I've tested, a Microsoft Surface Pro 6, a VMware VM, and an HP envy laptop of unknown model. But on some machines, GRUB can't find the file listed. I theorize that the exFAT partition is mounted at a different path depending on the computer's configuration. 

Is there a way to figure out where the exFAT partition is mounted, so that the cat command would work every time?
Thanks.
Reply
#2
It has been noted in the document: https://www.ventoy.net/en/plugin_grubmenu.html  (Special Build-in Variable)
You can just use vtoy_iso_part variable as follows:

Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat $vtoy_iso_part/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}
Reply
#3
solved 
(04-30-2022, 12:18 AM)longpanda Wrote: It has been noted in the document: https://www.ventoy.net/en/plugin_grubmenu.html  (Special Build-in Variable)
You can just use vtoy_iso_part variable as follows:

Code:
menuentry 'Read VERSIONS.txt' --class=F5tool {
    cat $vtoy_iso_part/VERSIONS.txt
        echo -e "\nPress ENTER to exit..."
        read vtInputKey
}

Sorry for the late reply, I had forgotten about this. Thanks, this solution works perfectly Big Grin .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)