Skip to content

Commit

Permalink
x230_fhd: Add support of X230 board with FHD mod
Browse files Browse the repository at this point in the history
resolves #83
  • Loading branch information
jyvet committed Aug 25, 2020
1 parent 71332f5 commit 4d6d774
Show file tree
Hide file tree
Showing 17 changed files with 1,798 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x230_fhd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/output
x230_fhd_coreboot_seabios_*rom*
/build
674 changes: 674 additions & 0 deletions x230_fhd/LICENSE

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions x230_fhd/NEWS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
skulls-x230_fhd 0.0.1 - released 2020-09-01
----------------------------------------
* initial seperate release for the X230 with FHD mod
based on the X230 configuration
* based on coreboot commit f5b3a49b76
104 changes: 104 additions & 0 deletions x230_fhd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Skulls - [Thinkpad X230](https://pcsupport.lenovo.com/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x230) with FHD mod

![seabios_bootmenu](front.jpg)

## Supported Hardware Modifications
The motherboard may be modified to use the 2nd Display Port from the dock
as the integrated panel's connection, which allows using a Full HD (FHD)
eDP panel instead of the stock LVDS display.

To make this work with coreboot a [patch](https://review.coreboot.org/c/coreboot/+/28950)
is automatically applied. It disables the internal LVDS connector and also allows
brightness controls to work out of the box.

*Note: this is currently only tested with the [Nitrocaster FHD mod](https://forum.thinkpads.com/viewtopic.php?f=43&t=122640).*

## Latest release
Get it from our [release page](https://github.com/merge/skulls/releases)
* __coreboot__: We take coreboot's master branch at the time we build a release image.
* __microcode update__: revision `0x21` from 2019-02-13
* __SeaBIOS__: version [1.13.0](https://seabios.org/Releases) from 2019-12-09

### release images to choose from
We release multiple different, but _very similar_ images you can choose from.
They all should work on all versions of the X230 FHD. These are the
differences; (xxxxxxxxxx stands for random characters in the filename):
* `x230_fhd_coreboot_seabios_xxxxxxxxxx_top.rom` includes the _proprietary_
[VGA BIOS](https://en.wikipedia.org/wiki/Video_BIOS) from [Intel](https://www.intel.com/content/www/us/en/intelligent-systems/intel-embedded-graphics-drivers/faq-bios-firmware.html)
which is non-free software. It is executed in "secure" mode.
* `x230_fhd_coreboot_seabios_free_xxxxxxxxxx_top.rom` includes the
[VGA BIOS](https://en.wikipedia.org/wiki/Video_BIOS)
[SeaVGABIOS](https://www.seabios.org/SeaVGABIOS) which is free software.
While technically more interesting, visually this is currently not as
beautiful:
* The [bootspash image is not shown](https://github.com/merge/skulls/issues/59).
* Early boot console messages (after your HDD's bootloader has started a kernel) might be [missing](https://github.com/merge/skulls/issues/46).

## table of contents
* [TL;DR](#tldr)
* [First-time installation](#first-time-installation)
* [Updating](#updating)
* [Moving to Heads](#moving-to-heads)
* [Why does this work](#why-does-this-work)
* [How to rebuild](#how-to-reproduce-the-release-images)
* [How to replace the splashscreen image](#how-to-replace-the-splashscreen-image)

## TL;DR
1. run `sudo ./x230_fhd_skulls.sh` on your current X230 Linux system
2. Power down, remove the battery. Remove the keyboard and palmrest. Connect
a hardware flasher to an external PC (or a Raspberry Pi with a SPI 8-pin chip clip
can directly be used), and run
`sudo ./external_install_bottom.sh` on the lower chip
and `sudo ./external_install_top.sh` on the top chip of the two.
3. For updating later, run `./x230_fhd_skulls.sh`. No need to disassemble.

And always use the latest [released](https://github.com/merge/skulls/releases)
package. This will be tested. The git master
branch is _not_ meant to be stable. Use it for testing only.

## First-time installation
Same steps as the X230 without FHD mod (see [First-time installation](https://github.com/jyvet/skulls/blob/master/x230/README.md#first-time-installation)).

## Updating
If you have locked your flash (i.e. `./external_install_bottom -l`) you can
flash externally using `external_install_top.sh` just like the
first time, see above. Only the "upper" 4MB chip has to be written.

It is recommended to do the the update directly on your X230 using Linux
though. This is considered more safe for your hardware and is very convenient -
just install the "flashrom" program and run `./x230_fhd_skulls.sh`, see below.

1. boot Linux with the `iomem=relaxed` boot parameter (for example in /etc/default/grub `GRUB_CMDLINE_LINUX_DEFAULT`)
2. [download](https://github.com/merge/skulls/releases) the latest Skulls release tarball and unpack it or check for updates by running `./x230_fhd_skulls.sh -U`.
3. run `sudo ./x230_fhd_skulls.sh` and choose the image to flash.

Hint: In case your Linux distribution's GRUB bootloader doesn't use the full
screen, put the line `GRUB_GFXMODE=1366x768x32` in your `/etc/default/grub` file
(and run `update_grub`).

## Moving to Heads
*Not supported yet.*

## Why does this work?
On the X230, there are 2 physical "BIOS" chips. The "upper" 4MB
one holds the actual bios we can generate using coreboot, and the "lower" 8MB
one holds the rest that you can [modify yourself once](#first-time-installation),
if you like, but strictly speaking, you
[don't need to touch it at all](https://www.coreboot.org/Board:lenovo/x230#Building_Firmware).
What's this "rest"?
Mainly a tiny binary used by the Ethernet card and the Intel Management Engine.
Read the [coreboot documentation](https://doc.coreboot.org/mainboard/lenovo/xx30_series.html)
for more details.

## How to reproduce the release images
* `git clone https://github.com/merge/skulls`
* `cd skulls/x230_fhd`
* `git checkout 0.1.0` for the release you want to build. In this example 0.1.5.
* `./build.sh` and choose the configuration you want to build

## How to replace the splashscreen image
In order to create your own splashscreen image, before building,
overwrite the `splashscreen.jpg` with your own JPEG, using
* "Progressive" turned off, and
* "4:2:0 (chroma quartered)" Subsampling

Binary file added x230_fhd/bootsplash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added x230_fhd/bootsplash.xcf
Binary file not shown.
82 changes: 82 additions & 0 deletions x230_fhd/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash
source "util/functions.sh"

warn_not_root

have_config=0

usage()
{
echo "Skulls for the X230 with FHD mod"
echo " Run this script to rebuild a released image"
echo ""
echo "Usage: $0 [-c <config_file>]"
echo ""
echo " -c <config_file> to use for flashrom"
}

args=$(getopt -o c:h -- "$@")
if [ $? -ne 0 ] ; then
usage
exit 1
fi

eval set -- "$args"
while [ $# -gt 0 ]
do
case "$1" in
-c)
CONFIGFILE=$2
have_config=1
shift
;;
-h)
usage
exit 1
;;
--)
shift
break
;;
*)
echo "Invalid option: $1"
exit 1
;;
esac
shift
done

if [ ! "$have_config" -gt 0 ] ; then
configs_available=$(ls -1 | grep config || true)
if [ -z "${configs_available}" ] ; then
echo "No config file found. Please add -c <file>"
echo ""
usage
exit 1
fi

prompt="Please select a configuration to use for building or start with the -c option to use a different one:"
options=( $(find -maxdepth 1 -name "*config*" -print0 | xargs -0) )

PS3="$prompt "
select CONFIGFILE in "${options[@]}" "Quit" ; do
if (( REPLY == 1 + ${#options[@]} )) ; then
exit

elif (( REPLY > 0 && REPLY <= ${#options[@]} )) ; then
break

else
echo "Invalid option. Try another one."
fi
done
fi

rm -f defconfig-*
CONFIGFILE_READY=$(echo $CONFIGFILE | cut -d'-' -f2-)
cp $CONFIGFILE $CONFIGFILE_READY

cd ..
./build.sh --clean-slate --commit $(ls -1 x230_fhd/defconfig-* | cut -d'-' -f2-) \
--patchset refs/changes/50/28950/12 x230_fhd
rm -f x230_fhd/defconfig-*
46 changes: 46 additions & 0 deletions x230_fhd/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-3.0+
# Copyright (C) 2018, Tom Hiller <[email protected]>

# shellcheck disable=SC1091
source /home/coreboot/common_scripts/variables.sh
source /home/coreboot/common_scripts/download_coreboot.sh
source /home/coreboot/common_scripts/config_and_make.sh

################################################################################
## MODEL VARIABLES
################################################################################
MAINBOARD="lenovo"
MODEL="x230_fhd"

################################################################################

###############################################
## download/git clone/git pull Coreboot ##
###############################################
downloadOrUpdateCoreboot

##############################
## Copy config and make ##
##############################
configAndMake

#####################
## Post build ##
#####################
if [ ! -f "$DOCKER_COREBOOT_DIR/build/coreboot.rom" ]; then
echo "Uh oh. Things did not go according to plan."
exit 1;
else
#split out top BIOS
if [ ! -z "$COREBOOT_COMMIT" ]; then
RELEASEFILE="${MODEL}_coreboot_seabios_$(echo ${COREBOOT_COMMIT} | cut -c 1-10)_top.rom"
else
RELEASEFILE="coreboot_$MAINBOARD-$MODEL-top.rom"
fi
dd if="$DOCKER_COREBOOT_DIR/build/coreboot.rom" of="$DOCKER_COREBOOT_DIR/$RELEASEFILE" bs=1M skip=8
sha256sum "$DOCKER_COREBOOT_DIR/$RELEASEFILE" > "$DOCKER_COREBOOT_DIR/${RELEASEFILE}".sha256
echo "==================== result: ======================"
echo "$DOCKER_COREBOOT_DIR/$RELEASEFILE"
echo "==================================================="
fi
Loading

0 comments on commit 4d6d774

Please sign in to comment.