Stop using the *.FL2.slice files - replace them with mcopy.

Note that this has the disadvantage that the resulting patched ISO images
are no longer easily diffable - the sectors used to store the patched
firmware will be changed by the mcopy program.

Since it turns out that the ISO image diff files were basically never
used, this is not a big issue - it mainly makes it harder to do QA on
the output.
pull/28/head
Hamish Coleman 7 years ago
parent 47b3a6a1b2
commit bd80d6bc6b

@ -36,13 +36,13 @@ r0iuj09wd.iso.orig 21b3abf69b9ee7ecf12fe0880564312122b1ff75 x270 BIOS 1.16 (R0IE
# The firmware files from inside the ISO images
t430.G1HT34WW.s01D2000.FL2.orig FIXME t430 EC 1.12 Flash File (unpatched)
t430.G1HT35WW.s01D2000.FL2.orig FIXME t430 EC 1.13 Flash File (unpatched)
t430s.G7HT39WW.s01D8000.FL2.orig FIXME t430s EC 1.15 Flash File (unpatched)
t530.G4HT39WW.s01D5100.FL2.orig FIXME t530 EC 1.13 Flash File (unpatched)
w530.G4HT39WW.s01D5200.FL2.orig FIXME w530 EC 1.13 Flash File (unpatched)
t430.G1HT35WW.s01D2000.FL2.orig 617a85d1a4df92ef1171369d6c8a168b8e864e87 t430 EC 1.13 Flash File (unpatched)
t430s.G7HT39WW.s01D8000.FL2.orig c0b5b12c3ad63c6acc752cbf77f05f43df7d2502 t430s EC 1.15 Flash File (unpatched)
t530.G4HT39WW.s01D5100.FL2.orig 071099bcad69b0f54448ab93b4edd0f7ed214d8a t530 EC 1.13 Flash File (unpatched)
w530.G4HT39WW.s01D5200.FL2.orig 071099bcad69b0f54448ab93b4edd0f7ed214d8a w530 EC 1.13 Flash File (unpatched)
x220.8DHT34WW.s01CB000.FL2.orig 770588d03c2dcccc833ef911f6247519cfbd6701 x220 EC 1.24 Flash File (unpatched)
x230.G2HT35WW.s01D3000.FL2.orig 55d419655d849334feb535c51a62795153e6af7f x230 EC 1.14 Flash File (unpatched)
x230t.GCHT25WW.s01DA000.FL2.orig FIXME x230t EC 1.14 Flash File (unpatched)
x230t.GCHT25WW.s01DA000.FL2.orig 854d2b6a75060b9c8257cffc72f101e0b98e205b x230t EC 1.14 Flash File (unpatched)
x250.N10HT17W.s01E5000.FL2.orig 0732e80cddd0efcca9ba72dcfbdd0110d3c29dae x250 EC 1.16 Flash File (unpatched)
x260.R02HT29W.s0AR0200.FL2.orig 35a9b0d623fea82a440aae816a91da2cb18f6801 x260 EC 1.11 Flash File (unpatched)
@ -57,4 +57,3 @@ x230.G2HT35WW.img.orig d70f5434ef316a66a6195651d9e231e84a2464a1 x230 EC 1.14
x230t.GCHT25WW.img.orig d9db308756a6a82ff83ee8e3eae930b5ff550e28 x230t EC 1.14 (decrypted)
x250.N10HT17W.img.enc.orig FIXME x250 EC 1.16 (encrypted)
x260.R02HT29W.img.orig FIXME x260 EC 1.11 (not encrypted)

@ -299,7 +299,16 @@ endef
# $1 = FL2 filename
# $2 = ISO image
define rule_iso
$(2): $(1) $(2).bat ; ./scripts/slice.insert $(1).slice $(1) $(2) && sed -i "s/__BUILT/`sha1sum $(1)`/" $(2).bat && mcopy -m -o -i $(2)@@$(FAT_OFFSET) $(2).bat ::AUTOEXEC.BAT && mdel -i $(2)@@$(FAT_OFFSET) ::EFI/Boot/BootX64.efi
$(2): $(1) $(2).bat ; cp --reflink=auto $(2).orig $(2) && ./scripts/copyFL2 to_iso $(2) $(1) && sed -i "s/__BUILT/`sha1sum $(1)`/" $(2).bat && mcopy -m -o -i $(2)@@$(FAT_OFFSET) $(2).bat ::AUTOEXEC.BAT && mdel -i $(2)@@$(FAT_OFFSET) ::EFI/Boot/BootX64.efi
endef
# Extract the FL2 file from an ISO image
# Note that the parameters here are essentially the same as rule_iso, but you cannot
# define two targets with one define..
# $1 = FL2 filename basename
# $2 = ISO image basename
define rule_fl2_extract
$(1).orig: $(2).orig ; ./scripts/copyFL2 from_iso $(2).orig $(1).orig && ./scripts/checksum --rm_on_fail $(2).orig
endef
#
@ -325,3 +334,10 @@ $(call rule_iso,w530.G4HT39WW.s01D5200.FL2,g5uj28us.iso)
$(call rule_iso,t430s.G7HT39WW.s01D8000.FL2,g7uj19us.iso)
$(call rule_iso,x230t.GCHT25WW.s01DA000.FL2,gcuj24us.iso)
$(call rule_fl2_extract,t430.G1HT35WW.s01D2000.FL2,g1uj40us.iso)
$(call rule_fl2_extract,t430.G1HT34WW.s01D2000.FL2,g1uj25us.iso)
$(call rule_fl2_extract,x230.G2HT35WW.s01D3000.FL2,g2uj25us.iso)
$(call rule_fl2_extract,t530.G4HT39WW.s01D5100.FL2,g4uj30us.iso)
$(call rule_fl2_extract,w530.G4HT39WW.s01D5200.FL2,g5uj28us.iso)
$(call rule_fl2_extract,t430s.G7HT39WW.s01D8000.FL2,g7uj19us.iso)
$(call rule_fl2_extract,x230t.GCHT25WW.s01DA000.FL2,gcuj24us.iso)

@ -0,0 +1,61 @@
#!/bin/sh
#
# Deal with copying the FL2 file from and to the ISO image
#
# All the bios update iso images I have checked have had a fat16 filesystem
# embedded in a dos mbr image as the el-torito ISO payload. They also all
# had the same offset to this fat filesystem, so hardcode that offset here.
# TODO - one day, this offset will be wrong. Deal with that..
FAT_OFFSET=71680
DIR="$1"
case "$DIR" in
from_iso) ;;
to_iso) ;;
*)
echo direction is either from_iso or to_iso
exit 1
;;
esac
shift
ISO="$1"
if [ ! -e "$ISO" ]; then
echo iso file must exist
exit 1
fi
shift
FILENAME="$1"
if [ -z "$FILENAME" ]; then
echo need filename
exit 1
fi
shift
FL2=$(mdir -i "$ISO"@@"$FAT_OFFSET" -/ -b |grep FL2)
if [ -z "$FL2" ]; then
echo "Error: could not find any FL2 files in $ISO"
exit 1
fi
if [ $(echo "$FL2" |wc -w) -ne 1 ]; then
echo "Error: $ISO has more than one FL2 file:"
echo "$FL2"
exit 1
fi
from_iso() {
mcopy -i "$ISO"@@"$FAT_OFFSET" "$FL2" "$FILENAME"
}
to_iso() {
if [ ! -f "$FILENAME" ]; then
echo "Error: $FILENAME must exist"
exit 1
fi
mcopy -m -o -i "$ISO"@@"$FAT_OFFSET" "$FILENAME" "$FL2"
}
$DIR

@ -1 +0,0 @@
g1uj25us.iso.orig 0xb85a00 12718080

@ -1 +0,0 @@
g1uj40us.iso.orig 0x8e7200 12718080

@ -1 +0,0 @@
g7uj19us.iso.orig 0x375e00 16912384

@ -1 +0,0 @@
g4uj30us.iso.orig 0x00b76600 12718080

@ -1 +0,0 @@
g5uj28us.iso.orig 0x00375e00 12718080

@ -1 +0,0 @@
g2uj25us.iso.orig 0x00219e00 12718080

@ -1 +0,0 @@
gcuj24us.iso.orig 0x00b79600 12718080

@ -1 +0,0 @@
n10ur10w.iso.orig 0x0083e000 196896

@ -1 +0,0 @@
r02uj46d.iso.orig 0x00210e00 286752
Loading…
Cancel
Save