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

add gentoo kernel config path search #270

Open
alexminder opened this issue Oct 1, 2024 · 5 comments
Open

add gentoo kernel config path search #270

alexminder opened this issue Oct 1, 2024 · 5 comments

Comments

@alexminder
Copy link
Contributor

Hello,
On Gentoo kernel config placed in /lib/modules/KVER/config. Can you add it for booster in to search path?

@anatol
Copy link
Owner

anatol commented Oct 2, 2024

Are you talking about kernel config file?

If yes the code is located here

if f, err := os.Open("/boot/config-" + kernelVersion); err == nil {

note that booster also falls back to /proc/config and /proc/config.gz files. Do you have it available at your machine?

@alexminder
Copy link
Contributor Author

alexminder commented Oct 2, 2024

Are you talking about kernel config file?
If yes the code is located here

if f, err := os.Open("/boot/config-" + kernelVersion); err == nil {

Yes.

I added block wich works for me:

      } else if f, err := os.Open("/lib/modules/" + kernelVersion + "/config"); err == nil {
              // Gentoo specific config path.
              debug("reading %s", f.Name())
              defer f.Close()
              r = f

note that booster also falls back to /proc/config and /proc/config.gz files. Do you have it available at your machine?

Config in /proc shows current (booted) kernel version. But if we build initramfs for new kernel version with changed kernel config, a new kernel may fail to boot. For example, root device driver was built-in , but in new config it changed to module.

@anatol
Copy link
Owner

anatol commented Oct 2, 2024

@alexminder your change looks good to me. Could you please send a PR with it?

A related item is to add Gentoo into set of tested platforms. To make that happen I need a script that creates an image with Gentoo system. Something like this one https://github.com/anatol/booster/blob/master/tests/generators/alpinelinux.sh AUR has portage package which is a good sight that creating a Gentoo image is possible.

@anatol
Copy link
Owner

anatol commented Oct 22, 2024

@alexminder the question with Gentoo testing is still open.

If you can provide me the simplest set of commands that creates a Gentoo image (similar to this script https://github.com/anatol/booster/blob/master/tests/generators/alpinelinux.sh) then I can add an integration test for Gentoo and it will help to catch problems with the disto early.

@desultory
Copy link

desultory commented Oct 22, 2024

@alexminder your change looks good to me. Could you please send a PR with it?

A related item is to add Gentoo into set of tested platforms. To make that happen I need a script that creates an image with Gentoo system. Something like this one https://github.com/anatol/booster/blob/master/tests/generators/alpinelinux.sh AUR has portage package which is a good sight that creating a Gentoo image is possible.

If you'd like to support gentoo, installkernel hooks would be very nice. https://github.com/desultory/ugrd/blob/main/hooks/installkernel/52-ugrd.install

The hook should pretty much just check that the relevant initrd_generator is set, then take the supplied kernel version and whatnot to make an image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants