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

Include standard filesystem symlinks like /lib -> /usr/lib in the image #104

Closed
ishitatsuyuki opened this issue Sep 20, 2021 · 14 comments
Closed

Comments

@ishitatsuyuki
Copy link

Kernel firmware for example requires this because it only searches /lib/firmware/. Including these is in general a good idea for compatibility.

If you put modules_force_load: amdgpu in the config you get:

Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: loading /lib/firmware/amdgpu/navi10_sos.bin failed with error -4
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: Direct firmware load for amdgpu/navi10_sos.bin failed with error -4
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: amdgpu: failed to init sos firmware
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: [drm:psp_sw_init [amdgpu]] *ERROR* Failed to load psp firmware!

and the graphics doesn't initialize. (It does boot with default config because it's loaded after rootfs is mounted.)

mkinitcpio symlinks for the reference.

@ishitatsuyuki
Copy link
Author

Actually this error message says -4 which is EINTR, it doesn't even make sense. Guess I'll need to dig deeper into this...

@ishitatsuyuki
Copy link
Author

Also #45 seems to be affected by the same issue.

@anatol
Copy link
Owner

anatol commented Sep 20, 2021

Actually this error message says -4 which is EINTR, it doesn't even make sense.

It is interesting... I do not have an AMD video card and it is hard for me to understand what is going on there. But it would be great to debug and fix this issue.

Do you use strip: true config option by the chance?

@ishitatsuyuki
Copy link
Author

Do you use strip: true config option by the chance?

I don't, I only have the modules_force_load line.

anatol added a commit that referenced this issue Sep 20, 2021
A lot of firmware binaries use non-standard paths like `/lib`. Add
standard tree of symlink for compatibility.

Closes #104
@anatol
Copy link
Owner

anatol commented Sep 20, 2021

I just pushed a commit to wip branch that recreates the same symlink tree as mkinitcpio does. Please try it and let me know if you see any difference.

anatol added a commit that referenced this issue Sep 20, 2021
A lot of firmware binaries use non-standard paths like `/lib`. Add
standard tree of symlink for compatibility.

Closes #104
@anatol
Copy link
Owner

anatol commented Sep 20, 2021

Now I would like to get to the EINTR error you see:

Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: loading /lib/firmware/amdgpu/navi10_sos.bin failed with error -4
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: Direct firmware load for amdgpu/navi10_sos.bin failed with error -4
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: amdgpu 0000:0a:00.0: amdgpu: failed to init sos firmware
Sep 20 20:57:44 ishitatsuyuki-ryzen kernel: [drm:psp_sw_init [amdgpu]] *ERROR* Failed to load psp firmware!

Are there any log entries from booster before and after these lines. Any logs that include finit word?

@anatol
Copy link
Owner

anatol commented Sep 20, 2021

I am looking at the sources of insmod here https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git/tree/shared/util.c and the only place where EINTR from kernel is handled is when module content is read from the disk.

I wonder if FINIT_MODULE kernel implementation is simply unable to read the module content in one step and returns the error back to user. I can try to come up with a patch that reads module upfront and then calls INIT_MODULE instead of FINIT_MODULE.

@anatol
Copy link
Owner

anatol commented Sep 20, 2021

Also here is a manpage for the syscall booster uses to load the modules https://linux.die.net/man/2/finit_module

anatol added a commit that referenced this issue Sep 20, 2021
A lot of firmware binaries use non-standard paths like `/lib`. Add
standard tree of symlink for compatibility.

Closes #104
@anatol
Copy link
Owner

anatol commented Sep 21, 2021

@ishitatsuyuki btw to enable booster debug logs please add booster.debug kernel parameter.

@ishitatsuyuki
Copy link
Author

With 408e628 (and the new wip branch) I'm magically able to boot. Still unsure about the -4 error code, but I think this can be considered resolve once the commit is merged to master.

@ishitatsuyuki
Copy link
Author

FWIW I don't think it's finit_module that is failing but rather just the firmware loading call. It's done entirely inside kernel space which shouldn't give EINTR. The relevant code is here.

@anatol
Copy link
Owner

anatol commented Sep 21, 2021

These are great news @ishitatsuyuki. If you have a chance could you please also check that 90dd03a (parent of 408e628) still has the problem? This way it will prove that symlinks were the root of the issue.

anatol added a commit that referenced this issue Sep 21, 2021
A lot of firmware binaries use non-standard paths like `/lib`. Add
standard tree of symlink for compatibility.

Closes #104
@ishitatsuyuki
Copy link
Author

I can confirm that 90dd03a does not work as you mentioned.

@anatol
Copy link
Owner

anatol commented Sep 21, 2021

Awesome! Thank you for the confirmation Tatsuyuki-san.

I am going to test wip changes for a week or two and if everything is OK I'll push it to master. If you have time please test it as well and let me know if you see any other issues.

anatol added a commit that referenced this issue Sep 21, 2021
A lot of firmware binaries use non-standard paths like `/lib`. Add
standard tree of symlink for compatibility.

Closes #104
@anatol anatol closed this as completed in 9527452 Sep 24, 2021
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

2 participants