User Tools

Site Tools


laptop:lenovo-x200:flash-lenovo-x200-libreboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
laptop:lenovo-x200:flash-lenovo-x200-libreboot [2021/11/09 01:30] chucklaptop:lenovo-x200:flash-lenovo-x200-libreboot [2025/01/19 23:27] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ======Flashing my Lenovo x200 with Libreboot====== ======Flashing my Lenovo x200 with Libreboot======
 +<WRAP info smaller>
 +This guide is fairly old (2020/2021) and I haven't had time to update it with any changes that Libreboot may require.
 +
 +Most of the steps will still be relevant but I suggest cross-checking with the Libreboot site for any necessary updates until I can update this guide.
 +
 +I apologize for any inconveniences this causes.
 +</WRAP>
  
 I accidentally botched my original Libreboot flash during an update, so I decided to take some pictures and type this guide to hopefully help someone else. I accidentally botched my original Libreboot flash during an update, so I decided to take some pictures and type this guide to hopefully help someone else.
Line 33: Line 40:
 After the hostname, it shows the current directory. Eg: After the hostname, it shows the current directory. Eg:
  
-<code bash> +  * We're on the main computer in the home (~) directory:<code bash>
-We're on the main computer in the home (~) directory+
 [user@mainpc:~]$ [user@mainpc:~]$
- +</code> 
-We're on the BBB in the armv7l directory+  We're on the BBB in the armv7l directory:<code bash>
 [debian@beaglebone:armv7l]$ [debian@beaglebone:armv7l]$
 </code> </code>
  
 ---- ----
 +
 =====Gather Supplies===== =====Gather Supplies=====
 +
 +<WRAP announcement blue smaller>
 +==Attention==
 +The BeagleBone Black used in this guide is old.\\
 +Head over to the Libreboot site for updated device recommendations:\\
 +https://libreboot.org/docs/install/spi.html
 +</WRAP>
  
 First, gather the supplies needed to perform the flash. First, gather the supplies needed to perform the flash.
Line 48: Line 62:
 {{ :laptop:lenovo-x200:libreboot:x200-supplies.jpg?direct&600 | Gather Supplies }} {{ :laptop:lenovo-x200:libreboot:x200-supplies.jpg?direct&600 | Gather Supplies }}
  
-**Pictured**+==Pictured==
   * BeagleBone Black   * BeagleBone Black
   * 5V Power Supply (for the BBB)   * 5V Power Supply (for the BBB)
Line 55: Line 69:
   * #0 Phillips Screwdriver   * #0 Phillips Screwdriver
  
-**Not Pictured**+==Not Pictured==
   * Lenovo X200 - Not X200S or X200T   * Lenovo X200 - Not X200S or X200T
   * Second computer - to connect to the BBB   * Second computer - to connect to the BBB
Line 67: Line 81:
  
 =====Prepare the Files===== =====Prepare the Files=====
 +
 +<WRAP info>
 +These instructions are currently for **Libreboot 20160907** which has a different gpg signing key than **Libreboot 20210522** and newer!
 +</WRAP>
  
 We need to download the necessary files from the Libreboot site and have them all set up and ready to go for when we get the BBB connected to the X200. We need to download the necessary files from the Libreboot site and have them all set up and ready to go for when we get the BBB connected to the X200.
Line 80: Line 98:
 </code> </code>
   * Select a HTTPS mirror   * Select a HTTPS mirror
-  * Click stable/ then 20160907/ +  * Click **stable/ 20160907/** 
-  * Right click and download the following to the ~/libreboot directory: +  * Right click and download the following to the ''%%~/libreboot%%'' directory: 
-    * SHA512SUMS +    * **SHA512SUMS** 
-    * SHA512SUMS.sig +    * **SHA512SUMS.sig** 
-    * libreboot_r20160907_util.tar.xz  +    * **libreboot_r20160907_util.tar.xz**  
-  * Click rom/ then grub/ +  * Click **rom/ grub/** 
-  * Right click and download the following to the ~/libreboot/rom/grub directory * +  * Right click and download the following to the ''%%~/libreboot/rom/grub directory%%'' 
-    * libreboot_r20160907_grub_x200_8mb.tar.xz+    * **libreboot_r20160907_grub_x200_8mb.tar.xz**
  
 <WRAP important> <WRAP important>
-//You need to verify what size flash chip your X200 has. That will be done below at the Checking Communication section. If you’re not sure, come back to this section once you know what rom to download.//+//You need to verify what size flash chip your X200 has. That will be done below at the [[laptop:lenovo-x200:flash-lenovo-x200-libreboot#checking-communication|Checking Communication]] section. If you’re not sure, come back to this section once you know what rom to download.//
 </WRAP> </WRAP>
  
  
-You should now have a file structure that looks like similar to this: +  * You should now have a file structure that looks similar to this:<code bash>
-<code bash>+
 [user@mainpc:~]$ cd ~/libreboot [user@mainpc:~]$ cd ~/libreboot
 [user@mainpc:libreboot]$ tree [user@mainpc:libreboot]$ tree
Line 152: Line 169:
 ---- ----
  
-====Prepare the ROM====+====Obtain the MAC Address====
  
 We need to set the MAC address for our wired interface in the rom. There are a few ways to get it. We need to set the MAC address for our wired interface in the rom. There are a few ways to get it.
Line 158: Line 175:
   * Look at the sticker on the bottom of the laptop.   * Look at the sticker on the bottom of the laptop.
   * If you have an OS installed on the X200 (or using a live usb):<code bash>   * If you have an OS installed on the X200 (or using a live usb):<code bash>
-[user@X200:~]$ ip link +[user@X200:~]$ ip link show eth0
-1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1 +
-    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00+
 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
-    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff 
-3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000  
     link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff     link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
 </code> </code>
-  * Read the first 6 bytes from position ''%%0x1000%%'' of the factory.rom. +  * Read the first 6 bytes from position ''%%0x1000%%'' of the factory.rom:<code bash> 
-    * If you need to use the factory.rom method, wait until you dump the factory rom to get the mac address, then come back and finish these steps.+[debian@beaglebone:libreboot]$ xxd -s 0x1000 -l 6 factory.rom 
 +00001000: XXXX XXXX XXXX ...'PH 
 +</code> 
 +    * If you need to use the factory.rom method, wait until you [[laptop:lenovo-x200:flash-lenovo-x200-libreboot#backup-factory-rom|dump the factory rom]] to get the mac address, then come back and finish these steps.
  
 ---- ----
  
 +====Prepare the ROM====
   * Check architecture:<code bash>   * Check architecture:<code bash>
 [user@mainpc:libreboot]$ uname -m [user@mainpc:libreboot]$ uname -m
Line 225: Line 242:
 After you have a fresh OS installed or updated the existing OS , make sure you can SSH to it from another computer. After you have a fresh OS installed or updated the existing OS , make sure you can SSH to it from another computer.
  
-===Transfer files to the BBB=== +  * Transfer files to the BBB:<code bash>
-<code> +
-# Change the ip to that of your BBB+
 [user@mainpc:~]$ scp -r ~/libreboot [email protected]:~/ [user@mainpc:~]$ scp -r ~/libreboot [email protected]:~/
 </code> </code>
  
-===SSH to the BBB=== +  * SSH to the BBB:<code bash>
-<code> +
-# Change the ip to that of your BBB+
 [user@mainpc:~]$ ssh [email protected] [user@mainpc:~]$ ssh [email protected]
 </code> </code>
  
-===Configure the pins=== +  * Configure the pins:<code bash>
-<code>+
 [debian@beaglebone:~]$ config-pin P9.17 spi_cs [debian@beaglebone:~]$ config-pin P9.17 spi_cs
 [debian@beaglebone:~]$ config-pin P9.18 spi [debian@beaglebone:~]$ config-pin P9.18 spi
Line 282: Line 294:
  
 Now that we’re all connected we need to verify that we can communicate with the chip. Now that we’re all connected we need to verify that we can communicate with the chip.
-<code> +  * Check the architecture:<code bash>
-Check the architecture+
 [debian@beaglebone:~]$ uname -m [debian@beaglebone:~]$ uname -m
 armv7l armv7l
 +</code>
 +  * Change directories:<code bash>
 [debian@beaglebone:~]$ cd ~/libreboot/libreboot_r20160907_util/flashrom/armv7l/ [debian@beaglebone:~]$ cd ~/libreboot/libreboot_r20160907_util/flashrom/armv7l/
 +</code>
 +  * Run flashrom:<code bash>
 [debian@beaglebone:armv7l]$ ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 [debian@beaglebone:armv7l]$ ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512
 flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l) flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l)
Line 296: Line 311:
 </code> </code>
  
-You can see that it found the Macronix flash chip and that it’s 8192kB. That lets us know that we need to use the 8Mb rom from the Libreboot mirror. If you need to, go back to Prepare the Files and download the proper rom and follow the steps up to disassembling the X200.+You can see that it found the Macronix flash chip and that it’s 8192kB. That lets us know that we need to use the 8Mb rom from the Libreboot mirror. If you need to, go back to [[laptop:lenovo-x200:flash-lenovo-x200-libreboot#prepare-the-files|Prepare the Files]] and download the proper rom and follow the steps up to disassembling the X200.
  
 ---- ----
Line 306: Line 321:
 I used the time command to show how long it took to complete the transfer. You don’t have to use it if you don’t want to but at least this gives you an idea on what to expect time-wise. I used the time command to show how long it took to complete the transfer. You don’t have to use it if you don’t want to but at least this gives you an idea on what to expect time-wise.
  
-<code>+ 
 +  * Create backup one:<code bash>
 [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory.rom [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory.rom
 flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l) flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l)
Line 318: Line 334:
 user 0m1.029s user 0m1.029s
 sys 0m4.249s sys 0m4.249s
 +</code> 
 +  * Create backup two:<code bash>
 [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory1.rom [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -r factory1.rom
 flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l) flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l)
Line 332: Line 349:
 </code> </code>
  
-===Verify Factory ROMs are the same=== +  * Verify Factory ROMs are the same:<code bash>
-<code>+
 [debian@beaglebone:armv7l]$ sha512sum factory*.rom [debian@beaglebone:armv7l]$ sha512sum factory*.rom
 45ea8db426c0fb776d397cfc4312cef2eb8262463538fb927dd0ebb98386218d2b3b64ae6bc5b454279e442de2b6dd30eb4bb584de6be4a09d05ffb20a633330  factory.rom 45ea8db426c0fb776d397cfc4312cef2eb8262463538fb927dd0ebb98386218d2b3b64ae6bc5b454279e442de2b6dd30eb4bb584de6be4a09d05ffb20a633330  factory.rom
Line 339: Line 355:
 </code> </code>
  
-Store the factory.rom somewhere safe. You may need it for recovery purposes or to revert back to factory BIOS some day. +  * Store the factory.rom somewhere safe. You may need it for recovery purposes or to revert back to factory BIOS some day.
-MAC Address+
  
-If you need to get the mac address from the factory rom, now you can read the first 6 bytes from position 0x1000: +  * Now is the time to get the mac address if you needed to for [[laptop:lenovo-x200:flash-lenovo-x200-libreboot#prepare-the-rom|Prepare the ROM]] steps above.
-<code> +
-[debian@beaglebone:libreboot]$ xxd -s 0x1000 -l 6 factory.rom +
-00001000XXXX XXXX XXXX ...'PH +
-</code> +
- +
-The mac address has been replaced with Xs and colored dark blue in the above output. Use those numbers for the ''%%ich9gen --mac-addresscommand%%'' for Prepare the ROM above.+
  
 ---- ----
Line 356: Line 365:
 And now for the moment of truth! And now for the moment of truth!
  
-<code>+  * Flash the chip:<code bash>
 [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w libreboot.rom  [debian@beaglebone:armv7l]$ time ./flashrom -p linux_spi:dev=/dev/spidev1.0,spispeed=512 -w libreboot.rom 
 flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l) flashrom v0.9.9-unknown on Linux 4.14.58-ti-r66 (armv7l)
Line 379: Line 388:
  
 If you’re planning on using wifi, it is recommended to replace the factory Intel wifi chip. The factory chip requires proprietary software to work correctly, and we’re librebooting to rid our x200 of closed source software! If you’re planning on using wifi, it is recommended to replace the factory Intel wifi chip. The factory chip requires proprietary software to work correctly, and we’re librebooting to rid our x200 of closed source software!
- 
-See Recommended for suggestions on what to change it with. 
  
 For reference, I replaced mine with an Atheros 9285G and the Libreboot tutorial shows them using a Atheros AR5B95. For reference, I replaced mine with an Atheros 9285G and the Libreboot tutorial shows them using a Atheros AR5B95.
Line 412: Line 419:
   * Double check connections   * Double check connections
   * Try a slower spispeed   * Try a slower spispeed
-  * Check BBB Pin options:<code>+  * Check BBB Pin options:<code bash>
 # List available pin configurations # List available pin configurations
 [debian@beaglebone:~]$ config-pin -l P9.17 [debian@beaglebone:~]$ config-pin -l P9.17
laptop/lenovo-x200/flash-lenovo-x200-libreboot.1636421406.txt.gz · Last modified: by chuck