-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Test T440p with Coreboot NO_GFX_INIT #1323
Comments
I can confirm I have tried with NO_GFX_INIT set with no adverse effects. For some reason, it still dosen't redraw the screen after the kexec until the deian kernel starts - not quite sure why. Here it the cbmem log (have built using coreboot 4.19, although 4.17 has the same behaviour) |
Also as a side issue regarding fine tuning the t440p kernel config, it is possible to safely remove CONFIG_DRM_AST=y (I think this was a leftover for when the kernel config was cloned from the common librem kernel - in order to make it work with their server boards - clearly not needed on the t440p) |
Definitely. I had evaluated all of the Coreboot defaults, but there were too many kernel config options to try and understand each one. Maybe we open another issue to try and come up with a process for auditing kernel config options? |
The kexec'ed OS will take over the screen only when and if i915/another fb driver initializes the display. That can be before/after plymouth. This is where igfx init from coreboot (or no ifgx_init) should create a difference. |
For example, it is known that installing Archlinux will require end users to add i915 into its initrd. Never tested archlinux with igfx on on coreboot. That is actually a good test case for this and will try. |
Thanks - I wonder whether it is that my version of debian on the HDD is fairly old (version 10 rather than 11). Perhaps older versions didn't add enough to the initramfs. I'll try and upgrade and see what happens. |
Just providing some metrics about adding NO_GFX_INIT to the t440p build. The size of the ramstage is reduced from 120925 to 99316 - so a saving in the CBFS of 21609 bytes. Clearly as the ramstage is LZMA compressed, the saving when loaded into RAM would be over twice this value. But we care mostly care about CBFS space which is the more precious commodity. I'll do some timing tests tomorrow with and without NO_GFX_INIT |
So have compared timings. Without NO_GFX_INIT (so both libgfxinit and linux kernel initialising graphics) - takes 9037ms So by setting NO_GFX_INIT, saves 248ms I have attached the cbmemc -t logs for both the builds |
I've upgraded my debian install. All works fine now - presumably my very old debian install didn't have the i915 driver in the initramfs or something. The behaviour of my T440p is the same as my X230 now from a graphics point of view when NO_GFX_INIT is set |
My main question in link to having NO_GFX_INIT set is that OSes known to offer i915+drm drivers into initramfs will boot and have graphics as early as the kexec'ed kernel taking over graphics. But for OSes not packing i915+drm, does coreboot GFX init (text/framebuffer support) permit to have a terminal on kexec'ed kernel prior of i915+drm and whn none are part of the initrd? Basically: is coreboot gfx init useful for OSes not supporting specific graphic cards directly in their initramfs? |
For me, NO_GFX_INIT not set (as it was/is currently) doesn't help at all with kernels that don't have i915-drivers. I have the same problem with Debian showing no graphics at early boot stage. This creates three problems for me:
|
@akunterkontrolle are you saying that the behavior changes with NO_IGFX or not for the 3 problems you specified above?
Last time I tested this on x230 (NO_IGFX) with manual kexec call from command line as specified there, it worked, and was confirmed by another user in need. It doesn't on latest memtest+ version? Note that it was 64 grub version. Please replicate and report under that issue, reopening it if needed. |
I would also be grateful if you could provide more information about your setup - ie what type thinkpad, what heads version and whether you have customised the configuration of heads when building. Also what version of the debian installer you have used would be helpful. I fairly regularly run the debian installer under Heads and haven't had any problems myself. I usually use installer in text mode, but the graphics mode seems to boot fine as well. I just tried on both my x220 (which has NO_IGFX set) and t430 (which by default does /not/ have NO_IGFX set). Both seem to work fine. I am currently using the installer image at - https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/debian-bookworm-DI-alpha2-amd64-netinst.iso It would be helpful if you try the exact same version of the installer as I have used, so we can try and work out what is different between our setups. |
It seems that the simple answer on what Debian bookworm works while earlier didn't is because i915 is included in initramfs as tested here #1285 (comment) |
Indeed - I think this is true. Although the reason I mentioned bookworm is that is the installer I have lying around. I have previously used bullseye (current stable) which also worked on systems both with and without NO_IGFX.
As we have eluded early versions of debian probably didn't have i915 in the initramfs - as you know, I initially struggled with my t440p as I had not realised I was trying to boot from a very old hard drive with circa 2018 version of Debian. Both with or without NO_IGFX set, this produced no graphics after the kexec until after the hard drive password had been entered and LUKS unlock had happened. So as far as I have seen not having NO_IGFX dosen't help in these cases. Presumably most (?all) the mainstream linux distros now package i915 in initramfs |
First of all sorry for not reporting back sooner.
Setup: Thinkpad T440p without dGPU (so Intel graphics only), i7-4810MQ, 16GB RAM, 128GB SSD in normal 2,5'' hard disk bay (I don't think that the last parameters have really any influence, but listed for completeness.) I did initially build heads based on that commit ed8c74e, since back then the pull request was not merged yet. I did not change any config options, so
I did try it with that bookworm-installer and my latest heads build. Still no change, the screen doesn't change after the kexec-command whether I try the normal or the graphical installer. And I do think the installer should have booted a few times despite my stability issues, since I was still able to reboot the system with Ctrl-Alt-Del - when it hangs, this normally not possible anymore. |
Definitely all very strange as we are both using identical installler/EC version, etc Can I clarify whether your machine is just intel grapgics or dual intel/nvidia? Reason I ask is that both I and rbreslow have Intel only boards I think, so not sure if a t440p with nvidia has been tried. |
Yes, indeed …
My machine is also Intel graphics only. I have updated my comment to clarify that. |
It turns out I think I was mistaken in that I don't think I have ever managed to boot the debian installer on my t440p. Have only succeeded on my x220, x230 and t430. The installed debian system does work on all the machines though. I still am struggling to work out why it dosen't work. What I know is:
On the t440p, I have tried the following permutations individually to my heads build to try and boot the debian installer (none seem to make any difference)
Whilst it sort of makes sense that the debian installer dosen't initialise graphics properly (as it lacks i915 in the initramfs), I am struggling to work out why the intel graphics t430 behaves differently (ie the installer works). The only other difference is the heads kernel version (5.10 versus 4.14). Trying a t440p build with a 4.14 kernel might be the next experiment ... All very confusing ... |
I have now tried building heads for the t440p with a 4.14 kernel (ie using the same linux config as is used on the t430). This builds fine and the debian installer works. So it must be something related to the 4.14 -> 5.10 kernel bump. From the sounds of it, there have been previous similar issues in the past with librem 13 machines - so presumably it isn't a t440p specific problem https://forums.puri.sm/t/how-to-boot-debian-installer-from-pureboot/9584 |
Huh, good thinking, I will have to try the 4.14 kernel. I tried kexec --reset-vga the other day thinking that the Debian kernel might just be unable to switch back to text mode due to lacking the i915 driver, but that didn't improve anything. I had thought that maybe the kernel was not able to display anything because we weren't providing either a VESA or GOP interface, but maybe this is wrong, I have not had a chance to dig in that direction. If it does work for me on the 4.14 kernel, it'll be interesting to see what driver the Debian kernel ends up using, so we can figure out why it is not working when Heads uses 5.10. |
@JonathonHall-Purism got a little time to figure out what librem_common 5.x kernel config is missing as compared to 4.x? Other similar problems encountered by NixOS users on i915 side. |
I intend to grab the dmesgs from the heads kernels (4.14 and 5.10) on my t440p to see if any obvious differences. Whilst I am trying both versions, is there any other information you think may be relevant for me to grab from within heads (eg are there any particular files within /sys) which might be relevant to compare? |
Comparison of oldconfig of both 4.14 and 5.10 would inform of what is missing inside of 5.10. Some insights would be about some fb related default having been dropped in the latter. |
Doesn't seem to be the case. So I created a branch which is not PR material as of now under https://github.com/tlaurion/heads/tree/add_tools_to_ease_kernel_version_bumping to add I produced with that versioned config files for linux-x230-maximized.config (shared accross xx20/xx30 but not the t440p which was based on librem_common.config without nvme support):
I then compared defconfig produced for 5.5 vs librem_common.config (defconfig for 5.5) and found nothing popping to my eyes related to framebuffers or anything that shows clear link with graphic framebuffers. |
One thing I see though as a difference that could matter when comparing librem14/t440p/x230:
|
I have further investigated linux config taking x230 linux config 4.14 as base, expended it into oldconfig format and then compared to librem under 6f7f209 (branch comparison under master...tlaurion:heads:add_tools_to_ease_kernel_version_bumping) Comments are under latest commits. Will test 5.10 converted and verified on x230-hotp-maximized to test hypothesis of similar (nothing related to FB outside of AST changes there) linux config but different iommu settings when comparing x230 with 4.14 linux kernel (now 5.x per change) to boot debian installer. @srgrint if you see this, please point to iso used (there is so many). Will download https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/debian-bookworm-DI-alpha2-amd64-netinst.iso as you referred from comment #1323 (comment) and just dd it over usb thumb drive to bypass anything related to booting iso + detached signature. |
x230-maximized master (linux 4.14 based config):
x230-maximized based on 5.10.5 kernel:
So what's up with debian netinstaller in https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/debian-bookworm-DI-alpha2-amd64-netinst.iso would need some unpacking of its initrd and looking up what is happening there. |
I usually use the debian netinst images. Usually for the stable version of debian (which at present is: https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-11.6.0-amd64-netinst.iso ). Given that Debian bookworm is so close to release though, I am currently doing some testing of the bookworm installers - hence also used the alpha2 image which you referred to above. |
Some additional progress. Reusing https://cdimage.debian.org/cdimage/bookworm_di_alpha2/amd64/iso-cd/debian-bookworm-DI-alpha2-amd64-netinst.iso with qemu boards setups. Some important output after kexec'ing into iso:
Basically, kexec-parse-boot doesn't seem to be happy with In our case for Librem/T440P 5.10 defconfig (added after 4.14 by default but not under 4.14): Might be a culprit. Testing things. |
Past comment is irrelevant. Tests and improvements in PoC just removed duplicate entries where the kernel does the right thing with what is passed from command line: if kernel option is not recognised, it is passed to user space to be interpreted there in init. |
One interesting thing, now being investigated was the absence of CONFIG_X86_SYSFB under linux configs for 5.x kernel, which was present under 4.14 but might have changed a lot since then:
|
@rbreslow @srgrint @JonathonHall-Purism @akunterkontrolle: None of the above tests were really useful, while still continuing to investigate. To make a short version of it: things constantly change in kernel. Right. Seems to Heads being thought almighty in its kexec-parse-boot (syslinux+grub config parser) is still doing "the right thing" in most cases, while non-xen/multiboot2 config fall into "elf" generic "else" case for iso+normal boot path when not using QubesOS (xen/multiboot), and that no hacks there whatsoever are passed to instruct kexec to do anything different then passing path to bzimage, initrd and command line parameters. All good, but not enough. Talking with linuxboot people made clearer a couple of things:
Anyway those are relevant traces of really important knowledge and discussion should continue over there to resolve the situation on both qemu+real hardware #1351 (comment) |
In our |
@rbreslow : I edited previous post. Rest of this discussion should happen under #1351 (comment) |
@akunterkontrolle @srgrint @rbreslow It would be awesome if you guys could confirm that adding NO_GFX_INIT added on top of #1378 fixes all your issues (even memtest elf launch) AND permit to remove libgfxinit altogether under coreboot as well. If it does, I think it might be a good time to remove libgfxinit on all boards enabling i915 kernel config. |
Sorry for not reporting back earlier. I think others have already confirmed it, but for good measurement: That pull request including NO_GFX_INIT=y does fix the issue on my t440p as well. The Debian (net)installer as well as memtest are now able to give a graphical output. Oddities / remarks:
|
Is this because you have selected the "high contrast" version (ie "dark theme") of the installer? In the boot options menu from Heads, there is a list of 37 (In bookworm RC2 netinst) boot options - including 2 "Install" options - 1 being the usual text installer and the other being "high contrast". |
For documentation purposes, in case some comes across this in the future: Yes, you are absolutely right, I choose the wrong "install" option and ended with the "high contrast" installer. If one "guesses" the right of the two install options, the normal installer will show up |
From Coreboot's
src/device/Kconfig
:@tlaurion says that the Linux kernel should be able to perform this initialization: #1282 (comment). It's possible that allowing Coreboot to initialize graphics as well is redundant/increases boot times.
The pull request should provide before and after
cbmem
timings.Waiting on #1282The text was updated successfully, but these errors were encountered: