diff --git a/src/public/blog/thinkpad-t440p-modification-guide/thumbnail.png b/src/public/blog/thinkpad-t440p-modification-guide/thumbnail.png deleted file mode 100644 index c77d059..0000000 Binary files a/src/public/blog/thinkpad-t440p-modification-guide/thumbnail.png and /dev/null differ diff --git a/src/src/components/mdx/command.tsx b/src/src/components/mdx/command.tsx index 426b21f..649ec06 100644 --- a/src/src/components/mdx/command.tsx +++ b/src/src/components/mdx/command.tsx @@ -4,6 +4,86 @@ import { Terminal, Copy, Check } from 'lucide-react'; import { FaDebian, FaFedora } from 'react-icons/fa6'; import { SiGentoo, SiNixos, SiArchlinux } from 'react-icons/si'; +// Component for multi-line command sequences +const CommandSequence = ({ + commands, + description, + shell = "bash" +}) => { + const [copied, setCopied] = useState(false); + + // Join the commands with newlines for copying + const fullCommandText = Array.isArray(commands) + ? commands.join('\n') + : commands; + + const copyToClipboard = () => { + navigator.clipboard.writeText(fullCommandText) + .then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }) + .catch(err => { + console.error('Failed to copy: ', err); + }); + }; + + return ( +
+ {/* Header with Terminal Icon and Copy Button */} +
+
+ +
+ {description || "Terminal Commands"} +
+
+ +
+ + {/* Command Display */} +
+
+ {Array.isArray(commands) + ? commands.map((cmd, index) => ( +
+ $ + + {cmd} + +
+ )) + : ( +
+ $ + + {commands} + +
+ ) + } +
+
+
+ ); +}; + +// Original Commands component with tabs for different distros const Commands = ({ commandId, description, @@ -25,9 +105,9 @@ const Commands = ({ }, { id: 'debian', - name: 'Debian', + name: 'Debian/Ubuntu', icon: FaDebian, - command: debianCommand || 'echo "No command specified for Debian"' + command: debianCommand || 'echo "No command specified for Debian/Ubuntu"' }, { id: 'fedora', @@ -113,7 +193,7 @@ const Commands = ({ {/* Command Display with Horizontal Scrolling */} -
+
$ @@ -125,7 +205,7 @@ const Commands = ({ ); }; -// Also include a simpler command component for single commands +// Single command component const Command = ({ command, description, @@ -173,7 +253,7 @@ const Command = ({
{/* Command Display with Horizontal Scrolling */} -
+
$ @@ -185,4 +265,4 @@ const Command = ({ ); }; -export { Commands, Command }; +export { Commands, Command, CommandSequence }; diff --git a/src/src/content/blog/thinkpad-t440p-coreboot-guide.mdx b/src/src/content/blog/thinkpad-t440p-coreboot-guide.mdx index 21c372b..7046d87 100644 --- a/src/src/content/blog/thinkpad-t440p-coreboot-guide.mdx +++ b/src/src/content/blog/thinkpad-t440p-coreboot-guide.mdx @@ -7,7 +7,7 @@ date: 2025-01-15 image: "/blog/thinkpad-t440p-coreboot-guide/thumbnail.png" --- -import { Commands, Command } from "@/components/mdx/command"; +import { Commands, Command, CommandSequence } from "@/components/mdx/command"; > **Interactive Script Available!** > Want to skip the manual steps in this guide? @@ -75,4 +75,230 @@ Flashrom should report that programmer initialization was a success. ## Extracting Original BIOS +To begin, first create a clean directory where all work to coreboot +the T440p will be done. + + +Next, extract the original rom from both EEPROM chips. This is +done by attaching the programmer to the correct chip and running +the subsequent commands. It may take longer than expected, and +ensuring the bios was properly extracted is important before proceeding +further. + + + + + +If the diff checks pass, combine both files into one ROM. + + + +## Building Required Tools + +Now that the original bios has been successfuly extracted, it is time +to clone the coreboot repository and build every tool needed to build +a new bios image. + + + +We will need to build `idftool`, which will be used to export all necessary blobs +from our original bios, and `cbfstool`, which will be used to extract __mrc.bin__(a blob +from a haswell chromebook peppy image). + + + + + +## Exporting Firmware Blobs + +Once the necessary tools have been built, we can export the +3 flash regions from our original bios image. + + + +## Obtaining mrc.bin + +In order to obtain __mrc.bin__, we need the chromeos peppy image. +This can be pulled by running the `crosfirmware.sh` script found in util/chromeos. + + + + +We can now obtain __mrc.bin__ using cbfstool to extract the blob from the image. + + + +## Configuring Coreboot + +Configuring coreboot is really where most of your time will be spent. To help out, +I've created several handy configs that should suit most use cases, and can be easily +tweaked to your liking. Here is a list of whats available: + +1. GRUB2 + + This configuration features GRUB2 as the bootloader, and contains 3 secondary payloads, + which the user can opt in/out of: + + * memtest built in + * nvramcui built in + * coreinfo built in + + This configuration also includes the dGPU option rom as well for T440p's featuring the gt730m on board. + +2. SeaBIOS + +3. edk2 + +> NOTE: Show the user how to choose the appropriate config, as well as building a custom config below. + +## Building and Flashing + +After configuring coreboot, it is time to build and flash it onto your unsuspecting T440p :D + + + +Once the coreboot build has completed, split the built ROM for the 8MB(bottom) chip & 4MB(top) chip. + + + +Now flash the new bios onto your thinkpad! + + + + + +Thats it! If done properly, your thinkpad should now boot! + +## Reverting to Original + +If for some reason you feel the need to revert back, or your T440p can't boot, +here are the steps needed to flash the original image back. + +### Can't Boot + + + + + + + +### Can Boot + + + +Reboot to apply `iomem=relaxed` + + + +And that about wraps it up! If you liked the guide, leave a reaction or comment any changes or fixes +I should make below. Your feedback is greatly appreciated! diff --git a/src/src/content/blog/thinkpad-t440p-modification-guide.mdx b/src/src/content/blog/thinkpad-t440p-modification-guide.mdx deleted file mode 100644 index 0803ce2..0000000 --- a/src/src/content/blog/thinkpad-t440p-modification-guide.mdx +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: Thinkpad T440p Modification Guide -description: You purchased a T440p, now what? -author: Timothy Pidashev -tags: [t440p, mods, coreboot, thinkpad] -date: 2025-01-15 -image: "/blog/thinkpad-t440p-modification-guide/thumbnail.png" ---- - -## The T440p - -Whether for privacy related reasons, coreboot, or someones advice on the internet, -you are now the proud owner of a T440p. Now what? Well, I have been daily driving -this laptop for over two years now, and would like to share my knowledge on this -lovely machine. If followed properly, this guide should help any privacy seeking -individual or programmer how to setup the "reasonably" perfect T440p. - -## Buying the Right Model - -Although the T440p comes in various configurations and specs, when searching for -one online there are two things to consider. - -1. Online Marketplace - * Purchasing from the right marketplace is important to consider, and while trusted - vendors like Amazon might be preferred, consider Ebay or AliExpress. - - * I personally have only purchased my thinkpad's on Ebay, as there are generally more listings - available from companies reselling retired units, usually at a steep discount. - - -2. Dedicated GPU - * The T440p motherboard comes in two different varieties, one with - a dGPU and the other without. There is only one dGPU model, which is the NVIDIA GT 730M. - Featuring 2GB of VRAM, it will work, however if your looking for longer battery life and - an easier coreboot config should you choose to coreboot, I would recommend sticking to - a non dGPU variant. - - * Finding a dGPU variant is quite difficult, as many online - sellers don't always list the motherboard spec, making things quite the guessing game. - When I was shopping for one, my strategy was to purchase the dGPU motherboard on its own, - and then a T440p laptop listed with a dead motherboard, as I was going to swap it out anyways. - -3. Quality - * Finding the perfect T440p is hard, and you will likely end up purchasing one that looks ok - in pictures, but comes with a cracked palmrest or front panel. Consider purchasing one which - looks good, and then replacing any cracked or aged parts should you choose to do so in the future. - - * T440p plastics are aged. Although this machine is an absolute brick, which can probably be thrown - at the ground without any major damage, it will definitely chip and crack. I myself have replaced my - palm rest/keyboard cover thrice, as every half a year or so I will open the laptop in the morning to - find that my careless "throw it in the backpack" has finally cracked the palmrest yet again. - -## Screen - -When it comes to the screen, you really don't want to get one of poor quality, especially since the -lousy 1366x768 panel is not great nowadays. Generally, I would recommend going for an ips 1080p panel, -as this is generally most the most supported. I purchased this panel from amazon for ~$60USD and have -never looked back. - -## Keyboard - -## Trackpad - -## Battery - -## CPU - -The T440p has a trick up its sleeve. The processor can be swapped out and replaced, allowing for an upgrade! -There are many models out there, however some aren't recommended due to thermal constraints, so finding the -right balance can be tough. - -## RAM - -## Storage - -## WLAN - -## WAN - -## MISC - -1. Fingerprint Reader - -2. Disc Reader - -3. Webcam & Microphone