Skip to content

Instantly share code, notes, and snippets.

@asamofal
Created April 18, 2020 21:50
Show Gist options
  • Save asamofal/d73ae12f3633c59ad53fc65132d1a3c0 to your computer and use it in GitHub Desktop.
Save asamofal/d73ae12f3633c59ad53fc65132d1a3c0 to your computer and use it in GitHub Desktop.
Update BIOS on ThinkPad X1 Carbon Gen 6th (Ubuntu 18.04, Legacy mode)

Update BIOS on ThinkPad X1 Carbon Gen 6th (Ubuntu 18.04)

Laptop (ThinkPad) Lenovo X1 Carbon 6th Gen (Type 20KH, 20KG)

If you are using your ThinkPad X1G6 with Linux in "Legacy only" mode, there's only one way how to update BIOS - you should use "BIOS Update (Bootable CD)". So this is a step by step guid how to do it.

Check current BIOS version:

fwupdmgr get-devices

$ fwupdmgr get-devices
20KH007BUK System Firmware
  DeviceId:             ***
  Guid:                 230c8b18-8d9b-53ec-838b-6cfc0383493a
  Plugin:               uefi
  Flags:                internal|require-ac|registered|needs-reboot
  Vendor:               LENOVO
  Version:              N23ET68W (1.43)
  VersionFormat:        plain
  Icon:                 computer
  Created:              2020-04-18
  UpdateError:          Firmware can not be updated in legacy mode, switch to UEFI mode.

BIOS version is: N23ET68W (1.43)

Download the latest BIOS Update (Bootable CD)

https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x1-carbon-6th-gen-type-20kh-20kg/downloads/ds502281

At this point the latest is n23ur23w.iso

Now need to convert iso file into img file, for that we will use genisoimage tool.

Install a tool:

sudo apt install genisoimage

Convert iso to img:

geteltorito -o n23ur23w.img n23ur23w.iso

Prepare bootable USB flash drive

Check the available USB disk using lsblk or df -h commands and unmount the drive:

$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb           8:16   1   3,8G  0 disk 
└─sdb1        8:17   1   3,8G  0 part 
nvme0n1     259:0    0 953,9G  0 disk 
├─nvme0n1p1 259:1    0 186,5G  0 part /
└─nvme0n1p5 259:3    0 767,4G  0 part /home

So, my drive is /dev/sdb. Yours could be /dev/sda or something else.

Make sure drive is unmounted:

sudo umount /dev/sdb

Now let's recreate partition table and partitions with parted tool:

  1. Start parted:

    sudo parted

  2. Detect USB disk (based on disk size):

    print devices

    (parted) print devices
    /dev/sdb (4020MB)
    /dev/nvme0n1 (1024GB)
    
  3. Select your USB disk:

    select /dev/sdb

  4. Create a new partition table:

    mklabel msdos

    (parted) mklabel msdos                                                     
    Warning: The existing disk label on /dev/sdb will be destroyed and all data on 	this disk will be lost. Do you want to
    continue?
    Yes/No? y
    
  5. Create a new partition:

    (parted) mkpart primary fat32 2048s 100%

  6. Add boot flag to the disk:

    (parted) set 1 boot on

  7. Check that everything is fine:

    (parted) print                                                            
    Model: JetFlash Transcend 4GB (scsi)
    Disk /dev/sdb: 4020MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags: 
    
    Number  Start   End     Size    Type     File system  Flags
     1      1049kB  4020MB  4019MB  primary  fat32        boot, lba
    
  8. Exit from parted:

    (parted) q

  9. Build FAT32 filesystem:

    sudo mkfs.vfat -F 32 -n X1G6BIOS /dev/sdb1

Copy files from our img file to the prepared disk:

sudo dd bs=4M if=./n23ur23w.img of=/dev/sdb1 status=progress oflag=sync

Update BIOS

  1. Firstly need to prepare some BIOS settings:

    • Startup

      • UEFI/Legacy Boot: [UEFI Only]
      • CSM Support: [No]
      • Boot device List F12 Option: [Enabled]
    • Security => Secure Boot: [Enabled]

    Notice: Boot capability with "Legacy Only" setting in the ThinkPad Setup is no longer supported

  2. Open Boot menu and choose your USB flash drive, follow the instructions.

  3. When the update process is over, you can change back Boot settings:

    • Security => Secure Boot: [Disabled]

    • Startup

      • UEFI/Legacy Boot: [Legacy Only] or [Both]
      • CSM Support: [Yes]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment