linuxboot / heads

A minimal Linux that runs as a coreboot or LinuxBoot ROM payload to provide a secure, flexible boot environment for laptops, workstations and servers.
https://osresearch.net/
GNU General Public License v2.0
1.41k stars 186 forks source link

openbsd and heads #697

Open ghost opened 4 years ago

ghost commented 4 years ago

EDIT: Can Heads kexec into BSD?


original: ping @tlaurion Has anyone every gotten OpenBSD with FDE to work with heads?

tlaurion commented 4 years ago

@0rb677 look in closed issues. I think someone did?

tlaurion commented 4 years ago

Current blocker is newer cryptsetup to support newer LUKS2 format, else I think kexec is able to boot kernel and initrd while really unsure.

Edit: really not sure!. No issue in the past sorry for having been misleading on this. It was an issue you opened and closed it because you were able to boot guix finally.

ghost commented 4 years ago

@tlaurion how to force boot full encryption disk with heads? i need modify /etc/config ? thats all? heads can't boot FDE /w boot

sda                         disk
|__sda1                  part
|______cryptroot    /
alex-nitrokey commented 4 years ago

Full disk encryption does not fit into the concept of heads.

You choose either one of these two. Changes of files in /boot are detected by heads though, so the only disadvantage of choosing heads instead of full disk encryption is minor information leakage (what kernel is in use or similiar).

ghost commented 4 years ago

Thanks @alex-nitrokey :)

FrostKnight commented 3 years ago

This actually interests me as well. I hope this will be possible in the future too. I am no huge hurry, but it would be cool to see in the future when I get my Nitropad.

tlaurion commented 3 years ago

@FrostKnight @0rb677 : OpenBSD kexec'ing from Linux possible? Answer is no.

You could have it under QubesOS though.

tlaurion commented 3 years ago

If that answers whys not, please close the issue.

FrostKnight commented 3 years ago

I don't completely understand, but then I don't really know what kexec means... maybe I should look it up. That being said, Hyperbola plans to move to HyperbolaBSD which will be based on OpenBSD but have many changes to it that are more libre. Is there anything that the Hyperbola devs could do that would make it possible to use heads to boot HyperbolaBSD?

techge commented 3 years ago

kexec is a tool to start/change into another linux kernel, thus not for windows, not for BSD or any other non-linux system. This is nothing that is going to be changed by BSD developers and probably nobody else (at least any time soon).

paulmenzel commented 3 years ago

Google Engineers Get Windows Booting When Kexec'ed Under Linux

techge commented 3 years ago

Well... not what one expects if they are talking about "booting into Windows", but nice anyway... in a way...

tlaurion commented 3 years ago

Google Engineers Get Windows Booting When Kexec'ed Under Linux

"The engineers involved have been implementing enough of the EFI Boot Services to be able to kexec Windows from Linux. "

Conference paper going into the details of implementing EFI services into Linuxboot

"LinuxBoot is a firmware for modern servers that replaces specific firmware functionality like the UEFI DXE phase with a Linux kernel and runtime."

FrostKnight commented 3 years ago

Okay, but are you aware that Hyperbola devs currently have a linux version and are switching to a bsd version derivative in say 2024 or something like that... They did that because they see a better future for security/privacy in making a liberated hard fork of OpenBSD. They used to work on Parabola GNU/Linux-Libre then they made their own linux forked version of arch with debian patches for stability and in the future they plan to do an OpenBSD hard fork... I tell you all this, because I am not sure your aware, that they are not like the devs at normal bsd derivatives.

Unless you mean this is completely impossible to do, in which case, I will shut up if you want.

Although, it might not a pressing issue in the near future, and maybe at some point I will have acquired newer hardware that won't be intel anyways. So,I apologize for wasting your time.

tlaurion commented 3 years ago

@FrostKnight searched around, and personally hve no idea how linux could kexec into a bsd kernel.

FrostKnight commented 3 years ago

I mean, I wouldnt know either, but it could be possible if the person developing the bsd, has less bsd mentality and more of say a fusion type thought process.
Curious, but is the thing that is blocking this idea on the end of heads, or the end of BSD or both? Not expecting you guys to do anything, besides hopefully reply.

I just wondered if this is something that could be fixed if the BSD developer decided to change things ever so slightly.

You said this was the issue way back, https://github.com/osresearch/heads/issues/697#issuecomment-600069051

I wondered, if that is easy to fix or if its something that is much harder then I realize.

Aka, if its a gpl rejection issue, or something more problematic.

Hyperbola devs don't have a problem with GPL or other copyleft licenses. :)

Thanks for checking around though. I appreciate it.

LiamDGray commented 3 years ago

FrostKing: Sounds like the issue is that Heads is not just a bootloader. It's not a drop-in substitute for BIOS/MBR or UEFI/GPT that another OS would expect to see. It provides a Linux-specific set of drivers and is, in fact, Linux.

On Tue, Mar 16, 2021 at 1:39 PM FrostKnight @.***> wrote:

I mean, I wouldnt know either, but it could be possible if the person developing the bsd, has less bsd mentality and more of say a fusion type thought process. Curious, but is the thing that is blocking this idea on the end of heads, or the end of BSD or both? Not expecting you guys to do anything, besides hopefully reply.

I just wondered if this is something that could be fixed if the BSD developer decided to change things ever so slightly.

You said this was the issue way back, #697 (comment) https://github.com/osresearch/heads/issues/697#issuecomment-600069051

I wondered, if that is easy to fix or if its something that is much harder then I realize.

Aka, if its a gpl rejection issue, or something more problematic.

Hyperbola devs don't have a problem with GPL or other copyleft licenses. :)

Thanks for checking around though. I appreciate it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/osresearch/heads/issues/697#issuecomment-800512402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2LGPMVQLDDJE474RS6YK3TD6QURANCNFSM4LNM3VOA .

tlaurion commented 3 years ago

@FrostKnight If kexec was modified in a way that all memory space is replaced by a BSD kernel, returning into real mode, I do not see why it couldn't be possible.

Kexec is made to put kernel into new address space and switch control to it. That kernel is expected to depend onto its initrd drivers and such to make the switch, which doesn't seem to have been fine between OSes. That would be a kexec project, on which if working, could be integrated into heads. As said previously, I'm not aware of any work happening to switch from a Linux kernel into BSD.

FrostKnight commented 3 years ago

Hmm, interesting, is there a kexec repo that I could talk to regarding this somewhere down the road?

I guess I will check...

FrostKnight commented 3 years ago

Is this related to what you mean? https://github.com/kexecboot/kexecboot

LiamDGray commented 3 years ago

@FrostKnight: Pretty sure they mean this: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel

kexec is part of the Linux kernel. When they say Heads is Linux, they are not kidding.

On Tue, Mar 16, 2021 at 7:04 PM FrostKnight @.***> wrote:

Is this related to what you mean? https://github.com/kexecboot/kexecboot

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osresearch/heads/issues/697#issuecomment-800693754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2LGPNW4AJOGPMZTJZHFRDTD7WZ5ANCNFSM4LNM3VOA .

FrostKnight commented 3 years ago

Lol, if that's the case, then nothing will change for a very, very long time if at all even. :(

Oh well, thanks for letting me know the actual truth in detail. Appreciated that I now understand the actual problem.

I very much doubt Torvaldo is the kind of person you can get to convince that making it possible to boot anything besides linux is possible. I might be wrong, but it seems very unlikely. Smh... :P ---> Me

Oh well... I will just wait for the foreseeable future to see what shows up/If I even will care by 2025. ARM and RISC-V are growing in popularity, who knows if one of those won't catch my interest by the time this laptop is no longer used for Hyperbola. And that aside, there is also osboot if I am that desperate to use HyperbolaBSD. ;)

tlaurion commented 3 years ago

@FrostKnight @LiamDGray

kexec is a tool aimed at replacing a live kernel with another, permitting to 'reboot' machines without hitting the reset button.

BSD and Linux have their kexec functions inside both of their kernel implementations.

The problem here is that those kernels are not made to be interchangeable without a lot of research and development. From my understanding, from both within the kernel kexec implementation and from the toolset that calls the loading of replacement kernel, in both space, while not having searched deeply the subject myself.

Never said it was impossible. See prior comment here.

There are projects for kexec loading BSD kernels from within BSD. The interest here being to boot BSD from Linux as of now. This is not existing. As usual if kernel people of both universes were talking on kexec space, magic could happen. Its an interesting concept, where BSD people wanting to use Heads to boot inside of BSD without using QubesOS is not CURRENTLY possible without development from those communities.

Hope this is clearer.

FrostKnight commented 3 years ago

Yeah, it is more clear, I will ask my Hyperbola buddies, much later, like 2023 or something if they can get involved in this. For now though, I don't see a big need. If that makes sense. Given that, Hyperbola's linux version will be supported till 2025 and its BSD version won't be as good as I want it to be till 2025+

Glad to know it isn't impossible though. I wonder where I can find such projects...

Either way, I will ponder this issue later.

Thanks for the info though!

tlaurion commented 3 years ago

Petitboot does it?

"Petitboot is an operating system bootloader based on Linux kexec. It can load any operating system image that supports the Linux kexec re-boot mechanism like Linux and FreeBSD. "

FrostKnight commented 3 years ago

I guess I will wait and see... for now.

tlaurion commented 2 years ago

It is possible to kexec to BSD from Linux.

FrostKnight commented 2 years ago

So it is possible to kexec to OpenBSD from heads?

tlaurion commented 2 years ago

@FrostKnight it SHOULD be possible. question is how.

FrostKnight commented 2 years ago

I wish I knew heh... I am not experienced enough with OpenBSD to do this, but I will be nearby in case, someone knows how, etc...