Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating Lenovo x230 BIOS to latest #130

Closed
wants to merge 1 commit into from

Conversation

ibleedcoffee
Copy link

Hey, so version 1.76 of the Lenovo X230 BIOS came out so I thought I'd update your code based off a previous post you made about how to do that, so I updated Descriptions.txt with the new strings, the new sha1 and names, the download URL is still the same and EC didn't change. It downloads and identifies the new version properly, but then it gets stuck trying to determine the IMG details.

Here is my output from terminal:
user@work:~/thinkpad-ec$ make patched.x230.img
Downloading x230 BIOS 2.76 (G2ETB6WW) EC 1.14 (G2HT35WW)
2019-07-23 23:50:48 URL:https://download.lenovo.com/pccbbs/mobiles/g2uj32us.iso [33927168/33927168] -> "g2uj32us.iso.orig" [1]
scripts/checksum --mv_on_fail g2uj32us.iso.orig g2uj32us.iso
./scripts/ISO_copyFL2 from_iso g2uj32us.iso.orig x230.G2HT35WW.s01D3000.FL2.orig 01D3000.FL2
./scripts/FL2_copyIMG from_fl2 x230.G2HT35WW.s01D3000.FL2.orig x230.G2HT35WW.img.enc.tmp
Could not determine IMG details for x230.G2HT35WW.s01D3000.FL2.orig
.d/generated.deps:189: recipe for target 'x230.G2HT35WW.img.orig' failed
make: *** [x230.G2HT35WW.img.orig] Error 1

So I'm not sure where I've done something wrong or if there is just something different about the newest BIOS update. Do you think you could help me figure out what the problem is?

@hamishcoleman
Copy link
Owner

hamishcoleman commented Jul 24, 2019 via email

@ibleedcoffee
Copy link
Author

ibleedcoffee commented Jul 24, 2019

Okay, this dump is all ff's until 00800000. I couldn't find a version string.
dump.txt
I also tried a few other things, like replacing the new sha1 hash with the old one (that failed, so I know the current code is getting the newest file and passing the checksum) and trying the US mirror instead of the Hong Kong mirror, (no effect) so I think either Lenovo must have changed something, or there's a dimension to the problem that I haven't considered.

I went ahead and put it on a USB and installed it on my Thinkpad, and it updated the BIOS, but didn't touch my EC firmware, which is still at 1.12. Is it possible that Lenovo has stopped packaging the EC update with the BIOS update? Their web page lists it as being included, but if there's data missing from the image, then maybe they cut it out.

@Africalifornia
Copy link

Africalifornia commented Jul 30, 2019

I faced exactly the same problem with @ibleedcoffee.
I changed descriptions.txt and updated wıth g2uj32us.iso from Lenovo support website.

Could not determine IMG details for x230.G2HT35WW.s01D3000.FL2.orig
.d/generated.deps:189: recipe for target 'x230.G2HT35WW.img.orig' failed
make: *** [x230.G2HT35WW.img.orig] Error 1

How to resolve this ?

@hamishcoleman
Copy link
Owner

I've gone through all the latest ISO images and a lot of the new FL2 files are now showing this issue. It looks like Lenovo has changed something.

Since the EC firmware has not been updated, it is still safe to just create the patch image from an earlier BIOS version.

There is some evidence that they are hand-creating these update images, so it is possible that this round was just a mistake, but futher investigations are probably required into these newer FL2 files.

@hamishcoleman
Copy link
Owner

Actually @ibleedcoffee - after reading your comment again, I see you installed the official update (without patches) and it /did not/ update your EC version to the correct 1.14 version - is that correct?

What BIOS version were you previously on?

If the official installer - used in the documented manner - did not install the correct EC firmware, then that is pretty clear to me that Lenovo have released some broken firmware updates :-(

@nil-0
Copy link

nil-0 commented Jul 31, 2019

Hi, updated my x230 with Lenovo's latest bios (2.76) today. EC Version is 1.14.
Before that, Bios was on 2.75.

Now, if I make patched.x230.img it downloads and patches an older version (2.75). Also, I am not sure, that everything worked as its supposed to. Does the below look good? Can I go ahead and flash the patched 2.75, basically downgrading?

Sorry for noobish questions, but this is my first take on modding a bios.


Generated dependancies from descriptions
Downloading x230 BIOS 2.75 (G2ETB5WW) EC 1.14 (G2HT35WW)
2019-07-31 15:52:33 URL:https://download.lenovo.com/pccbbs/mobiles/g2uj31us.iso [33927168/33927168] -> "g2uj31us.iso.orig" [1]
scripts/checksum --mv_on_fail g2uj31us.iso.orig g2uj31us.iso
./scripts/ISO_copyFL2 from_iso g2uj31us.iso.orig x230.G2HT35WW.s01D3000.FL2.orig 01D3000.FL2
git submodule update --init --remote
Submodule 'mec-tools' (https://github.com/eigenmatt/mec-tools) registered for path 'mec-tools'
Cloning into '/home/nil/thinkpad-ec/mec-tools'...
Submodule path 'mec-tools': checked out '07a1b1407326488376afed6c596d37c53d7432b6'
git submodule update
make -C mec-tools
make[1]: Entering directory '/home/nil/thinkpad-ec/mec-tools'
cc -Wall -O2 mec_csum_boot.c -o mec_csum_boot
cc -Wall -O2 mec_csum_flasher.c -o mec_csum_flasher
cc -Wall -O2 mec_csum_outer.c -o mec_csum_outer
cc -Wall -O2 mec_encrypt.c -o mec_encrypt -lcrypto
make[1]: Leaving directory '/home/nil/thinkpad-ec/mec-tools'
./scripts/FL2_copyIMG from_fl2 x230.G2HT35WW.s01D3000.FL2.orig x230.G2HT35WW.img.enc.tmp
IMG at offset 0x500000 size 0x30000 (FL2::prefix_ff x230.G2HT35WW.s01D3000.FL2.orig)
mec-tools/mec_encrypt -d x230.G2HT35WW.img.enc.tmp x230.G2HT35WW.img.orig.tmp
mec-tools/mec_csum_flasher -c x230.G2HT35WW.img.orig.tmp >/dev/null
mec-tools/mec_csum_boot -c x230.G2HT35WW.img.orig.tmp >/dev/null
./scripts/hexpatch.pl --rm_on_fail --report x230.G2HT35WW.img.report x230.G2HT35WW.img x230.G2HT35WW.img.d/*.patch
Attempting to patch x230.G2HT35WW.img
Applying x230.G2HT35WW.img.d/001_keysym.patch keysym
Applying x230.G2HT35WW.img.d/002_dead_keys.patch dead_keys
Applying x230.G2HT35WW.img.d/003_keysym_replacements.patch keysym_replacements
Applying x230.G2HT35WW.img.d/004_fn_keys.patch fn_keys
Applying x230.G2HT35WW.img.d/005_fn_key_swap.patch fn_key_swap
Applying x230.G2HT35WW.img.d/006_battery_validate.patch -7294,7 +7294,7
./scripts/xx30.encrypt x230.G2HT35WW.img x230.G2HT35WW.img.enc.tmp

  • cd mec-tools
  • ./mec_repack ../x230.G2HT35WW.img ../x230.G2HT35WW.img.enc.tmp
    building ../x230.G2HT35WW.img.enc.tmp from ../x230.G2HT35WW.img
    b4b73a78 b4b73a78 OK
    f02cdcf8 f02cdcf8 OK
    3ff064dd 203e469e FIXED
    40da02e2 6d3996cc FIXED
    64c4 1760 FIXED
    98e8 913c FIXED

reverifying
913c 913c OK
1760 1760 OK
b4b73a78 b4b73a78 OK
f02cdcf8 f02cdcf8 OK
203e469e 203e469e OK
6d3996cc 6d3996cc OK
./scripts/FL2_copyIMG to_fl2 x230.G2HT35WW.s01D3000.FL2.tmp x230.G2HT35WW.img.enc.tmp
IMG at offset 0x500000 size 0x30000 (FL2::prefix_ff x230.G2HT35WW.s01D3000.FL2.tmp)
./scripts/ISO_copyFL2 to_iso g2uj31us.iso.tmp x230.G2HT35WW.s01D3000.FL2.tmp 01D3000.FL2
mcopy -t -m -o -i g2uj31us.iso.tmp@@71680 g2uj31us.iso.report.tmp ::report.txt
mcopy -t -m -o -i g2uj31us.iso.tmp@@71680 g2uj31us.iso.bat.tmp ::AUTOEXEC.BAT
mdel -i g2uj31us.iso.tmp@@71680 ::EFI/Boot/BootX64.efi
cp g2uj31us.iso patched.x230.iso
cp g2uj31us.iso.report patched.x230.iso.report

Your build has completed with the following details:

Buildinfo: v1-307-ge5b632-dirty (20190731) patched.x230.img
Built: bbeb2cb0b44e524d897f1cae741238712623120f x230.G2HT35WW.s01D3000.FL2

Patches applied:
x230.G2HT35WW.img.d/001_keysym.patch x230.G2HT35WW.img.d/002_dead_keys.patch
x230.G2HT35WW.img.d/003_keysym_replacements.patch
x230.G2HT35WW.img.d/004_fn_keys.patch x230.G2HT35WW.img.d/005_fn_key_swap.patch
x230.G2HT35WW.img.d/006_battery_validate.patch

Description: x230 BIOS 2.75 (G2ETB5WW) EC 1.14 (G2HT35WW)
./scripts/geteltorito -o patched.x230.img.tmp patched.x230.iso
Booting catalog starts at sector: 20
Manufacturer of CD: NERO BURNING ROM
Image architecture: x86
Boot media type is: harddisk
El Torito image starts at sector 27 and has 65536 sector(s) of 512 Bytes

Image has been written to file "patched.x230.img.tmp".
./scripts/fix_mbr patched.x230.img.tmp
Found corrupted bootcode in ISO from Lenovo - attempting fix

Your build has completed with the following details:

Buildinfo: v1-307-ge5b632-dirty (20190731) patched.x230.img
Built: bbeb2cb0b44e524d897f1cae741238712623120f x230.G2HT35WW.s01D3000.FL2

Patches applied:
x230.G2HT35WW.img.d/001_keysym.patch x230.G2HT35WW.img.d/002_dead_keys.patch
x230.G2HT35WW.img.d/003_keysym_replacements.patch
x230.G2HT35WW.img.d/004_fn_keys.patch x230.G2HT35WW.img.d/005_fn_key_swap.patch
x230.G2HT35WW.img.d/006_battery_validate.patch

Description: x230 BIOS 2.75 (G2ETB5WW) EC 1.14 (G2HT35WW)

@hamishcoleman
Copy link
Owner

Hi @nil-0 you look good to go - the Built checksum from your output matches my test builds.

While this is based on the 2.75 BIOS, the EC firmware used by both 2.75 and 2.76 is identical (they both use EC 1.14) - so, the patches and EC firmware are all OK to use.

@nil-0
Copy link

nil-0 commented Jul 31, 2019

awesome, thanks a lot Hamish! Now I only have to wait for my brandnew x220 keyboard :)
I am gonna love it.

@hamishcoleman
Copy link
Owner

It turns out that I added these signatures in a different commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants