Skip to content

Commit d7e02f1

Browse files
committed
Fix integration test.
Because the builder's methods now consume it, the integration test failed. The MBI can now be produced directly by chaining them.
1 parent 848b1f8 commit d7e02f1

File tree

1 file changed

+8
-12
lines changed
  • integration-test/bins/multiboot2_chainloader/src

1 file changed

+8
-12
lines changed

integration-test/bins/multiboot2_chainloader/src/loader.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use elf_rs::{ElfFile, ProgramHeaderEntry, ProgramType};
2-
use multiboot2::builder::InformationBuilder;
32
use multiboot2::{
43
BootLoaderNameTag, CommandLineTag, MemoryArea, MemoryAreaType, MemoryMapTag, ModuleTag,
54
};
@@ -43,24 +42,21 @@ pub fn load_module(mut modules: multiboot::information::ModuleIter) -> ! {
4342
// that the basic data structures are usable.
4443

4544
// build MBI
46-
let mbi = {
47-
let mut mbi_builder: InformationBuilder = multiboot2::builder::InformationBuilder::new();
48-
mbi_builder.bootloader_name_tag(BootLoaderNameTag::new("mb2_integrationtest_chainloader"));
49-
mbi_builder.command_line_tag(CommandLineTag::new("chainloaded YEAH"));
45+
let mbi = multiboot2::builder::InformationBuilder::new()
46+
.bootloader_name_tag(BootLoaderNameTag::new("mb2_integrationtest_chainloader"))
47+
.command_line_tag(CommandLineTag::new("chainloaded YEAH"))
5048
// random non-sense memory map
51-
mbi_builder.memory_map_tag(MemoryMapTag::new(&[MemoryArea::new(
49+
.memory_map_tag(MemoryMapTag::new(&[MemoryArea::new(
5250
0,
5351
0xffffffff,
5452
MemoryAreaType::Reserved,
55-
)]));
56-
mbi_builder.add_module_tag(ModuleTag::new(
53+
)]))
54+
.add_module_tag(ModuleTag::new(
5755
elf_mod.start as u32,
5856
elf_mod.end as u32,
5957
elf_mod.string.unwrap(),
60-
));
61-
62-
mbi_builder.build()
63-
};
58+
))
59+
.build();
6460

6561
log::info!(
6662
"Handing over to ELF: {}",

0 commit comments

Comments
 (0)