Commit Graph

140 Commits

Author SHA1 Message Date
Trammell hudson
8108e419fe
remove unused flashrom 0.9.9 patch and use new --ifd feature in its place (pr #370) 2018-04-30 17:16:06 -04:00
Trammell hudson
03a0e39bce
Merge branch 'skip_sig_checks' of https://github.com/kylerankin/heads 2018-04-30 16:39:20 -04:00
Trammell hudson
cd2325781c
Merge branch 'colorized_warning_error' of https://github.com/kylerankin/heads 2018-04-30 16:31:45 -04:00
Trammell hudson
05a36ce3d9
Merge branch 'skip_confirmation_on_force' of https://github.com/kylerankin/heads 2018-04-30 16:31:05 -04:00
Trammell hudson
7372595a20
Merge branch 'red_background_on_insecure_boot' of https://github.com/kylerankin/heads 2018-04-30 16:30:29 -04:00
Francis Lam
c0f3a4bb79
Read and measure an EFI file into initrd during init 2018-04-29 19:58:44 -07:00
Kyle Rankin
22a8d6f603
Colorize warning and error messages in fbwhiptail
Since fbwhiptail allows us to customize the background colors, we should
colorize warnings and error messages to provide a user with an
additional subtle cue that there might be a problem. I have added two
additional configuration options:

CONFIG_WARNING_BG_COLOR
CONFIG_ERROR_BG_COLOR

and in the librem13v2.config file you can see an example for how to set
them to be yellow and red gradients, respectively. I've also updated the
main two scripts that use whiptail to include those background colors.

If you decide to use regular whiptail, just don't set these config
options and it should behave as expected.
2018-04-25 13:21:56 -07:00
Francis Lam
1cbae3cc12
Preserve custom CBFS files on flashrom updates 2018-04-21 17:21:37 -07:00
Francis Lam
48ca75a482
Add "heads/" prefix to all Heads-related cbfs files
Needed to identify which files should be preserved between upgrades
such as "heads/initrd/*" or "heads/counter"
2018-04-20 15:11:12 -07:00
Kyle Rankin
a308bc97e4
Skip boot choice confirmation in "force" mode
When a user gets confirmation of their boot menu choice, that's largely
to give them the option of making their boot choice the default. In the
case of "force mode" there's no reason for the user to be presented with
that dialog so this change skips right ahead to the boot once they have
2018-04-20 14:11:49 -07:00
Francis Lam
8644a36488
Drop unnecessary flashtools.patch
Also added convenience call to import keys and removed credentials
2018-04-20 10:46:08 -07:00
Francis Lam
e0c1ab2d79
Update cbfs-init script for new cbfs tool option 2018-04-20 09:29:57 -07:00
Francis Lam
d0294b1142
Add all supported network modules to network-init-recovery
also fix verbiage in comments
2018-04-20 09:29:57 -07:00
Francis Lam
37feebdc76
Read and measure CBFS files into initrd during init 2018-04-20 09:29:57 -07:00
Kyle Rankin
c99d5a8437
Add red background to boot console for insecure "force" boot
In the event a user does pick the insecure "force" boot option that
bypasses checksum and signing checks in Heads, it would be nice to
provide a clear visual warning during the boot process that they are in
this state. This change will add a kernel argument that changes the boot
console background to be red and removes any boot splash that might
obscure it, in the event the user picks the insecure boot mode.

Since a user should only boot into this mode during emergencies, having
it be apparent that it's an unsafe mode helps ensure the user doesn't
pick this boot option needlessly.
2018-04-11 16:09:46 -07:00
Trammell hudson
0eff9914ea
Merge branch 'gui_for_changed_boot_entries' of https://github.com/kylerankin/heads 2018-04-10 15:44:49 -04:00
Trammell hudson
d14b0f52d7
Merge branch 'detect_package_updates' of https://github.com/kylerankin/heads 2018-04-10 15:44:15 -04:00
Trammell hudson
b887104035
enable setsid for job control in recovery shell (issue #382) 2018-04-10 15:39:05 -04:00
Kyle Rankin
d1e6dcb899
Fix tab on return line 2018-04-04 14:27:31 -07:00
Kyle Rankin
5434e0bdf2
Add a gui menu for changed boot entries
Currently when the boot entries change, kexec-select-boot dies. Given
the normal loop is set up to catch this event and display a regular boot
menu at the next iteration of the loop, instead of dying it would be
better to just warn and then return from that function back into the
main loop. In addition to that I added a GUI menu for the same warning
when in GUI mode.
2018-04-04 14:25:22 -07:00
Kyle Rankin
887c79065e
Add GUI package update handler w/ checksum update function
Part of the Heads workflow involves handling legitimate changes to /boot
as part of the package manager. This is a challenging workflow to handle
as package managers on many systems work in a completely unattended way
(and some even reboot first, apply updates, and then reboot again).

We need to be able to detect changes that are potentially caused by a
package manager so to do that I've set up a trigger within the OS
(currently just for Debian) that runs both before and after package
updates. It verifies the signatures in /boot and if they fail before
package updates it creates a log file in
/boot/kexec_package_trigger_pre.txt. If they fail after package updates
run /boot/kexec_package_trigger_post.txt is created. These files contain
the following fields:

CHANGED_FILES: A list of files in /boot that failed the sha256sum check
UPDATE_INITRAMFS_PACKAGE: An (optional) list of packages known to
trigger initramfs changes

Following those fields is a list of log output from the last package
manager run which contains its own formatted fields (I'm pulling from
/var/lib/dpkg/info).

When a user selects a boot option, gui-init first verifies the
checksums just to catch errors before calling kexec-select-boot. If
there are any errors it looks for these package logs and if they exist,
it displays appropriate warnings. If the files are absent it displays a
more generic warning. The user is also given an opportunity to re-sign
the /boot hashes.
2018-04-03 15:20:34 -07:00
Trammell hudson
83df25c5ab
Merge branch 'nested_menus' of https://github.com/kylerankin/heads 2018-03-29 17:32:08 -04:00
Kyle Rankin
35916d942b
Handle signing failures more gracefully with a dialog 2018-03-20 11:26:09 -07:00
Trammell hudson
e7697055a3
Merge branch 'init-changes' of https://github.com/flammit/heads 2018-03-15 17:16:13 -04:00
Kyle Rankin
eaaa1dad39
Fix tab alignment to conform with rest of script 2018-03-14 10:24:14 -07:00
Kyle Rankin
665754122d
Allow insecure boot mode to bypass kexec sig checks
There was a bug in the "force" boot mode where it would still fail if
signatures didn't match. This was because the check_config function
validates the signatures for kexec files. I've added a few conditionals
here so that in the case of a forced boot mode, we can bypass those
signature checks that would prevent boot and error out to a recovery
console.
2018-03-14 10:18:52 -07:00
Kyle Rankin
769f6a7a24
Create nested menus and add option to rehash/sign /boot
The number of options we want in the menu is starting to get large
enough that it's worth slimming things down in the main menu and move
options to nested menus. Along with this nested menu change is the
option to re-sign and re-hash files in /boot directly from the menu.
2018-03-14 10:14:22 -07:00
Francis Lam
e86123769b
Moved network init to a separate bootscript
Enabled recovery serial console (tested on kgpe-d16)
Minor fix to kexec-boot to correct xen boot
Remove busybox power utils
2018-03-10 15:40:07 -08:00
Kyle Rankin
dee52415fa
Add a menu option to reset TPM for bootstrapping. Widen menus.
One of the other core functions a user needs when bootstrapping is
taking over the TPM. I've added a new option in the menu for this and it
revealed that some of the menus needed more space so I've widened all
the menus and also made the main menu longer so the options don't
scroll.
2018-03-08 16:36:56 -08:00
Trammell hudson
9c9b5bcd2b
Merge branch 'add_gui_hash_alert' of https://github.com/kylerankin/heads 2018-03-08 14:41:44 -05:00
Trammell hudson
1043da2860
Merge branch 'add_force_boot_mode' of https://github.com/kylerankin/heads 2018-03-08 11:53:56 -05:00
Trammell hudson
6443442912
restore /etc/motd 2018-03-08 01:14:41 -05:00
Trammell hudson
091ae92b6f
Merge branch 'KGPE-D16_port_NoTPM' of https://github.com/tlaurion/heads 2018-03-08 01:13:16 -05:00
Thierry Laurion
31dd1f4b62
kexec-boot patch so that xen can be booted from bootdir and referred xen.gz and not internal flash xen.gz 2018-03-08 00:58:50 -05:00
Kyle Rankin
8152e8c796
Add a "force" option to kexec-select-boot to bypass hash checks
The point of this change is to provide a failsafe (failunsafe?) mode for
less technically-savvy users who will ultimately be using Heads by
default on Librem laptops.

There are some scenarios where an end user might forget to update hashes
in /boot after an initrd change or might have some other hash mismatch.
Currently that user would then be stuck in a recovery console in Heads
not knowing what to do within that limited shell environment to fix the
situation.

This change adds a 'force' mode to kexec-select-boot that goes straight
into a boot menu and bypasses the hash checks so the user could more
easily get back into their system to attempt to repair it. It adds
appropriate warnings about why this is a risky option and moves it down
toward the bottom of the menu. The goal would be to just have this be an
emergency option our support could guide a user to if they ended up in
this situation.
2018-03-05 14:46:15 -08:00
Thierry Laurion
1c1a1a215d
reverting changes that were not merged from other branches 2018-03-01 01:53:37 -05:00
Thierry Laurion
9eadb07280
Merging to osresearch master 2018-03-01 01:37:36 -05:00
Thierry Laurion
23ae788c6f
Board, linux and coreboot configs 2018-03-01 00:40:46 -05:00
Trammell hudson
f9a12a270a
Merge branch 'add_gui_init' of https://github.com/kylerankin/heads into kylerankin-add_gui_init 2018-02-28 15:06:06 -05:00
Trammell hudson
a84ea7b9de
Merge branch 'tpm-optional' of https://github.com/persmule/heads 2018-02-28 13:33:01 -05:00
Trammell hudson
e4106c6969
Merge branch 'clean_up_init' of https://github.com/kylerankin/heads 2018-02-26 13:15:34 -05:00
Francis Lam
e9312e19bf
Cleanup of init to support server and desktop
Guarded linuxboot specific init entries
Removed Makefile entries into separate file (conflicts with srcing /etc/config)
Added CONFIG_BOOT_LOCAL/_REMOTE to control interface setup
Fixed CONFIG_TPM usage
2018-02-25 11:51:19 -08:00
persmule
b5072390ee
Make TPM dependency optional and controlled by flag CONFIG_TPM
if "CONFIG_TPM=y" is not present in the config file, functionalities
needing TPM could be disabled, while leaving other functionalities intact.

This will make Heads a more general-usage bootloader payload atop coreboot.
2018-02-24 14:46:33 -08:00
persmule
43ba7a777d fix the broken if syntax 2018-02-24 14:49:10 +08:00
Kyle Rankin
fbbfc8e22f
Replace remaining text-only options in main workflow w/ gui menus
In particular I added a GUI menu to instruct the user if there is no
TOTP code registered (as is the case upon first flash) and also added
better handling of the case the user selects 'default boot' when there
is no default boot set yet. Apart from that where there were text-only
menus left in gui-init I've replaced them with GUI menus.
2018-02-23 12:13:21 -08:00
Kyle Rankin
6ab78ae236
Add gui option to kexec-select-boot, use in gui-init menu option
When selecting the boot menu option (m) in the gui-init you call out to
kexec-select-boot. To better maintain the graphical menu experience,
I've added a -g option to kexec-select-boot that, when set, will use a
graphical whiptail menu for the most common menu selection modes.
2018-02-22 13:18:16 -08:00
Kyle Rankin
57405b0d28
Add menu for TOTP updates, provide sample board config to use gui-init 2018-02-21 15:58:54 -08:00
Kyle Rankin
140064bbf8
Add graphical init menu that uses whiptail
This is a modified version of the generic-init script that uses whiptail
to generate a graphical menu. I changed two of the options so that the
user can refresh the menu to get an updated TOTP code if needed.
2018-02-20 15:35:37 -08:00
persmule
baa30a2026 Add OHCI and UHCI drivers to initrd.
USB smart card readers are most full speed devices, and there is no
"rate-matching hubs" beneath the root hub on older (e.g. GM45) plat-
forms, which has companion OHCI or UHCI controllers and needs cor-
responding drivers to communicate with card readers directly plugged
into the motherboard, otherwise a discrete USB hub should be inserted
between the motherboard and the reader.

This time I make inserting linux modules for OHCI and UHCI controllable
with option CONFIG_LINUX_USB_COMPANION_CONTROLLER.

A linux config for x200 is added as an example.

Tested on my x200s and elitebook revolve 810g1.
2018-02-15 22:59:22 +08:00
persmule
9bf131b601 Make TPM dependency optional and controlled by flag CONFIG_TPM
if "CONFIG_TPM=y" is not present in the config file, functionalities
needing TPM could be disabled, while leaving other functionalities intact.

This will make Heads a more general-usage bootloader payload atop coreboot.
2018-02-15 22:42:12 +08:00