Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nitropad_x230
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-nitrokey committed Sep 23, 2020
2 parents e01e3cf + 0eb1f69 commit 65222d8
Show file tree
Hide file tree
Showing 27 changed files with 1,046 additions and 55 deletions.
30 changes: 24 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
command: |
rm -rf build/x230-flash/* build/log/* && make --load 2 \
V=1 \
BOARD=x230-flash \
BOARD=x230-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput x230-flash hashes
Expand All @@ -83,7 +83,7 @@ jobs:
command: |
rm -rf build/t430-flash/* build/log/* && make --load 2 \
V=1 \
BOARD=t430-flash \
BOARD=t430-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput t430-flash hashes
Expand All @@ -101,7 +101,7 @@ jobs:
command: |
rm -rf build/t430/* build/log/* && make --load 2 \
V=1 \
BOARD=t430 \
BOARD=t430 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput t430 hashes
Expand All @@ -119,7 +119,7 @@ jobs:
command: |
rm -rf build/x230/* build/log/* && make --load 2 \
V=1 \
BOARD=x230 \
BOARD=x230 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput x230 hashes
Expand All @@ -137,7 +137,7 @@ jobs:
command: |
rm -rf build/x230-hotp-verification/* build/log/* && make --load 2 \
V=1 \
BOARD=x230-hotp-verification \
BOARD=x230-hotp-verification || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput x230-hotp-verification hashes
Expand All @@ -150,12 +150,30 @@ jobs:
- store-artifacts:
path: build/x230-hotp-verification

- run:
name: librem_mini-NoTPM
command: |
rm -rf build/librem_mini-NoTPM/* build/log/* && make --load 2 \
V=1 \
BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Ouput librem_mini-NoTPM hashes
command: |
cat build/librem_mini-NoTPM/hashes.txt \
- run:
name: Archiving build logs for librem_mini-NoTPM
command: |
tar zcvf build/librem_mini-NoTPM/logs.tar.gz build/log/*
- store-artifacts:
path: build/librem_mini-NoTPM

- run:
name: qemu-coreboot
command: |
rm -rf build/qemu-coreboot/* build/log/* && make --load 2 \
V=1 \
BOARD=qemu-coreboot \
BOARD=qemu-coreboot || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
- run:
name: Output qemu-coreboot hashes
Expand Down
56 changes: 56 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,58 @@ DATE=`date --rfc-3339=seconds`

# This is the correct version of Make

# Check we have a suitable version of gawk
# that's at least the same major version
LOCAL_GAWK_VERSION := $(shell gawk --version 2>/dev/null | head -1 | cut -d' ' -f3 | cut -d, -f1)
LOCAL_GAWK_MAJOR_VERSION := $(patsubst .%,.,$(LOCAL_GAWK_VERSION))
include modules/gawk

# Wrong version
ifeq "" "$(filter $(LOCAL_GAWK_MAJOR_VERSION).%,$(gawk_version))"
# Wrong gawk version detected -- build our local version
# and re-invoke the Makefile with it instead.
$(eval $(shell echo >&2 "$(DATE) Wrong gawk detected: $(LOCAL_GAWK_VERSION)"))
HEADS_GAWK := $(build)/$(gawk_dir)/gawk

# Once we have a suitable version of gawk, we can rerun make
all linux cpio run: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $(MAKE_JOBS) $@
%.clean %.vol %.menuconfig: $(HEADS_GAWK)
LANG=C HEADS_GAWK=$(HEADS_GAWK) $(MAKE) $@

bootstrap: $(HEADS_GAWK)

# How to download and build the correct version of gawk
$(packages)/$(gawk_tar):
$(WGET) -O "$@.tmp" "$(gawk_url)"
if ! echo "$(gawk_hash) $@.tmp" | sha256sum --check -; then \
exit 1 ; \
fi
mv "$@.tmp" "$@"

$(build)/$(gawk_dir)/.extract: $(packages)/$(gawk_tar)
tar xf "$<" -C "$(build)"
touch "$@"

$(build)/$(gawk_dir)/.patch: $(build)/$(gawk_dir)/.extract
# ( cd "$(dir $@)" ; patch -p1 ) < "patches/gawk-$(gawk_version).patch"
touch "$@"

$(build)/$(gawk_dir)/.configured: $(build)/$(gawk_dir)/.patch
cd "$(dir $@)" ; \
./configure 2>&1 \
| tee "$(log_dir)/gawk.configure.log" \
$(VERBOSE_REDIRECT)
touch "$@"

$(HEADS_GAWK): $(build)/$(gawk_dir)/.configured
$(MAKE) -C "$(dir $@)" $(MAKE_JOBS) \
2>&1 \
| tee "$(log_dir)/gawk.log" \
$(VERBOSE_REDIRECT)
endif


BOARD ?= qemu-coreboot
CONFIG := $(pwd)/boards/$(BOARD)/$(BOARD).config

Expand Down Expand Up @@ -124,6 +176,10 @@ CROSS_TOOLS_NOCC := \
PKG_CONFIG_PATH="$(INSTALL)/lib/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR="$(INSTALL)" \

ifneq "$(HEADS_GAWK)" ""
CROSS_TOOLS_NOCC += AWK=$(HEADS_GAWK)
endif

CROSS_TOOLS := \
CC="$(heads_cc)" \
$(CROSS_TOOLS_NOCC) \
Expand Down
4 changes: 2 additions & 2 deletions blobs/librem_kbl/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The script depends on: wget sha256sum python2.7 bspatch pv
You can now compile the image with:

```
make BOARD=librem13v4
make BOARD=librem_13v4
or
make BOARD=librem15v4
make BOARD=librem_15v4
```
4 changes: 3 additions & 1 deletion blobs/librem_skl/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ The script depends on: wget sha256sum python2.7 bspatch pv
You can now compile the image with:

```
make BOARD=librem13v2
make BOARD=librem_13v2
or
make BOARD=librem_15v3
```
4 changes: 2 additions & 2 deletions blobs/t420/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ while getopts ":f:m:i:" opt; do
done

if [ -z "$MECLEAN" ]; then
MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1`
MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1|head -n1`
if [ -z "$MECLEAN" ]; then
echo "me_cleaner.py required but not found or specified with -m. Aborting."
exit 1;
fi
fi

if [ -z "$IFDTOOL" ]; then
IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1`
IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1|head -n1`
if [ -z "$IFDTOOL" ]; then
echo "ifdtool required but not found or specified with -m. Aborting."
exit 1;
Expand Down
4 changes: 2 additions & 2 deletions blobs/x220/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ while getopts ":f:m:i:" opt; do
done

if [ -z "$MECLEAN" ]; then
MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1`
MECLEAN=`command -v $BLOBDIR/../../build/coreboot-*/util/me_cleaner/me_cleaner.py 2>&1|head -n1`
if [ -z "$MECLEAN" ]; then
echo "me_cleaner.py required but not found or specified with -m. Aborting."
exit 1;
fi
fi

if [ -z "$IFDTOOL" ]; then
IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1`
IFDTOOL=`command -v $BLOBDIR/../../build/coreboot-*/util/ifdtool/ifdtool 2>&1|head -n1`
if [ -z "$IFDTOOL" ]; then
echo "ifdtool required but not found or specified with -m. Aborting."
exit 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for a librem13v2
CONFIG_LINUX_CONFIG=config/linux-librem13v2.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem13v2.config
# Configuration for a librem_13v2
CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_13v2.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.8.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration for a librem13v4
CONFIG_LINUX_CONFIG=config/linux-librem13v2.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem13v4.config
# Configuration for a librem_13v4
CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_13v4.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.8.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Configuration for a librem15v3

# The L15v3 Linux config is the same as the L13v2 linux config
CONFIG_LINUX_CONFIG=config/linux-librem13v2.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem15v3.config
# Configuration for a librem_15v3
CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_15v3.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.8.1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Configuration for a librem15v4

# The L15v4 Linux config is the same as the L13v2 linux config
CONFIG_LINUX_CONFIG=config/linux-librem13v2.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem15v4.config
# Configuration for a librem_15v4
CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_15v4.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.8.1
Expand Down
42 changes: 42 additions & 0 deletions boards/librem_mini-NoTPM/librem_mini-NoTPM.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Configuration for a librem mini
CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_mini-NoTPM.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.12
export CONFIG_LINUX_VERSION=4.19.139
export CONFIG_PURISM_BLOBS=y

CONFIG_CRYPTSETUP=y
CONFIG_FLASHROM=y
CONFIG_FLASHTOOLS=y
CONFIG_GPG2=y
CONFIG_KEXEC=y
CONFIG_UTIL_LINUX=y
CONFIG_LVM2=y
CONFIG_MBEDTLS=y
CONFIG_PCIUTILS=y
CONFIG_POPT=y
CONFIG_QRENCODE=y
CONFIG_TPMTOTP=y

CONFIG_CAIRO=y
CONFIG_FBWHIPTAIL=y
CONFIG_HOTPKEY=y

CONFIG_LINUX_USB=y

export CONFIG_TPM=n
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y

export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
export CONFIG_BOOT_KERNEL_ADD="intel_iommu=on"
export CONFIG_BOOT_KERNEL_REMOVE=""
export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOOT_GUI_MENU_NAME="Purism Librem Mini NoTPM Heads Boot Menu"
export CONFIG_WARNING_BG_COLOR="--background-gradient 0 0 0 150 125 0"
export CONFIG_ERROR_BG_COLOR="--background-gradient 0 0 0 150 0 0"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_USB_KEYBOARD=y
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/librem13v2/bzImage"
CONFIG_PAYLOAD_FILE="../../build/librem_13v2/bzImage"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=3"
CONFIG_LINUX_INITRD="../../build/librem13v2/initrd.cpio.xz"
CONFIG_LINUX_INITRD="../../build/librem_13v2/initrd.cpio.xz"
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/librem13v4/bzImage"
CONFIG_PAYLOAD_FILE="../../build/librem_13v4/bzImage"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=3"
CONFIG_LINUX_INITRD="../../build/librem13v4/initrd.cpio.xz"
CONFIG_LINUX_INITRD="../../build/librem_13v4/initrd.cpio.xz"
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/librem15v3/bzImage"
CONFIG_PAYLOAD_FILE="../../build/librem_15v3/bzImage"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=3"
CONFIG_LINUX_INITRD="../../build/librem15v3/initrd.cpio.xz"
CONFIG_LINUX_INITRD="../../build/librem_15v3/initrd.cpio.xz"
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ CONFIG_FSP_M_XIP=y
# CONFIG_DRIVERS_INTEL_WIFI is not set
CONFIG_DEFAULT_CONSOLE_LOGLEVEL_8=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/librem15v4/bzImage"
CONFIG_PAYLOAD_FILE="../../build/librem_15v4/bzImage"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=3"
CONFIG_LINUX_INITRD="../../build/librem15v4/initrd.cpio.xz"
CONFIG_LINUX_INITRD="../../build/librem_15v4/initrd.cpio.xz"
14 changes: 14 additions & 0 deletions config/coreboot-librem_mini-NoTPM.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONFIG_LOCALVERSION="PureBoot-beta"
CONFIG_VENDOR_PURISM=y
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/purism-blobs/mainboard/purism/librem_whl/vbt.bin"
CONFIG_IFD_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_whl/flashdescriptor.bin"
CONFIG_ME_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_whl/me.bin"
CONFIG_HAVE_IFD_BIN=y
CONFIG_BOARD_PURISM_LIBREM_MINI=y
CONFIG_CPU_MICROCODE_CBFS_EXTERNAL_BINS=y
CONFIG_CPU_UCODE_BINARIES="3rdparty/purism-blobs/mainboard/purism/librem_whl/cpu_microcode_blob.bin"
CONFIG_HAVE_ME_BIN=y
CONFIG_PAYLOAD_LINUX=y
CONFIG_PAYLOAD_FILE="../../build/librem_mini-NoTPM/bzImage"
CONFIG_LINUX_INITRD="../../build/librem_mini-NoTPM/initrd.cpio.xz"
CONFIG_LINUX_COMMAND_LINE="intel_iommu=igfx_off quiet loglevel=2"
2 changes: 1 addition & 1 deletion config/coreboot-t430.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ANY_TOOLCHAIN=y
CONFIG_USE_BLOBS=y
CONFIG_MEASURED_BOOT=y
CONFIG_VENDOR_LENOVO=y
CONFIG_CBFS_SIZE=0x800000
CONFIG_CBFS_SIZE=0x710000
# CONFIG_POST_IO is not set
# CONFIG_POST_DEVICE is not set
CONFIG_DRIVERS_UART_8250IO=y
Expand Down
2 changes: 1 addition & 1 deletion config/coreboot-x230.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG_ANY_TOOLCHAIN=y
CONFIG_USE_BLOBS=y
CONFIG_MEASURED_BOOT=y
CONFIG_VENDOR_LENOVO=y
CONFIG_CBFS_SIZE=0x700000
CONFIG_CBFS_SIZE=0x710000
# CONFIG_POST_IO is not set
# CONFIG_POST_DEVICE is not set
CONFIG_DRIVERS_UART_8250IO=y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,3 +319,4 @@ CONFIG_CRC8=m
CONFIG_XZ_DEC_TEST=m
CONFIG_CORDIC=m
CONFIG_IRQ_POLL=y
# CONFIG_RETPOLINE is not set
20 changes: 13 additions & 7 deletions initrd/etc/functions
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ recovery() {
if [ "$CONFIG_TPM" = y ]; then
tpm extend -ix 4 -ic recovery
fi
echo >&2 "!!!!! Starting recovery shell"
sleep 1

if [ -x /bin/setsid ]; then
exec /bin/setsid -c /bin/ash
else
exec /bin/ash
fi
while [ true ]
do
echo >&2 "!!!!! Starting recovery shell"
sleep 1

if [ -x /bin/setsid ]; then
/bin/setsid -c /bin/ash
else
/bin/ash
fi
# clear screen
printf "\033c"
done
}

pause_recovery() {
Expand Down
1 change: 1 addition & 0 deletions modules/coreboot
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ else ifeq "$(CONFIG_COREBOOT_VERSION)" "4.12"
coreboot_version := 4.12
coreboot_hash := edcad000ee9b73183c396ea76155629b3d27c693e0f1ae83e3424c4d936e2be2
coreboot-blobs_hash := 4735ee6850d55d1e65dee8b08cc9b28b8af00b42acf31365f5d9545406579104
coreboot_depends := $(if $(CONFIG_PURISM_BLOBS), purism-blobs)
else
$(error "$(BOARD): does not specify coreboot version under CONFIG_COREBOOT_VERSION")
endif
Expand Down
Loading

0 comments on commit 65222d8

Please sign in to comment.