Skip to content
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

Partial solution to Matter temporarily breaking on kernel upgrade. #47

Closed
mateosss opened this issue Sep 30, 2020 · 2 comments · Fixed by #63
Closed

Partial solution to Matter temporarily breaking on kernel upgrade. #47

mateosss opened this issue Sep 30, 2020 · 2 comments · Fixed by #63
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@mateosss
Copy link
Owner

When upgrading a kernel in ubuntu, apt keeps the old version of the kernel until you do a sudo apt autoremove. In this way the amount of entries in your grub increases but Matter set itself to apply the same number of icons as grub entries the user had on installation.

In particular the command (the hook) that patches grub.cfg is written at the end of /usr/sbin/grub-mkconfig with exactly the same icons the user originally specified. But if the number of entries varies, this command will just not do anything and return a warning for the user.

It would be nice to have some way of avoiding these situations in which the user stops having icons until he does a sudo apt autoremove (or equivalent in other distros). The optimal approach would be to pair the icons the user specifies to particular entries, such that when the number of entries varies Matter can recognize which entries had which icons.

For now, however, it would be enough to add a flag to the script called --relax-icons/-ri which when set, will relax the --icons/-i inputs to:

  • If the user provides less icons than entries, the remaining ones are considered "_" (underscores)
  • If the user provides more icons than entries, the extra icons are ignored.
    And then just add this flag to the hook command in grub-mkconfig.

This will at least show some icons on these situations, but most likely some of them will be in the wrong places.

@mateosss mateosss added good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed labels Sep 30, 2020
@heyzec
Copy link
Collaborator

heyzec commented Mar 31, 2021

Since matter.py needs some way to know what were the original entries and their corresponding icons, I was thinking of having a icons_config.json file that the script will save to. Would you think that is okay? Here's a sample of how that file will look like:

[["ubuntu", "menuentry \"Ubuntu 20.04\" --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f10fd0 ae-591d-4bdb-80c1-fd0328cef41e' {"], ["microsoft-windows", "menuentry \"Windows 10\" --class windows --class os $menuentry_id_option 'osprober-e fi-DC43-84C9' {"], ["folder", "submenu \"Advanced options for Ubuntu\"{"], ...]]

@mateosss
Copy link
Owner Author

I like the idea of having a config file inside the install directory. I would prefer the file to be called config.json and contain
a single JSON object with an icons entry { "icons": [...] } that way the config file could be reused for other things in the future.

So go ahead with it if you were planning on that. In general, I like to accept any contribution that enhances the project and later when I have time, improve it if it is needed. So any contributions are welcome!

heyzec added a commit to heyzec/matter that referenced this issue Apr 10, 2021
heyzec added a commit to heyzec/matter that referenced this issue Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants