Files
RedBear-OS/local/patches/bootloader/fix-uefi-alloc-panic.patch
vasilito 2e4c09a6b6 fix: bootloader UEFI alloc panic + pkgar staging fallback
Bootloader: alloc_zeroed_page_aligned no longer panics on OVMF
AllocatePages failure. Returns null on error.

Cookbook: pkgar falls back to repo/ dir when target pkgar missing.
Resolves KDE build chain failure.

redbear-full: builds 4.0GB image+ISO, boots without crash.
2026-05-03 14:23:54 +01:00

24 lines
599 B
Diff

--- a/src/os/uefi/mod.rs 2026-05-03 14:17:35.198125412 +0100
+++ b/src/os/uefi/mod.rs 2026-05-03 14:17:35.205312393 +0100
@@ -53,12 +53,16 @@
pages,
&mut ptr,
))
- .unwrap();
- ptr as *mut u8
+ .unwrap_or_else(|_| {
+ ptr = 0;
+ 0
+ });
+ if ptr == 0 { ptr::null_mut() } else { ptr as *mut u8 }
};
- assert!(!ptr.is_null());
- unsafe { ptr::write_bytes(ptr, 0, pages * page_size) };
+ if !ptr.is_null() {
+ unsafe { ptr::write_bytes(ptr, 0, pages * page_size) };
+ }
ptr
}