initial commit
commit
aab3ff8860
|
@ -0,0 +1,59 @@
|
||||||
|
CONFIG=free-defconfig-d5c31acee4
|
||||||
|
SDK_VERSION=2022-04-04_9a8d0a03db
|
||||||
|
BOOTSPLASH=bootsplash.jpg
|
||||||
|
# BOOTORDER=bootorder
|
||||||
|
REPO_URL=https://github.com/coreboot/coreboot.git
|
||||||
|
COMMIT=d5c31acee4
|
||||||
|
|
||||||
|
COREBOOT_CONFIG=coreboot/.config
|
||||||
|
BUILDER=./coreboot-sdk.sh \
|
||||||
|
--config $(CONFIG) \
|
||||||
|
--sdk-version $(SDK_VERSION) \
|
||||||
|
--bootsplash $(BOOTSPLASH)
|
||||||
|
#--bootorder $(BOOTORDER)
|
||||||
|
|
||||||
|
.PHONY: clean nuke defconfig checkout flash
|
||||||
|
|
||||||
|
build/coreboot_top_prepared_12mb.rom: build/coreboot_top.rom
|
||||||
|
dd if=/dev/zero of="$@" bs=4M count=2 status=none
|
||||||
|
dd if="$<" oflag=append conv=notrunc of="$@" bs=4M status=none
|
||||||
|
|
||||||
|
build/coreboot_top.rom.sha256: build/coreboot_top.rom
|
||||||
|
sha256sum "$<" > "$@"
|
||||||
|
|
||||||
|
build/coreboot_top.rom: build/coreboot.rom
|
||||||
|
dd if="$<" of="$@" bs=1M skip=8
|
||||||
|
|
||||||
|
build/coreboot.rom: $(COREBOOT_CONFIG) $(BOOTSPLASH) $(bootorder)
|
||||||
|
mkdir -p build
|
||||||
|
$(BUILDER) make
|
||||||
|
|
||||||
|
$(COREBOOT_CONFIG): $(CONFIG) checkout
|
||||||
|
mkdir -p build
|
||||||
|
$(BUILDER) make defconfig
|
||||||
|
|
||||||
|
defconfig: $(COREBOOT_CONFIG)
|
||||||
|
|
||||||
|
coreboot: # clone
|
||||||
|
git clone $(REPO_URL) $@
|
||||||
|
git -C coreboot submodule update --init --recursive --remote
|
||||||
|
|
||||||
|
checkout: coreboot
|
||||||
|
git -C coreboot checkout $(COMMIT)
|
||||||
|
git -C coreboot submodule update --recursive --remote
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf coreboot/.config
|
||||||
|
rm -rf build
|
||||||
|
|
||||||
|
nuke: clean
|
||||||
|
rm -rf coreboot
|
||||||
|
|
||||||
|
flash: build/coreboot_top_prepared_12mb.rom layout.txt
|
||||||
|
flashrom \
|
||||||
|
--force \
|
||||||
|
--noverify-all\
|
||||||
|
-p internal \
|
||||||
|
--layout layout.txt \
|
||||||
|
--image bios \
|
||||||
|
-w build/coreboot_top_prepared_12mb.rom
|
|
@ -0,0 +1,64 @@
|
||||||
|
# coreboot-builder
|
||||||
|
|
||||||
|
This is what I use to build my coreboot images. It is heavily based on the
|
||||||
|
scripts and configurations used by [skulls](https://github.com/merge/skulls).
|
||||||
|
But simplified to support only my very specific hardware and preferences. This
|
||||||
|
makes it leaner to use and easier for me to understand it, so it's easier to
|
||||||
|
customize (for example, if I want to change the boot order).
|
||||||
|
|
||||||
|
Currently I have only one config for my Thinkpad X230; `capibara`, and I use a
|
||||||
|
the "free" config (with the VGA BIOS SeaVGABIOS instead of the Intel one).
|
||||||
|
|
||||||
|
## Build process
|
||||||
|
|
||||||
|
I use a Makefile to orchestrate cloning the coreboot code, checking out the
|
||||||
|
right commit, compiling the image, flashing it, etc.
|
||||||
|
The coreboot SDK is run from a docker image because I couldn't manage to
|
||||||
|
compile everything otherwise.
|
||||||
|
|
||||||
|
## Splash screen
|
||||||
|
|
||||||
|
For an X230 the splash screen image needs to be a JPEG using:
|
||||||
|
|
||||||
|
* with "progressive" turned off
|
||||||
|
* "4:2:0 (chroma quartered)" Subsampling
|
||||||
|
* 1024px wide and 768px tall
|
||||||
|
|
||||||
|
But the X230 screen happens to be 16:9 (1366px wide, 768px tall). When the
|
||||||
|
SaBIOSVABIOS is used, the image is just shown centered in the screen, with
|
||||||
|
black blocks on each side. When the Intel VGA is used, the image is stretched
|
||||||
|
to fill the whole 1366 x 768 screen. So make sure to plan accordingly to make
|
||||||
|
the image look right.
|
||||||
|
|
||||||
|
Also, the SeaBIOS VGA seems to show weird colors when booting. I don't know
|
||||||
|
how to fix that, so I just keep the image pure black and white to make it look
|
||||||
|
decent.
|
||||||
|
|
||||||
|
## Updates
|
||||||
|
|
||||||
|
I try to follow skull's releases and update the coreboot commit, sdk version
|
||||||
|
and config as they do it.
|
||||||
|
|
||||||
|
Last release happened on 2022/05/03.
|
||||||
|
|
||||||
|
## Flashing
|
||||||
|
|
||||||
|
Before flashing, the system needs to boot with the kernel parameter
|
||||||
|
`iomem=relaxed`.
|
||||||
|
|
||||||
|
* Reboot the computer
|
||||||
|
* When the GRUB screen appears, press `e` to edit the startup command
|
||||||
|
* Append `iomem=relaxed` to the kernel command
|
||||||
|
* Press `ctrl-x` or `F2` to boot the system with the modification
|
||||||
|
* Then flash the new image with:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
flash: build/coreboot_top_prepared_12mb.rom layout.txt
|
||||||
|
flashrom \
|
||||||
|
--force \
|
||||||
|
--noverify-all\
|
||||||
|
-p internal \
|
||||||
|
--layout layout.txt \
|
||||||
|
--image bios \
|
||||||
|
-w build/coreboot_top_prepared_12mb.rom
|
||||||
|
```
|
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
Binary file not shown.
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
while :; do
|
||||||
|
case "$1" in
|
||||||
|
--config)
|
||||||
|
CONFIG="$2"
|
||||||
|
shift 2;;
|
||||||
|
--sdk-version)
|
||||||
|
SDK_VERSION="$2"
|
||||||
|
shift 2;;
|
||||||
|
--bootorder)
|
||||||
|
BOOTORDER="$2"
|
||||||
|
shift 2;;
|
||||||
|
--bootsplash)
|
||||||
|
BOOTSPLASH="$2"
|
||||||
|
shift 2;;
|
||||||
|
*)
|
||||||
|
break;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
uid=$(id -u)
|
||||||
|
gid=$(id -g)
|
||||||
|
|
||||||
|
docker run --rm -it \
|
||||||
|
--user "$uid:$gid" \
|
||||||
|
--workdir "/home/coreboot/cb_build" \
|
||||||
|
-v "$(pwd)/coreboot:/home/coreboot/cb_build" \
|
||||||
|
-v "$(pwd)/build:/home/coreboot/cb_build/build" \
|
||||||
|
-v "$(pwd)/${CONFIG}:/home/coreboot/cb_build/configs/defconfig:ro" \
|
||||||
|
-v "$(pwd)/${BOOTSPLASH}:/home/coreboot/cb_build/bootsplash.jpg:ro" \
|
||||||
|
coreboot/coreboot-sdk:"$SDK_VERSION" \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# -v "$(pwd)/${BOOTORDER}:/home/coreboot/cb_build/bootorder:ro" \
|
|
@ -0,0 +1,28 @@
|
||||||
|
CONFIG_BOOTSPLASH_IMAGE=y
|
||||||
|
CONFIG_VENDOR_LENOVO=y
|
||||||
|
CONFIG_NO_POST=y
|
||||||
|
CONFIG_CBFS_SIZE=0x400000
|
||||||
|
CONFIG_LINEAR_FRAMEBUFFER_MAX_HEIGHT=768
|
||||||
|
CONFIG_LINEAR_FRAMEBUFFER_MAX_WIDTH=1024
|
||||||
|
CONFIG_ONBOARD_VGA_IS_PRIMARY=y
|
||||||
|
CONFIG_SEABIOS_PS2_TIMEOUT=5000
|
||||||
|
CONFIG_CONSOLE_CBMEM_BUFFER_SIZE=0x20000
|
||||||
|
CONFIG_PCIEXP_HOTPLUG_BUSES=8
|
||||||
|
CONFIG_PCIEXP_HOTPLUG_MEM=0x800000
|
||||||
|
CONFIG_PCIEXP_HOTPLUG_PREFETCH_MEM=0x10000000
|
||||||
|
CONFIG_BOARD_LENOVO_X230=y
|
||||||
|
CONFIG_UART_PCI_ADDR=0x0
|
||||||
|
# CONFIG_H8_BEEP_ON_DEATH is not set
|
||||||
|
CONFIG_H8_SUPPORT_BT_ON_WIFI=y
|
||||||
|
CONFIG_BOOTBLOCK_NORMAL=y
|
||||||
|
CONFIG_GENERIC_LINEAR_FRAMEBUFFER=y
|
||||||
|
CONFIG_BOOTSPLASH=y
|
||||||
|
CONFIG_PCIEXP_HOTPLUG_IO=0x2000
|
||||||
|
CONFIG_SUBSYSTEM_VENDOR_ID=0x0000
|
||||||
|
CONFIG_SUBSYSTEM_DEVICE_ID=0x0000
|
||||||
|
CONFIG_I2C_TRANSFER_TIMEOUT_US=500000
|
||||||
|
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
|
||||||
|
CONFIG_SEABIOS_DEBUG_LEVEL=-1
|
||||||
|
CONFIG_COREINFO_SECONDARY_PAYLOAD=y
|
||||||
|
CONFIG_NVRAMCUI_SECONDARY_PAYLOAD=y
|
||||||
|
# CONFIG_SEABIOS_BOOTORDER_FILE="bootorder"
|
|
@ -0,0 +1,5 @@
|
||||||
|
0x00000000:0x00000fff ifd
|
||||||
|
0x00001000:0x00002fff gbe
|
||||||
|
0x00003000:0x004fffff me
|
||||||
|
0x00500000:0x007fffff unused
|
||||||
|
0x00800000:0x00bfffff bios
|
Loading…
Reference in New Issue