-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for subentry to existing Menuentry #22
Comments
Hi, the implementation of this feature is non-trivial and would require quite a bit of work, unfortunately. The generated boot stanza would have to be merged into the source boot stanza by converting it to a collection of sub-menus (flattening it, in other words) - that's the easy part. The hard part is replacing the source boot stanza at just the right position in the rEFInd configuration file with the resultant boot stanza. I suppose ANTLR does return the positions of tokens as it performs the lexical analysis of the source file expressed as a kind of offset (line and character, for example). Maybe something could be done with that. Also, this behavior would have to be configurable - that is, the user should be able to choose whether the generated boot stanzas are to be separated or merged. If you have the time and will, you could start in this source directory. It contains all the source boot stanza parsing, boot stanza generation and persistence code. When developing locally, make sure to create a virtual environment, install the dependencies and enable system site packages in your pyvenv.cfg:
because libbtrfsutil is not available on PyPI. |
Thanks for the extensive response. This indeed looks like more work than I had planned. I'll have to take a bit of time to see if it's feasible and then see if I have the time for this. Another option could be to force the user to separate the source boot stanza in a specific file so that refind-btrfs could work on this file without fearing breaking anything else. This would of course only be required when the user activates this specific option. |
How would you force the user to do so, that is perform the config file separation which you've mentioned? I don't see how that scenario can even be validated because I cannot discern whether the configured rEFInd config file is the one actually used by rEFInd itself or simply a utility config file to be used solely by refind-btrfs. |
just did some experimenting and came up with this:
Works like a charm, but is a lot of boilerplate. |
@UltraBlackLinux |
sadly already enabled for me. I think this is due to the weird configuration; I assume it wants |
Quote from that option's explanation: "If set to "true", only those sub-menus which do not override the main stanza's "loader" and "options" fields and which do not delete (i.e., set it to nothing) its "initrd" field are taken into consideration." I can't really remember why I've added those constraints in the first place. It's been some time since I've implemented them but there has to be a reason. |
sadly, it still does not work. It does not get submenus just because I created a menu with kernel selection submenus |
Hi,
First I'd like to thank you for your tool, it's really useful and saved me from rolling out my own scripts.
At the moment I have my main entry in refind as well as the one generated from the snapshots and their submenuentry.
Ideally I'd like to only have one menuentry and have the snapshots only as submenuentry of this original entry.
I'd be open to create a PR to add this. Could you help me get started with this idea and where to start in the code please?
The text was updated successfully, but these errors were encountered: