summaryrefslogtreecommitdiff
path: root/resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch
diff options
context:
space:
mode:
authorNicholas Chin <nic.c3.14@gmail.com>2023-05-06 12:16:38 -0600
committerNicholas Chin <nic.c3.14@gmail.com>2023-05-06 12:23:32 -0600
commit2e64f6397556b7e6fff8a7a305a5eaa1095acfc1 (patch)
tree94fa2dc794f6da0bdba0d9c67ef3d3b10a3f9703 /resources/bios_extract/patches/0003-dell_inspiron_1100_unpacker-Add-module-type-0x52.patch
parentf5150f26a8c310746a267ce8090ccca9d0fceaf1 (diff)
Add patches for bios_extract
This updates the dell_inspiron_1100.py script from Python 2 to 3 for better compatibility (some distros have dropped Python 2), and adds special handling so that it works with the Latitude E6400 BIOS. These have also been sent upstream, so these patches can be dropped once they are merged: https://review.coreboot.org/c/bios_extract/+/74975/ https://review.coreboot.org/c/bios_extract/+/74976/ https://review.coreboot.org/c/bios_extract/+/74977/
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.patch50
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 0000000..6de392b
--- /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
+