Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream PureBoot 27 #1419

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
d937426
Use the Librem Key as a TPM work-alike in the absence of a TPM
kylerankin Nov 25, 2019
d094dcd
gui-init/seal-libremkey: reduce friction when generating new secret
MrChromebox Aug 21, 2019
efc49c7
Add Root file hash feature
kylerankin Sep 3, 2021
1ea5f3b
modules/coreboot: Allow building from Purism's coreboot git repo
MrChromebox Mar 25, 2021
3766d32
board/librem_{13/14/15/mini}: Use Purism repo for coreboot
MrChromebox Mar 29, 2021
3191bfb
oem-factory-reset: Add 'use defaults' prompt to simplify user options
MrChromebox Apr 29, 2022
0967fe3
configs/busybox: enable lzma (de)compression
MrChromebox Jan 7, 2022
14a5d19
Move show_system_info() from gui-init to gui-functions
MrChromebox Mar 15, 2022
3a917bb
config-gui.sh: Extract utilities from config-gui.sh
JonathonHall-Purism Nov 3, 2022
5d7afa2
kexec-select-boot: Extract boot menu scanning logic
JonathonHall-Purism Nov 16, 2022
b365f13
Extract pause_automatic_boot() from gui-init to gui_functions
JonathonHall-Purism Nov 9, 2022
606c29f
Extract enable_usb_storage() from mount-usb
JonathonHall-Purism Nov 9, 2022
39c655a
Add load_config_value() and get_config_display_action()
JonathonHall-Purism Nov 10, 2022
468643e
functions: Add toggle_config function for use in config GUI
JonathonHall-Purism Mar 24, 2023
a5238b5
config/coreboot.{librem_14,mini_v2}: enlarge CBFS for blob jail
MrChromebox Feb 22, 2022
4bc6159
Add PureBoot Basic Mode
MrChromebox Mar 15, 2022
79da79a
Implement Restricted Boot Mode
kylerankin Oct 25, 2022
b0e0a91
Add PureOS signing key
JonathonHall-Purism Nov 2, 2022
206d59d
Add USB autoboot feature to PureBoot Basic
JonathonHall-Purism Nov 9, 2022
6e0d241
ioport: Add ioport module (inb, outb)
JonathonHall-Purism Nov 28, 2022
d148d31
init: Add optional board-specific init script
JonathonHall-Purism Nov 28, 2022
2d3ecfa
librem_mini/librem_mini_v2: Add automatic power-on setting
JonathonHall-Purism Nov 28, 2022
87eff7b
gui-init: Implement blob jail feature
MrChromebox Jan 7, 2022
f6cc806
blobs: Add WiFi, BT driver blobs
MrChromebox Jan 7, 2022
01594a8
config-gui.sh: Update sizes of whiptail prompts
JonathonHall-Purism Jun 13, 2023
5e55535
config-gui.sh: Fix refactors, simplify implementation more
JonathonHall-Purism Mar 25, 2023
e9a5b27
librem_mini,librem_mini_v2: Don't use three values for auto poweron
JonathonHall-Purism Mar 25, 2023
12c7dfd
modules/linux: Support building with Linux 6.1.8.
JonathonHall-Purism Apr 7, 2023
be13389
modules/fbwhiptail: Update to 1.1
JonathonHall-Purism Apr 7, 2023
6b111d8
Add new board: Librem L1UM v2
JonathonHall-Purism Apr 10, 2023
3e6eac9
modules/coreboot,purism-blobs: Update to 4.20.1-Purism-1
JonathonHall-Purism Jun 14, 2023
1bf8331
Blob jail: Add zstd-decompress, decompress more complex archives
JonathonHall-Purism Jun 20, 2023
3c4a9fc
Rename CONFIG_PUREBOOT_BASIC to CONFIG_BASIC
JonathonHall-Purism Jun 21, 2023
c518325
Add CONFIG_BRAND_NAME and allow overriding in Makefile with BRAND_NAME
JonathonHall-Purism Jun 21, 2023
89858f5
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jun 21, 2023
71243c1
config-gui.sh,gui-init: Fix whiptail message box sizes to 16 60
JonathonHall-Purism Jun 21, 2023
f6134e9
gui-init: Opt into skipping QR code scan for Librem boards only
JonathonHall-Purism Jun 23, 2023
8289d1b
oem-factory-reset: Offer to use all defaults on Librem boards only
JonathonHall-Purism Jun 23, 2023
861529c
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jun 27, 2023
33c2cfb
Root hash: Allow configuring from unset defaults
JonathonHall-Purism Jun 30, 2023
23a086d
config-gui.sh: Simplify root hash device prompt
JonathonHall-Purism Jun 30, 2023
09f66e9
Root hashes: enable even if there is no TPM
JonathonHall-Purism Jun 30, 2023
0378d62
media-scan: Fix up whiptail prompt, remove errant "s for standard boot"
JonathonHall-Purism Jun 30, 2023
09d8bf9
media-scan: Simplify implementation and improve RB message
JonathonHall-Purism Jun 30, 2023
e0c03be
Change '16 60'-sized whiptail prompts to '0 80'
JonathonHall-Purism Jun 30, 2023
6618dd6
Restricted boot: Fix wording of 'disable' prompt, does not reset TPM
JonathonHall-Purism Jun 30, 2023
84569e3
kexec-save-default: Don't seal LUKS disk unlock key in basic mode
JonathonHall-Purism Jun 30, 2023
048bec6
modules/busybox: Enable truncate
JonathonHall-Purism Jul 3, 2023
75cb8a0
initrd/bin/flash.sh: Remove '-s' "SHA-256" mode
JonathonHall-Purism Jul 3, 2023
0a35ef9
Use 160 bits of ROM hash for TPM-less HOTP secret (up from 80)
JonathonHall-Purism Jul 5, 2023
9458ec8
modules/fbwhiptail: Update to 99fe815f (AVX fast copy branch)
JonathonHall-Purism Jul 5, 2023
4c8e445
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jul 5, 2023
99673d3
seal-hotpkey: Try default PIN only for 1 month and if >=3 attempts left
JonathonHall-Purism Jul 6, 2023
f089ca2
.circleci/config.yml: Persist build/x86/coreboot-git in cache
JonathonHall-Purism Jul 6, 2023
252efc6
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jul 7, 2023
157efc6
kexec-select-boot: Fix test for basic mode
JonathonHall-Purism Jul 7, 2023
1961074
config-gui.sh: Fix truncated restricted boot prompt
JonathonHall-Purism Jul 7, 2023
e023448
initrd/bin/flash.sh: Remove -s vestiges
JonathonHall-Purism Jul 10, 2023
61609ff
initrd/init: Prevent Restricted Boot bypass
JonathonHall-Purism Jul 11, 2023
718be73
config-gui.sh: Reword Restricted Boot prompts
JonathonHall-Purism Jul 11, 2023
440dc5b
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jul 11, 2023
47e9e4c
Merge remote-tracking branch 'github-heads/master' into pureboot-27-h…
JonathonHall-Purism Jul 12, 2023
45245fe
qemu-*: Show how to enable restricted/basic in board config
JonathonHall-Purism Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ jobs:
- build/x86/coreboot-4.15
- build/x86/coreboot-4.17
- build/x86/coreboot-4.19
- build/x86/coreboot-git
- build/ppc64/coreboot-git
- save_cache:
#Generate cache for the exact same modules definitions if hash is not previously existing
Expand Down
22 changes: 21 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ GIT_STATUS := $(shell \
fi)
HEADS_GIT_VERSION := $(shell git describe --abbrev=7 --tags --dirty)

CB_OUTPUT_BASENAME := heads-$(BOARD)-$(HEADS_GIT_VERSION)
# Override BRAND_NAME to set the name displayed in the UI, filenames, versions, etc.
BRAND_NAME ?= Heads

CB_OUTPUT_BASENAME := $(shell echo $(BRAND_NAME) | tr A-Z a-z)-$(BOARD)-$(HEADS_GIT_VERSION)
CB_OUTPUT_FILE := $(CB_OUTPUT_BASENAME).rom
CB_OUTPUT_FILE_GPG_INJ := $(CB_OUTPUT_BASENAME)-gpg-injected.rom
CB_BOOTBLOCK_FILE := $(CB_OUTPUT_BASENAME).bootblock
Expand Down Expand Up @@ -180,6 +183,7 @@ FORCE:
define install_config =
sed -e 's!@BOARD_BUILD_DIR@!$(board_build)!g' \
-e 's!@BLOB_DIR@!$(pwd)/blobs!g' \
-e 's!@BRAND_NAME@!$(BRAND_NAME)!g' \
"$1" > "$2"
endef

Expand Down Expand Up @@ -513,6 +517,8 @@ bin_modules-$(CONFIG_TPM2_TOOLS) += tpm2-tools
bin_modules-$(CONFIG_BASH) += bash
bin_modules-$(CONFIG_POWERPC_UTILS) += powerpc-utils
bin_modules-$(CONFIG_IO386) += io386
bin_modules-$(CONFIG_IOPORT) += ioport
bin_modules-$(CONFIG_ZSTD) += zstd

$(foreach m, $(bin_modules-y), \
$(call map,initrd_bin_add,$(call bins,$m)) \
Expand Down Expand Up @@ -568,6 +574,7 @@ $(COREBOOT_UTIL_DIR)/superiotool/superiotool: \
initrd-y += $(pwd)/blobs/dev.cpio
initrd-y += $(build)/$(initrd_dir)/modules.cpio
initrd-y += $(build)/$(initrd_dir)/tools.cpio
initrd-y += $(build)/$(initrd_dir)/board.cpio
initrd-$(CONFIG_HEADS) += $(build)/$(initrd_dir)/heads.cpio

#$(build)/$(initrd_dir)/.build: $(build)/$(initrd_dir)/initrd.cpio.xz
Expand Down Expand Up @@ -597,6 +604,17 @@ $(build)/$(initrd_dir)/initrd.cpio.xz: $(initrd-y)
bundle-$(CONFIG_LINUX_BUNDLED) += $(board_build)/$(LINUX_IMAGE_FILE).bundled
all: $(bundle-y)

# The board.cpio is built from the board's initrd/ directory. It contains
# board-specific support scripts.

ifeq ($(wildcard $(pwd)/boards/$(BOARD)/initrd),)
$(build)/$(initrd_dir)/board.cpio:
cpio -H newc -o </dev/null >"$@"
else
$(build)/$(initrd_dir)/board.cpio: FORCE
$(call do-cpio,$@,$(pwd)/boards/$(BOARD)/initrd)
endif

#
# The heads.cpio is built from the initrd directory in the
# Heads tree.
Expand Down Expand Up @@ -633,6 +651,8 @@ $(initrd_tmp_dir)/etc/config: FORCE
>> $@ ; \
echo export CONFIG_BOARD=$(BOARD) \
>> $@ ; \
echo export CONFIG_BRAND_NAME=$(BRAND_NAME) \
>> $@ ; \
)

# Ensure that the initrd depends on all of the modules that produce
Expand Down
1 change: 1 addition & 0 deletions blobs/librem_jail/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This directory contains firmware/microcode needed for the Intel AX200 WiFi module, its Bluetooth counterparts, and the Bluetooth component (ar3k) of Ath9k WiFi modules. It is synchronized via the main system firmware (Pureboot) at each boot, and should not be modified.
Binary file added blobs/librem_jail/ar3k/AthrBT_0x11020100.dfu
Binary file not shown.
Binary file added blobs/librem_jail/ar3k/ramps_0x11020100_40.dfu
Binary file not shown.
Binary file added blobs/librem_jail/intel/ibt-20-1-3.ddc
Binary file not shown.
Binary file added blobs/librem_jail/intel/ibt-20-1-3.sfi
Binary file not shown.
Binary file added blobs/librem_jail/iwlwifi-cc-a0-59.ucode
Binary file not shown.
7 changes: 6 additions & 1 deletion boards/librem_13v2/librem_13v2.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

Expand All @@ -30,6 +30,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y
export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOARD_NAME="Librem 13 v2/v3"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
7 changes: 6 additions & 1 deletion boards/librem_13v4/librem_13v4.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

Expand All @@ -30,6 +30,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y
export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOARD_NAME="Librem 13 v4"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
7 changes: 6 additions & 1 deletion boards/librem_14/librem_14.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_14.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

Expand All @@ -28,6 +28,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y

export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOARD_NAME="Librem 14"
export CONFIG_FLASHROM_OPTIONS="-p internal"

export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
7 changes: 6 additions & 1 deletion boards/librem_15v3/librem_15v3.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

Expand All @@ -30,6 +30,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y
export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOARD_NAME="Librem 15 v3"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
7 changes: 6 additions & 1 deletion boards/librem_15v4/librem_15v4.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

Expand All @@ -30,6 +30,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y
export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
export CONFIG_BOOT_REQ_ROLLBACK=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOARD_NAME="Librem 15 v4"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
5 changes: 5 additions & 0 deletions boards/librem_l1um/librem_l1um.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=y
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y

export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
Expand All @@ -39,3 +41,6 @@ export CONFIG_BOARD_NAME="Librem Server L1UM"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_USB_KEYBOARD=y
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
51 changes: 51 additions & 0 deletions boards/librem_l1um_v2/librem_l1um_v2.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Configuration for librem_l1um_v2
CONFIG_LINUX_CONFIG=config/linux-librem_common-6.1.8.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_l1um_v2.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=6.1.8
export CONFIG_PURISM_BLOBS=y

CONFIG_CRYPTSETUP2=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=y
export CONFIG_TPM2_TOOLS=y
CONFIG_TPM2_TSS=y
CONFIG_OPENSSL=y
CONFIG_PRIMARY_KEY_TYPE=ecc
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=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="plymouth.ignore-serial-consoles"
export CONFIG_BOOT_RECOVERY_SERIAL="/dev/ttyS0"
export CONFIG_BOOT_DEV="/dev/nvme0n1p1"
export CONFIG_BOARD_NAME="Librem Server L1UM v2"
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_USB_KEYBOARD=y
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
16 changes: 16 additions & 0 deletions boards/librem_mini/initrd/bin/board-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -o pipefail

. /tmp/config

# If CONFIG_AUTOMATIC_POWERON is set, always set the EC BRAM setting during
# boot. It persists as long as the RTC battery is set, but set it during every
# boot for robustness in case the battery is temporarily removed, or the user
# toggles in config-gui and then does not flash, etc.
if [ "$CONFIG_AUTOMATIC_POWERON" = "y" ]; then
set_ec_poweron.sh y
fi

# Don't disable the setting in the EC BRAM though if CONFIG_AUTOMATIC_POWERON
# is not enabled. The default is disabled anyway, and the OS could configure
# it.
16 changes: 16 additions & 0 deletions boards/librem_mini/initrd/bin/set_ec_poweron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Set the EC BRAM setting for automatic power-on.
# If $1 is 'y', enable automatic power-on. Otherwise, disable it.

# EC BRAM bank 1
BRAMADDR=0x360
BRAMDATA=0x361

outb "$BRAMADDR" 0x29 # Select byte at offset 29h
if [ "$1" = "y" ]; then
outb "$BRAMDATA" 0x00 # 0 -> automatic power-on
else
outb "$BRAMDATA" 0x01 # 1 -> stay off
fi

9 changes: 8 additions & 1 deletion boards/librem_mini/librem_mini.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ CONFIG_LINUX_CONFIG=config/linux-librem_common.config
CONFIG_COREBOOT_CONFIG=config/coreboot-librem_mini.config

export CONFIG_COREBOOT=y
export CONFIG_COREBOOT_VERSION=4.17
export CONFIG_COREBOOT_VERSION=purism
export CONFIG_LINUX_VERSION=5.10.5
export CONFIG_PURISM_BLOBS=y

CONFIG_CRYPTSETUP2=y
CONFIG_FLASHROM=y
CONFIG_FLASHTOOLS=y
CONFIG_GPG2=y
CONFIG_IOPORT=y
CONFIG_KEXEC=y
CONFIG_UTIL_LINUX=y
CONFIG_LVM2=y
Expand All @@ -28,6 +29,8 @@ CONFIG_LINUX_USB=y

export CONFIG_TPM=n
export CONFIG_TPM_NO_LUKS_DISK_UNLOCK=y
export CONFIG_TOTP_SKIP_QRCODE=y
export CONFIG_OEMRESET_OFFER_DEFAULTS=y

export CONFIG_BOOTSCRIPT=/bin/gui-init
export CONFIG_BOOT_REQ_HASH=n
Expand All @@ -39,3 +42,7 @@ export CONFIG_BOARD_NAME="Librem Mini"
export CONFIG_FLASHROM_OPTIONS="-p internal"
export CONFIG_USB_KEYBOARD=y
export CONFIG_AUTO_BOOT_TIMEOUT=5
export CONFIG_ROOT_DEV="/dev/nvme0n1p2"
export CONFIG_ROOT_DIRLIST="bin boot lib sbin usr"
export CONFIG_ROOT_CHECK_AT_BOOT="n"
export CONFIG_SUPPORT_AUTOMATIC_POWERON=y
16 changes: 16 additions & 0 deletions boards/librem_mini_v2/initrd/bin/board-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -o pipefail

. /tmp/config

# If CONFIG_AUTOMATIC_POWERON is set, always set the EC BRAM setting during
# boot. It persists as long as the RTC battery is set, but set it during every
# boot for robustness in case the battery is temporarily removed, or the user
# toggles in config-gui and then does not flash, etc.
if [ "$CONFIG_AUTOMATIC_POWERON" = "y" ]; then
set_ec_poweron.sh y
fi

# Don't disable the setting in the EC BRAM though if CONFIG_AUTOMATIC_POWERON
# is not enabled. The default is disabled anyway, and the OS could configure
# it.
16 changes: 16 additions & 0 deletions boards/librem_mini_v2/initrd/bin/set_ec_poweron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Set the EC BRAM setting for automatic power-on.
# If $1 is 'y', enable automatic power-on. Otherwise, disable it.

# EC BRAM bank 1
BRAMADDR=0x360
BRAMDATA=0x361

outb "$BRAMADDR" 0x29 # Select byte at offset 29h
if [ "$1" = "y" ]; then
outb "$BRAMDATA" 0x00 # 0 -> automatic power-on
else
outb "$BRAMDATA" 0x01 # 1 -> stay off
fi

Loading