How to boot Debian installer from PureBoot?

Well, I poked around a bit. As it turns out, when kexec passes the display parameters to the kernel, it needs to supply a parameter called “orig_video_isVGA”. I don’t know why it’s called that, or what all the possible values mean, but at least for x86, this field should seemingly be set to either VIDEO_TYPE_EFI (0x70) or VIDEO_TYPE_VLFB (0x23). kexec tries to automatically detect the correct value, but that automatic detection doesn’t work in PureBoot.

If you apply the following patch to kexec:

--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -138,7 +138,8 @@
 		goto out;
 	if (-1 == ioctl(fd, FBIOGET_VSCREENINFO, &var))
 		goto out;
-	if (0 == strcmp(fix.id, "VESA VGA")) {
+	if (0 == strcmp(fix.id, "VESA VGA")
+	    || 0 == strcmp(fix.id, "inteldrmfb")) {
 		/* VIDEO_TYPE_VLFB */
 		real_mode->orig_video_isVGA = 0x23;
 	} else if (0 == strcmp(fix.id, "EFI VGA")) {

Then, build a static kexec binary (by running “./configure CC=‘gcc -static’ && make”) and copy it to somewhere accessible to PureBoot, you should then be able to boot the Debian installer by running:

/boot/misc/kexec -l /media/install.amd/vmlinuz --initrd /media/install.amd/initrd.gz
/boot/misc/kexec -e

I don’t know if the above patch is the best solution in general, but hopefully this should make it work correctly for Librem users at least.

7 Likes

@floppus Awesome!

I found kexec source code here: https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git

1 Like

I’ll add this patch to the next PureBoot release as it looks reasonably sane

edit: built and tested, fixed booting with Debian 10

4 Likes

Which release is this fixed in?

My Librem Mini v2 is running PureBoot-Release-17 and I can’t boot into debian-10.9.0 or debian-live-10.9.0 from USB. It scribbles some unreadable blue lines at the top of the screen and then I think the installer menu but super tiny and repeated all along the top of the screen. Connected to a 1080p monitor over HDMI.

1 Like

I think this was fixed in PureBoot beta 13, though I’m not sure now. I’m using beta 15.1 now and it’s not working for me either.

It’d be better for this issue to be addressed by the upstream kexec / kernel developers.

Hi everyone first time poster but long time viewer.

I’m aware I’m slightly digging up this thread, but I have the same issue, we’ll kind of, I had this exact same issue, until I upgraded to the latest 18.1 pureboot install 10 mins ago, due to the security announcement this morning.

I treated myself for the optional extra Qubes USB, but after a week of faffing about I decided it wasn’t for me. I’m in the process of trying to install the latest 64 bit version of Kali Linux but get the same issues as above poster.

When I use the graphical and text install I get the following screen:

I created the USB by using Rufus, with the standard default settings. The USB stick works on other devices and boots so I know that works.

I’m not sure what other information would be helpful to you, but please let me know what would be useful resolve this issue.

Thanks

1 Like

I tried with the Live USB but unfortunately whilst I was able to get the live instance to work, I wasn’t able to use Calamari or anything like that to install to the disc.

Any help on this would be amazing…! Looks like this might be one for the support desk.

it’s a problem of how debian kernel and initrd is being build.
it simply not initialise i915_drm so it’s not able to find graphics card.
i am trying to find hack how to force ity to load.

Hey, thanks Ninex if you get anywhere let me know.

I have exhausted my knowledge and expertise on this one and planning to contact Suport on Monday.

Who said privacy and security were easy right…

it’s not so simple.
looks like we will have to wait for next pureboot release
or you can just as MRChromebox to share his build , or fetch pureboot sources add kexec patch and build it on your own.

that’s wierd , because we had this patch in tree already…
it’s not being somehow applied?

download live+nonfree image
it boots on 18.1 without trouble
patrch metioned above is in 18.1 already
from that image you will able boot without troubles.

EDIT
debian-live-11.0.0-amd64-gnome+nonfree.iso
adn use graphical isntaller.
somehow console passtrough not works after kexec, but xorg will start fine and you will get desktop, and then you can run isntaller from it

Thank you for responding, but specifically I am looking to install Kali Linux 64bit ISO.

As that is Debian based also, I’m not sure how many more changes would be required.

actually taht statement will aslo not work.
if you add before this line printf("%s",fix.id);
you will get: i915drmfb
as i915drmfb != inteldrmfb this if statement will not apply

NineX your Linux expertise seems to have eclipsed mine, thanks for this.

As i’m new here Is there anyone I should be @mentioning or forwarding this bug too?

I’m really keen to get kali working on pureboot. It would be amazing If I can get this working before I head off away with work on Wednesday.

@w4key my commentary was targeted to @MrChromebox. sorry for to deep technbicals.
problem is in kexec called kernel.
there is an interesting thread about FB console handling on one of mailing lists related to heads.
probably to fix this , heads kernel need to do not have intel_drm framebuffer driver, as that driver missbyhaves.
i am trying to rebuild pureboot with changed kernel, to confirm that.
if it will fix i will PR @MrChromebox repo and hopefully it will be released.
https://www.spinics.net/lists/kexec/msg26924.html

1 Like

It’s complicated, and it’s been a few months since I looked into this. But to summarize, I have the impression that neither the DRM developers, nor the kexec developers, are interested in supporting this use case, so it will probably continue to break over time.

I haven’t tested this recently, but here’s my most recent attempt at a more robust kexec patch:

--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -151,7 +151,19 @@
 		err = get_bootparam(&real_mode->orig_video_isVGA, offset, 1);
 		if (err)
 			goto out;
+	} else if (fix.smem_start != 0
+	           && fix.smem_len != 0
+	           && fix.type == FB_TYPE_PACKED_PIXELS
+	           && fix.visual == FB_VISUAL_TRUECOLOR) {
+		/* Emulate EFI using Linux framebuffer */
+		real_mode->orig_video_isVGA = 0x70;
 	} else {
+		fprintf(stderr,
+		        "warning: unsupported framebuffer device (%.16s)\n"
+		        "    smem_start = %#lx, smem_len = %#x\n"
+		        "    type = %d, visual = %d\n",
+		        fix.id, fix.smem_start, fix.smem_len,
+		        fix.type, fix.visual);
 		real_mode->orig_video_isVGA = 0;
 		close(fd);
 		return 0;

In order for this to work, I believe you will also need to set the option CONFIG_DRM_FBDEV_LEAK_PHYS_SMEM=y in the configuration for the PureBoot kernel, and you will need to add drm_kms_helper.drm_leak_fbdev_smem=1 to the PureBoot kernel command line.

I intended to put all this together as a pull-request to Heads, but I never got around to testing it… sorry! Hope this is helpful if someone else wants to pick it up and run with it.

2 Likes

@floppus
there was suggestion to do not load intelDRM to initial kernel, so next kernel can initialise it properly.

EDIT: it will semi work… (switching off i915 drm) - kids don’t try this at home :s
it boots VGA mode, so no fb present… at all, but is capable booting other kernel with i915fb…
:S

Wow!

This is a seriously technical community thanks guys… I think as an initial work around I will just create a kali/Debian qube for the next few weeks whilst I track this.

I’m not keen on going off the beaten track as I want to have a stable device as I (will be) rely on it very heavily.

let me try to build that :wink:
Sadly that doesn’t work.

what wondering me is why debian kernel not loading i915drm ,while purism kernel does.