Skip to content

Commit fc82152

Browse files
committed
rename the binary to mkefivardata
1 parent e76049f commit fc82152

6 files changed

Lines changed: 23 additions & 111 deletions

File tree

.gitignore

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,7 @@
11
*.o
2-
*.so
3-
*.a
4-
*.efi
5-
*.key
6-
*.crt
7-
*.csr
8-
*.cer
92
*.auth
10-
*.esl
11-
*.1
12-
PK.h
13-
KEK.h
14-
DB.h
15-
hashlist.h
16-
*.hash
3+
*.vardata
174
*~
185
*.swp
19-
*.orig
20-
*.pvk
21-
*.p12
22-
*.der
23-
*.pk7
24-
*.cab
25-
hash-to-efi-sig-list
26-
cert-to-efi-sig-list
27-
cert-to-efi-hash-list
28-
sig-list-to-certs
29-
sign-efi-sig-list
30-
efi-keytool
31-
efi-readvar
32-
efi-updatevar
33-
flash-var
34-
/build
6+
/mkefivardata
357
/tags

Make.rules

Whitespace-only changes.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
BINARY = efi-updatevar
1+
BINARY = mkefivardata
22

33
CFLAGS =
44
CFLAGS += -Iinclude

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,28 @@
1-
# efi-updatevar
1+
# mkefivardata
22

33
* [efitools was removed from Fedora 41](https://discussion.fedoraproject.org/t/f41-secure-boot-with-only-your-own-keys/138120)
44
* [efitools upstream](https://web.git.kernel.org/pub/scm/linux/kernel/git/jejb/efitools.git/) is unmaintained
55
* sbctl can generate keys and sign, but [efi-updatevar is still needed](https://github.com/Foxboron/sbctl/issues/434)
66

7-
The upstream efi-updatevar was modified so that it doesn't write to the efivars filesystem directly, but converts the "auth" files to intermediate "vardata" files instead.
7+
The upstream `efi-updatevar` was modified so that it doesn't write to the efivars filesystem directly, but converts the `*.auth` files to intermediate `*.vardata` files instead. To avoid confusion, it was also renamed to `mkefivardata`.
88

9-
It is safe to copy the vardata files onto an untrusted machine as they do not contain the private key. To enroll the secureboot keys they contain, simply copy the vardata files to the appropriate file in the efivars filesystem.
9+
It is safe to copy the `*.vardata` files onto an untrusted machine, since they do not contain the private key. To enroll keys, it is enough to copy the vardata files to the appropriate place in the efivars filesystem.
1010

11-
### dependencies
11+
### Install dependencies
1212

1313
```sh
1414
sudo dnf group install c-development
1515
sudo dnf install gnu-efi-devel openssl-devel
1616
```
1717

18-
### Building efi-updatevar
18+
### Build the binary
1919

2020
```sh
2121
make clean
2222
make
2323
```
2424

25-
### create ctags
26-
27-
```sh
28-
ctags -R --exclude .git
29-
```
30-
31-
### Testing
25+
### Enroll keys
3226

3327
Install sbctl:
3428

@@ -37,36 +31,38 @@ sudo dnf copr enable chenxiaolong/sbctl
3731
sudo dnf install sbctl
3832
```
3933

40-
Generate auth files:
34+
Generate keys and auth files:
4135

4236
```sh
4337
sudo sbctl create-keys
4438
sudo sbctl enroll-keys --microsoft --export auth
4539
```
4640

47-
Convert auth to vardata.
41+
Convert auth files to vardata files:
4842

4943
```sh
50-
./efi-updatevar db.auth /tmp/db.vardata db
51-
./efi-updatevar KEK.auth /tmp/KEK.vardata KEK
52-
./efi-updatevar PK.auth /tmp/PK.vardata PK
44+
./mkefivardata db.auth db.vardata db
45+
./mkefivardata KEK.auth KEK.vardata KEK
46+
./mkefivardata PK.auth PK.vardata PK
5347
```
5448

55-
Next, we update the efivars filesystem.
56-
This may only work in setup mode.
49+
The remaining steps may only work in setup mode.
5750

5851
To verify that the system is in setup mode, run `mokutil --sb-state` or `sbctl status`.
5952

60-
Now copy each vardata file to its correct destination in the efivars filesystem:
53+
Copy each vardata file to its correct destination in the efivars filesystem:
6154

6255
```sh
6356
sudo chattr -i /sys/firmware/efi/efivars/*
64-
sudo cp /tmp/db.vardata /sys/firmware/efi/efivars/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
65-
sudo cp /tmp/KEK.vardata /sys/firmware/efi/efivars/KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c
66-
sudo cp /tmp/PK.vardata /sys/firmware/efi/efivars/PK-8be4df61-93ca-11d2-aa0d-00e098032b8c
57+
sudo cp db.vardata /sys/firmware/efi/efivars/db-d719b2cb-3d3a-4596-a3bc-dad00e67656f
58+
sudo cp KEK.vardata /sys/firmware/efi/efivars/KEK-8be4df61-93ca-11d2-aa0d-00e098032b8c
59+
sudo cp PK.vardata /sys/firmware/efi/efivars/PK-8be4df61-93ca-11d2-aa0d-00e098032b8c
6760
```
6861

62+
Congratulations, the keys are now enrolled.
63+
6964
Notes:
7065

71-
* The destination filenames in the efivars filesystem look random, but they are always the same.
66+
* `cp <var>.vardata /sys/...` is equivalent to `efi-updatevar -f <var>.auth <var>`.
67+
* The destination filenames in the efivars filesystem may look random, but they are always the same.
7268
* After copying `PK.vardata`, the system should not be in setup mode anymore.

doc/efi-updatevar.1.in

Lines changed: 0 additions & 56 deletions
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)