-
Notifications
You must be signed in to change notification settings - Fork 38
bls: describe optional linux-appendroot key #136
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
base: main
Are you sure you want to change the base?
Conversation
The linux-appendroot key is an extension[1] to the bootloader specification implemented by barebox since 2015[2]. When set, it instructs barebox to generate a suitable root= command-line: - If global.bootm.root_dev is set to a partition known to barebox, barebox will detect the file system on it and generate the suitable root command-line argument - If global.bootm.root_dev is not set, barebox will use the file system containing the bootloader specification entries as the Linux rootfs. The former is useful in A/B setups, where bootloader spec entries are shipped as part of an immutable partition image, which is at odds with customizing the root= option according to whether the A or B system is used. The latter is especially useful for remote file systems like NFS or 9P: By placing bootloader specification entries directly into the rootfs, these file systems can be booted remotely by just pointing barebox at their remote path. Describe this key in the specification with the same boolean syntax that loader.conf is using for its boolean keys. [1]: End of https://www.barebox.org/doc/latest/user/booting-linux.html#boot-loader-specification [2]: barebox/barebox@716fdbf Signed-off-by: Ahmad Fatoum <[email protected]>
I now think it would be better to have an explicit linux-appendroot in the bootloader spec entry file. I submitted a proposal here: uapi-group/specifications#136 Signed-off-by: Ahmad Fatoum <[email protected]>
Hi, any thoughts on this? Is there a better place to discuss whether this would be an appropriate addition to the bootloader spec? Thanks! |
Isn't this already covered by the GPT generators? |
GPT generator can only fill out this role in the happy path:
In absence of any of these, having the bootloader fix up the Thanks, |
Sorry but I don't think it makes sense to add support for legacy things in new specifications, as it means everybody needs to support them to be compliant. Nobody should add support for MBR or BIOS these days, it's legacy stuff. It's of course fine to support them in your specific products/components if you wish to do so. |
I wouldn't use MBR in a new project either, but you picked out just one thing in my enumeration. To reiterate my previous point: Not everything is
As far as I know barebox is the only implementaton that implements
We are mainly using
We already do, but for the reasons listed before, I think the change is generally useful. NFS root is not an esoteric use case and neither is not having an initramfs (or having an initramfs, but with systemd only in the "real" rootfs). |
Network boot via HTTP is supported in UEFI
There's a UEFI protocol for device tree extensions
Device trees can be used with UEFI just fine and are in fact orthogonal - you might be thinking of ACPI, but that's completely different and separate. UEFI is supported on ARM too. Just use UEFI, adding support for legacy firmwares to this spec makes no sense, sorry.
Sorry, but I just don't see how this is useful. If something can be done with UEFI, just do UEFI, as that's the present and future of firmware environments. |
Thanks very much for your consideration. I disagree that UEFI has solved the issues. To elaborate:
HTTP boot does not replace NFS/9P. People use the same NFS/9P on different hosts concurrently, e.g., to reinstall cross-compiled software from a build-server and use it without reboot. HTTP boot in UEFI is not a replacement for this. Being able to just drop in Type #1 Bootloader specification entries and be able to boot them straight feels pretty in-line with the spirit of the bootloader specification?
If you mean the Device-Tree Fixup protocol, this is not a replacement for I still see much parallels between
"Just" is doing a lot of work here and I don't want to derail the discussion. Bootloader spec Type #1 can right now be used with device tree to build reliable systems that avoid many shortcomings of UEFI that are yet to be sorted out. One example: What happens when someone clones an embedded MMC and puts it on an SD-Card and boots with both inserted? Blame the user and boot whatever is not an acceptable option.
I am not thinking of ACPI.
Device Tree only boot is not a legacy on embedded ARM systems, sorry. The traditional ARM boot flow has its fair share of historical baggage, but it's a fallacy to ignore the different historical baggage with UEFI and consider it a no-brainer "upgrade" for systems that look nothing like an IBM PC.
I have detailed different ways this is useful and it's an optional key, of which there are others already. I am looking forward to get more hands-on experience with UEFI in unattended systems, but right now, using UEFI on the same systems, where bootloader spec with |
Sorry, but this really sounds like a solution in search of a problem. LIterally everything you said can be done just fine on UEFI. You can choose to ignore what the actual industry standard is, and stay tied to one of the several thousands bespoke and product-specific legacy solutions for your own use cases of course, but I am pretty sure this is the wrong place for any of this. This is not a place where to go and dump every competing and slightly different implementation that might exist in any given product at any given time. It needs to fit in the ecosystem. And if it's about firmwares/bootloaders and it's not UEFI, sorry, but it just doesn't fit. Maybe in 10 years there will be a different standard for firmwares and bootloaders, but in 2025 this is the situation. |
I agree that it can be done differently using UEFI, but it comes with shortcomings of which I have described some.
I took much of your time already but I'd very much appreciate to learn about what state-of-the-art UEFI provides to workaround the limitations I listed. While most my work is ARM with no UEFI, I have worked on x86 projects with UEFI as well and what I described pretty much applied there too to the best of my knowledge.
I understood the scope of the specification to be pragmatic about limitations. EFI variables are a staple, but yet they have reliability issues, so you do renames on the FAT1. Similarly, EFI has limitations that
It's unfortunate that our discussion took the turn of pitting UEFI against something else. To make my point clear: The issue is not limited to UEFI, it applies equally to UEFI and UEFI doesn't solve it AFAIK. If you can point out where my thoughts gone wrong or just tell me to go implement a UEFI protocol that brings the reliability guarantees Thanks again for your prompt reply to my ping and for your continued feedback. The PR either gets better with a more coherent argument in favor of it or I (and whoever reads this) can learn what should be done instead for new projects. Footnotes
|
The
linux-appendroot
key is an extension1 to the bootloader specification implemented by barebox since 20152.When set, it instructs barebox to generate a suitable
root=
command-line:If
global.bootm.root_dev
is set to a partition known to barebox, barebox will detect the file system on it and generate the suitable root command-line argumentIf
global.bootm.root_dev
is not set, barebox will use the file system containing the bootloader specification entries as the Linux rootfs.The former is useful in A/B setups, where bootloader spec entries are shipped as part of an immutable partition image, which is at odds with customizing the
root=
option according to whether the A or B system is used.The latter is especially useful for remote file systems like NFS or 9P: By placing bootloader specification entries directly into the rootfs, these file systems can be booted remotely by just pointing barebox at their remote path.
Describe this key in the specification with the same boolean syntax that loader.conf is using for its boolean keys.
Footnotes
End of https://www.barebox.org/doc/latest/user/booting-linux.html#boot-loader-specification ↩
https://github.com/barebox/barebox/commit/716fdbf18ca12feb81e26df729a5b8969e394e96 ↩