Biosias / uefi-mkconfig

grub-mkconfig inspired script for automatically managing uefi entries for booting linux kernel directly without bootloader
Apache License 2.0
10 stars 3 forks source link

Missing config file #26

Closed desultory closed 1 month ago

desultory commented 2 months ago

I recently updated and I see uefi-mkconfig is no longer making entries, the installkernel hook fails.

Clearly, this is because the config file is missing, but the error does not make it clear how I should fix this, and I can't see --help info or man pages installed.

I don't need any additional cmdline parameters, just for the kernel/initramfs to be detected. Maybe there could be some way to safely ignore a missing file and install like that? I'm not sure if this would cause problems in other cases.

Nowa-Ammerlaan commented 2 months ago

What works for creating entries without a cmdline is to touch /etc/kernel/uefi-mkconfig, i.e. explicitly tell it to use no cmdline.

desultory commented 2 months ago

Does it make sense for it to work without any file at all? It would be nice if it worked with no config. Maybe warned that it was assuming no config is used since it can't find a file?

Maybe it could have a simple help message to explain usage. Is there any issue with it running with no config?

desultory commented 2 months ago

https://github.com/Biosias/uefi-mkconfig/blob/main/uefi-mkconfig#L173 I mean if this were just a warning, would that be fine? It's functionally about the same as an empty config, right? Maybe the ebuild could install a commented out template config?

Biosias commented 2 months ago

Hello @desultory ,

the reasoning behind this is that having inbuilt cmdline is not the standard. Having it done this way means a small annoyance of needing an empty file.

But for those that use the standard way it means that if for some reason the config disappears and they miss the warning it'll break their system.

desultory commented 2 months ago

Hello @desultory ,

the reasoning behind this is that having inbuilt cmdline is not the standard. Having it done this way means a small annoyance of needing an empty file.

But for those that use the standard way it means that if for some reason the config disappears and they miss the warning it'll break their system.

I mostly use this with ugrd, which internally tracks the root mount so root= or any command line args are purely optional.

If uefi-mkconfig installed a default config file with all options commented, would this cause issues?

Biosias commented 2 months ago

If uefi-mkconfig installed a default config file with all options commented, would this cause issues?

Unfortunately there is no such a thing as "default config". Here the same thing applies. If empty config is installed upon installation, people could forget tp configure it. This problem is much more relevant due to the fact that uefi-mkconfig is in majority of cases installed as dependency of installkernel so it could be overlooked.

desultory commented 2 months ago

I mean "default" in the sense that it's a commented out file that explains what could be configured, or is the file read and dumped into the cmdline?

For the use case of using ugrd, which is also likely used by installkernel, there is no need to specify a cmdline, so uefi-mkconfig (if used with ugrd) only needs to add a new efi entry for new kernels/initramfs files by name. In some cases, I think it makes sense to have an empty config here.

Biosias commented 2 months ago

Currently it is just simply read.

But I agree with you having it the way you say is better. It even is a work in progress to re-do the config file so it will allow for much more flexibility in the future.

desultory commented 2 months ago

I think that would be nice, I'm hoping there is some simple way users can just enable uefi-mkconfig and ugrd, then just have a working setup with no more steps. Having to touch a file is very minor, but the real issue I see is that from the emerge error, it's not entirely clear what a user should do to fix this.

Biosias commented 2 months ago

I'm hoping there is some simple way users can just enable uefi-mkconfig and ugrd, then just have a working setup with no more steps.

This shouldn't be a problem but currently I cannot guarantee when it will be done.

I see is that from the emerge error, it's not entirely clear what a user should do to fix this.

this is a very good point. I'll make sure it's fixed for the next release.

desultory commented 2 months ago

I'm hoping there is some simple way users can just enable uefi-mkconfig and ugrd, then just have a working setup with no more steps.

This shouldn't be a problem but currently I cannot guarantee when it will be done.

Yea, I think this could technically work if ugrd were to touch that file or something, but I would prefer to not do this blindly. I would just like it to be as easy for the user as possible.

I see is that from the emerge error, it's not entirely clear what a user should do to fix this.

this is a very good point. I'll make sure it's fixed for the next release.

Thank you, this should help a lot. I was able to figure out the solution after digging a bit, but I feel some people may give up at that point, especially if they are doing this on a fresh install without an easy way to browse the web.

Biosias commented 2 months ago

I've clarified that error message a little bit more and added link to where users can find more information https://github.com/Biosias/uefi-mkconfig/commit/57590ec9d5a311247c104008f731e803a57dbea4

I hope it is enough until the revision of config file is finished.

desultory commented 2 months ago

I've clarified that error message a little bit more and added link to where users can find more information 57590ec

I hope it is enough until the revision of config file is finished.

That is a good start, I feel a clear mention of the path would be nice, like "uefi-mkconfig not found at: $configpath"

Biosias commented 2 months ago

Hello again @desultory ! From the next release of uefi-mkconfig once #27 is merged, default configuration file will be created in case no configuration file is found.

desultory commented 2 months ago

Hello again @desultory ! From the next release of uefi-mkconfig once #27 is merged, default configuration file will be created in case no configuration file is found.

Thanks! :D this is great for my uses, this should mean I can more or less just add the use flag and everything works.

I can try to test that branch when I get the time.