Skip to content

Commit 495774f

Browse files
committed
gentoo-config-luks2-grub-systemd: Update passphrase prompt instructions
GRUB 2.14 automatically prompts the user to re-enter the passphrase if the user entered a wrong passphrase, and it no longer falls back to rescue mode if the menu has not been shown. Therefore, delaying the prompt is not very vital for user experience any more and can thus be demoted to an optional step.
1 parent babd266 commit 495774f

6 files changed

Lines changed: 41 additions & 59 deletions

File tree

content/en/collections/gentoo-config-luks2-grub-systemd/goals.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,8 @@ extent, and they are recommended to consult these additional resources:
7878

7979
## Resulting Boot Process
8080

81-
The boot process that the instructions in this tutorial are intended to achieve
82-
is described as follows:
81+
After following this tutorial's instructions, the user will just need to enter
82+
the LUKS partition's passphrase *once* in the entire boot process. The user
83+
will enter the passphrase in GRUB, before the Linux kernel is loaded.
8384

84-
1. When GRUB starts, it shows the menu without asking for the passphrase. This
85-
will allow the user to not enter the passphrase until it is really needed.
86-
For example, booting an alternative operating system that is not on the LUKS
87-
partition (e.g. Microsoft Windows) does not require the passphrase for the
88-
LUKS partition; neither does using the "UEFI Firmware Settings" option to
89-
easily launch the computer's BIOS utility. With the resulting
90-
configuration, the passphrase will not be asked in these scenarios.
91-
2. When a menu entry for the operating system on the LUKS partition is
92-
selected, GRUB prompts for the passphrase. This will be the **only** time
93-
when the user needs to enter the passphrase.
94-
![GRUB asks for passphrase after selecting a menu
95-
entry]({{< static-path img grub-unlock.png >}})
96-
3. If the passphrase entered is correct, then the boot process continues
97-
normally. The passphrase will not be asked anymore during the boot.
98-
![GRUB boots the operating system upon successful
99-
authentication]({{< static-path img grub-unlock-success.png >}})
100-
4. If an incorrect passphrase is supplied, GRUB returns to the menu. The user
101-
can retry entering the passphrase by selecting the same menu entry, or
102-
choose a different entry.
85+
![GRUB asks for passphrase]({{< static-path img grub-unlock.png >}})

content/en/collections/gentoo-config-luks2-grub-systemd/setup-process/_index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ The overall setup process consists of the following steps:
1717
2. The system is configured so that the passphrase is asked only once during
1818
boot.
1919
3. The Linux kernel is configured with support for the LUKS partition.
20-
4. To improve user experience, GRUB is configured to postpone asking for the
21-
passphrase until necessary.
20+
4. GRUB is configured for unlocking the LUKS partition.
2221
4. The LUKS partition's parameters are tuned to achieve an acceptable unlock
2322
speed in GRUB.

content/en/collections/gentoo-config-luks2-grub-systemd/setup-process/configure-gentoo/grub.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
---
2-
title: "Configure GRUB for Better User Experience"
2+
title: "Configure GRUB"
33
weight: 337
44
---
55

6-
A few additional configuration steps can be taken to improve the user
7-
experience of unlocking the LUKS partition from GRUB.
8-
96
## Update GRUB Settings for LUKS
107

118
With the default configuration, GRUB disregards operating systems in LUKS
@@ -54,54 +51,57 @@ with the actual block device for the ESP.
5451
# mount /dev/sda1 "${ESP}"
5552
```
5653

57-
## Improve GRUB's Passphrase Prompt
54+
## Optional: Delay GRUB's Passphrase Prompt
5855

59-
At this point, if GRUB was installed normally, it would be functional and can
60-
unlock the LUKS partition already. However, it would ask for the passphrase
61-
immediately when it launches, before even showing any menu entries:
56+
At this point, if GRUB has been installed normally, it will be functional and
57+
can unlock the LUKS partition already. However, it will ask for the LUKS
58+
partition's passphrase *immediately* when it launches, even *before* showing
59+
any menu entries:
6260

6361
![GRUB asks for passphrase directly when it starts]({{< static-path img
6462
grub-start-unlock.png >}})
6563

66-
This might be an acceptable behavior, until an incorrect passphrase is entered,
67-
in which case GRUB would directly fall back to the rescue mode without giving a
68-
chance to reenter the passphrase:
64+
Users who accept this behavior of GRUB can skip this step and move on to the
65+
next one.
6966

70-
![GRUB falls back to the rescue mode directly if authentication fails when it
71-
starts]({{< static-path img grub-start-unlock-failure.png >}})
67+
To some users, this behavior may be undesirable because they want to access
68+
some GRUB menu options without entering the passphrase. After all, some options
69+
do not really need the passphrase because they need not unlock the LUKS
70+
partition, like options to boot an alternative operating system that is not on
71+
the LUKS partition (e.g. Microsoft Windows), and the “UEFI Firmware Settings”
72+
option for launching the computer’s BIOS utility. These users might not wish to
73+
unnecessarily enter the passphrase to use these options.
7274

73-
To avoid this behavior of GRUB, move the `/boot/grub` directory to the ESP,
74-
then create a symbolic link to the new directory under `/boot`.
75+
To avoid this behavior of GRUB, these users should move the `/boot/grub`
76+
directory to the ESP, then create a symbolic link to the new directory under
77+
`/boot`:
7578

76-
If a new Gentoo installation is being performed, or an existing installation
77-
where GRUB is not used is being worked with, then please run the following
78-
command:
79+
1. If a new Gentoo installation is being performed, or an existing installation
80+
where GRUB is not used is being worked with, then please run the following
81+
command:
7982

80-
```console
81-
# mkdir "${ESP}/grub"
82-
```
83+
```console
84+
# mkdir "${ESP}/grub"
85+
```
8386

84-
If GRUB is already being used as the bootloader, please use this command
85-
instead to move existing GRUB files to the ESP:
87+
If GRUB is already being used as the bootloader, please use this command
88+
instead to move existing GRUB files to the ESP:
8689

87-
```console
88-
# mv /boot/grub "${ESP}"
89-
```
90+
```console
91+
# mv /boot/grub "${ESP}"
92+
```
9093

91-
Then, **in both cases**, run the following command to set up the symbolic link:
94+
2. Then, **in both cases**, run the following command to set up the symbolic link:
9295

93-
```console
94-
# ln -s "${ESP}/grub" /boot
95-
```
96+
```console
97+
# ln -s "${ESP}/grub" /boot
98+
```
9699

97100
Now, GRUB's passphrase prompt is deferred until a menu entry that requires the
98-
LUKS partition to be unlocked is selected, and if an incorrect passphrase is
99-
entered, GRUB no longer falls back to the rescue mode. Instead, the user can
100-
press any key to return to the menu and reselect the same menu entry to reenter
101-
the passphrase.
101+
LUKS partition to be unlocked is selected.
102102

103-
![GRUB allows authentication retry]({{< static-path img grub-unlock-failure.png
104-
>}})
103+
![GRUB asks for passphrase after selecting a menu entry]({{< static-path img
104+
grub-unlock.png >}})
105105

106106
Moving the contents of the `/boot/grub` directory to the ESP resolves this user
107107
experience issue by making all critical files GRUB needs for full
Binary file not shown.
Binary file not shown.
3.6 KB
Loading

0 commit comments

Comments
 (0)