Ventoy Forums
[feature suggestion] Find files by path without setting in ventoy.json - Printable Version

+- Ventoy Forums (https://forums.ventoy.net)
+-- Forum: Ventoy General Use —— Ventoy 使用交流 (https://forums.ventoy.net/forumdisplay.php?fid=1)
+--- Forum: Ventoy Discussion Forum (https://forums.ventoy.net/forumdisplay.php?fid=2)
+--- Thread: [feature suggestion] Find files by path without setting in ventoy.json (/showthread.php?tid=2034)



[feature suggestion] Find files by path without setting in ventoy.json - calzlot - 04-09-2022

Hello!

Venty has reached a maturity that allows to look beyond function and start polishing the usability. Thank you for the hard work! I wonder why nobody did that much sooner?


Here is one suggestion. Allow me to explain the background first.
Whether we throw our files all into one directory...

Code:
/images-and-corresponding-files/
    distro1-config.cfg
    distro1-persistence.dat
    distro1.iso
    distro2-config.cfg
    distro2-persistence.dat
    distro2.iso
/ventoy/
    ventoy.json            # global settings file (distros and ventoy)

...or keep them sorted...
Code:
/configs/
    distro1-config.cfg
    distro2-config.cfg
/images/
    distro1.iso
    distro2.iso
/persistence-files/
    distro1-persistence.dat
    distro2-persistence.dat
/ventoy/
    ventoy.json            # global settings file (distros and ventoy)

...or sort by distro...

Code:
/distros/
    distro1/
        distro1-config.cfg
        distro1.iso
        distro1-persistence.dat
    distro2/
        distro2-config.cfg
        distro2.iso
        distro2-persistence.dat
/ventoy/
    ventoy.json            # global settings file (distros and ventoy)

... whenever we change a distro, we also have to
  • rename the persistence file,
  • rename the config file,
  • and edit the names of persistence and config files in the global ventoy.jason.

That can be more elegant. Here's the suggestion, consisting of two steps:

  1. Yentoy is enabled to automatically accept all files that belong to an image, if they are in the same folder with that image. That means its corresponding .dat, .cfg, .md5/.sha1/.sha256/.sha512 files.
  2. And also, all image specific settings that are now in the global ventoy.json file could go into an image-specific config file in that folder.
To keep backward compatibility, ventoy then needs to first look for corresponding files in its global ventoy.json, so every user can continue to use their current settings. Only if ventoy does not find entries there for the selected image, it then looks inside the folder of the selected image, reads the config there (if one exists), and then loads the image and the other files there.

We then could group images and files like this:

Code:
/distros/
    distro1/
        distro1-config.cfg
        distro1-persistence.dat
        distro1-v1.2.3.iso
        distro1.json    # only settings for distro1
    distro2/
        distro2-config.cfg
        distro2-persistence.dat
        distro2-v4.5.6.iso
        distro2.json    # only settings for distro2
/ventoy/
    ventoy.json            # only settings for ventoy itself

Then, if the image file is replaced, and we want the new image to keep its new name (e.g., when it contains a version number):
  • No corresponding files needs renaming. (Checksums have to be replaced anyway.)
  • No edit necessary in global ventoy.json.
  • No edit necessary in image-specific config file (if existent).
Removing an image now only requires that a directory is deleted. No editing ventoy.json necessary. (Of course, one could stay with the old way, and just leave ventoy.json untouched, if one loves the accumulating cruft. Smile )

The reasoning behind the idea is as follows.
A minor version change (e.g. v1.2.34 => 1.2.35) will rarely need a changed config (and maybe not even persistence?). For the case that it does, the ventoy documentation needs an extra sentence that alerts to unchanged .dat, .cfg, and .json in case of errors, and suggests moving them elsewhere for a test.
This will prove especially useful with images that do not change much over long times, and only add security fixes and minor changes (e.g. Clonezilla). They can use the same config for a long time, and we will not need to edit the .cfg name and ventoy.json with every minor update.



For the interested, related reading about the power of the lack of ease of use: "Beware Trivial Inconveniences"


RE: [feature suggestion] Find files by path without setting in ventoy.json - longpanda - 04-09-2022

Most of Ventoy plugins configuration can use fuzzy matching. https://www.ventoy.net/en/plugin_path_match.html
For example:
Code:
{
    "persistence": [
        {
            "image": "/distro1/distro1-v1.*.*.iso",
            "backend": "/distro1/distro1-persistence.dat"
        }
    ]
}

You can put  
distro1-v1.2.3.iso
distro1-v1.2.4.iso
distro1-v1.2.5.iso
distro1-v1.2.6.iso 
..... 
together in the same directory.