bootloader icon indicating copy to clipboard operation
bootloader copied to clipboard

Docs on how to use UEFI feature

Open Andy-Python-Programmer opened this issue 4 years ago • 8 comments

Currently if I run my os:

[dependencies.bootloader]
version = "0.10.0"
features = ["binary", "uefi_bin"]

I get:

   Compiling bootloader v0.10.0
error: failed to run custom build command for `bootloader v0.10.0`

Caused by:
  process didn't exit successfully: `H:\Andy\Rust\aero\target\debug\build\bootloader-2cdadb50cdaed247\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'The UEFI bootloader must be compiled for the `x86_64-unknown-uefi` target.', C:\Users\user\.cargo\registry\src\github.com-1ecc6299db9ec823\bootloader-0.10.0\build.rs:41:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Which is kindof obvious but until bootimage get support for it?

Andy-Python-Programmer avatar Apr 07 '21 07:04 Andy-Python-Programmer

Also some docs on windows user how to get OVMF.fd without WSL if thats possible will be great :)

Andy-Python-Programmer avatar Apr 07 '21 08:04 Andy-Python-Programmer

See https://docs.rs/bootloader/0.10.1/bootloader/ for some instructions on how to create the bootable disk images. The idea is that you create your own "boot" crate instead of using bootimage. Unfortunately there is no example project yet, but I'm working on an step-by-step explanation here.

phil-opp avatar Apr 07 '21 08:04 phil-opp

All good! I will check it out thanks!

Andy-Python-Programmer avatar Apr 07 '21 08:04 Andy-Python-Programmer

Also some docs on windows user how to get OVMF.fd without WSL if thats possible will be great :)

Absolutely, thanks for the suggestion! I'm still figuring out the best way to do this, but it seems like downloading a precompiled version is the easiest solution. The question is where from... For now, I think you should be able to use the precompiled versions of the pebble project.

phil-opp avatar Apr 07 '21 08:04 phil-opp

Thanks!

Andy-Python-Programmer avatar Apr 07 '21 08:04 Andy-Python-Programmer

@phil-opp is there a flag for the bootloader to only build UEFI, or better, only the boot-uefi-<kernel>.efi file? I do not need the other files, and they waste time so to speak.

georglauterbach avatar Feb 03 '22 17:02 georglauterbach

I think that would just be using cargo build instead of running the binary that creates a disk image I think. For example something like https://github.com/rust-osdev/bootloader/blob/06381af626db364a08abc17160daed360c2d8cac/examples/basic/.cargo/config.toml#L5

bjorn3 avatar Feb 03 '22 18:02 bjorn3

Thanks for your response. I found the flag I need - it was --firmware uefi when invoking the builder command to just build UEFI related files :)

georglauterbach avatar Feb 03 '22 21:02 georglauterbach