From d08e5eb7bcf3cfca0dd94f95b7f58dd085b3a041 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:10:10 +0200 Subject: [PATCH 1/8] clippy: apply new fixes --- multiboot2-header/Changelog.md | 17 ++-- multiboot2-header/src/end.rs | 6 ++ multiboot2/Changelog.md | 112 +++++++++++++++++--------- multiboot2/src/builder/information.rs | 6 ++ 4 files changed, 100 insertions(+), 41 deletions(-) diff --git a/multiboot2-header/Changelog.md b/multiboot2-header/Changelog.md index 0198ae21..a8d8a5d9 100644 --- a/multiboot2-header/Changelog.md +++ b/multiboot2-header/Changelog.md @@ -1,5 +1,9 @@ # CHANGELOG for crate `multiboot2-header` +## Unreleased + +- added `EndHeaderTag::default()` + ## 0.3.2 (2023-11-30) - **BREAKING** bumped `multiboot2` dependency to `v0.19.0` @@ -22,20 +26,23 @@ - **BREAKING** `HeaderBuilder::build` now returns a value of type `HeaderBytes` The old builder could produce misaligned structures. - added the optional `unstable` feature (requires nightly) - - implement `core::error::Error` for `LoadError` + - implement `core::error::Error` for `LoadError` ## 0.2.0 (2022-05-03) - **BREAKING** renamed `EntryHeaderTag` to `EntryAddressHeaderTag` -- **BREAKING** some paths changed from `multiboot2_header::header` to `multiboot2_header::builder` - -> thus, import paths are much more logically now +- **BREAKING** some paths changed from `multiboot2_header::header` + to `multiboot2_header::builder` + -> thus, import paths are much more logically now - internal code improvements ## 0.1.1 (2022-05-02) - fixed a bug that prevented the usage of the crate in `no_std` environments -- added a new default `builder`-feature to Cargo which requires the `alloc`-crate - (this feature can be disabled which will also remove the dependency to the `alloc` crate) +- added a new default `builder`-feature to Cargo which requires the `alloc` + -crate + (this feature can be disabled which will also remove the dependency to + the `alloc` crate) ## 0.1.0 (2021-10-08) diff --git a/multiboot2-header/src/end.rs b/multiboot2-header/src/end.rs index 271b1254..15f8c76f 100644 --- a/multiboot2-header/src/end.rs +++ b/multiboot2-header/src/end.rs @@ -12,6 +12,12 @@ pub struct EndHeaderTag { size: u32, } +impl Default for EndHeaderTag { + fn default() -> Self { + Self::new() + } +} + impl EndHeaderTag { pub const fn new() -> Self { EndHeaderTag { diff --git a/multiboot2/Changelog.md b/multiboot2/Changelog.md index afb2e012..aff09672 100644 --- a/multiboot2/Changelog.md +++ b/multiboot2/Changelog.md @@ -1,6 +1,11 @@ # CHANGELOG for crate `multiboot2` +## Unreleased + +- added `InformationBuilder::default()` + ## 0.19.0 (2023-09-21) + - **BREAKING** MSRV is 1.69.0 - **BREAKING** `Tag::get_dst_str_slice` renamed to `Tag::parse_slice_as_string` and now returns `Result<&str, StringError>` @@ -14,9 +19,11 @@ `add_tag` was introduced for that. ## 0.18.1 (2023-07-13) + - Documentation improvements ## 0.18.0 (2023-07-13) + - **BREAKING** The `TagTrait` was enhanced and now has an associated `ID` constant. This is only breaking to users that used `BootInformation::get_tag` or that implement custom tags. `BootInformation::get_tag` doesn't need the @@ -37,29 +44,39 @@ - Internal code cleanup. ## 0.17.0 (2023-07-12) -- **BREAKING** Make functions of `InformationBuilder` chainable. They now consume the builder. + +- **BREAKING** Make functions of `InformationBuilder` chainable. They now + consume the builder. - **BREAKING** Allow non-standard memory area types by using new pair of corresponding types: `MemoryAreaTypeId` and `MemoryAreaType`. ## 0.16.0 (2023-06-23) + - **BREAKING** renamed `MULTIBOOT2_BOOTLOADER_MAGIC` to `MAGIC` - **BREAKING** `EFIMemoryDesc` was removed and is now an alias of `uefi_raw::table::boot::MemoryDescriptor` - **BREAKING** `EFIMemoryAreaType` was removed and is now an alias of `uefi_raw::table::boot::MemoryType` - **BREAKING** MSRV is 1.68.0 -- **BREAKING** Removed `MemoryAreaIter` and `MemoryMapTag::available_memory_areas` -- **BREAKING** Renamed `BootInformation::load_base_addr` to `BootInformation::load_base_addr_tag` -- **BREAKING** Renamed `BootInformation::efi_32_ih` to `BootInformation::efi_32_ih_tag` -- **BREAKING** Renamed `BootInformation::efi_32_ih` to `BootInformation::efi_32_ih_tag` +- **BREAKING** Removed `MemoryAreaIter` + and `MemoryMapTag::available_memory_areas` +- **BREAKING** Renamed `BootInformation::load_base_addr` + to `BootInformation::load_base_addr_tag` +- **BREAKING** Renamed `BootInformation::efi_32_ih` + to `BootInformation::efi_32_ih_tag` +- **BREAKING** Renamed `BootInformation::efi_32_ih` + to `BootInformation::efi_32_ih_tag` - **BREAKING** Renamed `ImageLoadPhysAddr` to `ImageLoadPhysAddrTag` - **BREAKING** Renamed `EFIImageHandle32` to `EFIImageHandle32Tag` - **BREAKING** Renamed `EFIImageHandle64` to `EFIImageHandle64Tag` - **BREAKING** Renamed `EFISdt32` to `EFISdt32Tag` - **BREAKING** Renamed `EFISdt64` to `EFISdt64Tag` -- **BREAKING** Renamed `EFIBootServicesNotExited` to `EFIBootServicesNotExitedTag` -- **BREAKING** Renamed `CommandLineTag::command_line` renamed to `CommandLineTag::cmdline` -- **\[Might be\] BREAKING** Added `TagTrait` trait which enables to use DSTs as multiboot2 tags. This is +- **BREAKING** Renamed `EFIBootServicesNotExited` + to `EFIBootServicesNotExitedTag` +- **BREAKING** Renamed `CommandLineTag::command_line` renamed + to `CommandLineTag::cmdline` +- **\[Might be\] BREAKING** Added `TagTrait` trait which enables to use DSTs as + multiboot2 tags. This is mostly relevant for the command line tag, the modules tag, and the bootloader name tag. However, this might also be relevant for users of custom multiboot2 tags that use DSTs as types. See the example provided in the doc of the @@ -72,6 +89,7 @@ - added `MemoryMapTag::entry_size` and `MemoryMapTag::entry_version` ## 0.15.1 (2023-03-18) + - **BREAKING** `MemoryMapTag::all_memory_areas()` was renamed to `memory_areas` and now returns `MemoryAreaIter` instead of `impl Iterator`. Experience showed that its better to @@ -86,14 +104,16 @@ - fix: prevent a possible panic in `ElfSection::section_type()` ## 0.15.0 (2023-03-17) + - **BREAKING** MSRV is 1.56.1 - **BREAKING** fixed lifetime issues: `VBEInfoTag` is no longer `&static` - **BREAKING:** `TagType` is now split into `TagTypeId` and `TagType` - - `TagTypeId` is a binary-compatible form of a Multiboot2 tag id - - `TagType` is a higher-level abstraction for either specified or custom tags - but not ABI compatible. - - There exists a seamless integration between `u32`, `TagType`, and - `TagTypeId` via `From` and `PartialEq`-implementations. + - `TagTypeId` is a binary-compatible form of a Multiboot2 tag id + - `TagType` is a higher-level abstraction for either specified or custom + tags + but not ABI compatible. + - There exists a seamless integration between `u32`, `TagType`, and + `TagTypeId` via `From` and `PartialEq`-implementations. - fixed another internal lifetime issue - `BootInformation::framebuffer_tag()` now returns `Option>` instead of @@ -106,6 +126,7 @@ from. ## 0.14.2 (2023-03-17) + - documentation fixes - `MbiLoadError` now implements `Display` - Added the `unstable` feature, which enables nightly-only functionality. @@ -113,53 +134,67 @@ be used with `anyhow::Result` for example. ## 0.14.1 (2023-03-09) -- fixed the calculation of the last area of the memory map tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119)) - (Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag) + +- fixed the calculation of the last area of the memory map + tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119)) + (Previously, iterating the EFI Memory map resulted in a superfluous entry as + it ran over the next tag) ## 0.14.0 (2022-06-30) + - **BREAKING CHANGES** \ - This version includes a few small breaking changes that brings more safety when parsing strings from the + This version includes a few small breaking changes that brings more safety + when parsing strings from the multiboot information structure. - - `BootLoaderNameTag::name` now returns a Result instead of just the value - - `CommandLineTag::command_line` now returns a Result instead of just the value - - `ModuleTag::cmdline` now returns a Result instead of just the value - - `RsdpV1Tag::signature` now returns a Result instead of an Option - - `RsdpV1Tag::oem_id` now returns a Result instead of an Option - - `RsdpV2Tag::signature` now returns a Result instead of an Option - - `RsdpV2Tag::oem_id` now returns a Result instead of an Option + - `BootLoaderNameTag::name` now returns a Result instead of just the value + - `CommandLineTag::command_line` now returns a Result instead of just the + value + - `ModuleTag::cmdline` now returns a Result instead of just the value + - `RsdpV1Tag::signature` now returns a Result instead of an Option + - `RsdpV1Tag::oem_id` now returns a Result instead of an Option + - `RsdpV2Tag::signature` now returns a Result instead of an Option + - `RsdpV2Tag::oem_id` now returns a Result instead of an Option - internal code improvements ## 0.13.3 (2022-06-03) + - impl `Send` for `BootInformation` ## 0.13.2 (2022-05-02) + - `TagType` now implements `Ord` so that it can be used in `BTreeSet` -- small internal improvements and restructuring of the code (no breaking changes to public API) +- small internal improvements and restructuring of the code (no breaking changes + to public API) ## 0.13.1 (2022-01-09) + - minor fix ## 0.13.0 (**yanked**) + - added missing getters for tag `ImageLoadPhysAddr` - added missing getters for tags `EFIImageHandle32` and `EFIImageHandle64` ## 0.12.2 (2021-10-02) + - `TagType` now implements `Eq` and `Hash` - internal improvements - - `std` can be used in tests; the crate is still `no_std` - - this implies that `cargo test` doesn't work on "non-standard" targets - - CI (Ubuntu) still works. - - code formatting/style - - sensible style checks as optional CI job - - `.editorconfig` file - - prepared co-existence of crates `multiboot2` and `multiboot2-header` - in a Cargo workspace inside the same repository + - `std` can be used in tests; the crate is still `no_std` + - this implies that `cargo test` doesn't work on "non-standard" targets + - CI (Ubuntu) still works. + - code formatting/style + - sensible style checks as optional CI job + - `.editorconfig` file + - prepared co-existence of crates `multiboot2` and `multiboot2-header` + in a Cargo workspace inside the same repository ## 0.12.1 (2021-08-11) + - `TagType`-enum introduced in `v0.11` is now actually public - internal code improvements ## 0.12.0 (2021-08-06) + - **breaking:** `load()` and `load_with_offset` now returns a result - added public constant `MULTIBOOT2_BOOTLOADER_MAGIC` - Rust edition 2018 (instead of 2015) @@ -167,21 +202,26 @@ ## 0.11.0 (2021-07-07) -- **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`) return `impl Iterator` instead of a concrete type +- **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`) + return `impl Iterator` instead of a concrete type - lib now contains `TagType`-enum that contains all possible mbi tags that are specified (taken from spec) - much improved debug-formatting of `BootInformation` - internal code improvements / formatting ## 0.10.0 (2020-11-03) + - allow access to all memory regions (MemoryMap-Tag) - internal code improvements ## 0.9.0 (2020-07-06) -- Add a `checksum_is_valid` method to the RSDP tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64)) +- Add a `checksum_is_valid` method to the RSDP + tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64)) ## 0.8.2 (2022-03-02) -- Add some basic documentation ([#62](https://github.com/rust-osdev/multiboot2/pull/62)) -- Add MemoryAreaType, to allow users to access memory area types in a type-safe way ([#61](https://github.com/rust-osdev/multiboot2/pull/61)) +- Add some basic + documentation ([#62](https://github.com/rust-osdev/multiboot2/pull/62)) +- Add MemoryAreaType, to allow users to access memory area types in a type-safe + way ([#61](https://github.com/rust-osdev/multiboot2/pull/61)) diff --git a/multiboot2/src/builder/information.rs b/multiboot2/src/builder/information.rs index 7b6fe990..11616e31 100644 --- a/multiboot2/src/builder/information.rs +++ b/multiboot2/src/builder/information.rs @@ -64,6 +64,12 @@ impl core::error::Error for RedundantTagError {} #[derive(Debug, PartialEq, Eq)] pub struct InformationBuilder(Vec<(TagType, SerializedTag)>); +impl Default for InformationBuilder { + fn default() -> Self { + Self::new() + } +} + impl InformationBuilder { /// Creates a new builder. pub const fn new() -> Self { From d0fe1eff563c735c48fe89656fa3b55c893a4f76 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:16:17 +0200 Subject: [PATCH 2/8] clippy: apply new fixes + MSRV fix --- multiboot2-header/Cargo.toml | 2 +- multiboot2-header/Changelog.md | 3 ++- multiboot2-header/src/header.rs | 1 - multiboot2/Cargo.toml | 2 +- multiboot2/Changelog.md | 1 + multiboot2/src/builder/information.rs | 1 + multiboot2/src/efi.rs | 1 - multiboot2/src/image_load_addr.rs | 2 +- multiboot2/src/memory_map.rs | 1 - multiboot2/src/rsdp.rs | 4 ++-- 10 files changed, 9 insertions(+), 9 deletions(-) diff --git a/multiboot2-header/Cargo.toml b/multiboot2-header/Cargo.toml index eefdcb68..30a4b77c 100644 --- a/multiboot2-header/Cargo.toml +++ b/multiboot2-header/Cargo.toml @@ -26,7 +26,7 @@ readme = "README.md" homepage = "https://github.com/rust-osdev/multiboot2-header" repository = "https://github.com/rust-osdev/multiboot2" documentation = "https://docs.rs/multiboot2-header" -rust-version = "1.68" +rust-version = "1.69" [[example]] name = "minimal" diff --git a/multiboot2-header/Changelog.md b/multiboot2-header/Changelog.md index a8d8a5d9..91d5bc18 100644 --- a/multiboot2-header/Changelog.md +++ b/multiboot2-header/Changelog.md @@ -3,6 +3,7 @@ ## Unreleased - added `EndHeaderTag::default()` +- MSRV is 1.69 ## 0.3.2 (2023-11-30) @@ -17,7 +18,7 @@ ## 0.3.0 (2023-06-23) -- **BREAKING** MSRV is 1.68.0 +- **BREAKING** MSRV is 1.68.0 (UPDATE: This is actually 1.69.) - **BREAKING** renamed the `std` feature to `alloc` - **BREAKING** bumped `multiboot2` dependency to `v0.16.0` - **BREAKING** renamed `MULTIBOOT2_HEADER_MAGIC` to `MAGIC` diff --git a/multiboot2-header/src/header.rs b/multiboot2-header/src/header.rs index bff62778..cb256f92 100644 --- a/multiboot2-header/src/header.rs +++ b/multiboot2-header/src/header.rs @@ -4,7 +4,6 @@ use crate::{ HeaderTag, HeaderTagISA, HeaderTagType, InformationRequestHeaderTag, ModuleAlignHeaderTag, RelocatableHeaderTag, }; -use core::convert::TryInto; use core::fmt::{Debug, Formatter}; use core::mem::size_of; diff --git a/multiboot2/Cargo.toml b/multiboot2/Cargo.toml index 3a31f84b..2ff96114 100644 --- a/multiboot2/Cargo.toml +++ b/multiboot2/Cargo.toml @@ -31,7 +31,7 @@ readme = "README.md" homepage = "https://github.com/rust-osdev/multiboot2" repository = "https://github.com/rust-osdev/multiboot2" documentation = "https://docs.rs/multiboot2" -rust-version = "1.68" +rust-version = "1.69" [features] default = ["builder"] diff --git a/multiboot2/Changelog.md b/multiboot2/Changelog.md index aff09672..4eb240ff 100644 --- a/multiboot2/Changelog.md +++ b/multiboot2/Changelog.md @@ -3,6 +3,7 @@ ## Unreleased - added `InformationBuilder::default()` +- MSRV is 1.69 ## 0.19.0 (2023-09-21) diff --git a/multiboot2/src/builder/information.rs b/multiboot2/src/builder/information.rs index 11616e31..700072cd 100644 --- a/multiboot2/src/builder/information.rs +++ b/multiboot2/src/builder/information.rs @@ -47,6 +47,7 @@ type SerializedTag = Vec; /// Error that indicates a tag was added multiple times that is not allowed to /// be there multiple times. #[derive(Debug)] +#[allow(unused)] pub struct RedundantTagError(TagType); impl Display for RedundantTagError { diff --git a/multiboot2/src/efi.rs b/multiboot2/src/efi.rs index a80325ca..230b1bd8 100644 --- a/multiboot2/src/efi.rs +++ b/multiboot2/src/efi.rs @@ -8,7 +8,6 @@ use crate::TagTypeId; use crate::{Tag, TagTrait, TagType}; -use core::convert::TryInto; use core::mem::size_of; /// EFI system table in 32 bit mode tag. diff --git a/multiboot2/src/image_load_addr.rs b/multiboot2/src/image_load_addr.rs index efb1b49e..fbc6645d 100644 --- a/multiboot2/src/image_load_addr.rs +++ b/multiboot2/src/image_load_addr.rs @@ -2,7 +2,7 @@ use crate::{Tag, TagTrait, TagType, TagTypeId}; #[cfg(feature = "builder")] -use {core::convert::TryInto, core::mem::size_of}; +use core::mem::size_of; /// The physical load address tag. Typically, this is only available if the /// binary was relocated, for example if the relocatable header tag was diff --git a/multiboot2/src/memory_map.rs b/multiboot2/src/memory_map.rs index c502551e..a5197ec5 100644 --- a/multiboot2/src/memory_map.rs +++ b/multiboot2/src/memory_map.rs @@ -5,7 +5,6 @@ pub use uefi_raw::table::boot::MemoryDescriptor as EFIMemoryDesc; pub use uefi_raw::table::boot::MemoryType as EFIMemoryAreaType; use crate::{Tag, TagTrait, TagType, TagTypeId}; -use core::convert::TryInto; use core::fmt::{Debug, Formatter}; use core::marker::PhantomData; use core::mem; diff --git a/multiboot2/src/rsdp.rs b/multiboot2/src/rsdp.rs index 12a5b723..d8526157 100644 --- a/multiboot2/src/rsdp.rs +++ b/multiboot2/src/rsdp.rs @@ -13,11 +13,11 @@ //! use crate::{Tag, TagTrait, TagType, TagTypeId}; +#[cfg(feature = "builder")] +use core::mem::size_of; use core::slice; use core::str; use core::str::Utf8Error; -#[cfg(feature = "builder")] -use {core::convert::TryInto, core::mem::size_of}; const RSDPV1_LENGTH: usize = 20; From cc685d44997d47fc02e26db1abb7d737df7afdb5 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:19:40 +0200 Subject: [PATCH 3/8] cargo: update --- Cargo.lock | 16 ++++++++-------- multiboot2/Cargo.toml | 6 +++++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 962bcb24..b02ea0fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "derive_more" @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "multiboot2" @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -75,9 +75,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] diff --git a/multiboot2/Cargo.toml b/multiboot2/Cargo.toml index 2ff96114..5305cd61 100644 --- a/multiboot2/Cargo.toml +++ b/multiboot2/Cargo.toml @@ -45,7 +45,11 @@ bitflags.workspace = true derive_more.workspace = true log.workspace = true -uefi-raw = { version = "0.3", default-features = false } +# We only use a very basic type definition from this crate. To prevent MSRV +# bumps from uefi-raw, I restrict this here. Upstream users are likely to have +# two versions of this library in it, which is no problem, as we only use the +# type definition. +uefi-raw = { version = "=0.3", default-features = false } ptr_meta = { version = "0.2", default-features = false } [package.metadata.docs.rs] From 7a0d6a2e197033b8bc1943b26cd8c7b22956af99 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:19:53 +0200 Subject: [PATCH 4/8] niv: update nixpkgs --- integration-test/nix/sources.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/integration-test/nix/sources.json b/integration-test/nix/sources.json index f5049a96..51da70ed 100644 --- a/integration-test/nix/sources.json +++ b/integration-test/nix/sources.json @@ -1,14 +1,14 @@ { "nixpkgs": { - "branch": "nixos-23.05", + "branch": "nixos-23.11", "description": "Nix Packages collection", "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad157fe26e74211e7dde0456cb3fd9ab78b6e552", - "sha256": "0l5gimzlbzq1svw48p4h3wf24ry21icl9198jk5x4xqvs6k2gffx", + "rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659", + "sha256": "065jy7qivlbdqmbvd7r9h97b23f21axmc4r7sqmq2h0j82rmymxv", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/ad157fe26e74211e7dde0456cb3fd9ab78b6e552.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/219951b495fc2eac67b1456824cc1ec1fd2ee659.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } } From 40bb2ea5c39882f1396b69dd30cb8fd8144dc9c2 Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:35:10 +0200 Subject: [PATCH 5/8] integration-test: script with more verbosity --- integration-test/tests/multiboot2/build_img.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-test/tests/multiboot2/build_img.sh b/integration-test/tests/multiboot2/build_img.sh index ff528557..026e80cf 100755 --- a/integration-test/tests/multiboot2/build_img.sh +++ b/integration-test/tests/multiboot2/build_img.sh @@ -25,4 +25,5 @@ cp grub.cfg .vol/boot/grub cp "$MULTIBOOT2_PAYLOAD_PATH" .vol # Create a GRUB image with the files in ".vol" being embedded. -grub-mkrescue -o "grub_boot.img" ".vol" 2>/dev/null +echo "Creating bootable image..." +grub-mkrescue -o "grub_boot.img" ".vol" From 9f01fc216db7f5b9da5912fb415900edf0fba6ff Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:35:26 +0200 Subject: [PATCH 6/8] integration-test: fix compiler warning --- .../bins/multiboot2_chainloader/src/multiboot.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration-test/bins/multiboot2_chainloader/src/multiboot.rs b/integration-test/bins/multiboot2_chainloader/src/multiboot.rs index 31aa0052..0a0bd5f6 100644 --- a/integration-test/bins/multiboot2_chainloader/src/multiboot.rs +++ b/integration-test/bins/multiboot2_chainloader/src/multiboot.rs @@ -1,9 +1,8 @@ //! Parsing the Multiboot information. Glue code for the [`multiboot`] code. use anyhow::anyhow; +use core::ptr::addr_of_mut; use core::slice; -pub use multiboot::information::ModuleIter; -pub use multiboot::information::Multiboot as Mbi; use multiboot::information::{MemoryManagement, Multiboot, PAddr, SIGNATURE_EAX}; static mut MEMORY_MANAGEMENT: Mem = Mem; @@ -14,7 +13,8 @@ pub fn get_mbi<'a>(magic: u32, ptr: u32) -> anyhow::Result Date: Tue, 2 Apr 2024 13:35:49 +0200 Subject: [PATCH 7/8] integration-test: make more resilient against different GRUB versions --- integration-test/bins/multiboot2_payload/src/verify/grub.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-test/bins/multiboot2_payload/src/verify/grub.rs b/integration-test/bins/multiboot2_payload/src/verify/grub.rs index df71c93d..9954e835 100644 --- a/integration-test/bins/multiboot2_payload/src/verify/grub.rs +++ b/integration-test/bins/multiboot2_payload/src/verify/grub.rs @@ -23,7 +23,7 @@ fn basic_sanity_checks(mbi: &BootInformation) -> anyhow::Result<()> { .map_err(anyhow::Error::msg)? .cmdline() .map_err(anyhow::Error::msg)?; - assert_eq!(bootloader_name, "GRUB 2.06"); + assert!(bootloader_name.starts_with("GRUB 2.")); assert_eq!(cmdline, "some commandline arguments"); Ok(()) From 7a7ac8dd3113194a099ab104f3fc1f86d5e5503b Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Tue, 2 Apr 2024 13:37:19 +0200 Subject: [PATCH 8/8] integration-test: update rust toolchain The data-layout string is necessary because of https://github.com/rust-lang/rust/commit/8b199222cc92667cd0e57595ad435cd0a7526af8 --- integration-test/bins/rust-toolchain.toml | 2 +- integration-test/bins/x86-unknown-none.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-test/bins/rust-toolchain.toml b/integration-test/bins/rust-toolchain.toml index 0aa1490d..6cd890fc 100644 --- a/integration-test/bins/rust-toolchain.toml +++ b/integration-test/bins/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2023-06-22" +channel = "nightly-2024-03-31" # rustc 1.79-nightly profile = "default" components = [ "rust-src", diff --git a/integration-test/bins/x86-unknown-none.json b/integration-test/bins/x86-unknown-none.json index 3e5359f6..7b294d42 100644 --- a/integration-test/bins/x86-unknown-none.json +++ b/integration-test/bins/x86-unknown-none.json @@ -1,6 +1,6 @@ { "llvm-target": "i686-unknown-none", - "data-layout": "e-m:e-i32:32-f80:128-n8:16:32-S128-p:32:32", + "data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128", "arch": "x86", "target-endian": "little", "target-pointer-width": "32",