Open zmanji opened 3 years ago
Note
With the following patch:
diff --git a/src/util.h b/src/util.h
index ca6620b..d297a28 100644
--- a/src/util.h
+++ b/src/util.h
@@ -65,16 +65,12 @@ struct aligned_buffer {
static __always_inline inline
uint8_t* buffer_pos(simple_buffer_t buffer) {
- assert(buffer->buffer);
- assert(buffer->pos < buffer->allocated);
return (uint8_t*) buffer->buffer + buffer->pos;
}
static __always_inline inline
size_t buffer_len(simple_buffer_t buffer) {
- assert(buffer->buffer);
- assert(buffer->pos < buffer->length);
return buffer->length - buffer->pos;
}
diff --git a/tools/build_image.c b/tools/build_image.c
index bfc6a82..70cba94 100644
--- a/tools/build_image.c
+++ b/tools/build_image.c
@@ -465,7 +465,7 @@ int main(int argc, char* argv[]) {
largest_vma = ALIGN_VALUE(section->virtual_address + section->virtual_size, section_alignment);
largest_raw_address += section->size_of_raw_data;
filesize += section->size_of_raw_data;
- assert(filesize < mem.size);
+ assert(filesize <= mem.size);
}
if (!silent) {
I was able to successfully create a unified kernel. This kernel was discovered by systemd-boot and booted properly.
I had to remove the asserts in util.h
otherwise the stub would fail on those asserts.
On the latest Ubuntu release (20.10) I did the following:
build_image
like this:The above step fails with:
The following files are located in the attached zips for your reference:
zloaderaa64.efi.stub
vmlinux-5.13.0-19-generic
initrd.img-5.13.0-19-generic
cmdline.txt
os-release
rest.zip kernel.zip initrd.zip