diff options
author | Leah Rowe <vimuser@noreply.codeberg.org> | 2023-05-06 21:23:08 +0000 |
---|---|---|
committer | Leah Rowe <vimuser@noreply.codeberg.org> | 2023-05-06 21:23:08 +0000 |
commit | 0729d6e600b6592e79db049576e36d1961341ea1 (patch) | |
tree | 94fa2dc794f6da0bdba0d9c67ef3d3b10a3f9703 /resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch | |
parent | f5150f26a8c310746a267ce8090ccca9d0fceaf1 (diff) | |
parent | 2e64f6397556b7e6fff8a7a305a5eaa1095acfc1 (diff) |
Merge pull request 'Add patches for bios_extract' (#49) from nic3-14159/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/49
Diffstat (limited to 'resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch')
-rw-r--r-- | resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch b/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch new file mode 100644 index 00000000..6de392be --- /dev/null +++ b/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch @@ -0,0 +1,50 @@ +From b3868ed71a390f925eb22b926b9c735f7b84b383 Mon Sep 17 00:00:00 2001 +From: Nicholas Chin <nic.c3.14@gmail.com> +Date: Sat, 6 May 2023 11:14:45 -0600 +Subject: [PATCH 3/3] dell_inspiron_1100_unpacker: Add module type 0x52 + +The module with type 0x52 in the Latitude E6400 BIOS is the EC firmware, +and is not compressed. The current behavior tries to decompress this +module leading to an index out of bounds error at runtime, so add a new +condition to avoid decompressing it. This assumes type 0x52 is always +used for EC firmware. + +The current behavior also assumes all the data before the first module +is EC firmware, which was probably true for the Inspiron 1100, but for +the E6400 the EC firmware is in module 0x52. However, for simplicity an +exception is not made for this behavior, so the extracted EC.bin should +just be treated as spurious data for the E6400. + +TEST: Inspiron 1100 BIOS is still unpacked correctly, Latitude E6400 +BIOS unpacks without runtime errors. + +Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com> +Change-Id: I3152150b7dea4d79840c61683692c65b1311cce2 +--- + dell_inspiron_1100_unpacker.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/dell_inspiron_1100_unpacker.py b/dell_inspiron_1100_unpacker.py +index 5e43813..3589550 100755 +--- a/dell_inspiron_1100_unpacker.py ++++ b/dell_inspiron_1100_unpacker.py +@@ -66,6 +66,7 @@ def dell_unpack(indata): + mod_types = { + 0x01: "Main ROM", + 0x0C: "Microcode update", ++ 0x52: "EC firmware" + } + + print("Dell/Phoenix ROM BIOS PLUS unpacker") +@@ -107,7 +108,7 @@ while True: + break + data = f[offs:offs+leng] + offs += leng +- if type_id != 0xC: ++ if type_id != 0xC and type_id != 0x52: + odata = dell_unpack(data) + else: + odata = data +-- +2.40.1 + |